How to extract FASTA representative sequences per biological sample from combined representative sequences (qzv) file?


I have run my analysis for 35 samples together (35 samples in one metadata).
I now have a representative sequences (qzv) file that can be converted to FASTA sequences, but these include sequences for all samples, combined together.

How can I extract FASTA representative sequences (OTU / ASV sequences) per biological sample from this file?

I found the following:

But it’s a long time ago, and the links it points to have changed.

Many thanks for your help and time

Hi @fgara,

it’s slow (so possibly consider writing a for-loop) but check out qiime feature-table filter-seqs and then export (qiime tools export/qiime tools extract), which should give you the per-sample fasta files you want.


Hi Justine,

I was able to run the commands that you suggested, but I realized by default they exported the FASTA by creating a new directory, not as a file with the name I gave. So I tried the options given here:

Usage: qiime tools export [OPTIONS]

Exporting extracts (and optionally transforms) data stored inside an
Artifact or Visualization. Note that Visualizations cannot be transformed
with --output-format

Path to file that should be exported [required]
–output-path PATH Path to file or directory where data should be
** exported to [required]**
–output-format TEXT Format which the data should be exported as. This
option cannot be used with Visualizations
–help Show this message and exit.

This command gives me an option to save output as file, but I couldn’t get it work… I’ve tried it many times.

I also tried “fasta”, “.fasta”, “.txt” and so on for the option " --output-format ", but it also didn’t work…

Can you help please?

Many thanks for your generous help

Hi @fgara,

You need to use DNAFASTAFormat as your output format. (I think this is linked to the input/output format tied to semantic types. You can also specify the sample name in the output path.



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