Question: metagenomeSeq cumNorm issue with NAs in real data
0
gravatar for carr0603
4.1 years ago by
carr06030
United States
carr06030 wrote:

Hi I am trying to run the command cumNorm(). 

When I go through the tutorial I get an output and when I run the command on simulated data it works as well. However, when I try to run the command on my real data the output is a bunch of NAs. 

Any suggestions? 

> obj<-newMRexperiment(otu_table_final)
> cumNorm(obj)
MRexperiment (storageMode: environment)
assayData: 57394 features, 255 samples 
  element names: counts 
protocolData: none
phenoData: none
featureData: none
experimentData: use 'experimentData(object)'
Annotation:  
Warning message:
In cumNormStatFast(obj) : Low quantile estimate. Default value being used.
> head(normFactors(obj))
X02.HA.Forehead.375338    X02.HA.Stool.374811 
                    NA                     NA 
X02.HB.Forehead.374920    X02.HB.Stool.375396 
                    NA                     NA 
X02.HC.Forehead.375061    X02.HC.Stool.374906 
                    NA                     NA 

metagenomeseq • 800 views
ADD COMMENTlink modified 4.1 years ago by Joseph Nathaniel Paulson270 • written 4.1 years ago by carr06030
Answer: metagenomeSeq cumNorm issue with NAs in real data
0
gravatar for Joseph Nathaniel Paulson
4.1 years ago by
United States
Joseph Nathaniel Paulson270 wrote:

Hi there,

The issue you're having is that you need to re-assign the normalized object to itself or another object. If you run the following your code will work.

obj<-newMRexperiment(otu_table_final)
obj = cumNorm(obj)
head(normFactors(obj))

 

ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by Joseph Nathaniel Paulson270
Answer: metagenomeSeq cumNorm issue with NAs in real data
0
gravatar for carr0603
4.1 years ago by
carr06030
United States
carr06030 wrote:

Thanks for the reply Joseph! I followed your instructions but I am still getting the NA error. The code works when I run it on the lung data or the mouse data and even in a simulated dataset I made. But my dataset has many more 0's. Could this be the issue?

 

> obj<-newMRexperiment(data)

> obj
MRexperiment (storageMode: environment)
assayData: 57393 features, 255 samples 
  element names: counts 
protocolData: none
phenoData: none
featureData: none
experimentData: use 'experimentData(object)'
Annotation:  
> obj = cumNorm(obj)
Warning message:
In cumNormStatFast(obj) : Low quantile estimate. Default value being used.
> head(normFactors(obj))
X02.HA.Forehead.375338    X02.HA.Stool.374811 X02.HB.Forehead.374920 
                    NA                     NA                     NA 
   X02.HB.Stool.375396 X02.HC.Forehead.375061    X02.HC.Stool.374906 
                    NA                     NA                     NA 

ADD COMMENTlink written 4.1 years ago by carr06030

That shouldn't be a problem,

Feel free to send me a MRE (minimally reproducible example) or your dataset privately and I'll take a look at the specific issue for you

ADD REPLYlink written 4.1 years ago by Joseph Nathaniel Paulson270

Thank you!!

ADD REPLYlink written 4.1 years ago by carr06030

Work for you?

ADD REPLYlink written 3.8 years ago by Joseph Nathaniel Paulson270
Answer: metagenomeSeq cumNorm issue with NAs in real data
0
gravatar for Joseph Nathaniel Paulson
4.1 years ago by
United States
Joseph Nathaniel Paulson270 wrote:

Hi @carr0603,

Your dataset looks like it was improperly formatted. The matrix you made available to download does have 57393 rows, but a good number of them are all empty (no zeros even) and the rownames are duplicates. I'd take a look at how you generated the count matrix and fix that. In either case, here are the steps to fix this particular dataset. Additionally, it looks like you generated this from a biom file. You can import biom vs1 files using the load_biom function.

y=read.csv("otu_table_final.csv",stringsAsFactors=FALSE)
# Find which ones are NA in your matrix
unique(sapply(1:ncol(y),function(i){which(is.na(y[,i]))[1]}))
y=y[1:8241,]
rownames(y) = y[,1]
y = y[,-1]
obj = newMRexperiment(y)
obj = cumNorm(obj)

> head(normFactors(obj))

X02.HA.Forehead.375338    X02.HA.Stool.374811 X02.HB.Forehead.374920 

                   150                    157                    130 

   X02.HB.Stool.375396 X02.HC.Forehead.375061    X02.HC.Stool.374906 

                   254                    416                    285 

 

You should have ~8k OTUs and 255 samples. 

ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by Joseph Nathaniel Paulson270
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 146 users visited in the last hour