Only show genus taxonomy on ancombc graphic?

Hey guys,

Sorry if my question is redundant but I am trying to generate the ancombc graphic with qiime composition da-barplot, but only showing the gender of taxonomy - instead of the entre taxonomy classification - as It appears below on "feces" for example (and if It does not have the gender classification, that It shows the previous classification such as family and so forth and so on):

https://view.qiime2.org/visualization/?type=html&src=https%3A%2F%2Fdl.dropbox.com%2Fs%2Fr7j8pvyv604ynrz%2Fq2comp-104-example-output.qzv%3Fdl%3D1

I saw It on this post here:

Also, is there a way to only show the statistically significant ASVs (i.e. p value < 0.05)? Is it necessary to filter the data before putting It on da-barplot? If so, can anyone help me with that? I am trying but haven't successfuly managed to filter the "gender" only.

Hello @Liviacmg,

What do you mean by "but only showing the gender of taxonomy"? I'm guessing your groups are male and female? You want the features to be labeled by gender somehow? This doesn't seem very straightforward. You should know by the way you set up your formula what depleted and enriched mean in relation to sex, right?

The --p-significance-threshold parameter is what you're looking for to only plot results with p < 0.05.

1 Like

Hi @colinvwood ,

Thank you so much!!!! Oh Sorry, I meant genus, hahahahah

Hello @Liviacmg,

Ah, I see :sweat_smile:. You're talking about the visualizations made by the qiime composition da-barplot command right?

Hi @colinvwood ,

Yes, precisely! I want that on the graphic only appears the genus because when I generate it with the entre taxonomy It is "cutted" in the middle, like this:

I wanted it to be like this (like on the link I posted):

