-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unifrac warning message #936
Comments
This happens to me when the data frame containing the sample names is incomplete. I am talking about the metadata to be merged with the OTU table to create your phyloseq object. Hope it helps |
Thanks for the suggestion, Max. I double checked and unfortunately my sample names is complete, so that's not causing whatever this issue is. |
Hi, |
Hi MSMortsensen, I went back and pruned samples after incorporating them into the phyloseq object and that fixed the issue! Thank you for your insight! |
I am experiencing the exact same issue but can't recalculate the tree as suggested. ''' uuf = UniFrac(ex89, weighted = FALSE) |
can you please clarify how you pruned samples to solve this? thanks |
Hi, |
@gkphylo My specific problem was caused because I removed some unneeded samples from my OTU table before putting everything together in a phyloseq object, which meant that my tree was inconsistent with my table. When I pruned those samples after making the phyloseq object instead, the problem was solved because phyloseq removed the offending OTUs from the tree at the same time. If you've already put everything into a phyloseq object before removing things, it sounds like you have a slightly different problem than I did. |
It is interesting that my tree seems to be rooted after pruning and I still get the problem. """ is.rooted(phy_tree(set)) I will try @MSMortensen 's approach and report back to all. I bet this question will become very important for users of the decontam package |
Hi all, I have the same problem! I created my phyloseq object with the tree, used the decontam package as well and then pruned unwanted samples and taxa. I checked and my tree is still "rooted = TRUE". But I get the same error message when trying to use PCoA and unifrac either weighted or unweighted in the ordinate function.
Warning message: Looking forward to someone figuring this out! |
I don't have a good solution yet, but I have a patch for this. I traced the problem back to removing "family" level taxa using the pruning function and fixed it by removing "genus" level contaminants. Curious to know how you are removing the contaminants identified by decontam |
First I identified contaminants based on prevalence: sample_data(ps)$is.neg <- sample_data(ps)$Sample_or_Control == "Control" Then I removed them from my ps object: ps.decontam_Skin <- prune_taxa(!contamdf.prev05$contaminant, ps) I am not sure I understand what you are saying about removing "family" or "genus" level? |
I traced my problem to the genus Klebsiella by removing all contaminants manually. So when I sequentially add taxa to find what is causing the glitch Klebsiella is the culprit. I get these responses:
|
@joey711 or anyone else. I still haven't been able to figure this out. Do you guys have any input? Highly appreciate it, Nat |
@Nat211 this problem is not due to how you remove contaminants, but solely because you remove the OTU which have been set as the root of your tree.
|
Thank you @MSMortensen - I managed to get it to work! |
Hello everyone, I'm having the same issue; however, I am not performing any kind of filtering whatsoever. Nevertheless, I get the same error:
This happens with rooted & unrooted. |
Hi, library(biomformat);packageVersion("biomformat") |
Hi, Export repseq and redo tree with seq in clean.2k Import into Qiime2 Build midpoint rooted tree in Qiime2 Export tree Create the tree in qiime2 and import it here |
Hello, I'm having the same issue. I am not performing any filtering and directly using an OTU table with taxonomy and rooted tree from QIIME2. Warning message: Any help is appreciated! |
Hi, I am also having the same issue with DADA2 classified OTUs from qiime2. I have tried the tree re-rooting, which doesn't seem to be helping. Seems to be a problem a few are having, anybody found a solution that is not to do with rooting the tree? Thanks! Christina |
Resurrecting this because I ran smack into it and think I found the root (no pun intended) of the problem. This error seems to occur when a phylogenetic tree ends up with an
fails because an odd number of elements can't go into a 2-column matrix evenly. The odd number of rows, in turn, seems to happen when the phylogenetic tree is built so that some nodes have more than two children. This is output from my own tree (freshly imported from QIIME2):
Most nodes have only 2 children, but some have more (up to 13!). The thing is, I don't know enough about phylogenetics to know if this is an error in phyloseq for making a faulty assumption, or an error in QIIME (or its wrapped software) for making a faulty tree. Can someone tell me where the error lies? I've made a trimmed version of my tree where I trimmed it to 1000 taxa but still have some nodes with 4-5 children and an odd number of rows in the edge matrix. I'm new to Github; is there a way to upload/attach that file for reproducibility? |
Hi, @wallacelab , Thank you for your input. If you want to attach a file, just drag and drop it into the message box. Best, |
Hi Jia,
Yes I do remember that error.... interesting but wouldn’t you be able to check this by selecting an even number of rows and the making a tree based on his conclusion?
My understanding is that nodes are the recent common ancestors, the branches between them point to relationships and the ‘children’ I think he is referring to are what we/I call the tips. These are the species/OTUs that represent genetic similarity and in microbe land this can be many. Might be wrong in my understanding though...
… On 22 Aug 2019, at 22:16, mstagliamonte ***@***.***> wrote:
Hi, @wallacelab ,
Thank you for your input. If you want to attach a file, just drag and drop it into the message box.
Best,
Max
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It will be good to see what the response is
… On 22 Aug 2019, at 22:16, mstagliamonte ***@***.***> wrote:
Hi, @wallacelab ,
Thank you for your input. If you want to attach a file, just drag and drop it into the message box.
Best,
Max
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Here's the example (trimmed-down version of my whole dataset): Code:
Again, I'm not a phylogenetics expert, so I don't know if it's internal nodes or tips or whatever that is the issue, but it seems likely to mess up the resulting calculation. |
Hi all, |
Wow, am I glad someone had already gotten to the bottom of this. Note that for me though, the problem came down to having singleton lineages, and I had to add |
For me, seems the solution from @PandengWang with |
I just became aware of this issue. If encountering problems with UniFrac, I advise checking for expected results with the reference implementation. It has been validated against the original test suite in PyCogent developed by Cathy Lozupone and Rob Knight who originally defined UniFrac, as well as validated against the test suite in scikit-bio. The reference implementation is BSD-licensed, developed and maintained by Rob Knight's lab, has been extensively optimized (ref.1; ref.2), and is actively maintained. |
I'm running into trouble calculating unifrac distances in phyloseq. I keep getting the following message whenever I run the distance function with weighted or unweighted unifrac:
Warning message: In matrix(tree$edge[order(tree$edge[, 1]), ][, 2], byrow = TRUE, : data length [86515] is not a sub-multiple or multiple of the number of rows [43258]
I've checked to make sure that my tree is rooted, that there are no 0 count OTUs in my count table, or any NA values in the OTU count table or tree. After seeing this thread I updated phyloseq (v1.23.1), but the problem is still ongoing. A solution will be reached when I run the distance function, but I'm not sure if it can be trusted. Does anyone have any ideas about what this warning means, how much of a problem it is, and how it might be solved? I'd really appreciate the help.
Thanks in advance!
Update: I've updated R to version 3.5 and all packages to the latest versions (vegan v2.5-2, ape v5.1, and phyloseq v1.24.0) but no luck getting rid of the warning.
Edit: Removed data and code 7/3/18
The text was updated successfully, but these errors were encountered: