diff lrn_risk.py @ 5:5aa8560d9d91 draft

Uploaded
author greg
date Tue, 29 Aug 2023 15:17:07 +0000
parents 8fe04662585c
children a3799444f281
line wrap: on
line diff
--- a/lrn_risk.py	Tue Aug 29 01:23:22 2023 +0000
+++ b/lrn_risk.py	Tue Aug 29 15:17:07 2023 +0000
@@ -133,11 +133,15 @@
                 freetext = '{0}/{1} ({2}%)'.format(pres, denom, perc)
             elif gtdb != '(Unknown Species)':
                 ann = 'NA'
-                denom = gtdbd[gtdb]
+                if gtdb in gtdbd.keys():
+                    denom = gtdbd[gtdb]
+                else:
+                    denom = 'NA' 
                 freetext = "*WARNING"
-                warnings.append("*WARNING: This gene has never been detected in this species! Interpret with caution!")
+                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!")
             else:
                 ann = 'NA'
+                denom = 'NA'
                 freetext = "**WARNING"
                 warnings.append("**WARNING: This genome belongs to an undescribed species. Interpret with caution!")
             finallines.append('%s\t%s\t%s' % (bv, ann, freetext))