I have an OTU table containing 888 taxa from 58 samples. Rows = OTUs and columns = samples, like this:
Otus <- data.frame(S_1 = c(0, 0, 1), S_2 = c(12, 0, 5), S_3 = c(0, 5, 3), row.names = c("OTU_1", "OTU_2", "OTU_3"))
I moved it from phyloseq over to DESeq2 using the phyloseq_to_deseq2 command after seeing this answer. Now that it's a DESeq2object, I have normalized the OTU table using the variance stabilizing transformation with the following command:
getVarianceStabilizedData(side_dds) #side_dds is a DESeq2 object
I would like to create a PCoA plot of my samples after normalization. Therefore I have to calculate a distance metric. However, my go-to method (Bray-Curtis) does not allow negative numbers as an entry and throws the error message: "results may be meaningless because data have negative entries in method “bray”."
In my search I found this post, but no answer has been provided as well as this post which in conclusion discourages adding a constant to the data.
Can anyone provide me with help?
EDIT: I have run out of comment space (s. below) but would like to provide others with the comment by Bastian Schiffthaler:
It would be good if you could upload a reproducible workflow, or your data. The error you are getting is because BC similarity should be calculated using a strictly positive value, but VST can produce negatives. You can assay(vsd) + min(assay(vsd)) since your data is now homoscedastic and (pseudo)-log2 transformed. This essentially just moves the zero offset. Just don't try to relate the value back to any "real-world" meaning. Since your data is zero inflated, also have a look at e.g.: bioconductor.org/packages/release/bioc/html/zinbwave.html for preprocessing instead of VST