comparison lrn_risk.py @ 5:5aa8560d9d91 draft

Uploaded
author greg
date Tue, 29 Aug 2023 15:17:07 +0000
parents 8fe04662585c
children a3799444f281
comparison
equal deleted inserted replaced
4:8fe04662585c 5:5aa8560d9d91
131 perc = str(round(float(perc), 2)) 131 perc = str(round(float(perc), 2))
132 ann = items[-1] 132 ann = items[-1]
133 freetext = '{0}/{1} ({2}%)'.format(pres, denom, perc) 133 freetext = '{0}/{1} ({2}%)'.format(pres, denom, perc)
134 elif gtdb != '(Unknown Species)': 134 elif gtdb != '(Unknown Species)':
135 ann = 'NA' 135 ann = 'NA'
136 denom = gtdbd[gtdb] 136 if gtdb in gtdbd.keys():
137 denom = gtdbd[gtdb]
138 else:
139 denom = 'NA'
137 freetext = "*WARNING" 140 freetext = "*WARNING"
138 warnings.append("*WARNING: This gene has never been detected in this species! Interpret with caution!") 141 warnings.append("*WARNING: This gene has never been detected in this species and/or this species has not been included in the LRNRisk database! Interpret with caution!")
139 else: 142 else:
140 ann = 'NA' 143 ann = 'NA'
144 denom = 'NA'
141 freetext = "**WARNING" 145 freetext = "**WARNING"
142 warnings.append("**WARNING: This genome belongs to an undescribed species. Interpret with caution!") 146 warnings.append("**WARNING: This genome belongs to an undescribed species. Interpret with caution!")
143 finallines.append('%s\t%s\t%s' % (bv, ann, freetext)) 147 finallines.append('%s\t%s\t%s' % (bv, ann, freetext))
144 return [finallines, warnings] 148 return [finallines, warnings]
145 149