Question: Alpha diversity on Rlogtransformed data
0
3.9 years ago by
David860
David860 wrote:

Hello,

I´m running a miseq experiment on 100 samples metagenomics experiment and would like to measure the alpha diversity. My understanding is that data has to be first transformed (rarefaction is not suitable anymore). So I have transformed my phyloseq object to a DeSeq2 object (see code below).

From what i´ve found the rlogtransformation from Deseq2  looks ok when you do not have biological replicates and it performs better when library sizes can be highly different (which us my case here). However the rlogtransform generates negative values which will fail with some of the phyloseq alpha diversities (see method below)

I can obviously replace my negative values with , let´s say 0.001 or 0.01.... but not sure which value to take ???

What do you think it´s the best approach. MetagenomeSeq provides a css method for normalization of the data, dealing with negative values but is it necessary to normalize for alpha diversity or simply log transform the data ?? Does metagenomeSeq provides a similar rlogtransformation to deseq2 ?? well just want to make sure i use the appropriate method.

GPdds = phyloseq_to_deseq2(taxoRLD, ~1)
GPdds = estimateSizeFactors(GPdds)
GPdds = estimateDispersions(GPdds, fitType = "local")
rld <- rlogTransformation(GPdds, blind=TRUE)
rownames(rld) <- taxa_names(taxoRLD)
otu_table(taxoRLD) <- otu_table(assay(rld), taxa_are_rows = TRUE)

#Alpha diversity
OTU = otu_table(round(as(otu_table(taxoRLD), "matrix")), FALSE)
alpha = estimate_richness(OTU, split = FALSE, measures = c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson"))

> alpha
Observed Chao1 se.chao1 ACE se.ACE  Shannon
estimateR.OTU.        0     0      NaN NaN    NaN 4.604333
Simpson InvSimpson
estimateR.OTU. 0.9899836   99.83641

phyloseq deseq2 metagenomeseq • 1.4k views
modified 3.9 years ago • written 3.9 years ago by David860

I would say that any method that can't handle negative values probably isn't expecting its input to be on a log scale.

Answer: Alpha diversity on Rlogtransformed data
0
3.9 years ago by
Michael Love25k
United States
Michael Love25k wrote:

I can answer some of the DESeq2 questions, but not the best practices for metagenomics, as this is not my area of expertise.

"From what i´ve found the rlogtransformation from Deseq2  looks ok when you do not have biological replicates and it performs better when library sizes can be highly different (which us my case here)."

Yes this was the motivating factor for the development of rlog over VST (which we discuss in the DESeq2 paper). The VST has its own advantages, such as running time when there are many samples and that it is theoretically motivated for stabilizing variance.

"However the rlogtransform generates negative values"

This is not really a bug from the DESeq2 point of view.

rlog() is approximating a log2(), and when the shrunken value is less than 1 read, it makes sense to give a negative value. I don't have any feedback on what to do with these with respect to downstream metagenomic analysis.

Answer: Alpha diversity on Rlogtransformed data
0
3.9 years ago by
David860
David860 wrote:

It looks that rlog transformation might not be required for any of the alpha diversities used, so it would be straight to directly use untransfomed data. I guess that´s what i´m going to do.

For other downstream analysis such as diffrential expression i will definitely rlog transform the data. (or normalize if i can have biological replicates).

Feel free to update the post if other practices are commonly used.

thanks,

david

Note that we do not recommend using rlog for DE. The first line of the vignette section on transformations:

"In order to test for differential expression, we operate on raw counts and use discrete distributions as described
in the previous Section 1.4. However for other downstream analyses – e.g. for visualization or clustering – it
might be useful to work with transformed versions of the count data."

Answer: Alpha diversity on Rlogtransformed data
0
3.9 years ago by
David860
David860 wrote:

Ok thanks for the update.  Not to use Rlog for DE.