comparison amino2consensus.py @ 20:b1e1f49ebe14 draft

planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/tools/micall-lite commit 822e7e1c2de31a72c2a13bcc15b9df06b699561f-dirty
author dfornika
date Wed, 25 Sep 2019 18:36:16 -0400
parents 8e6d3de9c7fa
children d099ef46fd42
comparison
equal deleted inserted replaced
19:8e6d3de9c7fa 20:b1e1f49ebe14
11 amino = "" 11 amino = ""
12 total_count = sum(amino_counts.values()) 12 total_count = sum(amino_counts.values())
13 amino_with_max_counts = sorted(amino_counts, key=amino_counts.get, reverse=True)[0] 13 amino_with_max_counts = sorted(amino_counts, key=amino_counts.get, reverse=True)[0]
14 if total_count == 0: 14 if total_count == 0:
15 amino = "#" 15 amino = "#"
16 elif (amino_counts[amino_with_max_counts] / total_count) > threshold: 16 elif (amino_counts[amino_with_max_counts] / float(total_count)) > threshold:
17 amino = amino_with_max_counts 17 amino = amino_with_max_counts
18 else: 18 else:
19 amino = "@" 19 amino = "@"
20 return amino 20 return amino
21 21