SegataLab / export2graphlan

Conversion software tool for producing both annotation and tree files for GraPhlAn
https://segatalab.github.io/tools/graphlan
MIT License
8 stars 6 forks source link

Metaphlan3.0 > export2graphlan error #2

Closed charlottecc closed 4 years ago

charlottecc commented 4 years ago

Hi,

I'm trying to use export2graphlan on my MetaPhlAn3 abundance table output. I installed this and graphlan in another Conda env as they require python 2.7.

When I run: export2graphlan.py --skip_rows 1 -i statemerged_abundance_table_g.txt--tree merged_abundance.tree.txt --annotation merged_abundance.annot.txt --most_abundant 100 --abundance_threshold 1 --least_biomarkers 10 --annotations 5,6 --external_annotations 7 --min_clade_size 1

I get the error: Traceback (most recent call last): File "/pub38/cchong/miniconda2/envs/graphlan/bin/export2graphlan.py", line 770, in <module> main() File "/pub38/cchong/miniconda2/envs/graphlan/bin/export2graphlan.py", line 599, in main biomarkers = get_biomarkes(abundant, args.least_biomarkers) File "/pub38/cchong/miniconda2/envs/graphlan/bin/export2graphlan.py", line 381, in get_biomarkes while lvl < len(max(cc)): ValueError: max() arg is an empty sequence

statemerged_abundance_table_g.txt Any ideas what's going wrong?

Thanks in advance!

fasnicar commented 4 years ago

Hi,

Many thanks for using export2graphlan.

The error you got is due to the fact that the input file is not a MetaPhlAn output, in particular the first column (the taxonomy), only contains the species levels and not the full taxonomy path. This makes not possible for export2graphlan to identify the biomarkers, and this is what causing the error. If you can fix the input file by using the full path-taxonomy instead of only the species levels, that should fix the error you got.

Many thanks, Francesco

charlottecc commented 4 years ago

Hi Francesco,

Thank you for your reply and your help! I used the unmodified MetaPhlAn output table and it fixed the error.

Best wishes, Charlotte