Closed werdnus closed 8 years ago
Hi! I am encountering the same problem Did you find a solution to it?
Thanks, Mauro
Honestly, you'll probably just want to use "simple proportions" for the distance metrics being discussed. Not all transformations are appropriate for all distances.
This is explained in more detail on the new phyloseq-FAQ answer for exactly the problem of negative numbers in variance stabilized output.
Let me know if I should add a little more detail there.
Thank you! I have read papers using DESeq2->Bray->NMDS and I thought to try it. I now see it is actually not the good way to proceed. The FAQ is pretty clear, it has been very helpful. Thank you very much for your help.
Glad it helped.
Couple points:
Just to make sure it is also described here, and not just at that link, negative numbers after log-like transformation like vst represent "less than one count" after rescaling. Hardly @werdnus 's "throwing away the baby with the bath" for one to truncate these values, assign them a floor, etc. There are a couple of important points here.
See this comparison of DADA2 v. 'State of the Art' OTU methods for a useful benchmark on mock and simulated data.
Also see the DADA2 home page for details and instructions on how to use this. We've found that it generally gives impressive results w.r.t. false positives, in addition to providing exact sequence resolution (no OTU clustering needed). The ~negligible false features means many fewer of these pesky fake rare taxa to worry about and muck up downstream methods, and likely a more reliable parametric transformation like DESeq2::vst
, etc.
I would have mentioned sooner, but the package was still in progress and still undergoing validation tests, etc. The paper is coming out soon, now, though; and the package has been released on the latest version of Bioconductor:
https://www.bioconductor.org/packages/release/bioc/html/dada2.html
Hope that helps.
Best
joey
Ah, I suppose I should have left a comment earlier. Left to my own devices with no one commenting on this thread, I did some exploration (tested out the MetaGenomeSeq package's CSS transformation, among other things) and discovered that all of the negatives in my transformed set were actually zeros in the original count data. So yeah, not throwing the baby out with the bath, indeed.
Thanks for getting that FAQ up Joey—it'll save a lot of people the same sort of rough learning curve I went through, I think.
@werdnus sorry for my long delay, as well, and for your trouble. I'm glad you found some alternatives and did some sleuthing. Hope that data looks good!
Hi Joey,
I have a very stringent pipeline for denoising which uses Vsearch for chimera detection and OTU clustering. I already went through DADA2 and I will test it very soon. So I am very happy with that.
Now I am trying to understand the best way to visualise my data. I do not think the bray-curtis applied on the DESeq2::vst or DESeq2::rlog microbiome transformed data is the best way to proceed. It would require me to modify the data to avoid the production of negative numbers (like adding an arbitrary constant to each value before DESeq analysis or setting every negative number as zero after the analysis). I would prefer not to play with the data this way.
I thought it was a good method transforming the data to take into consideration the depth before calculate the distance/dissimilarity metrics and then visualise the data. What do you think about it? I am not a statistician and I am not very sure what metrics to use on the transformed data.
Thanks.
I'll jump in here.
Different questions require different transformations; one size does not fit all. For differential abundance testing, there is no doubt that DESeq2 is the way to go. However the structure and qualities of your data dictate the visualization step.
I agree that Bray Curtis is not the best way to calculate relevant distances after transformation of the data. We usually use just PCA on the transformed data but not because of the negative numbers just because DESeq makes a transformation that you can think of a log in the large scale and making ratios of logs doesn't make sense. If you already took care of the multiplicative effects your don't need to do it again with the ratios as used in Bray Curtis.
For ordination purposes, you can keep the data as counts and use correspondence analysis which takes the depth and ratios into account.
If you want to take the tree into account in your analyses we have been using DPCOA with a lot of success. It really depends on how different your sample depths are.
Hope this helps, Susan
On Wed, May 11, 2016 at 3:00 AM, MTutino notifications@github.com wrote:
Hi Joey,
I have a very stringent pipeline for denoising which uses Vsearch for chimera detection and OTU clustering. I already went through DADA2 and I will test it very soon. So I am very happy with that.
Now I am trying to understand the best way to visualise my data. I do not think the bray-curtis applied on the DESeq2::vst or DESeq2::rld microbiome transformed data is the best way to proceed. It would require me to modify the data to avoid the production of negative numbers (like adding an arbitrary constant to each value before DESeq analysis or setting every negative number as zero after the analysis). I would prefer not to play with the data this way.
I thought it was a good method transforming the data to take into consideration the depth before calculate the distance/dissimilarity metrics and then visualise the data. What do you think about it? I am not a statistician and I am not very sure what metrics to use on the transformed data.
Thanks.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/joey711/phyloseq/issues/492#issuecomment-218415438
Susan Holmes Professor, Statistics and BioX John Henry Samter Fellow in Undergraduate Education Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/
I've been going through the phyloseq tutorials, trying to implement the negative binomial variance stabilization by way of DESeq, (as in the 'Waste not, want not' paper) and I'm running into a bit of a snag with moving on to downstream analysis. I was wondering if I could get some advise.
I think the best example of the sort of thing I'm trying to do is sort of like what's presented in this thread.
I can get my phyloseq object with the variance stabilized counts in the OTU table, and see a pretty similar pattern in the change to the heat map as in the example. Where I'm confused is how to take that into downstream analysis: I'd like to generate community distance matrices with these variance stabilized counts, to examine changes in community similarity with environmental and physical distance between sampling locations, but the variance stabilizations include lots of negative numbers, which makes standard distance calculations (e.g., Bray-Curtis) impossible, because they do not work with negative numbers.
Where @joey711 uses distance calculations in his examples (e.g., the ordination tutorial), he doesn't use the DESeq variance stabilized counts, but instead a proportional transformation (e.g.,
1e+06 * x/sum(x)
).I've found one thread talking about issues with the geometric means calculation where the poster (@btemperton) converts all of the negatives to zeros for distance calculation and ordination. The whys and hows of this are not really discussed in that thread, since it was off the topic of geometric means, but this seems a bit like throwing the baby out with the bath: you lose all of the information in the differential abundances of low abundant taxa (as well as the effect of presence/absence), and as such seems just as problematic as rarefying, particularly given the proportion of taxa in the low-abundance category in most microbiome datasets. I tried it, and (as I suspected) see a homogenizing effect in the ordination as compared to proportionally transformed counts.
I feel like the answer has got to be something relatively simple, but I've been googling up a storm, re-reading the distance metric sections in all my stats text books, and generally just banging my head against a wall for a couple of weeks now, so I thought it was time to ask for help.
Here's some code that reproduces the issue:
Which gives me these errors:
Any help would be appreciated.