Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - JHela001

1
XCMS / Re: Get fold, p-value for set of EIC m/z values
Quote from: "Jan Stanstrup"
For post-integration filtering you can do the following. I have used pipes and dplyr syntax since I find that the easiest and cleanest.

Code: [Select]
library(xcms)

# sample data
library(faahKO)
filepath <- system.file("cdf", package = "faahKO")
xsg <- group(faahko)
xsg <- fillPeaks(xsg)
reporttab <- diffreport(xsg)


#target list
targets <- rbind(c(mz = 328.2000, rt= 3632.839),
                c(mz = 466.2000, rt= 3695.437),
                c(mz = 495.2131, rt= 3426.267)
                )
targets <- as.data.frame(targets)


# hit tolerance
mz_tol=0.1
rt_tol=0.5*60


# filtering using pipes and dplyr
library(dplyr)
reporttab_filtered <- reporttab %>%
                      rowwise %>%
                      filter( any(    abs(mzmed-targets$mz)<mz_tol &  abs(rtmed-targets$rt)<rt_tol    ) ) %>%
                      select(name,mzmed,rtmed,fold,pvalue) %>%
                      as.data.frame
fantastic Jan! I'll be sure to check this out ASAP when back in the lab. Thanks so much!
2
XCMS / Re: Get fold, p-value for set of EIC m/z values
Quote from: "Jan Stanstrup"
Are you talking about simply filtering the diffreport or actually only integrating your targets in the first place?
Filtering is trivial if you supply example data. The latter requires changes in xcms. I took a look at the code and I think it should be relatively easy to add an m/z target list to centwave but it would be non-trivial to restrict by retention time prior to integration.

It's really just filtering after the fact, but now that I think of it, having it the m/z targets before might be useful too, in that it will force the program to give me a p-value difference, but perhaps this is far more difficult than I think.

At the moment I'm just doing CTRL+F in microsoft excel using the diffReports, inputting my m/z (2 decimal places usually works) and then copying and pasting the data.

It would be really nice if I could just load some script to look at mz range 1, given it is in retention time range 1, output its fold, p-value, and q-value, and do the same for a list of mz/rt's.

Quote from: "sneumann"
Hi JHela001,

I could imagine that one could create an xcmsSet without peaks,
add your EICs (which should be mz and RT rectangles) as "groups" and let fillPeaks() do the integration job.

Yours,
Steffen

At the present moment I don't know how I'd go about this, but I'm hoping you're right.
3
XCMS / Get fold, p-value for set of EIC m/z values
Hi everyone,

I am trying to find a simple way to export integration data for a set of EIC's from my data in metabolomics.

I have a table of ~50 EIC's that I'd like to simply extract their fold change, p-value, q-value from my data sets. Ideally I'd also like to export whether there are outliers but this isn't necessary at this moment.

Has anyone developed a script to do just this, without looking for all the significantly different peaks?

I am not exceptionally familiar with R. We have been using the simple script to look at all the differences:

Code: [Select]
library(xcms)
files <- list.files(recursive = TRUE, full.names = TRUE)
xset <- xcmsSet(method = "centWave", files = files, ppm = 15, peakwidth = c(6,40), nSlaves=3)
xset <- group(xset)
xset2 <- retcor(xset, family = "symmetric", plottype = "mdevden")
xset2 <- group(xset2, bw = 8)
xset3 <- fillPeaks(xset2)
reporttab <- diffreport(xset3, "x", "y", "x_vs_y", 2500, metlin = 0.15, h = 480, w = 640)

Thanks in advance
4
metaXCMS / OTHER common features (Treatments 1, 2 NOT 3)
When "Export common features" tab is clicked, it exports a file with the common features of all 3 of my treatments.

This is interesting and useful, but I also want to look exclusively at what is common in treatments 1&2 (not 3), 2&3 (not 1) and 1&3 (not2).

Is there a convenient way to do this?

Thanks.