Skip to main content

Topics

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

Topics - LauraShireman

1
XCMS / Remove a sample after xcmsSet step
I should have been more careful, but I accidentally included a file that failed to inject when I ran the xcmsSet command. When I tried to perform retcor() later in the script, my failed injection is mucking things up because there are too few peak groups. Is there some way to remove a specific sample from an xcmsSet() object and keep all the others?
2
XCMS / Why do I have fewer compounds with more samples?
When I use xcms to process 50 samples, I get ~4000 compounds for one particular dataset. When I use xcms to process 150 samples -- including the original 50 samples -- I get ~1500 compounds. What's going on? Why would more samples result in fewer compounds? This is particularly disconcerting for these data because the aligned data with 50 samples include a compound we're interested in and the aligned data with 150 samples do not.

Here's an example of my code:
Code: [Select]
Samples <- list.files(getwd(), pattern="mzdata.xml", full.names=F, recursive=TRUE)

xs1 <- xcmsSet(Samples[1:50], method = "centWave",  ppm=15, peakwidth=c(4,12),
              snthresh = 5, mzCenterFun="apex", prefilter=c(5,500),
              integrate = 1, fitgauss= TRUE)

xs2 <- xcmsSet(Samples[51:150], method = "centWave",  ppm=15, peakwidth=c(4,12),
              snthresh = 5, mzCenterFun="apex", prefilter=c(5,500),
              integrate = 1, fitgauss= TRUE)

xset.grouped <- group(c(xs1, xs2)), method="density", bw=4,
                          minsamp=1, mzwid=0.007, max=500)

xset.RTcor <- retcor(xset.grouped, method="peakgroups",
                        missing=20, extra=50, smooth="loess",
                        family="symmetric", plottype="none")

xset.grouped2 <- group(xset.RTcor, method="density", minsamp=1,
                          mzwid=0.007, bw=2, max=500)

xset.filledpeaks <- fillPeaks(xset.grouped2)

xset.peaks <- peakTable(xset.filledpeaks, filebase="xset peak table")

If I only align xs1, I get more compounds than if I align both xs1 and xs2.

Thanks for any help!

Laura
3
XCMS / Saving an xcmsSet object
I need to peak pick and align about 250 samples, and because I forgot to turn off Microsoft's automatic updates, the computer I had set up to do this restarted right in the middle of the xcmsSet step, and I lost about a day of computing time. Lesson learned: I turned OFF automatic updates. However, it made me wonder whether there was some way to save an xcmsSet object that's only partway completed. Is that possible? Could I, for example, run xcmsSet on a subset of my samples, save what I've got so far, then run xcmsSet on the next chunk of samples, save again, etc. and at the end, put everything together into one xcmsSet object?

Many thanks in advance for any help! You guys are great!

Laura
4
XCMS / XCMS2: collect() doesn't work
I'm trying to use XCMS2 to search METLIN for MS/MS spectra, and I'm stuck at one of the first steps. When I try the collect() function, I get this error:
Code: [Select]
Error in function (classes, fdef, mtable)  : 
  unable to find an inherited method for function "collect", for signature "xcmsRaw"

Here is the code I'm using:
Code: [Select]
library(xcms)

Data.raw <- xcmsRaw(filename="20110724pooledplasma-MSMS-06.mzdata.xml", includeMSn=TRUE)
Data.raw

Data.coll <- collect(Data.raw, rt=30)

Any suggestions? Thanks in advance!

Laura
5
XCMS / Plot multiple EICs from the same sample
I see how to plot the extracted ion chromatograms for a single ion from multiple samples all in the same plot (getEIC and then plot that object), but how do you plot the extracted ion chromatograms for several ions from a single sample all in the same plot?

Laura
6
CAMERA / Plot all EICs of a single isotope group
After finding isotopes, is it possible to pick an isotope group and plot the EICs just from that isotope group for a specific sample? I don't want to plot an entire peak group; I would like to see just the EICs for all the ions that CAMERA has assigned to the same isotope group. I thought maybe getIsotopeCluster would be a step in the right direction, but I don't know what to do after that.

On that topic, when getIsotopeCluster or any of the other commands in CAMERA ask for "value" or "intval", what do "maxo", "into" and "intb" refer to?

Thanks!

Laura
7
XCMS / How do I plot the EIC from an xcmsRaw object?
Thanks to some  helpful advice earlier, I can plot the EICs of mass features from an xcmsSet object, but I'm having trouble getting it to work for an xcmsRaw object when there isn't a groupidx to call. I want to look at one sample, QC1, and I want to see the extracted-ion chromatogram for 512.27 m/z from 705 to 740 seconds. This is what I've tried:
Code: [Select]
QC1.raw <- xcmsRaw("QC1.mzdata.xml", profstep=0.01, profmethod="bin")
QC1.eic <- getEIC(QC1.raw, mzrange=c(512.0, 512.4), rtrange=c(705,740))
plot(QC1.eic, mzrange=c(512.0, 512.4), rtrange=c(705,740))
When I try the "getEIC" command, I get this error:
    Error in vector("list", nrow(rtrange)) : invalid 'length' argument

There may also be an error in the plot command, but I haven't been able to get past getEIC, so I'm not sure whether the plot command will work the way that I want.

Ultimately, what I want to do is use my own data to get graphs like those in figure 1 from "Highly sensitive feature detection for high resolution LC/MS" by Ralf Tautenhahn, Christoph Böttcher and Steffen Neumann, 2008, BMC Bioinformatics. I can get the plotRaw function to work, which gives me the upper of the two graphs in figure 1, but I can't figure out how to make the lower graph. The help file for XCMS says that mzrange and rtrange should each be a two-column matrix, but I don't really understand what that means. I mean, for the retention time, for example, I just want to look at 705 to 740 seconds, so that would be one row. What would the other rows in the matrix be?

Thanks!

Laura
8
CAMERA / Way too many ions being assigned to the same compound
I'm trying to use CAMERA to annotate peaks from data collected in ESI- on a QToF in single-MS mode. I started off using the parameters listed in "LC-MS Peak Identification and Annotation with CAMERA" by Carsten Kuhl, Ralf Tautenhahn and Steffen Neumann, and then, when those parameters gave the result that many, many ions were all caused by the same compound, I tried adjusting. I've tried making my parameters stricter and stricter, and I've now got parameters that suggest that we've got the world's most amazingly mass- and retention-time accurate QToF, but I'm still coming up with the same number of grouped features every time. For example, a bunch of stuff co-elutes around 12.5 minutes, and CAMERA has put 137 ions into that pcgroup, and I just can't believe that one compound could really generate 137 ions. What am I doing wrong? Am I misunderstanding the output? I thought that CAMERA would take a peak-picked, peak-aligned and peak-filled XCMS object and determine which of all those mass features were caused by the same compound. For example, let's say that two compounds co-elute and each generates one Na adduct and one 13C peak in addition to their major, monoisotopic peak. Doesn't CAMERA then decipher those data and tell you, "Hey, it looks like you've got two different compounds that co-elute and these three peaks are because of compound A and those three peaks are because of compound B."? Wouldn't those two compounds have a different number listed under pcgroup?

Here's the code I'm using, in case that's illuminating.
Code: [Select]
Set1.annot <- xsAnnotate(Set1.filledpeaks)
Set1.F <- groupFWHM(Set1.annot, perfwhm=0.005)
Set1.C <- groupCorr(Set1.F, cor_eic_th=1.6, pval=0.001, calcIso=TRUE,
                      calcCiS=TRUE)
Set1.FI <- findIsotopes(Set1.C, maxcharge=3, maxiso=4, ppm=10,
                          mzabs=0.0001, intval="maxo", minfrac=0.1)
Set1.FA <- findAdducts(Set1.FI, ppm=10, mzabs=0.0001, multiplier=3,
                        polarity="negative", rules=NULL, max_peaks=100)
Set1.peaklist <- getPeaklist(Set1.FA)
write.csv(Set1.peaklist, file="Set1 annotated peaklist.csv")

By the way, what are the allowable numbers for cor_eic_th? Is that referring to equation 1 in Kuhl 20012 Analytical Chemistry? So can that parameter range from 0 to 3?

