Skip to main content
Topic: Diffreport command returns warnings. Help please? (Read 5629 times) previous topic - next topic

Diffreport command returns warnings. Help please?

I am new to using XCMS but had great results with XCMS online so I decided to try and duplicate my results with XCMS so I can analyze my large dataset.  The problem is when I get to the diffreport command I am getting a bunch of errors and usually don't end up with EIC's.  I have tried several different versions of the diffreport command but all come up with the same warnings,  with the second command there is no EIC  folder created ( I'm assuming because I don't specify a filebase) and with the first there is an EIC folder but it only has one file in it which is an unreadable PNG.  All the steps before diffreport seem to be working fine (at least I have the same number of peaks detected as XCMS online etc).  I am using R version 2.15 and the most recent release of XCMS.

Here are the commands I am using

library(xcms)
setwd('c:/mztest')
 xset<-xcmsSet(method="centWave",ppm=5,peakwidth=c(5,90),snthresh=3,mzdiff=0.01,prefilter=c(3,10))
 save(xset,file='mztest')
 xset2<-retcor(xset,method='obiwarp',profStep=0.1)
 xset2<-group(xset2,method="density",bw=10,mzwid=0.025,minfrac=0.5,minsamp=1)
 xset3<-fillPeaks(xset2)
 save(xset3,file="mztest2.RData")
  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) OR
> reporttab <- diffreport(xset_filled, class1="Control", class2="WSN",metlin=.03)

After I type the final command this is what I get
> reporttab <- diffreport(xset_filled, class1="Control", class2="WSN",metlin=.03)
Loading required package: multtest
Loading required package: Biobase
Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following object(s) are masked from ‘package:stats’:

    xtabs

The following object(s) are masked from ‘package:base’:

    anyDuplicated, cbind, colnames, duplicated, eval, Filter, Find,
    get, intersect, lapply, Map, mapply, mget, order, paste, pmax,
    pmax.int, pmin, pmin.int, Position, rbind, Reduce, rep.int,
    rownames, sapply, setdiff, table, tapply, union, unique

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: ‘Biobase’

The following object(s) are masked from ‘package:xcms’:

    phenoData, phenoData<-

Warning messages:
1: sd(<matrix>) is deprecated.
 Use apply(*, 2, sd) instead.
2: sd(<matrix>) is deprecated.
 Use apply(*, 2, sd) instead.
3: In data.row.names(row.names, rowsi, i) :
  some row.names duplicated: 156,327 --> row.names NOT used
>
Can anyone tell me what I am doing wrong here and how I might fix it?  Thanks!

Re: Diffreport command returns warnings. Help please?

Reply #1
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