Thank you for providing and maintaining this great suite of tools.
I have been following the guide here to create hclust2 heatmaps and GraPhlAn cladograms for visualization of MetaPhlAn2 profiles.
My GraPhlAn workflow is as follows:
- Generate MetaPhlAn2 abundance profiles for individual fastq files β
sampleA_profile.txt
,sampleB_profile.txt
,sampleC_profile.txt
, etc. - Merge abundance profiles using
merge_metaphlan_tables.py
βmerged_abundance_table.txt
- Create tree and annotation files using
export2graphlan.py
βmerged_abundance.annot.txt
andmerged_abundance.tree.txt
- Create xml file using
graphlan_annotate.py
βmerged_abundance.xml
- Generate cladogram and legends using
graphlan.py
βmerged_abundance.png
,merged_abundance_legend.png
, andmerged_abundance_annot.png
This produces a cladogram similar to the example provided in the demo linked above. However, I would like to make a cladogram that looks like the cladogram for the human microbiome project, where the rings surrounding the tree are a heatmap showing relative abundances of each species in each sample.
I have been playing around with the options for export2graphlan (e.g. --metadata_rows
), but I canβt seem to generate an annotation file that preserves the sample information of my merged abundance table.
My tab-delimited merged_abundance_table.txt
file has the following structure:
ID sampleA sampleB sampleC ...
#SampleID Metaphlan2_Analysis Metaphlan2_Analysis Metaphlan2_Analysis ...
k__Bacteria 100.0 63.78929 75.19684 ...
k__Bacteria|p__Actinobacteria 1.50648 0.0 0.0 ...
k__Bacteria|p__Actinobacteria|c__Actinobacteria 1.50648 0.0 0.0 ...
...
In short, what options can I use in my call of export2graphlan.py
to create an annotation file that will encode the sample names and values found in merged_abundance_table.txt
, such that graphlan_annotate.py
adds the desired heatmap rings annotation to the xml? The biobakery github page does a great job explaining the ring options, but does not explicate how one is meant to programmatically incorporate ring annotations.
Edit
Iβm using GraPhlAn version 1.1.3 and MetaPhlAn version 2.5.0.