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

1
XCMS / xcmsRow mzrange
Hi, I would use xcmxRow() to read a .CDF file but, instead of to read all the file I would only read the file in a particular m/z range. 

This is the classic approach:
Code: [Select]
a <- xcmsRaw(myCDF)

An "xcmsRaw" object with 3238 mass spectra

Time range: 329.8-1439.9 seconds (5.5-24 minutes)
Mass range: 50-549.4 m/z
Intensity range: 150-4750850

MSn data on  0  mass(es)
with  0  MSn spectra
Profile method: bin
Profile step: 1 m/z (500 grid points from 50 to 549 m/z)
>
> dim(a@env$profile)
[1]  500 3238

I tried this code to select a particular m/z range but it doesen't work as expected:

Code: [Select]
xs <- xcmsRaw(myCDF, profparam=list(mzrange=100:400))
An "xcmsRaw" object with 3238 mass spectra

Time range: 329.8-1439.9 seconds (5.5-24 minutes)
Mass range: 50-549.4 m/z
Intensity range: 150-4750850

MSn data on  0  mass(es)
with  0  MSn spectra
Profile method: bin
Profile step: 1 m/z (500 grid points from 50 to 549 m/z)
Profile parameters: mzrange = 100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400

>
> dim(a@env$profile)
[1]  500 3238

Unexpectedly the dimension of the resulting data matrix is the same.

Where do I wrong?

Is there another way to do this?

All the best
2
XCMS / QQQ MRM data
Hi, I'm working with MRM data and I would analize them using xcms. I have encountered some trouble and I'm not still able to read the data using xcms. I've searched into the forum to try to understand if xcms is able to work with MRM data or not but, I haven't found any recent discussion about that...

This is what I've done:
    1 - MRM data aquired with AB-Sciex QQQ
    2 - wiff file converted using msConvert (ProteoWizard) into mzML.

Now when I try to run xcmsRaw I obtain this:
Code: [Select]
[SpectrumList_mzML::spectrum()] Index out of bounds.

Seems that no spectral information are contained into the mzML file but, if I try to open it using seeMS from proteo wizard I see all my MRM experiment...

Have you ever experienced a problem like this??

All the best
3
XCMS / fillPeaks question
Hi to everybody, I have a question about the results od the fillPeaks() step.
Reading the description of the function I understand that it identify peak groups where that sample is not represented and it integrate the signal in the region of that peak group and create a new peak. So I belive that all the samples should have the same number of peaks, i.e. all the samples ha the same lenght. But if I take a look at the dimension of the peak slot after the fillPeak() step, all the samples have a different lenght, i.e. a different number of peaks.

Can you explain it to me? Is it a normal behaviour?

Best Regards, Riccardo
4
XCMS / xcmsRaw and obiwarp
Hi, I have several xcmsRaw object that I would like to align using the obiwarp method. Is there a way to do this without using xcmsSet?

Best Regards
Riccardo
5
CAMERA / Deconvolution of EI-GC-MS spectra
Hi, I would use CAMERA to deconvolute EI-GC-MS chromatograms, i.e.separate co-eluting peaks. So my idea is to extract all the ion traces with xcms and group it together using CAMERA-groupFWHM(). The problem is that I obtain only a low number of preudospectra with more than six ions. This is not possible for EI ionization technique.

Code: [Select]
## xcms ##
xset <- xcmsSet(files = files, nSlaves = slaves, method = 'matchedFilter',## sleep = 3,
                snthr = 1, fwhm = 10, step = .5, steps = 2, mzdiff = 0, max = 500)
xset <- group(xset, method = 'density', bw = 30, mzwid = 1, minfrac = 1, ## sleep = 3,
                max = 500)
xsetRT <- retcor(xset, method = 'loess', family = 'gaussian')
plotrt(xsetRT, leg = FALSE, densplit = TRUE)
xsetRT <- group(xsetRT, method = 'density', bw = 10, mzwid = 1, minfrac = 1, ## sleep=5,
                max = 500)
xsetFP <- fillPeaks(xsetRT)

## camera ##
xsA <- annotate(xsetFP, nSlaves = slaves, sigma = 3, perfwhm = .06, calcCaS = TRUE, mzabs = 1,
                ppm = 100, sample = c(1:3), quick = TRUE, intval = 'maxo', max_peaks = 500,)

## number of pseudospectra with more than 6 ions
data <- getPeaklist(xsC)
data$pcgroup <- as.numeric(data$pcgroup)
(a <- which(table(data$pcgroup) >= 6))
length(a)

I tried to play with the perfwhm parameter but I have't obtained significative changes.

Have you some suggestion?
6
XCMS / GC-MS Metabolomics: Supervised vs. Unsupervised Approach
Hi, I would like to discuss with you about the data pre-processing in a metabolomic experiment performed using GC-MS. In my experience we have two possibility: a supervised method, using a 'direct approach' to each chromatogram, for example using AMDIS for the spectral deconvolution to separate the co-eluting compounds; and an unsupervised approach using a dynamic programming method, i.e. xcms.

I'm working on the same data set using both approach but, I'm not been able to obtain comparable results. In particular using AMDIS I have extracted about 180 different compounds while, using xcms-CAMERA, I'm not been able to extract more than 35 compounds. This is the code I used:

Code: [Select]
## xcms
xset <- xcmsSet(files, nSlaves = slaves, method = 'centWave', ppm = 100, peakwidth = c(3,10),
                snthr = 3, integrate = 1, prefilter = c(3,100), noise = 0)
xsetRT <- retcor(xset,  method = 'obiwarp', profStep = 1, plottype = 'none')
plotrt(xsetRT, leg = FALSE, densplit = TRUE)
xsetRT <- group(xsetRT, method = 'density', minfrac = 0.5, bw = 30, mzwid = 0.25,
              max = 100, minsamp = 1)
xsetF <- fillPeaks(xsetRT)
## camera
xsA <- annotate(xsetF, nSlaves = slaves, perfwhm = .6, calcCaS = TRUE, mzabs = 0.1,
                ppm = 100)

Further I wrote a little code to extract only the groups with a minimum number of ions, i.e. 6 ions, because using an electron ionization source, I haven't only the molecular ion, but I have a lot of fragments.

Code: [Select]
data <- getPeaklist(xsA)
data$pcgroup <- as.numeric(data$pcgroup)
(a <- which(table(data$pcgroup) >= 6))
length(a)

My intent is to replicate the deconvolution approach of AMDIS using xcms-CAMERA.

What is your opinion??
Have you ever tryed to use xcms with GC-MS data?? Which results did you obtained??

How can I improve the code I wrote to obtain better results??
7
XCMS / Warning problem after fillPeaks
Hi all,
I have some problems after the fillPeaks. This is the code I work with:

Code: [Select]
xset <- xcmsSet(files, method="centWave", snthresh=10, ppm=10, mzdiff=0.01,
                prefilter=c(3,500), peakwidth=c(10,60), nSlaves=4)
idx<-which(xset@peaks[,"mz"] > 100 & xset@peaks[,"mz"] < 1000)
xset@peaks<-xset@peaks[idx,]
xsetR <- retcor(xset, method="obiwarp", profStep=0.1, plottype="deviation")
xsetR <- group(xsetR, bw=5, mzwid=0.025,  minsamp=5)
xsetF <- fillPeaks(xsetR)

I have this warning message after the fillPeaks step:

There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In .local(object, ...) :
  getPeaks: Peak  m/z:397.366577148438-397.368316650391,  RT:364.471-378.604is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

2: In .local(object, ...) :
  getPeaks: Peak  m/z:479.481033325195-479.483581542969,  RT:364.471-391.31is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

3: In .local(object, ...) :
  getPeaks: Peak  m/z:480.484039306641-480.487976074219,  RT:364.471-392.215is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

4: In .local(object, ...) :
  getPeaks: Peak  m/z:610.453125-610.457580566406,  RT:364.471-383.212is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

5: In .local(object, ...) :
  getPeaks: Peak  m/z:617.063537597656-617.069519042969,  RT:364.471-376.196is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

6: In .local(object, ...) :
  getPeaks: Peak  m/z:713.638122558594-713.643371582031,  RT:364.471-398.001is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

7: In .local(object, ...) :
  getPeaks: Peak  m/z:798.143920898438-798.152557373047,  RT:364.471-376.5195is out of retention time range for this sample (/home/cism/Documents/Controllo10.mzXML), using zero intensity value.

