How can I represent the bacterial taxonomy of all samples in one barplot using a script ?

Hello,

I want to represent the bacterial taxonomy of 110 sequenced samples at once using barplots command
qiime taxa barplot
–i-table table.qza
–i-taxonomy taxonomy.qza
–m-metadata-file sample-metadata.tsv
–o-visualization taxa-bar-plots.qzv
I’m a beginner in writing script. Instead of repeating the command for each sample i want to execute a script to represent the bacterial taxonomy of all the samples in one barplot using the following command.

the table.qza file for each sample is located in this directory /scratch2/PICK_OTUS
the taxonomy.qza file for each sample is located in this directory /scratch2/Assign_TAX
the metadata file is located in this directory /scratch2/MAP_T
i will generate the output in the current directory.
Please help me to write a script to represent the bacterial taxonomy of 110 samples in one barplot.

Thanks

I’m confused here. The table.qza should have all the 110 samples, shouldn’t it? So if you plot it, shouldn’t it plot the bar plots for all the samples?

Or am I missing something here?

EDIT: or do you have 110 different sequencing runs?

Thanks for the message.

I Don’t have 110 different sequencing runs.

Total samples analyzed 110
i generated for each sample table.qza and taxonomy.qza files

i would like to run a script to execute the command barplots taking into consideration for each sample table.qza and taxonomy.qza files and to merge results for 110 samples in one barplot.

I think one table.qza file will have all the data from all the samples. For example look at slide 95 here The output is a barplot of all the samples by just running the commands once.

Did you try running the barplot commands? What do you get?

1 Like

I tried barplot command for one sample . I obtained the corresponding representation of bacterial taxa.
i have 110 table.qza and 110 taxonomy.qza files.

Hi @M_F,

You want to merge your tables and taxonomy. You may find qiime feature-table merge and qiime feature-table merge-taxa useful.

However, I strong recommend looking at how you constructed your per-sample tables. Did you merge all your sequences, generate a table, and then split it up? Or, did you generate each one by one? If its the later, how did you generate your features?

Best,
Justine

Hello Justine,

Thank you for the response. I will try to run the commands merge.

I generated feature one by one for each sample using qiime2 vsearch

Best

Hi @M_F,

Did you use de novo, open reference, or closed reference OTU picking?

Best,
Justine

Hi Justine,

I used de novo clustering of OTUs

qiime vsearch cluster-features-de-novo
–i-table table.qza
–i-sequences rep-seqs.qza
–p-perc-identity 0.99
–o-clustered-table table-dn-99.qza
–o-clustered-sequences rep-seqs-dn-99.qza

Hi @M_F,

If you’ve done de novo clustering, there is no point in combining your tables. De novo clustering requires you to have a common set of clusters; this can be done if you process all the samples together; if you do it on a per-sample basis, there is no point of comparison because there’s no guarantee that you have common features.

I would recommend that, at a minimum, you go back and process the samples together. I would actually also encourage you to consider denoising over OTU clustering, because it gives you a higher resolution result.

Best,
Justine

Hi Justine,
Thank you for all those clarifications.
I will merge samples and i will compare categories of samples : controls versus affected.

According to you what is the required method for clustering after merging of samples: de novo, Closed-reference or Open-reference clustering.

Best

Hi @M_F,

Leaving aside any person opinions on OTUs, ASVs, and what you should be doing, my recommendation is that you import all your samples together as sequences, and then process them through your pipeline of choice in the same way.

Best,
Justine

Hi Justine,

Thank you so much for your messages.

Best

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.