Hello,
I hope you're doing well. I've been using the QIIME2 Galaxy GUI for a few months now, and I recently ran into an issue while trying to calculate Faith's PD. I understand similar questions have been asked on the forum, but the answers haven't been helpful for my situation.
I'm using the "diversity-lib faith-pd" command
I'm uploading a PresenceAbsence OTU table in BIOMV100 format. I've tried this both with and without a taxonomy column
I downloaded a phylogenetic tree from here in Newick format
I'm confident that the list of microbes I put into PhyloT to generate my Newick file is the same as the list of microbes in my OTU table
The error message (including some lines from the traceback) is: File "/tool_deps/_conda/envs/mulled-v1-d2fbd9e406e52f729baea46fa009d86f67fd285aefb55846f62ec86080bf4cab/lib/python3.8/site-packages/qiime2/sdk/action.py", line 391, in _callable_executor_ output_views = self._callable(**view_args) File "<decorator-gen-233>", line 2, in faith_pd File "/tool_deps/_conda/envs/mulled-v1-d2fbd9e406e52f729baea46fa009d86f67fd285aefb55846f62ec86080bf4cab/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 57, in _disallow_empty_tables return wrapped_function(*args, **kwargs) File "/tool_deps/_conda/envs/mulled-v1-d2fbd9e406e52f729baea46fa009d86f67fd285aefb55846f62ec86080bf4cab/lib/python3.8/site-packages/q2_diversity_lib/alpha.py", line 49, in faith_pd result = unifrac.faith_pd(table_str, tree_str) File "unifrac/_api.pyx", line 162, in unifrac._api.faith_pd ValueError: The table does not appear to be completely represented by the phylogeny.
What are your recommendations on how to solve this issue? I'm also happy to provide any other relevant information. Thank you so much!
Hi @kirti.p,
This isssue is almost exclusively caused by the features in the feature-table not being fully represented in the phylogenetic tree, which I am sure you saw in your research of this error.
Can you talk about what your process was for PhyloT creation and and
how you have checked that the list of microbes you used to generate my Newick file is the same as the list of microbes in your OTU table?
Hello,
Thank you for your response! I have a data wrangling pipeline that outputs a few files including a TSV file that is my PresenceAbsence OTU table (file 1). I then duplicated this file and used this link to create a CSV for Excel use (file 2).
Files (1) and (2) are formatted as: #OTU ID Sample1 Sample2 Sample3
OTU1 0 1 0
OTU2 0 1 1
To create the phylogeny file: I highlighted all the row names (OTUs) from output (2) and pasted that list into phyloT. I downloaded the file in Newick format. I then uploaded that file to Galaxy and used the qiime2 tools import function to import it as Phylogeny[Rooted].
To create my BIOM file: I took output (1) and then used the command biom convert -i otu_table_qiime.txt -o otu_table_qiime.biom --table-type="OTU table" --to-json to make it a BIOM file. I uploaded this BIOM file to Galaxy and used qiime2 tools import to import it as FeatureTable[PresenceAbsence] with the BIOMV100 format.
I then tried to use the generated Phylogeny[Rooted] and FeatureTable[PresenceAbsence] files for the diversity-lib faith-pd function and received the output I included above.
Hello,
I would like to add that I'm using the following code to check that the values in my OTU table and the Newick file are the same. The test passes, which gives me confidence that the same values are there. Does converting the data from Newick --> QIIME or TSV --> QIIME change anything?
Thank you for your williness to look at my data. I've attached truncated data that replicates the error shown above. I would like to note that if I truncate my table and list of microbes to ~150 rows, the analysis runs properly. I'm unsure why this is happening.
All your features must be tree tips of your phylogenetic tree.
Looking at your table you have Hungatella hathewayi VE202-11 and Hungatella hathewayi in your table but you only have Hungatella hathewayi VE202-11 as a tip in your tree.
So I think you need to modify your script so that Hungatella hathewayi is also a tip.
Hello @cherman2
I was able to fix the problem I mentioned above, so that tree tip issue is no more! My files now pass the test I showed you above (test_otu_ids_in_phylo_qza). However, I'm unfortunately still getting the same error.
There are 113 tree tips and 113 IDs in my table. I got this by running the two tests shown below.
Thus, my pytests indicate that my data is good to go. However, in QIIME Galaxy, I still get the error message: File "/tool_deps/_conda/envs/mulled-v1-d2fbd9e406e52f729baea46fa009d86f67fd285aefb55846f62ec86080bf4cab/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 57, in _disallow_empty_tables return wrapped_function(*args, **kwargs) File "/tool_deps/_conda/envs/mulled-v1-d2fbd9e406e52f729baea46fa009d86f67fd285aefb55846f62ec86080bf4cab/lib/python3.8/site-packages/q2_diversity_lib/alpha.py", line 49, in faith_pd result = unifrac.faith_pd(table_str, tree_str) File "unifrac/_api.pyx", line 162, in unifrac._api.faith_pd ValueError: The table does not appear to be completely represented by the phylogeny.
I'm completely stumped, and I've been trying to solve this for a while . I attached some files below, can you please take a look at them and help me solve this?
So Weird. That was not what I thought was going to happen.
Let me try this out with your data and see if i can reproduce this. Would you be okay sharing your metadata with me? You can DM me if you don't want to share it publically
Thank you!!
I didn't use any of our metadata to produce this error - it comes entirely from submitting these two files to the "diversity-lib faith-pd" function.
I think PhyloT is introducing " " into your feature names. Your table has "_" instead. I noticed that your newick file doesn't have spaces in it but when I call treeNode.name it has spaces.
Could you try replacing the " _ " with a "." or something to see if the error persists?
Here is the notebook where I was testing this out.