Thank you very much in advance!

Laura
9
XCMS / Undesired filtering somewhere
For metabolomics data, the biostatisticians with whom we collaborate strongly discourage any kind of filtering of mass features based on group membership. For example, they say that it would be a bad idea to detect peaks and then, during peak alignment, only keep mass features that were present in 50% of the samples in treatment group A or 50% of the samples in treatment group B. Better, they say, to keep mass features present in 50% of all samples so that your data preprocessing steps do not bias your outcome. With that in mind, I'm trying to make sure that XCMS is not filtering at all. Here's my issue: I get different results when I group my samples -- putting my raw data files into different folders -- than when I do not, so somewhere, I'm filtering when I don't mean to be. Here is the code I'm using:
Code: [Select]
Samples <- list.files(getwd(), pattern="mzdata.xml", full.names=FALSE, recursive=TRUE)

U5g.raw <- xcmsSet(Samples, method = "centWave", snthresh = 10, ppm=15, peakwidth=c(6,12), mzCenterFun="apex", integrate = 1,fitgauss= TRUE)

U5g.raw

U5g.grouped <- group(U5g.raw, method="density", minsamp=1, mzwid=0.004, bw=10, max=10)

U5g.RTcor <- retcor(U5g.grouped, missing=15, extra=30, smooth="loess", family="symmetric", plottype="mdevden")

U5g.grouped2 <- group(U5g.RTcor, method="density", minsamp=1, mzwid=0.004, bw=10, max=10)

U5g.filledpeaks <- fillPeaks(U5g.grouped2)

U5g.peaks <- peakTable(U5g.filledpeaks, filebase="ESI+ urine 5g peak table")
When I have my samples in 4 folders, one each for the four treatment groups I've got, I get 12,793 mass features. (Yes, I know that many of those are noise and that I'm probably too stringent on some of my mass spectral resolution parameters. :-)  I'll adjust that later, once I better understand what's going on here.) When I put those exact same data files all together into one folder, I get 3,806 mass features.

Anyone have any thoughts on what's going on? I thought that if I put "minsamp=1" for a grouping parameter that meant that I wasn't filtering at all, but if I'm not filtering based on group membership, why do I get a different number of mass features when I group my samples by treatment group than when I don't?

Thanks in advance. This board has really, really been helpful to me in the past!

Laura
10
XCMS / How do I plot the EIC for compounds XCMS has found?
I'm really confused about how to use plotEIC, plotPeaks and plotChrom and how they're different. From the help file, it sounds like they're all plotting raw data, which isn't what I want. I would like to plot the retention-time-corrected and aligned peaks for specific mass features. So far, I have:
* picked peaks with xcmsSet,
* grouped them with group,
* corrected the retention time with retcor,
* grouped again with group,
* filled in missing peaks with fillPeaks,
* and generated a difference report with diffreport.
When I called the diffreport function, I had it also plot the EICs for the top 20-most different peaks, and those plots are the kind of plots I want. How do I create plots for the EICs of other compounds that XCMS has found? I don't really want it to plot every single one of the 5000+ compounds it found and then just look through that list and find the png files I'm interested in. How do I choose the ones that I want? I've tried playing around with getEIC, plotEIC, plotPeaks and plotChrom, and, to be honest, I can't get a single one of them to work, and I'm just not really understanding what the help file is saying. 

Thanks in advance.

Laura
11
XCMS / Peak filtering
Is there some way to turn off the automatic filtering wherein XCMS removes any peaks that are present in less than half of the samples in any group? If it's possible, I'd like to get ALL the peaks detected, even if they were only detected once. Is that possible?

Thanks!
Laura S.
12
XCMS / Vicinity elimination postprocessing
I read in the often-cited Smith 2006 Analytical Chemistry paper that the vicinity elimination postprocessing step removes peaks within 0.7 m/z of the higher-intensity peaks. Is there some way to adjust that m/z range or turn that feature off when you've got better spectral resolution than that? Is that something that happens when you call xcmsSet or does it happen within some other function?

Thanks in advance!
Laura S.