-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
calc_diff_abund_deseq2, linear variables and "design"? #351
Comments
Hello Marcel, I dont think these are possible with the current code as it, but they seem like good functionality to add. I am about to leave for a conference, so I dont have time to look into this too much now, but it is possible that its a minor change. If you have some R experience, I bet you could make the changes since I will try to get back to this soon, but its possible that it will be a few weeks before I have time. Best, Zach |
Hey Zach! |
Hello again! Sorry for the wall of text, and I hope I am not saying anything stupid here. But I am quite sure that there is something not working quite correctly yet, but I will try my best to understand and maybe even fix the issue! |
Dear Zachary and members of the Grunwald lab,
first of all: Thank you very, very much for the metacoder heat tree package! These heat trees open up so many possibilities!
I have a question regarding the differential abundance analysis using the calc_diff_abund_deseq2 function. I am trying to perform differential abundance analysis and display the results as a heat tree, and that seems to work fine if I use a factor with two levels in the function (groups = metadata$treatment; treatment having two levels). However, my experimental design is a little more complex than that. My experimental design is a split-plot experiment (nested design, every plot was split into the 2 treatments; pseudo-replication!), so I would like to remove the "plot" effect first. In DESeq2 there is the option to specify the "design" to account for exactly that problem:
deseq2Data <- DESeqDataSetFromMatrix(countData=cerco_taxmap$data$tax_counts[-1], colData=metadata, design= ~ plotcode + treatment)
Is there a possibility to do this using calc_diff_abund_deseq2 as well?
Furthermore, on plot level, I have a plant diversity gradient that I would like to test as a linear variable (log-transformed, but that is not important at this point). In other words, I want to know which OTUs/ASVs are more abundant at low (or high, respectively) plant species richness. Again, DESeq2 offers a parameter for this in the "results" function: While "contrast" is used for factors, "name" can be used for continuous variables, e.g.:
deseq2Results <- results(diff_abundant_OTUs, name="log_sowndiv", alpha = 0.05)
But the calc_diff_abund_deseq2 function only accepts factors. The Error message (group is not a factor, see ?results) also refers to the results function of DESeq2. I think the issue is that DESeq2 itself uses the abovementioned two different parameters ("group" or "name") for different variable types, but calc_diff_abund_deseq2 only accepts factors. Or am I overlooking an additional parameter?
I am aware that this function is still in development, so this may not be implemented yet. But can you think of a "workaround" to still get this to work? I am sadly not too familiar with either DESeq2 nor metacoder, so I struggle a lot with that.
And if it is already implemented and I am just overlooking it, then I am very sorry for the inconvenience! But maybe this helps improve the function!
Thanks in advance, and greetings from Germany!
Marcel
The text was updated successfully, but these errors were encountered: