Question: How to create heatmap for Genus in Metaphlan2?
0
gravatar for anderson.nb6
15 months ago by
anderson.nb620
anderson.nb620 wrote:

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

ADD COMMENTlink modified 8 days ago by Biostar ♦♦ 20 • written 15 months ago by anderson.nb620

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 REPLYlink written 15 months ago by Kevin Blighe35k
1
gravatar for anderson.nb6
14 months ago by
anderson.nb620
anderson.nb620 wrote:

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 COMMENTlink written 14 months ago by anderson.nb620

Glad that you got it solved.

Best of luck!

ADD REPLYlink written 14 months ago by Kevin Blighe35k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1441 users visited in the last hour