Phinch - meyermicrobiolab/Meyer_Lab_Resources GitHub Wiki

Phinch

Phinch is a visualization framework meant to intake .biom files generated from QIIME2 to produce insightful graphs for its users. This tutorial assumes that you have followed the QIIME tutorial, because we will need the transformed-otu.qza, the taxonomy.txt file, and the metadata.txt file from it.

Steps

  1. Prep the Taxonomy Text File
  2. Convert the TransformedOTU.qza
  3. Join the Taxonomy and OTU.biom
  4. Convert the joined table into .biom
  5. Add Metadata
  6. Input into Phinch

Prep the Taxonomy Text File

The first thing that we will have to do is prep the taxonomy text file to be joined with Phinch. In order for us to convert our OTU.biom into an OTU_w_Tax.biom we need to collapse our taxonomy down to one column. To do this we can use the awk command.

head -n1 your_taxa_table.txt > formatted_taxonomy.txt
awk '{print $1 "\tk__"$2"; p__"$3"; c__"$4"; o__"$5"; f__"$6"; g__"$7}' your_taxa_table.txt >> formatted_taxonomy.tsv

Convert the Transformed_OTU.qza

Go back to your QIIME files and find your your-feature-table-transposed.qza. This is the table that we will need to export in order to join with our formatted_taxonomy.txt. When you find it, load QIIME2 and use:

qiime tools export \
  --input-path your-feature-table-transposed.qza \
  --output-path exported-feature-table

This will output the feature-table.qza into an exported-feature-table folder. We then convert that into a .txt file with

biom convert -i exported-feature-table/feature-table.biom -o otu-table-transposed.txt --to-tsv

Join the Taxonomy and OTU

This is very similar to how we joined our Taxonomy to our ANCOM statistic. To prep for our new file, we need to get our column names into a new text file.

head -n1 otu-table-transposed.txt > otu_w_tax.txt

Make sure to then open up the otu_w_tax.txt and add a taxonomy column at the end. Now we have to sort our formatted_taxonomy.txt and our otu-table-transposed.txt so go in and remove the column names from both files.

sort formatted_taxonomy.txt > sorted_tax.txt
sort otu-table-transposed.txt > sorted_otu.txt
join sorted_otu.txt sorted_tax.txt -t $'\t' >> otu_w_tax.txt

Convert otu_w_tax.txt into .biom

biom convert -i otu_w_tax.txt -o otu_w_tax.biom --table-type="otu table" --process-obs-metadata=taxonomy

Add the metadata

biom add-metadata -i otu_w_tax.biom -o otu_w_tax_metadata.biom --sample-metadata-fp metadata.txt

Input into Phinch

Now you should be able to input this data into Phinch.

⚠️ **GitHub.com Fallback** ⚠️