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 - LauraShireman

32
XCMS / Re: How do I plot the EIC for compounds XCMS has found?
Oh, I see: getEIC populates some other table that you call when you use plot, so if you only getEIC for one compound, regardless of what groupidx it was in originally, now it will be the 1 and only groupidx, right? Thank you, Carsten!

I feel like I'm asking questions that must be spelled out someplace in some documentation somewhere, and I just don't want to waste your time. Is there some documentation that explains some of these things or did you read through the code itself to figure that out?

Another question I have is how to figure out what the groupidx for a given compound is. It doesn't appear to be related to the output of diffreport, so then I thought that it might be the row number for the output of groups(set5.filledpeaks) but it doesn't look like that's it, either.

Thanks again!

Laura
33
XCMS / Re: How do I plot the EIC for compounds XCMS has found?
Thanks for the response, Carsten!

I tried your code, and while I could get it to work with the first mass feature listed in the groups, I couldn't get it to work with any others. For example, I tried looking at the 4th mass feature, and I got an error that says, "Error in tempsplit[[2]] : subscript out of bounds".

Here's what I did for the 1st mass feature (and this worked):
Code: [Select]
MF1.raw <- getEIC(set5.filledpeaks, rt="raw", groupidx=1)
MF1.cor <- getEIC(set5.filledpeaks, rt="corrected", groupidx=1)

par(mfrow=c(2,1))
plot(MF1.raw, set5.filledpeaks, groupidx=1)
plot(MF1.cor, set5.filledpeaks, groupidx=1)
And here's what I did for the 4th mass feature (and this gave me that error above when I tried getEIC so I didn't even get to the plot part):
Code: [Select]
MF4.raw <- getEIC(set5.filledpeaks, rt="raw", groupidx=4)
MF4.cor <- getEIC(set5.filledpeaks, rt="corrected", groupidx=4)
Any suggestions? Thank you very much for your help!

Laura
34
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
35
XCMS / Re: Diffreport command returns warnings. Help please?
I'm also pretty new to XCMS, but I'll take a stab since I've been able to get diffreport to work so far.

For the first option you listed for diffreport:
Quote from: "kmhilmer"
reporttab<-diffreport(xset3,class1="Control",class2="WSN",filebase="mztest",eicmax=7000,eicwidth=120,classeic=c("control","wsn"),value=c("into"),metlin=.03,h=480,w=640)
I'm not sure what filebase refers to because I haven't used that. Is that supposed to be where the output files are stored? I've been able to get diffreport to work by setting my working directory when I first get the files that I want to use. For example, if I had my files, which are in mzData format, in two folders called Group1 and Group2 in the My Documents folder I'll use something like this:
Code: [Select]
setwd("C:/Users/Laura/Documents")
MyFiles <- list.files(getwd(), pattern="mzdata.xml", full.names=FALSE, recursive=TRUE)

Then I type "MyFiles" to make sure that I see something like this:
"Group1/FileA"  "Group1/FileB"  "Group1/FileC"  "Group2/FileD"  "Group2/FileE"  "Group2/FileF"

Then, I'd do pretty much what you're doing except that I'd specify that the object I want to use with xcmsSet is MyFiles, e.g.
Code: [Select]
xset <- xcmsSet(MyFiles, method='centWave',ppm=5,peakwidth=c(5,90),snthresh=3,mzdiff=0.01,prefilter=c(3,10))
I don't know how important it is to specify the object with xcmsSet. If it seems to work without specifying, then I guess you're fine, but I've been specifying it. That way I also know for sure that I'm analyzing what I mean to analyze.

Then, when I'm ready to generate the diffreport, then I use a command like this to get the top 20 EICs ranked by differences between the groups:
Code: [Select]
MyReport <- diffreport(xset3, "Group1", "Group2", "MyOutputFile", 20)

It looks like you're using more parameters than I have been when you call diffreport, so maybe this won't be particularly helpful as I don't know how to be specific about which EICs I get in the output files and I'm not searching Metlin directly from XCMS.  :)

