How can I specifically built a functional abundance table with picrust2?

I have built an OTU table using the instructions above. Now I have my study participants as columns and OTUs as rows. I would also like to build a picrust2 table. I am overwhelmed by the tutorials. Is there an easy way to get a picrust2 processed table of functional abundances? I think I might have already many of the missing pieces in place, but how can I specifically built a functional abundance table with picrust2?

Basically, I have built my OTU table from pared-end V4 fasta like this:

qiime tools import --type 'SampleData[PairedEndSequencesWithQuality]' --input-path ${location_path}Taxonomy_Classification/qiime_manifest.tsv --input-format PairedEndFastqManifestPhred33V2 --output-path ${prj_name}.qza
qiime demux summarize --i-data ${prj_name}.qza --o-visualization ${prj_name}.qzv
qiime dada2 denoise-paired --p-n-threads 0 --i-demultiplexed-seqs "${prj_name}.qza" --p-trunc-len-f $fwd_read --p-trunc-len-r $rev_read --output-dir DADA2 --verbose -p-pooling-method 'pseudo' &> DADA2_denoising.log
qiime feature-table summarize --i-table table.qza --o-visualization table.qzv
qiime metadata tabulate --m-input-file denoising_stats.qza --o-visualization denoising_stats.qzv
qiime feature-table tabulate-seqs --i-data representative_sequences.qza --o-visualization rep_seqs.qzv
qiime feature-classifier classify-sklearn --i-classifier $classifier_path --i-reads representative_sequences.qza --o-classification "${location_path}Taxonomy_Classification/analysis/taxonomy/classified_rep_seqs.qza" --p-n-jobs 6
qiime metadata tabulate --m-input-file classified_rep_seqs.qza --o-visualization classified_rep_seqs.qzv
qiime taxa barplot --i-table "${location_path}Taxonomy_Classification/analysis/DADA2/table.qza" --i-taxonomy classified_rep_seqs.qza --m-metadata-file "${location_path}Taxonomy_Classification/qiime_metadata.tsv" --o-visualization "${location_path}Taxonomy_Classification/analysis/outputs/taxa-bar-plots.qzv"
qiime taxa collapse --i-table "${location_path}Taxonomy_Classification/analysis/DADA2/table.qza" --i-taxonomy classified_rep_seqs.qza --p-level 6 --o-collapsed-table genus-table.qza
qiime tools export --input-path genus-table.qza --output-path abs-table
biom convert -i abs-table/feature-table.biom -o "${location_path}Taxonomy_Classification/analysis/outputs/abs-genus-table.tsv" --to-tsv
1 Like

Hi @neocat

Apologies for the delay in replying, I've only just come across your post.

I will assume you already have Picrust2 installed. As you already have your feature table in .tsv format, the only other thing which picrust2 requires is your rep-seqs in FASTA format.

You can use the following command in q2:

Export Sequences from .qza to FASTA

qiime tools export
--input-path rep-seqs.qza
--output-path exported-rep-seqs

The FASTA file will be renamed to 'dna-sequences.fasta' in a new folder/directory.

Here are the next steps in picrust2 to get your functional abundance table:

Normalise your feature table

picrust2_pipeline.py -s rep_seqs.fasta -i feature-table.tsv -o picrust2_output -p 4

Predict functional abundances

picrust2_pipeline.py -s rep_seqs.fasta -i feature-table.tsv -o picrust2_output -p 4 --hsp-method pic --stratified

The outputs will be in a directory called 'picrust2_output' which should include abundance files (e.g., EC or KEGG).

There are other scripts within picrust2 which can generate things like pathway abundances if you wish. I've found some great ways to create some cool heat maps too.

Hope that helps!