So it can have the most specific taxon until genus (i.e if it isn't classified on genus, that it shows only the family, or the order etc)

Hello @Liviacmg,

You could try using --p-level-delimiter ";".

2 Likes

Hi @colinvwood ,

Thanks a million!!! :grin: :grin: :grin: I was trying to do this for a long time and was even trying to do a script of my own to filter the taxonomy levels to try to input lol.

Now I have adjusted the --p-significance-label parameter for "p_val" as well --p-significance-threshold 0.05 and --p-level-delimiter ";". I also noticed I was trying to input --m-feature-ids-file genus.tsv as a metadata but it was only not needed and was also wrong for what I was trying to do. Jeez. :sweat_smile: :melting_face:

Let me also take the opportunity to ask: is it also possible to filter by a category? For example if I have healthy individuals and bipolar, is it possible to generate graphics to only healthy, only bipolar, and both? Because the graphic already gets the statistically significant independly from which individual it comes from, right?

1 Like

Hello @Liviacmg,

The qiime feature-table filter-seqs command should be able to do that.

1 Like

Hi @colinvwood ,

Thank you again!!! :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face:

Hi @colinvwood ,

I tried to use the qiimefeature-table filter-seqs, by using the metadata like this:

qiime feature-table filter-seqs
--i-data rep-seqs.qza
--m-metadata-file metadado-validado.tsv
--p-where "[Host_disease]='BipolarDisorder'"
--o-filtered-data bipolar-rep-seqs.qza

But then were this error:

Plugin error from feature-table:

All features were filtered out of the data.

Debug info has been saved to /tmp/qiime2-q2cli-err-jceyjop0.log

Traceback (most recent call last):
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2cli/commands.py", line 468, in call
results = action(**arguments)
File "", line 2, in filter_seqs
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 509, in callable_executor
output_views = self._callable(**view_args)
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_feature_table/_filter.py", line 118, in filter_seqs
raise ValueError('All features were filtered out of the data.')
ValueError: All features were filtered out of the data.

And then I saw that in this post there is exactly the same problem as I am facing:

And I tried to exclude the --p-where but then the same error appeared.

I didn't understand the solution reported in the post, for example how this clean-table.qza was generated and what it contains:

qiime feature-table filter-seqs
--i-data rep-seqs.qza
--i-table clean-table.qza
--o-filtered-data clean-rep-seqs.qza

How can I separate the bipolar for example to generate the ancombc graph with qiime composition da-barplot? Because I exported the ancombc and counted on the "p_val_slice.csv" that there are a lot of genus that passed the p-value < 0.05 for bipolar but when the graphic is generated it only seems to show the healthy.

1 Like

Hello @Liviacmg,

If you feel comfortable doing so, can you attach your metadata file?

Hi @colinvwood ,

Of course, no problem:

metadado-validado.tsv (76.5 KB)

Hello @Liviacmg,

What are the rep-seqs from? Dada2? Could you attach this artifact so I can look at the provenance?

Hi @colinvwood ,

Yes, they are from DADA2, as it follows:

rep-seqs.qza (201.5 KB)

Hello @Liviacmg,

The seqs directly outputted from dada2 aren't really relevant here. Using qiime feature-table filter-features to filter your feature table the way you want then passing that to da-barplot using --m-feature-ids-file should work.

1 Like

Hi @colinvwood ,

Thank you so much again! Well, I tried using qiime taxa collapse (as I did before, to show the taxonomic classification on level of genus):

qiime taxa collapse
--i-table table-dada2.qza
--i-taxonomy taxonomy.qza
--p-level 6
--o-collapsed-table genus.qza

And then I used the input to qiime feature-table filter-features as you said (in this case i filtered only for bipolar):

qiime feature-table filter-features
--i-table genus.qza
--m-metadata-file sample-metadata.tsv
--p-where "[Host_disease]='BipolarDisorder'"
--o-filtered-table feature-frequency-bipolar.qza

And then I tried to calculate ancombc:

qiime composition ancombc --i-table feature-frequency-bipolar.qza --m-metadata-file sample-metadata.tsv --p-formula Host_disease --o-differentials ancombcbipolar.qza

But then this error appeared:

Plugin error from composition:

('Value provided in reference_levels parameter not associated with any IDs in the feature table. Please make sure the value(s) selected in each column::value pair are associated with IDs present in the feature table. \n\n Value not associated with any IDs in the table: "BipolarDisorder"', ' IDs not found in table: "Index(['SRR7690036', 'SRR7690039', 'SRR7690040', 'SRR7690043', 'SRR7690044',\n 'SRR7690046', 'SRR7690047', 'SRR7690048', 'SRR7690049', 'SRR7690053',\n ...\n 'SRR7690201', 'SRR7690203', 'SRR7690204', 'SRR7690205', 'SRR7690206',\n 'SRR7690209', 'SRR7690210', 'SRR7690211', 'SRR7690212', 'SRR7690213'],\n dtype='object', name='SampleID', length=115)"')

Debug info has been saved to /tmp/qiime2-q2cli-err-ga1w7cqh.log

Debug info:

Traceback (most recent call last):
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2cli/commands.py", line 468, in call
results = action(**arguments)
File "", line 2, in ancombc
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/qiime2/sdk/action.py", line 509, in callable_executor
output_views = self._callable(**view_args)
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 41, in ancombc
return _ancombc(
File "/usr/local/miniconda3/envs/qiime2-2023.5/lib/python3.8/site-packages/q2_composition/_ancombc.py", line 207, in _ancombc
raise ValueError('Value provided in reference_levels'
ValueError: ('Value provided in reference_levels parameter not associated with any IDs in the feature table. Please make sure the value(s) selected in each column::value pair are associated with IDs present in the feature table. \n\n Value not associated with any IDs in the table: "BipolarDisorder"', ' IDs not found in table: "Index(['SRR7690036', 'SRR7690039', 'SRR7690040', 'SRR7690043', 'SRR7690044',\n 'SRR7690046', 'SRR7690047', 'SRR7690048', 'SRR7690049', 'SRR7690053',\n ...\n 'SRR7690201', 'SRR7690203', 'SRR7690204', 'SRR7690205', 'SRR7690206',\n 'SRR7690209', 'SRR7690210', 'SRR7690211', 'SRR7690212', 'SRR7690213'],\n dtype='object', name='SampleID', length=115)"')

Am I doing something wrong?

1 Like

Hello @Liviacmg,

Can you please explain what you're trying to accomplish again? My understanding is that you've performed da analysis between the bipolar disorder and healthy control groups and want to filter the barplot figure in what way exactly?