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
Thanks for your comments.
I would say that any method that can't handle negative values probably isn't expecting its input to be on a log scale.