Mercurial > repos > cpt > cpt_protein_blast_grouping
diff protein_blast_grouping.py @ 5:11701cc63084 draft default tip
planemo upload commit 12a58961f0eb41803c1954ac8c2543ed7c56186f
author | cpt |
---|---|
date | Thu, 08 Aug 2024 04:04:26 +0000 |
parents | 258afe02e34a |
children |
line wrap: on
line diff
--- a/protein_blast_grouping.py Thu Aug 08 03:52:37 2024 +0000 +++ b/protein_blast_grouping.py Thu Aug 08 04:04:26 2024 +0000 @@ -42,12 +42,12 @@ self, num_hits, sort_key="unique_queries", output_file=sys.stdout ): top_hits = self.get_top_hits(num_hits, sort_key) - print(f"# Top {num_hits} Hits", file=output_file) print( "Rank\tPhage Name\tUnique Query Matches\tUnique Subject Hits", file=output_file, ) - for rank, (organism, data) in enumerate(top_hits): + for r, (organism, data) in enumerate(top_hits): + rank = r + 1 # 1-based ranking print( f"{rank}\t{organism}\t{len(data['unique_queries'])}\t{len(data['unique_hits'])}", file=output_file,