......

So, I think there is a specific problem, for example, in the file called  Controllo10.mzXML, but clustering the RT differences it seems that the groups aren't too different.

Code: [Select]
minlength <- min(sapply(xsetR@rt$raw, length ))
devs <-
    sapply(1:length(xsetR@rt$corrected),
          function(x){
              (xsetR@rt$raw[[x]]-xsetR@rt$corrected[[x]])[1:minlength]})
colnames(devs) <- sampnames(xsetR)
ddevs <- dist(t(devs))
hdevs <- hclust(ddevs)
x11(); plot(hdevs)

The result of the clustering analysis is:

[attachment=1:29id13si]HCluster.png[/attachment:29id13si]

And this is the result of the retcor step:

[attachment=0:29id13si]RTDev.png[/attachment:29id13si]
 
Do you have any suggestion to try to solve this kind of problem?? Should I discard from my dataset the sample in the warning message??

Best
Riccardo

P.S. This enormous problem in the RT are due to the use of a HILIC LC column...  :evil:

[attachment deleted by admin]
8
XCMS / matchedFilter parameters
Hi to everybody,
I'm setting up an xcms object using the matchedFilter algorithm. So, reading the Smith's paper (XCMS: Processing Mass Spectrometry....) I'm adjusting s/n and fwhm parameters to obtain the best result.

Code: [Select]
xsetSUP <- xcmsSet(files, method="matchedFilter", snthresh=8, fwhm=10, sleep=1)

My question is about the red horizontal line: I think is regulated by the s/n so, the higher is the s/n the higher is the red line. Is it right?? Is the red line used as baseline to integrate the signal?? How it is calculated the s/n ratio?? RMS or Peak to peak??

Best

Riccardo
9
XCMS / fillPeaks ERROR
Hi to all and good year!
I have had a problem running fillPeaks.
Controllo10 Error in checkSlotAssignment(object, name, value) : "scantime" is not a slot in class “NULL”

This are the settings I use:
Code: [Select]
xset <- xcmsSet(files, method="centWave", nSlaves=4, polarity="positive", ppm=5)
xset <- group(xset, bw=30, mzwid=0.025, minfrac=0.5, minsamp=10)
xset.retcor <- retcor(xset, method="obiwarp", profStep=0.1, distFunc= "cov", plottype="deviation")
xset.retcor <- group(xset.retcor, bw=10, mzwid=0.025, minfrac=0.5, minsamp=10)
xset.finale <- fillPeaks(xset.retcor)

My data set is made up of 60 negative control and 15 positive control. Is correct to use minsamp=10 that is 2/3 of the positive control? My data were aquired with Agilent LC/qTOF.

Best
10
XCMS / Duplicate 'row.names' ERROR
Hi to all, I notice a strange  error while I run xcmsSet:
Code: [Select]
xset <- xcmsSet(files, method="centWave", nSlaves=4, polarity="positive", prefilter=c(3,100), ppm=5)

In particular, if :
Code: [Select]
files <- list.files(path= myPath, pattern="mzXML", full.names = TRUE, recursive =TRUE)

all works fine but, if:
Code: [Select]
files <- list.files(path= myPath, pattern="mzXML", full.names = FALSE, recursive =TRUE)

the xcmsSet function says:
Error in `row.names<-.data.frame`(`*tmp*`, value = value) : duplicate 'row.names' are not allowed
In addition: Warning message: non-unique values when setting 'row.names': ‘’
.

If I see the files object, I do not see any duplicate.

    > files
     [1] "Negative/Controllo10.mzXML"    "Negative/Controllo11.mzXML" 
     [3] "Negative/Controllo12.mzXML"    "Negative/Controllo13.mzXML" 
     [5] "Negative/Controllo14.mzXML"    "Negative/Controllo15.mzXML" 
     [7] "Negative/Controllo16.mzXML"    "Negative/Controllo17.mzXML" 
     [9] "Negative/Controllo18.mzXML"    "Negative/Controllo19.mzXML" 
    [11] "Negative/Controllo1.mzXML"    "Negative/Controllo20.mzXML" 
    [13] "Negative/Controllo21.mzXML"    "Negative/Controllo22.mzXML" 
    [15] "Negative/Controllo23.mzXML"    "Negative/Controllo24.mzXML" 
    [17] "Negative/Controllo25.mzXML"    "Negative/Controllo26.mzXML" 
    [19] "Negative/Controllo27.mzXML"    "Negative/Controllo28.mzXML" 
    [21] "Negative/Controllo29.mzXML"    "Negative/Controllo2.mzXML"   
    [23] "Negative/Controllo30.mzXML"    "Negative/Controllo31.mzXML" 
    [25] "Negative/Controllo32.mzXML"    "Negative/Controllo33.mzXML" 
    [27] "Negative/Controllo34.mzXML"    "Negative/Controllo35.mzXML" 
    [29] "Negative/Controllo36.mzXML"    "Negative/Controllo37.mzXML" 
    [31] "Negative/Controllo38.mzXML"    "Negative/Controllo39.mzXML" 
    [33] "Negative/Controllo3.mzXML"    "Negative/Controllo40.mzXML" 
    [35] "Negative/Controllo41.mzXML"    "Negative/Controllo42.mzXML" 
    [37] "Negative/Controllo43.mzXML"    "Negative/Controllo44.mzXML" 
    [39] "Negative/Controllo45.mzXML"    "Negative/Controllo46.mzXML" 
    [41] "Negative/Controllo47.mzXML"    "Negative/Controllo48.mzXML" 
    [43] "Negative/Controllo49.mzXML"    "Negative/Controllo4.mzXML"   
    [45] "Negative/Controllo50.mzXML"    "Negative/Controllo51.mzXML" 
    [47] "Negative/Controllo52.mzXML"    "Negative/Controllo53.mzXML" 
    [49] "Negative/Controllo54.mzXML"    "Negative/Controllo55.mzXML" 
    [51] "Negative/Controllo56.mzXML"    "Negative/Controllo57.mzXML" 
    [53] "Negative/Controllo58.mzXML"    "Negative/Controllo59.mzXML" 
    [55] "Negative/Controllo5.mzXML"    "Negative/Controllo60.mzXML" 
    [57] "Negative/Controllo6.mzXML"    "Negative/Controllo7.mzXML"   
    [59] "Negative/Controllo8.mzXML"    "Negative/Controllo9.mzXML"   
    [61] "Positive/Positivo1_rip1.mzXML" "Positive/Positivo1_rip2.mzXML"
    [63] "Positive/Positivo1_rip3.mzXML" "Positive/Positivo2_rip1.mzXML"
    [65] "Positive/Positivo2_rip2.mzXML" "Positive/Positivo2_rip3.mzXML"
    [67] "Positive/Positivo3_rip1.mzXML" "Positive/Positivo3_rip2.mzXML"
    [69] "Positive/Positivo3_rip3.mzXML" "Positive/Positivo4_rip1.mzXML"
    [71] "Positive/Positivo4_rip2.mzXML" "Positive/Positivo4_rip3.mzXML"
    [73] "Positive/Positivo5_rip1.mzXML" "Positive/Positivo5_rip2.mzXML"
    [75] "Positive/Positivo5_rip3.mzXML"
    >

Any suggestion??

EDIT
> traceback()
6: stop("duplicate 'row.names' are not allowed")
5: `row.names<-.data.frame`(`*tmp*`, value = value)
4: `row.names<-`(`*tmp*`, value = value)
3: `rownames<-`(`*tmp*`, value = c(NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
  NA_character_, NA_character_, NA_character_))
2: phenoDataFromPaths(files)
1: xcmsSet(files, method = "centWave", nSlaves = 4, polarity = "positive",
      ppm = 5)


P.S. Merry XMas :D
11
XCMS / Upgrade xcms error
Hi, I am a mac user (OS X 10.5.8) I have already upgraded R to 2.14.0 to use the last relese of xcms and now I have some problem to load it. When I try to load xcms the R consol say:

library(xcms)
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/Users/riccardoromoli/Library/R/2.14/library/xcms/libs/x86_64/xcms.so':
dlopen(/Users/riccardoromoli/Library/R/2.14/library/xcms/libs/x86_64/xcms.so,
6): Library not loaded: /usr/local/lib/libnetcdf.7.dylib
Referenced from:
/Users/riccardoromoli/Library/R/2.14/library/xcms/libs/x86_64/xcms.so
Reason: image not found

Errore: package/namespace load failed for ‘xcms’


I think the error is the absence of ibnetcdf.7.dylib. Do you have any idea how can I correct this error??

Best
Riccardo
12
CAMERA / Isotope extraction
Hi, I'm playng for the first time with the metabolomics and I have some doubt about the metabolite identification (herehttp://http://metabolomics-forum.com/viewtopic.php?f=8&t=187&sid=0f294f5a8bf7f8474256f8b0649aea2e). After the anlysis with only xcms I would like to go further using CAMERA to try to better understand the data obtained with xcms.

So, after the xcms and CAMERA workflow I tryed the getIsotopeCluster function to work only with the molecular ion.

Code: [Select]
xsa <- xsAnnotate(xset)
xsaF <- groupFWHM(xsa)
xsaC <- groupCorr(xsaF)
xsaI <- findIsotopes(xsaC)
data.set <- getPeaklist(xsaI)
isolist <- getIsotopeCluster(xsaI, value="into")

My question is about the usage of the getIsotopeCluster function, in particular how can I extrapolate only the information about the $peak slot of all my sample and collect them into a data frame??

Best
13
XCMS / Extract metabolite information
Hi to everybody,
I have somethings in my mind that is unclear about the interpretation of the result obtained using the xcms package for metabolomic data analysis.

Because I have more than two classes I haven't used the diffreport function to extract the most significant peaks according to their ANOVA p-value, but I wrote some code to do this. So I found a small number of signal that are significantly different among the treatment and I use this for the multivariate statistical analysis.

Furthermore the next step was to try to understand if the significative peaks have a "name and surname". To do this I extracted the m/z information from the peak list using the groupnames function and I used the Metabolite Search engine directly from my web browser.  I adjusted the ppm error and the polarity.

Now the question: how about the charge state parameter??
In particularly I tried different charge state option: M+H, M+Na, M+K, M+H-H2O... and I studied the results obtained, trying to understand which are the different signal obtained crossing the different data report. For example if the signal 490.1765 m/z has no positive hits with the M+H option, but have a positive hit with the M+Na option, I conclude that is a sodiated adduct instead of a protonated adduct.

Is a correct way to try to identify a metabolite?? Why the diffreport approach has only an M+H information?? Should I use a de-isotoping function to be sure I work only with M+H signal??  Is possible to do this with xcms??

Best

P.S. Sorry for my bad English :oops: I hope you can understand the question/s.
14
XCMS / METLIN information extraction
Hi, is there a way to manually generate the link to Metlin database without using diffreport method?? I see in the manual that is possible when you have an MS^n experiment while I have only a MS experiment with no fragmentation.

Best
15
XCMS / Pbroblem with large data set and loop
Hi, I have a problem to work with a large data set (about 200 samples). In particular I have a problem to creaete the xcmsSet:

Code: [Select]
xset <- xcmsSet(data.set, method="centWave",
                    polarity="positive", ppm=10, snthr=15,
                    peakwidth=c(4,15))

In particular, after a few times, about 2 hours, I encountered  several errors such as:

Detecting mass traces at 1o ppm ...
 % finished: 0 10 Error in .local(object, ...) :
  m/z sort assumption violated ! (scan 376, p 63, current 100.9567 (I=1708.65), last 843.6795)


or

17_GS34_A.mzdata: Error in rampSIPeaks(rampid, scans, scanHeaders$peaksCount[scans]) :
  unexpected end of peak list
Calls: xcmsSet -> xcmsRaw -> rampRawData -> rampSIPeaks -> .Call


I have no idea about the problem, do you have any suggestion??

I also tryed to use a loop to create an xcmsSet object:
Code: [Select]
for(i in 1:3){
    xset[i] <- xcmsSet(data.set[i], method="centWave",
                      polarity="positive", ## prefilter=c(3,5000),
                      ppm=10, snthr=1500, peakwidth=c(4,15))
    foo <- c(xset[i])
}

but the R console say: Error in xset <- xcmsSet(data.set, method = "centWave", polarity = "positive",  :
  object of type 'S4' is not subsettable


Best