Mercurial > repos > iuc > customize_metaphlan_database
comparison formatoutput.py @ 5:aac70228c28a draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/metaphlan/ commit 08ec37116aab4268fdb93f175b60e50a0bbfafb2
| author | iuc |
|---|---|
| date | Mon, 27 Feb 2023 06:58:39 +0000 |
| parents | 8c76d39a6357 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:8610c7d8f59f | 5:aac70228c28a |
|---|---|
| 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] |
