Question: normFactors when aggregating in metagenomeSeq
0
gravatar for noelle.noyes
4.3 years ago by
noelle.noyes30
United States
noelle.noyes30 wrote:

Hello.  I am using metagenomeSeq for a metagenomic dataset.  We are assessing relative abundance of specific genes.  These genes belong to different classes and mechanisms, and therefore we want to conduct this analysis at multiple levels to compare results (much like one would do analysis at species, genus, family levels).  I am using metagenomeSeq's function "aggTax" to aggregate:

 

 

AggObj = aggTax(MRcounts(obj, norm=TRUE, log=FALSE),norm=TRUE, log=FALSE, lvl = Class, out = "MRexperiment")

As you can see, I am using the normalized counts for aggregation, as I believe it is standard procedure to normalize at the lowest level.  After I've done this, I need to re-populate the normFactors slot, but I'm not sure what I should re-populate it with, as the libSize values are now the aggregated, normalized counts.  I realize that the normFactors slot is necessary to run fitZig (as a related aside, I am running it with option useCSSoffset=FALSE).  I tried setting p=0 and running cumNorm, but this still resulted in small values populating the normFactors slot, which I don't understand -- does this have something to do with accounting for different processes for creating 0 counts?

I'm not sure where to go from here, and any help would be greatly appreciated!  

 

 

 

 

 

microbiome metagenomeseq • 992 views
ADD COMMENTlink modified 4.3 years ago by Joseph Nathaniel Paulson270 • written 4.3 years ago by noelle.noyes30
Answer: normFactors when aggregating in metagenomeSeq
1
gravatar for Joseph Nathaniel Paulson
4.3 years ago by
United States
Joseph Nathaniel Paulson270 wrote:

Hi Noelle,

Thanks for the message,

So instead of what you posted above to aggregate by normalized counts, you can simply pass the MRexperiment object directly to the aggTax/aggregateByTaxonomy function and with norm=TRUE it will aggregate the values.

AggObj = aggTax(obj,norm=TRUE,lvl=Class)

If you're running useCSSoffset = FALSE then you already have defined your normalization factor within the model matrix, or you wish to input normalized counts, in which case any values in the normFactors slot will work, i.e. just run:

obj = cumNorm(obj,p=1):

However, if you want to force your normFactors to 1, the following will work temporarily - I will modify this post once I fix the aggTax function or create an alternative:

pData(obj@expSummary$expSummary)$normFactors = rep(1,ncol(obj))
ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by Joseph Nathaniel Paulson270
Answer: normFactors when aggregating in metagenomeSeq
1
gravatar for noelle.noyes
4.3 years ago by
noelle.noyes30
United States
noelle.noyes30 wrote:

Thanks very much for the quick response.  So when I set useCSSoffset = FALSE, is the normFactors slot basically ignored?  This is what I want to do, since I've aggregated the normalized counts anyway.  Thanks again!

ADD COMMENTlink written 4.3 years ago by noelle.noyes30

Yes, exactly.

ADD REPLYlink written 4.3 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: 319 users visited in the last hour