Good luck!
Laura
36
XCMS / Re: Peak filtering
Oh! Well, that would explain it! And I suppose that 5 ppm is a bit overly optimistic. That's on the better end of our resolution. We probably get more like 5-10 ppm for most mass features but sometimes lower. I tried again, this time using the density function. Here's the code I used:

Code: [Select]
QCset5 <- xcmsSet(Samples, method = "centWave", snthresh = 10, 
                  ppm=15, peakwidth=c(6,18),
                  mzCenterFun="wMean",integrate = 1,fitgauss= TRUE)

QCset5

QCset5.grouped <- group(QCset5, method="density", minsamp=1, mzwid=0.004)
QCset5.RTcor <- retcor(QCset5.grouped, missing=0, extra=1, smooth="loess",
                          family="symmetric", plottype="mdevden")
QCset5.grouped.2 <- group(QCset5.RTcor, method="density", minsamp=1, mzwid=0.004)
QCset5.filledpeaks <- fillPeaks(QCset5.grouped.2)
QCset.5c1e <- diffreport(QCset5.filledpeaks, "20110211", "20110223", "QCurine XCMS 5c1e", 20)

And it appears to have worked! Yay!

I'm still tweaking my parameters, but this was very, very helpful! THANKS!!!

Laura
37
XCMS / Re: Peak filtering
I should have included the code I'm using. Sorry. Here it is. My data are in mzData format.

Code: [Select]
Samples <- list.files(getwd(), pattern="mzdata.xml", full.names=FALSE, recursive=TRUE)
QCset <- xcmsSet(Samples, method = "centWave", snthresh = 10,
              ppm=5, peakwidth=c(10,30),
              mzCenterFun="wMean",integrate = 1,fitgauss= TRUE)

QCset

QCset.mzClust <- group(QCset, method="mzClust", minsamp=1, mzppm=5)
QCset.mzClust.2 <- retcor(QCset.mzClust, missing=0, extra=1, smooth="loess",
                          family="symmetric", plottype="mdevden")
QCset.mzClust.3 <- group(QCset.mzClust.2, method="mzClust", minsamp=1, mzppm=5)
QCset.mzClust.4 <- fillPeaks(QCset.mzClust.3)
QCset.5c1c <- diffreport(QCset.mzClust.4, "20110211", "20110223", "QCurine XCMS 5c1c", 20)

Laura
38
XCMS / Re: Peak filtering
Hi, Jan.

If by "single spectrum" data you mean single MS (as opposed to tandem MS) data, then yes, that's what I have. Sorry, I'm not familiar with the term "single spectrum".  :)  To collect my metabolomics data, I'm using an Agilent 6520 QToF in which the first mass analyzer is not selective and all the accurate mass info comes from the ToF. Would you recommend using the "density" or "nearest" methods instead of "mzClust" for this? I'm new to XCMS and I want to make sure that I'm using the appropriate parameters. It would not surprise me if I'm making some inappropriate parameter choices because somewhere along the way, I've messed up something with my retention times. Even though the retention-time-correction plot looks fine, all my RT in the output are "-1". I had thought my mistake was some where other than in the group function, though. 

I really appreciate your help!

Laura
39
XCMS / Re: Peak filtering
Thank you! That worked. The code I used was:
group(xset, method="mzClust", minsamp=1, mzppm=5)

Laura
40
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.
41
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.
42
METLIN / Re: MS/MS Spectrum Match is available now
Thanks! This is FANTASTIC!

A question: I want to make sure that I'm interpreting my search results correctly; is there an explanation somewhere for how to interpret the lines in the spectra listed under "spectrum matching"? I believe that the upper half of the spectrum is what I submitted, but I'm not sure why sometimes the line is blue and sometimes it's black, and the bottom must be what is in the database. How are you determining the length of the line? On the top, is that what I submitted and then the bottom is the residual of the fit to what's in your database?

Thank you very much for a great tool!

Laura