@@ -74,20 +74,6 @@ def __init__(self,prog):
74
74
version = lib .get_version ()
75
75
lib .log .info ("Running %s" % version )
76
76
77
- #check EggNog database, download if necessary.
78
- if not args .eggnog_db in lib .Nogs :
79
- lib .log .error ("%s is not a valid EggNog group, options are:\n %s" % (args .eggnog_db , ', ' .join (lib .Nogs )))
80
- sys .exit (1 )
81
- if not os .path .isfile (os .path .join (parentdir , 'DB' , args .eggnog_db + '_4.5.hmm' )):
82
- lib .log .error ("%s EggNog DB not found, trying to download and format..." % args .eggnog_db )
83
- cmd = [os .path .join (parentdir , 'util' , 'getEggNog.sh' ), args .eggnog_db , os .path .join (parentdir , 'DB' )]
84
- lib .runSubprocess (cmd , '.' , lib .log )
85
- if not os .path .isfile (os .path .join (parentdir , 'DB' , args .eggnog_db + '_4.5.hmm' )):
86
- lib .log .error ("Downloading failed, exiting" )
87
- sys .exit (1 )
88
- else :
89
- lib .log .error ("%s downloaded and formatted, moving on." % args .eggnog_db )
90
-
91
77
if args .outgroup :
92
78
if not os .path .isdir (os .path .join (parentdir , 'DB' , 'outgroups' )):
93
79
lib .log .error ("Outgroup folder is not properly configured" )
@@ -138,6 +124,8 @@ def __init__(self,prog):
138
124
secmet = []
139
125
sm_backbones = []
140
126
transmembrane = []
127
+ cogs = []
128
+ meropsold = []
141
129
num_input = len (args .input )
142
130
if num_input == 0 :
143
131
lib .log .error ("Error, you did not specify an input, -i" )
@@ -173,20 +161,25 @@ def __init__(self,prog):
173
161
lib .log .error ("%s contains 0 gene models, exiting script" % genomeStats [0 ])
174
162
sys .exit (1 )
175
163
stats .append (genomeStats )
176
- merops .append (lib .getStatsfromNote (GBK , 'MEROPS' ))
177
- ipr .append (lib .getStatsfromDbxref (GBK , 'InterPro' ))
178
- pfam .append (lib .getStatsfromDbxref (GBK , 'PFAM' ))
179
- cazy .append (lib .getStatsfromNote (GBK , 'CAZy' ))
180
- busco .append (lib .getStatsfromNote (GBK , 'BUSCO' ))
181
- signalp .append (lib .getStatsfromNote (GBK , 'SECRETED' ))
182
- transmembrane .append (lib .getStatsfromNote (GBK , 'TransMembrane' ))
183
- secmet .append (lib .getStatsfromNote (GBK , 'antiSMASH' ))
184
- sm_backbones .append (lib .getSMBackbones (GBK ))
164
+ #this function will return list of dictionaries for each functional category
165
+ functional = lib .getGBKannotation (GBK )
166
+ #split those dictionaries and append to master list for each group of annotation
167
+ pfam .append (functional [0 ])
168
+ ipr .append (functional [1 ])
169
+ cazy .append (functional [5 ])
170
+ busco .append (functional [3 ])
171
+ signalp .append (functional [7 ])
172
+ transmembrane .append (functional [8 ])
173
+ cogs .append (functional [6 ])
174
+ secmet .append (functional [9 ])
175
+ sm_backbones .append (functional [10 ])
176
+ eggnog .append (functional [2 ])
177
+ merops .append (functional [4 ])
185
178
lib .parseGOterms (GBK , go_folder , stats [i ][0 ].replace (' ' , '_' ))
186
179
lib .gb2proteinortho (GBK , protortho , stats [i ][0 ].replace (' ' , '_' )+ '_' + stats [i ][1 ])
187
- eggnog .append (lib .getEggNogfromNote (GBK ))
188
180
scinames .append (stats [i ][0 ].replace (' ' , '_' )+ '_' + stats [i ][1 ])
189
181
182
+
190
183
#convert busco to dictionary
191
184
busco = lib .busco_dictFlip (busco )
192
185
@@ -523,6 +516,13 @@ def __init__(self,prog):
523
516
output .write (lib .FOOTER )
524
517
########################################################
525
518
519
+ ######COG families#####################
520
+ #print cogs
521
+
522
+
523
+ ############################
524
+
525
+
526
526
####SignalP############################
527
527
#flip the dict and just count number for each
528
528
signalpDict = lib .busco_dictFlip (signalp )
@@ -876,7 +876,7 @@ def __init__(self,prog):
876
876
pd .set_option ('display.max_colwidth' , - 1 )
877
877
output .write (lib .HEADER )
878
878
output .write (lib .SUMMARY )
879
- output .write (df .transpose (). to_html (classes = 'table table-condensed' ))
879
+ output .write (df .to_html (classes = 'table table-condensed' ))
880
880
output .write (lib .FOOTER )
881
881
############################################
882
882
@@ -913,7 +913,7 @@ def __init__(self,prog):
913
913
goList .append (description )
914
914
goDict [col [0 ]] = goList
915
915
916
- EggNog = lib .eggnog2dict (os .path .join (parentdir , 'DB' , args .eggnog_db + '.annotations.tsv' ))
916
+ # EggNog = lib.eggnog2dict(os.path.join(parentdir, 'DB', args.eggnog_db+'.annotations.tsv'))
917
917
iprDict = lib .dictFlipLookup (ipr , INTERPRO )
918
918
pfamDict = lib .dictFlipLookup (pfam , PFAM )
919
919
meropsDict = lib .dictFlip (merops )
@@ -999,7 +999,7 @@ def __init__(self,prog):
999
999
for i in notes :
1000
1000
if i .startswith ('EggNog:' ):
1001
1001
hit = i .replace ('EggNog:' , '' )
1002
- egg = hit + ': ' + EggNog . get ( hit )
1002
+ egg = hit
1003
1003
if i .startswith ('antiSMASH:' ):
1004
1004
cluster = i .replace ('antiSMASH:' , '' )
1005
1005
if i .startswith ('SMCOG:' ):
0 commit comments