Mercurial > repos > iuc > customize_metaphlan_database
comparison formatoutput.py @ 5:892a0629e2ed draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/metaphlan/ commit f3a89af137b13715f9fb13383577aceb2c445ce6
| author | iuc |
|---|---|
| date | Sat, 03 Dec 2022 10:43:00 +0000 |
| parents | 487da152fb43 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:150ebe4d0fd9 | 5:892a0629e2ed |
|---|---|
| 55 # parse metaphlan file | 55 # parse metaphlan file |
| 56 for line in metaphlan_output_f.readlines(): | 56 for line in metaphlan_output_f.readlines(): |
| 57 # skip headers | 57 # skip headers |
| 58 if line.startswith("#"): | 58 if line.startswith("#"): |
| 59 continue | 59 continue |
| 60 # skip UNKNOWN lines in Predicted taxon relative abundances | 60 |
| 61 if "UNKNOWN" in line: | 61 # skip UNKNOWN (v3) or UNCLASSIFIED (v4) lines in predicted taxon relative abundances |
| 62 if "UNKNOWN" in line or 'UNCLASSIFIED' in line: | |
| 62 continue | 63 continue |
| 64 | |
| 63 # spit lines | 65 # spit lines |
| 64 split_line = line[:-1].split('\t') | 66 split_line = line[:-1].split('\t') |
| 65 taxo_n = split_line[0].split('|') | 67 taxo_n = split_line[0].split('|') |
| 66 if legacy_output: | 68 if legacy_output: |
| 67 abundance = split_line[1] | 69 abundance = split_line[1] |
