How to create heatmap for Genus in Metaphlan2?
1
0
Entering edit mode
6.5 years ago
anderson.nb6 ▴ 30

Hi, I have the following problem:

I have in my hands the file 'merged_abundance_table.txt' and I want to create a heatmap of relative abundance for Genus. How should I rearrange the comand below?

linux@ubuntu:~$ grep -E "(s__)|(^ID)" merged_abundance_table.txt | grep -v "t__" | sed 's/^.*s__//g' > merged_abundance_table_species.txt

Can you help me please?

Thanks

Metaphlan2 genome sequencing next-gen • 2.5k views
ADD COMMENT
0
Entering edit mode

Can you show the first few lines of merged_abundance_table.txt ? ..also, an example of the format you want to produce would help a great deal.

Thanks! Kevin

ADD REPLY
1
Entering edit mode
6.5 years ago
anderson.nb6 ▴ 30

HI Kevin, thanks for the reply. But I had already solved the question. Knowing that it had multiple '.fna', I was able to resolve the issue with the following command sequence:

linux@ubuntu:~$ for f in *.fna; do metaphlan2.py $f --input_type fasta --nproc 4 --tax_lev g > ${f%.fasta.gz}_profile.txt; done

linux@ubuntu:~$ merge_metaphlan_tables.py *_profile.txt > merged_abundance_table.txt

linux@ubuntu:~$ grep -E "(g__)|(^ID)" merged_abundance_table.txt | grep -v "t__" | sed 's/^.*g__//g' > merged_abundance_table_genus.txt

linux@ubuntu:~$ hclust2.py -i merged_abundance_table_genus.txt -o abundance_heatmap_genus.png --ftop 25 --f_dist_f braycurtis --s_dist_f braycurtis --cell_aspect_ratio 0.5 -l --flabel_size 6 --slabel_size 6 --max_flabel_len 100 --max_slabel_len 100 --minv 0.1 --dpi 300

Thank you very much anyway !! :)

ADD COMMENT
0
Entering edit mode

Glad that you got it solved.

Best of luck!

ADD REPLY

Login before adding your answer.

Traffic: 2623 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6