-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathKEGG_decoder.py
1725 lines (1646 loc) · 64.3 KB
/
KEGG_decoder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/python
'''
KEGG-decoder.py V.1.3
V.1.3
Added several pathways associated with carotenoid biosynthesis, including
end-products: astaxanthin, nostoxanthin, zeaxanthin diglucoside, &
myxoxanthophylls. Plus, staphyloaxanthin biosynthesis and the two pathways for
terpenoid building blocks, the mevalonate pathway and the MEP/DOXP pathway.
The pathways were provided by Dr. Tania Kurbessoian
V.1.2.1
Fixed typo in determing reverse TCA cycle as identified by KEGG-Decoder
user Cheng. Added all-trans-8'-apo-beta-carotenal 15,15'-oxygenase
which will cleave apo-carotenals to generate retinal. Suggested by Eric Webb.
Upstream pathway unknown
V.1.2
Added several new pathways including PET degradation, carbon storage,
related to starch/gylcogen & polyhydroxybutyrate, and posphate storage,
related to the reversible polyphosphate reaction. Part of summer research
with Sheyla Aviles.
V.1.1
Correcting typos identified by Chris Neely. Adding more complete
pathways components for amino acid biosynthesis identified by
Dr. Eric Webb
phenylalanine added K01713 pheC; cyclohexadienyl dehydratase OR K05359 ADT;
arogenate/prephenate dehydratase OR K04518 pheA2; prephenate dehydratase
tyrosine added K00220 tyrC; cyclohexadieny/prephenate dehydrogenase OR
K24018; cyclohexadieny/prephenate dehydrogenase OR K15226 tyrAa; arogenate dehydrogenase
V.1.0.10
Add the biosynthesis of the 20 amino acids - represented as the last
step in the pathway
KEGG-decoder.py V.1.0.8.2
V.1.0.8
Several recent updates have improved all three outputs for visualization
expanded further in the ReadMe note. Additionally, a correction to
determining the completeness of ubiquinol-cytochrome c reductase. Previously,
only checked for the presence of K00411 and K00410. K00410 is a fusion of
K00412 and K00413 only present in a subset of Proteobacteria. Identified
by Grayson Chadwick
V.1.0.5
Added tanglegram correction for minimizing euclidean distance
V.1.0.4
Removed check for small datasets in interactive viz, added autosizing of tanglegram plots,
switch similarity metric in tanglegram to braycurtis
V.1.0.3
Quality of life updates for KEGG-decoder, tangelgram option, and interactive plots
V.1.0.2
Adds Na+-transporting NADH:ubiquinone oxidoreductase and several metal transporters
KEGG-decoder.py V.0.8
V.0.8
Add elements regarding arsenic reduction
V.0.7
Clarifies elements of methane oxidation and adds additional methanol/alcohol dehydrogenase
to KEGG function search. Adds the serine pathway for formaldehyde assimilation
V.0.6.1 Corrects an issue with the Wood-Ljungdhal pathway that used the wrong
carbon-monoxide deydrogenase subunit
V.0.6 Adds Bacterial Secretion Systems as descrived by KEGG covering Type I, II, III, IV, Vabc,
VI, Sec-SRP and Twin Arginine Targeting systems
V.0.5 Adds parameters to force labels to be printed on heatmap. Includes functions
for sulfolipid biosynthesis (key gene sqdB) and C-P lyase
V.0.4 Adds sections that more accurately represents anoxygenic photosynthesis
- type-II and type-I reaction centers, adds NiFe hydrogenase Hyd-1 hyaABC,
corrected typo leading to missed assignment to hydrogen:quinone oxidoreductase
V.0.3. Adds retinal biosynthesis, sulfite dehydrogenase (quinone),
hydrazine dehydrogenase, hydrazine synthase, DMSP/DMS/DMSO cycling,
cobalamin biosynthesis, competence-related DNA transport, anaplerotic
reactions
Usage: python KEGG-decoder.py <KOALA INPUT> <FUNCTION LIST FORMAT>
Designed to parse through a blastKoala or ghostKoala output to determine
the completeness of various KEGG pathways
Dependencies:
Pandas - http://pandas.pydata.org/pandas-docs/stable/install.html
Seaborn - http://seaborn.pydata.org/installing.html
matplotlib - http://matplotlib.org/users/installing.html
For extended information about KEGG assignments, genes and pathways,
please see accompanying document "KOALA_definitions.txt"
'''
def nitrogen(ko_match):
out_data = {'dissim nitrate reduction': 0, 'nitrite oxidation': 0,
'DNRA': 0, 'nitrite reduction': 0, 'nitric oxide reduction' : 0,
'nitrous-oxide reduction': 0, 'nitrogen fixation' : 0,
'hydroxylamine oxidation' :0, 'ammonia oxidation (amo/pmmo)': 0,
'hydrazine dehydrogenase': 0, 'hydrazine synthase': 0}
#narGH
if ('K00370' in ko_match and 'K00371' in ko_match):
out_data['dissim nitrate reduction'] = 1
#napAB
if ('K02567' in ko_match and 'K02568' in ko_match):
out_data['dissim nitrate reduction'] = 1
#nxrAB
if ('K00370' in ko_match and 'K00371' in ko_match):
out_data['nitrite oxidation'] = 1
#nirBD
if ('K00362' in ko_match and 'K00363' in ko_match):
out_data['DNRA'] = 1
#nrfAH
if ('K03385' in ko_match and 'K15876' in ko_match):
out_data['DNRA'] = 1
#nirK
if ('K00368' in ko_match):
out_data['nitrite reduction'] = 1
#nirS
if ('K15864' in ko_match):
out_data['nitrite reduction'] = 1
#norBC
if ('K04561' in ko_match and 'K02305' in ko_match):
out_data['nitric oxide reduction'] = 1
#nosZ
if ('K00376' in ko_match):
out_data['nitrous-oxide reduction'] = 1
#nifKDH
# if ('K02586' in ko_match and 'K02591' in ko_match and 'K02588' in ko_match):
# out_data['nitrogen fixation'] = 1
if ('K02586' in ko_match):
out_data['nitrogen fixation'] += 0.33
if ('K02591' in ko_match):
out_data['nitrogen fixation'] += 0.33
if ('K02588' in ko_match):
out_data['nitrogen fixation'] += 0.33
#hao
if ('K10535' in ko_match):
out_data['hydroxylamine oxidation'] = 1
#amoA
if ('K10944' in ko_match):
out_data['ammonia oxidation (amo/pmmo)'] = 0.33
#amoB
if ('K10945' in ko_match):
out_data['ammonia oxidation (amo/pmmo)'] += 0.33
#amoC
if ('K10946' in ko_match):
out_data['ammonia oxidation (amo/pmmo)'] += 0.33
if ('K20935' in ko_match):
out_data['hydrazine dehydrogenase'] = 1
hydrazine_synth = ['K20932', 'K20933', 'K20934']
for i in hydrazine_synth:
if i in ko_match:
out_data['hydrazine synthase'] += 0.33
return out_data
def glycolysis(ko_match):
#Check for presence of 9 genes
total = 0
#phosphoglucomutase, glucose-6-phosphate isomerase, fructose-bisphosphate aldolase
#phosphoglycerate kinase, enolase
single_ko = ['K01835', 'K01810', 'K01623', 'K00927', 'K01689']
for i in single_ko:
if i in ko_match:
total += 1
#6-phosphofructokinase
if ('K00850' in ko_match or 'K00895' in ko_match):
total += 1
#glyceraldehyde 3-phosphate dehydrogenase
if ('K00134' in ko_match or 'K00150' in ko_match):
total += 1
#2,3-bisphosphoglycerate-dependent phosphoglycerate mutase
if ('K01834' in ko_match or 'K15633' in ko_match):
total += 1
#pyruvate kinase
if ('K00873' in ko_match or 'K01006' in ko_match):
total += 1
value = float(total)/float(9)
return {'glycolysis': float("%.2f" % (value))}
def gluconeogenesis(ko_match):
total = 0
#Requires fructose-1,6-bisphosphatase to continue
if ('K03841' in ko_match):
total += 1
#phosphoglucomutase, glucose-6-phosphate isomerase, fructose-bisphosphate aldolase
#phosphoglycerate kinase, enolase
single_ko = ['K01835', 'K01810', 'K01623', 'K00927', 'K01689']
for i in single_ko:
if i in ko_match:
total += 1
#glyceraldehyde 3-phosphate dehydrogenase
if ('K00134' in ko_match or 'K00150' in ko_match):
total += 1
#2,3-bisphosphoglycerate-dependent phosphoglycerate mutase
if ('K01834' in ko_match or 'K15633' in ko_match):
total += 1
#pyruvate kinase
if ('K00873' in ko_match or 'K01006' in ko_match):
total += 1
value = float(total)/float(9)
return {'gluconeogenesis': float("%.2f" % (value))}
def tca_cycle(ko_match):
total = 0
#aconitate hydratase
if ('K01681' in ko_match or 'K01682' in ko_match):
total += 1
#isocitrate dehydrogenase
if ('K00031' in ko_match) or ('K00030' in ko_match) or ('K17753' in ko_match):
total += 1
#2-oxoglutarate/2-oxoacid ferredoxin oxidoreductase
if ('K00174' in ko_match and 'K00175' in ko_match):
total += 1
#succinyl-CoA synthetase
if (('K01899' in ko_match and 'K01900' in ko_match) or
('K01902' in ko_match and 'K01903' in ko_match) or
('K18118' in ko_match)):
total += 1
#fumarate reductase
if (('K00244' in ko_match and 'K00245' in ko_match and 'K00246' in ko_match and 'K00247' in ko_match)
or
('K00239' in ko_match and 'K00240' in ko_match and 'K00241' in ko_match and 'K00242' in ko_match)
or
('K00234' in ko_match and 'K00235' in ko_match and 'K00236' in ko_match and 'K00237' in ko_match)):
total += 1
#fumurate hydratase
if (('K01677' in ko_match and 'K01678' in ko_match and 'K01679' in ko_match) or
('K01676' in ko_match)):
total += 1
#malate dehydrogenase
if (('K00116' in ko_match) or
('K00025' in ko_match) or
('K00026' in ko_match) or
('K00024' in ko_match)):
total += 1
#citrate synthase
if ('K01647' in ko_match):
total += 1
value = float(total)/float(8)
return {'TCA Cycle': float("%.2f" % (value))}
def cbb_cycle(ko_match):
total = 0
var_cnt = 4
out_data = {'RuBisCo' : 0, 'CBB Cycle': 0}
#RuBisCO - Only large subunit Type 1 and 2
if ('K01601' in ko_match):
out_data['RuBisCo'] = 1
total += 1
#phosphoglycerate kinase
if ('K00927' in ko_match):
total += 1
#glyceraldehyde 3-phosphate dehydrogenase
if ('K00134' in ko_match) or ('K05298' in ko_match) or ('K00150' in ko_match):
total += 1
#phosphoribulokinase
if ('K00855' in ko_match):
total += 1
#Ribulose regeneration
#ribulose-phosphate 3-epimerase AND xylulose-5-phosphate/fructose-6-phosphate phosphoketolase
if ('K01783' in ko_match and 'K01621' in ko_match):
total += 2
var_cnt += 2
#transketolase AND ribulose-phosphate 3-epimerase
if ('K00615' in ko_match and 'K01783' in ko_match):
total += 2
var_cnt += 2
#transketolase AND ribose 5-phosphate isomerase
if ('K00615' in ko_match and 'K01807' in ko_match):
total += 2
var_cnt += 2
#fructose-bisphosphate aldolase AND transketolase AND fructose-1,6-bisphosphatase
if (('K01623' in ko_match or 'K01624' in ko_match or 'K11645' in ko_match) and
('K00615' in ko_match) and
('K11532' in ko_match or 'K03841' in ko_match or 'K02446' in ko_match)):
total += 3
var_cnt += 3
value = float(total)/float(var_cnt)
out_data['CBB Cycle'] = float("%.2f" % (value))
return out_data
def reverse_tca(ko_match):
out_data = {'rTCA Cycle' : 0}
#ATP-citrate lyase
if ('K15230' in ko_match and 'K15231' in ko_match):
out_data['rTCA Cycle'] = 1
#citryl-CoA synthetase AND citryl-CoA lyase
if ('K15232' in ko_match and 'K15233' in ko_match and 'K15234' in ko_match):
out_data['rTCA Cycle'] = 1
return out_data
def wood_ljungdahl(ko_match):
total = 0
CO_methyl_present = 0
#Carbon fixing branch
#acetyl-CoA decarbonylase/synthase complex subunit alpha OR
#CO-methylating acetyl-CoA synthase
if ('K00192' in ko_match) or ('K14138' in ko_match):
total += 1
CO_methyl_present = 1
#catalytic subunits only of CO dehydrogenase
#anaerobic carbon-monoxide dehydrogenase OR aerobic carbon-monoxide dehydrogenase large subunit
if ('K00198' in ko_match) or ('K03520' in ko_match):
total+= 1
if CO_methyl_present == 1:
#Methyl branch
#formate dehydrogenase
if ('K05299' in ko_match and 'K15022' in ko_match):
total+= 1
#formate--tetrahydrofolate ligase
if ('K01938' in ko_match):
total+= 1
#methylenetetrahydrofolate dehydrogenase (NADP+) / methenyltetrahydrofolate cyclohydrolase
if ('K01491' in ko_match):
total+= 1
#methylenetetrahydrofolate reductase (NADPH)
if ('K00297' in ko_match):
total+= 1
value = float(total)/float(6)
return {'Wood-Ljungdahl' : float("%.2f" % (value))}
def three_prop(ko_match):
total = 0
#pyruvate ferredoxin oxidoreductase alpha and beta subunits
if ('K00169' in ko_match and 'K00170' in ko_match):
total +=1
#pyruvate dikinase
if ('K01006' in ko_match or 'K01007' in ko_match):
total +=1
#phosphoenolpyruvate carboxylase
if ('K01595' in ko_match):
total +=1
#malate dehydrogenase
if ('K00024' in ko_match):
total +=1
#succinyl-CoA:(S)-malate CoA-transferase
if ('K14471' in ko_match and 'K14472' in ko_match):
total +=1
#malyl-CoA/(S)-citramalyl-CoA lyase
if ('K08691' in ko_match):
total +=1
#acetyl-CoA carboxylase, biotin carboxylase
if ('K02160' in ko_match and 'K01961' in ko_match and
'K01962' in ko_match and 'K01963' in ko_match):
total +=1
#malonyl-CoA reductase / 3-hydroxypropionate dehydrogenase (NADP+)
if ('K14468' in ko_match and 'K15017' in ko_match):
total +=1
#3-hydroxypropionate dehydrogenase (NADP+)
if ('K15039' in ko_match):
total +=1
#acrylyl-CoA reductase (NADPH) / 3-hydroxypropionyl-CoA dehydratase / 3-hydroxypropionyl-CoA synthetase
if ('K14469' in ko_match and 'K15018' in ko_match):
total +=1
#3-hydroxypropionyl-coenzyme A dehydratase
if ('K15019' in ko_match):
total +=1
#acryloyl-coenzyme A reductase
if ('K15020' in ko_match):
total +=1
#malyl-CoA/(S)-citramalyl-CoA lyase
if ('K08691' in ko_match):
total +=1
#2-methylfumaryl-CoA hydratase
if ('K14449' in ko_match):
total +=1
#2-methylfumaryl-CoA isomerase
if ('K14470' in ko_match):
total +=1
#3-methylfumaryl-CoA hydratase
if ('K09709' in ko_match):
total +=1
#malyl-CoA/(S)-citramalyl-CoA lyase
if ('K08691' in ko_match):
total +=1
value = float(total)/float(17)
return {'3-Hydroxypropionate Bicycle' : float("%.2f" % (value))}
def four_hydrox(ko_match):
#Based on the reference present in Thaumarchaea -- pathway is not complete
total = 0
#acetyl-CoA carboxylase, biotin carboxylase
if ('K02160' in ko_match and 'K01961' in ko_match and
'K01962' in ko_match and 'K01963' in ko_match):
total +=1
#malonic semialdehyde reductase
if ('K18602' in ko_match):
total +=1
#3-hydroxypropionyl-CoA synthetase
if ('K18594' in ko_match):
total +=1
#acrylyl-CoA reductase (NADPH) / 3-hydroxypropionyl-CoA dehydratase / 3-hydroxypropionyl-CoA synthetase
if ('K14469' in ko_match and 'K15019' in ko_match):
total +=1
#methylmalonyl-CoA/ethylmalonyl-CoA epimerase
if ('K05606' in ko_match):
total +=1
#methylmalonyl-CoA mutase
if ('K01847' in ko_match and 'K01848' in ko_match and
'K01849' in ko_match):
total +=1
#4-hydroxybutyryl-CoA synthetase (ADP-forming)
if ('K18593' in ko_match):
total +=1
#4-hydroxybutyryl-CoA dehydratase / vinylacetyl-CoA-Delta-isomerase
if ('K14534' in ko_match):
total +=1
#enoyl-CoA hydratase / 3-hydroxyacyl-CoA dehydrogenase
if ('K15016' in ko_match):
total +=1
#acetyl-CoA C-acetyltransferase
if ('K00626' in ko_match):
total +=1
value = float(total)/float(10)
return {'4-Hydroxybutyrate/3-hydroxypropionate' : float("%.2f" % (value))}
def c_degradation(ko_match):
out_data = {'beta-glucosidase' : 0, 'cellulase':0, 'chitinase':0,
'bifunctional chitinase/lysozyme':0,
'basic endochitinase B':0, 'diacetylchitobiose deacetylase':0,
'beta-N-acetylhexosaminidase':0, 'pectinesterase':0,
'exo-poly-alpha-galacturonosidase':0, 'oligogalacturonide lyase':0,
'exopolygalacturonase':0, 'D-galacturonate isomerase':0,
'D-galacturonate epimerase':0, 'alpha-amylase': 0, 'glucoamylase':0,
'pullulanase':0}
if ('K05350' in ko_match or 'K05349' in ko_match):
out_data['beta-glucosidase'] += 1
if ('K01225' in ko_match or 'K19668' in ko_match):
out_data['cellulase'] += 1
if ('K01183' in ko_match):
out_data['chitinase'] += 1
if ('K13381' in ko_match):
out_data['bifunctional chitinase/lysozyme'] += 1
if ('K20547' in ko_match):
out_data['basic endochitinase B'] += 1
if ('K03478' in ko_match or 'K18454' in ko_match):
out_data['diacetylchitobiose deacetylase'] += 1
if ('K01207' in ko_match):
out_data['beta-N-acetylhexosaminidase'] += 1
if ('K01730' in ko_match):
out_data['oligogalacturonide lyase'] += 1
if ('K01184' in ko_match):
out_data['exopolygalacturonase'] += 1
if ('K01812' in ko_match):
out_data['D-galacturonate isomerase'] += 1
if ('K08679' in ko_match):
out_data['D-galacturonate epimerase'] += 1
if ('K01176' in ko_match):
out_data['alpha-amylase'] += 1
if ('K01178' in ko_match):
out_data['glucoamylase'] += 1
if ('K01200' in ko_match):
out_data['pullulanase'] += 1
return out_data
def chemotaxis(ko_match):
#Che family of proteins
total = 0
single_ko = ['K13924', 'K00575',
'K03413', 'K03412', 'K03406', 'K03407',
'K03415', 'K03408']
for i in single_ko:
if i in ko_match:
total += 1
value = float(total)/float(len(single_ko))
return {'Chemotaxis': float("%.2f" % (value))}
def flagellum(ko_match):
#Components of the flagellum biosynthesis group
total = 0
single_ko = ['K02409', 'K02401', 'K02394', 'K02397',
'K02396', 'K02391', 'K02390', 'K02393',
'K02392', 'K02386', 'K02557', 'K02556',
'K02400', 'K02418', 'K02389', 'K02412',
'K02387', 'K02410', 'K02411', 'K02416',
'K02417', 'K02407', 'K02406']
for i in single_ko:
if i in ko_match:
total += 1
value = float(total)/float(len(single_ko))
return {'Flagellum': float("%.2f" % (value))}
def sulfur(ko_match):
out_data = {'sulfur assimilation':0, 'dissimilatory sulfate < > APS':0,
'dissimilatory sulfite < > APS':0, 'dissimilatory sulfite < > sulfide':0,
'thiosulfate oxidation':0, 'alt thiosulfate oxidation doxAD':0,
'alt thiosulfate oxidation tsdA':0, 'thiosulfate disproportionation':0, 'sulfur reductase sreABC':0,
'thiosulfate/polysulfide reductase':0, 'sulfhydrogenase':0,
'sulfur disproportionation':0, 'sulfur dioxygenase':0, 'sulfite dehydrogenase':0,
'sulfide oxidation':0, 'sulfite dehydrogenase (quinone)':0,
'DMSP demethylation': 0, 'DMS dehydrogenase': 0, 'DMSO reductase': 0}
#sir; sulfite reductase (ferredoxin) [EC:1.8.7.1] OR
#cysJ; sulfite reductase (NADPH) flavoprotein alpha-component [EC:1.8.1.2] + cysI; sulfite reductase (NADPH) hemoprotein beta-component [EC:1.8.1.2]
if ('K00392' in ko_match) or ('K00380' in ko_match and 'K00381' in ko_match):
out_data['sulfur assimilation'] = 1
#sat; sulfate adenylyltransferase
if ('K00958' in ko_match):
out_data['dissimilatory sulfate < > APS'] = 1
#aprB; adenylylsulfate reductase, subunit B [EC:1.8.99.2] + aprA; adenylylsulfate reductase, subunit A [EC:1.8.99.2]
if ('K00395' in ko_match and 'K00394' in ko_match):
out_data['dissimilatory sulfite < > APS'] = 1
#dsrA; sulfite reductase, dissimilatory-type alpha subunit [EC:1.8.99.3] + dsrB; sulfite reductase, dissimilatory-type beta subunit [EC:1.8.99.3]
if ('K11180' in ko_match and 'K11181' in ko_match):
out_data['dissimilatory sulfite < > sulfide'] = 1
#soxABCXYZ
if ('K17222' in ko_match):
out_data['thiosulfate oxidation'] += .16
if ('K17224' in ko_match):
out_data['thiosulfate oxidation'] += .16
if ('K17225' in ko_match):
out_data['thiosulfate oxidation'] += .16
if ('K17223' in ko_match):
out_data['thiosulfate oxidation'] += .16
if ('K17226' in ko_match):
out_data['thiosulfate oxidation'] += .16
if ('K17227' in ko_match):
out_data['thiosulfate oxidation'] += .16
#doxAD thiosulfate dehydrogenase [quinone]
if ('K16936' in ko_match and 'K16937' in ko_match):
out_data['alt thiosulfate oxidation doxAD'] = 1
#tsdA thiosulfate dehydrogenase [EC:1.8.2.2]
if ('K19713' in ko_match):
out_data['alt thiosulfate oxidation tsdA'] = 1
#sulfur reductase
if ('K17219' in ko_match):
out_data['sulfur reductase sreABC'] += .33
if ('K17220' in ko_match):
out_data['sulfur reductase sreABC'] += .33
if ('K17221' in ko_match):
out_data['sulfur reductase sreABC'] += .33
#thiosulfate reductase / polysulfide reductase psrABC/phsABC
if ('K08352' in ko_match):
out_data['thiosulfate/polysulfide reductase'] += .33
if ('K08353' in ko_match):
out_data['thiosulfate/polysulfide reductase'] += .33
if ('K08354' in ko_match):
out_data['thiosulfate/polysulfide reductase'] += .33
#sulfhydrogenase hydABGD
if ('K17993' in ko_match):
out_data['sulfhydrogenase'] += .25
if ('K17996' in ko_match):
out_data['sulfhydrogenase'] += .25
if ('K17995' in ko_match):
out_data['sulfhydrogenase'] += .25
if ('K17994' in ko_match):
out_data['sulfhydrogenase'] += .25
#sor; sulfur oxygenase/reductase
if ('K16952' in ko_match):
out_data['sulfur disproportionation'] += 1
#sdo; sulfur dioxygenase
if ('K17725' in ko_match):
out_data['sulfur dioxygenase'] += 1
#sorB; sulfite dehydrogenase
if ('K05301' in ko_match):
out_data['sulfite dehydrogenase'] += 1
#sqr; sulfide:quinone oxidoreductase OR fccB; sulfide dehydrogenase [flavocytochrome c]
if ('K17218' in ko_match or 'K17229' in ko_match):
out_data['sulfide oxidation'] = 1
value = out_data['thiosulfate oxidation']
out_data['thiosulfate oxidation'] = float("%.2f" % (value))
#soeABC; sulfite dehydrogenase (quinone)
soeABC = ['K21307', 'K21308', 'K21309']
for i in soeABC:
if i in ko_match:
out_data['sulfite dehydrogenase (quinone)'] += 0.33
#DMSP lyase
# if ('K16953' in ko_match):
# out_data['DMSP lyase, dddL'] = 1
#dmdA; dimethylsulfoniopropionate demethylase
if ('K17486' in ko_match):
out_data['DMSP demethylation'] = 1
#ddhABC; dimethylsulfide dehydrogenase
dms_dh = ['K16964', 'K16965', 'K16966']
for i in dms_dh:
if i in ko_match:
out_data['DMS dehydrogenase'] += 0.33
#dmsABC; anaerobic dimethyl sulfoxide reductase
dmso_red = ['K07306', 'K07307', 'K07308']
for i in dmso_red:
if i in ko_match:
out_data['DMSO reductase'] += 0.33
return out_data
def methanogenesis(ko_match):
out_data = {'Methanogenesis via methanol':0, 'Methanogenesis via dimethylamine':0,
'Methanogenesis via dimethylsulfide, methanethiol, methylpropanoate':0,
'Methanogenesis via methylamine':0, 'Methanogenesis via trimethylamine':0,
'Methanogenesis via acetate':0, 'Methanogenesis via CO2':0,
'Coenzyme M reduction to methane':0, 'Coenzyme B/Coenzyme M regeneration':0,
'dimethylamine/trimethylamine dehydrogenase':0}
#dmd-tmd; dimethylamine/trimethylamine dehydrogenase
if ('K00317' in ko_match):
out_data['dimethylamine/trimethylamine dehydrogenase'] = 1
#mtaA; [methyl-Co(III) methanol-specific corrinoid protein]:coenzyme M methyltransferase
#mtaB; methanol---5-hydroxybenzumidazolylcobamide Co-methyltransferase
#mtaC; methanol corrinoid protein
methanol_kos = ['K14080', 'K04480', 'K14081']
for i in methanol_kos:
if i in ko_match:
out_data['Methanogenesis via methanol'] += .33
#mtbA; [methyl-Co(III) methylamine-specific corrinoid protein]:coenzyme M methyltransferase
#mtbB; dimethylamine---corrinoid protein Co-methyltransferase
dimethylamine_kos = ['K14082', 'K16178']
for i in dimethylamine_kos:
if i in ko_match:
out_data['Methanogenesis via dimethylamine'] += .50
#mtsA; methylthiol:coenzyme M methyltransferase
#mtsB; methylated-thiol--corrinoid protein
dimethylsulfide_kos = ['K16954', 'K16955']
for i in dimethylsulfide_kos:
if i in ko_match:
out_data['Methanogenesis via dimethylsulfide, methanethiol, methylpropanoate'] += .50
#mtmB; monomethylamine methyltransferase
if ('K16178' in ko_match):
out_data['Methanogenesis via methylamine'] = 1
#mttB; trimethylamine methyltransferase
if ('K14083' in ko_match):
out_data['Methanogenesis via trimethylamine'] = 1
#acetyl-CoA decarbonylase/synthase complex
acetate_kos = ['K00193', 'K00194', 'K00197']
for i in acetate_kos:
if i in ko_match:
out_data['Methanogenesis via acetate'] += .33
#formylmethanofuran dehydrogenase
#ftr; formylmethanofuran--tetrahydromethanopterin N-formyltransferase
#mch; methenyltetrahydromethanopterin cyclohydrolase
#hmd; 5,10-methenyltetrahydromethanopterin hydrogenase
#mer; 5,10-methylenetetrahydromethanopterin reductase
#mtrABCDEFGH; tetrahydromethanopterin S-methyltransferase
co2_kos = ['K00200', 'K00201', 'K00202', 'K00203', 'K00205', 'K11261',
'K00672', 'K01499', 'K13942', 'K00320', 'K00577', 'K00578', 'K00579',
'K00580', 'K00581', 'K00582', 'K00583', 'K00584']
for i in co2_kos:
if i in ko_match:
out_data['Methanogenesis via CO2'] += .05
#mcrABCD; methyl-coenzyme M reductase
coenzymeM_kos = ['K00399', 'K00401', 'K00402']
for i in coenzymeM_kos:
if i in ko_match:
out_data['Coenzyme M reduction to methane'] += .33
#hdrABCDE; CoB-CoM heterodisulfide reductase
regeneration_kos = ['K03388', 'K03389', 'K03390', 'K08264', 'K08265']
for i in regeneration_kos:
if i in ko_match:
out_data['Coenzyme B/Coenzyme M regeneration'] += .20
value = out_data['Coenzyme B/Coenzyme M regeneration']
out_data['Coenzyme B/Coenzyme M regeneration'] = float("%.2f" % (value))
return out_data
def methane_ox(ko_match):
out_data = {'Soluble methane monooxygenase':0,'methanol dehydrogenase':0,
'alcohol oxidase':0}
#mmoXYZC; soluble methane monooxygenase
single_ko = ['K16157', 'K16158', 'K16159', 'K16161']
for i in single_ko:
if i in ko_match:
out_data['Soluble methane monooxygenase'] += .25
methanol_dh = ['K14028', 'K14029']
for i in methanol_dh:
if i in ko_match:
out_data['methanol dehydrogenase'] += .5
if ('K17066' in ko_match):
out_data['alcohol oxidase'] = 1
return out_data
def hydrogen(ko_match):
out_data = {'NiFe hydrogenase':0, 'membrane-bound hydrogenase':0,
'ferredoxin hydrogenase':0, 'hydrogen:quinone oxidoreductase':0,
'NAD-reducing hydrogenase':0, 'NADP-reducing hydrogenase':0,
'NiFe hydrogenase Hyd-1':0}
#hydB2,hydA2; NiFe hydrogenase
if ('K00437' in ko_match and 'K18008' in ko_match):
out_data['NiFe hydrogenase'] = 1
#mbhLJK; membrane-bound hydrogenase
if ('K18016' in ko_match and 'K18017' in ko_match
and 'K18023' in ko_match):
out_data['membrane-bound hydrogenase'] = 1
#hupSL; ferrodoxin hydrogenase
if ('K00533' in ko_match and 'K00534' in ko_match):
out_data['ferredoxin hydrogenase'] = 1
#hydA3,hydB3; hydrogen:quinone oxidoreductase
if ('K05922' in ko_match and 'K05927' in ko_match):
out_data['hydrogen:quinone oxidoreductase'] = 1
#hoxHFUY; NAD-reducing hydrogenase
nad_ko = ['K00436' , 'K18005' , 'K18006' , 'K18007']
for i in nad_ko:
if i in ko_match:
out_data['NAD-reducing hydrogenase'] += .25
#hndABCD; NADP-reducing hydrogenase
nadp_ko = ['K17992', 'K18330', 'K18331', 'K18332']
for i in nadp_ko:
if i in ko_match:
out_data['NADP-reducing hydrogenase'] += .25
#hyaABC; NiFe hydrogenase Hyd-1
hyd_ko = ['K06282', 'K06281', 'K03620']
for i in hyd_ko:
if i in ko_match:
out_data['NiFe hydrogenase Hyd-1'] += 0.33
return out_data
def transporters(ko_match):
out_data = {'transporter: phosphate':0, 'transporter: phosphonate':0,
'transporter: thiamin':0, 'transporter: vitamin B12':0,
'transporter: urea':0}
#pstABCS; phosphate
phosphate_ko = ['K02040', 'K02037', 'K02038', 'K02036']
for i in phosphate_ko:
if i in ko_match:
out_data['transporter: phosphate'] += .25
#phnDEC; phosphonate
phosphonate_ko = ['K02044', 'K02042', 'K02041']
for i in phosphonate_ko:
if i in ko_match:
out_data['transporter: phosphonate'] += .33
#tbpA,thiPQ; thiamin
thiamin_ko = ['K02064', 'K02063', 'K02062']
for i in thiamin_ko:
if i in ko_match:
out_data['transporter: thiamin'] += .33
#btuFCD; vitamin B12
b12_ko = ['K06858', 'K06073', 'K06074']
for i in b12_ko:
if i in ko_match:
out_data['transporter: vitamin B12'] += .33
#urtABCED; urea
urea_ko = ['K11959', 'K11960', 'K11961', 'K11962', 'K11963']
for i in urea_ko:
if i in ko_match:
out_data['transporter: urea'] += .2
value = out_data['transporter: urea']
out_data['transporter: urea'] = float("%.2f" % (value))
return out_data
def riboflavin(ko_match):
total= 0
#ribB; 3,4-dihydroxy 2-butanone 4-phosphate synthase OR
#ribAB; 3,4-dihydroxy 2-butanone 4-phosphate synthase / GTP cyclohydrolase II
if ('K02858' in ko_match or 'K14652' in ko_match):
total += 1
#ribD2; 5-amino-6-(5-phosphoribosylamino)uracil reductase OR
#ribD; diaminohydroxyphosphoribosylaminopyrimidine deaminase / 5-amino-6-(5-phosphoribosylamino)uracil reductase
if ('K00082' in ko_match or 'K11752' in ko_match):
total += 1
#ribH; 6,7-dimethyl-8-ribityllumazine synthase
if ('K00794' in ko_match):
total += 1
#ribE; riboflavin synthase
if ('K00793' in ko_match):
total += 1
#RFK; riboflavin kinase OR FHY; riboflavin kinase / FMN hydrolase OR
#ribF; riboflavin kinase / FMN adenylyltransferase
# if ('K00861' in ko_match or 'K20884' in ko_match or 'K11753' in ko_match):
# total += 1
#FAD synthetase
# if ('K14656' in ko_match or 'K00953' in ko_match):
# total += 1
value = float(total)/float(4)
return {'riboflavin biosynthesis': float("%.2f" % (value))}
def thiamin(ko_match):
total = 0
#thiF; sulfur carrier protein ThiS adenylyltransferase
if ('K03148' in ko_match):
total += 1
#iscS; cysteine desulfurase
if ('K04487' in ko_match):
total += 1
#thiH; 2-iminoacetate synthase OR K03153 thiO; glycine oxidase
if ('K03150' in ko_match or 'K03153' in ko_match):
total += 1
#thiI; thiamine biosynthesis protein ThiI
if ('K03151' in ko_match):
total += 1
#dxs; 1-deoxy-D-xylulose-5-phosphate synthase
if ('K01662' in ko_match):
total += 1
#thiG; thiazole synthase
if ('K03149' in ko_match):
total += 1
#tenI; thiazole tautomerase OR THI4; thiamine thiazole synthase
if ('K10810' in ko_match or 'K03146' in ko_match):
total += 1
#THI5; pyrimidine precursor biosynthesis enzyme OR K03147 thiC; phosphomethylpyrimidine synthase OR
#THI20; hydroxymethylpyrimidine/phosphomethylpyrimidine kinase / thiaminase OR
#thiD; hydroxymethylpyrimidine/phosphomethylpyrimidine kinase OR
#thiDE; hydroxymethylpyrimidine kinase / phosphomethylpyrimidine kinase / thiamine-phosphate diphosphorylase
if ('K18278' in ko_match or 'K03147' in ko_match or
'K00877' in ko_match or 'K00941' in ko_match):
total += 1
#THI20; hydroxymethylpyrimidine/phosphomethylpyrimidine kinase / thiaminase OR
#thiD; hydroxymethylpyrimidine/phosphomethylpyrimidine kinase
if ('K00877' in ko_match or 'K00941' in ko_match):
total += 1
#thiE; thiamine-phosphate pyrophosphorylase OR
#thiDE; hydroxymethylpyrimidine kinase / phosphomethylpyrimidine kinase / thiamine-phosphate diphosphorylase OR
#THI6;thiamine-phosphate diphosphorylase / hydroxyethylthiazole kinase
if ('K00788' in ko_match or 'K14153' in ko_match or
'K14154' in ko_match):
total += 1
#thiL; thiamine-monophosphate kinase
if ('K00946' in ko_match):
total += 1
value = float(total)/float(11)
return {'thiamin biosynthesis': float("%.2f" % (value))}
def cobalamin(ko_match):
total = 0
#pduO; cob(I)alamin adenosyltransferase
#cobA; cob(I)alamin adenosyltransferase
if ('K00798' in ko_match or 'K19221' in ko_match):
total += 1
#cobQ; adenosylcobyric acid synthase
if ('K02232' in ko_match):
total += 1
#cobC; cobalamin biosynthetic protein CobC
if ('K02225' in ko_match):
total += 1
#cobD; adenosylcobinamide-phosphate synthase
if ('K02227' in ko_match):
total += 1
#cobU; adenosylcobinamide kinase / adenosylcobinamide-phosphate guanylyltransferase
if ('K02231' in ko_match):
total += 1
#cobY; adenosylcobinamide-phosphate guanylyltransferase
if ('K19712' in ko_match and 'K02231' not in ko_match):
total += 1
#cobV; adenosylcobinamide-GDP ribazoletransferase
if ('K02233' in ko_match):
total += 1
#cobC; alpha-ribazole phosphatase
if ('K02226' in ko_match):
total += 1
#cobT; nicotinate-nucleotide--dimethylbenzimidazole phosphoribosyltransferase
if ('K00768' in ko_match):
total += 1
value = float(total)/float(8)
return {'cobalamin biosynthesis': float("%.2f" % (value))}
def oxidative_phoshorylation(ko_match):
out_data ={'F-type ATPase':0, 'V-type ATPase':0, 'NADH-quinone oxidoreductase':0,
'NAD(P)H-quinone oxidoreductase':0, 'Cytochrome c oxidase, cbb3-type':0,
'Cytochrome bd complex':0, 'Cytochrome o ubiquinol oxidase':0,
'Cytochrome c oxidase':0, 'Cytochrome aa3-600 menaquinol oxidase':0,
'Ubiquinol-cytochrome c reductase':0, 'Na-NADH-ubiquinone oxidoreductase': 0}
#atpFBCHGDAE
ftype_ko = ['K02111', 'K02112', 'K02115', 'K02113',
'K02114', 'K02108', 'K02109', 'K02110']
for i in ftype_ko:
if i in ko_match:
out_data['F-type ATPase'] += 0.125
#ntpABCDEFIK,ahaH
vtype_ko = ['K02117', 'K02118', 'K02119', 'K02120',
'K02121', 'K02122', 'K02107', 'K02123', 'K02124']
for i in vtype_ko:
if i in ko_match:
out_data['V-type ATPase'] += 0.11
#nuoABCDEFGHIJKLMN
nuo_ko = ['K00330', 'K00331', 'K00332', 'K00333',
'K00334', 'K00335', 'K00336', 'K00337',
'K00338', 'K00339', 'K00340', 'K00341',
'K00342', 'K00343']
for i in nuo_ko:
if i in ko_match:
out_data['NADH-quinone oxidoreductase'] += 0.07
value = out_data['NADH-quinone oxidoreductase']
out_data['NADH-quinone oxidoreductase'] = float("%.2f" % (value))
#ndcABCDEFGHIJKLMN
ndc_ko = ['K05574', 'K05582', 'K05581', 'K05579',
'K05572', 'K05580', 'K05578', 'K05576',
'K05577', 'K05575', 'K05573', 'K05583',
'K05584', 'K05585']
for i in ndc_ko:
if i in ko_match:
out_data['NAD(P)H-quinone oxidoreductase'] += 0.07
#ccoPQNO
cbb3_ko = ['K00404', 'K00405', 'K00407', 'K00406']
for i in cbb3_ko:
if i in ko_match:
out_data['Cytochrome c oxidase, cbb3-type'] += 0.25
#cydAB
bd_ko = ['K00425', 'K00426']
for i in bd_ko:
if i in ko_match:
out_data['Cytochrome bd complex'] += 0.5
#cyoABCD
o_ko = ['K02300', 'K02299', 'K02298', 'K02297']
for i in o_ko:
if i in ko_match:
out_data['Cytochrome o ubiquinol oxidase'] += 0.25
#coxABCD
cytc_ko = ['K02277', 'K02276', 'K02274', 'K02275']
for i in cytc_ko:
if i in ko_match:
out_data['Cytochrome c oxidase'] += 0.25
#qoxABCD
aa3_ko = ['K02829', 'K02828', 'K02827', 'K02826']
for i in aa3_ko:
if i in ko_match:
out_data['Cytochrome aa3-600 menaquinol oxidase'] += 0.25
#petA,fbcH; ubiquinol-cytochrome c reductase
#petA,petB,petC; ubiquinol-cytochrome c reductase
if ('K00411' in ko_match) and ('K00410' in ko_match):
out_data['Ubiquinol-cytochrome c reductase'] = 1
else:
ubiquinol_ko = ['K00411', 'K00412', 'K00413']
for i in ubiquinol_ko:
if i in ko_match:
out_data['Ubiquinol-cytochrome c reductase'] += 0.33
#nqrABCDEF; Na+-transporting NADH:ubiquinone oxidoreductase
na_ubiquinone_ko = ['K00346', 'K00347', 'K00348', 'K00349',
'K00350', 'K00351']
for i in na_ubiquinone_ko:
if i in ko_match:
out_data['Na-NADH-ubiquinone oxidoreductase'] += 0.167
value = out_data['Na-NADH-ubiquinone oxidoreductase']
out_data['Na-NADH-ubiquinone oxidoreductase'] = float("%.2f" % (value))
return out_data
def photosynthesis(ko_match):
out_data = {'Photosystem II':0, 'Photosystem I':0, 'Cytochrome b6/f complex':0,
"anoxygenic type-II reaction center":0, "anoxygenic type-I reaction center":0,
'Retinal biosynthesis':0, 'Retinal from apo-carotenals': 0}
psII = ['K02703', 'K02706', 'K02705', 'K02704', 'K02707', 'K02708']
#Photosystem II core complex
for i in psII:
if i in ko_match:
out_data['Photosystem II'] += 0.167
psI = ['K02689', 'K02690', 'K02691', 'K02692', 'K02693', 'K02694', 'K02696',
'K02697', 'K02698', 'K02699', 'K02700', 'K08905', 'K02695', 'K02701',
'K14332', 'K02702']
#Photosystem I
for i in psI:
if i in ko_match:
out_data['Photosystem I'] += 0.0625
cyt_b6 = ['K02635', 'K02637', 'K02634', 'K02636', 'K02642', 'K02643', 'K03689',
'K02640']
#Cytochrome b6/f complex
for i in cyt_b6:
if i in ko_match:
out_data['Cytochrome b6/f complex'] += 0.125
#Anoxygenic type-II reaction center pufL & pufM
if ('K08928' in ko_match):
out_data['anoxygenic type-II reaction center'] += 0.5
if ('K08929' in ko_match):
out_data['anoxygenic type-II reaction center'] += 0.5
#Anoxygenic type-I reaction center pscABCD
rci = ['K08940', 'K08941', 'K08942', 'K08943']
for i in rci:
if i in ko_match:
out_data['anoxygenic type-I reaction center'] += 0.25
#Retinal biosynthesis
retinal = ['K06443', 'K02291', 'K10027', 'K13789']
for i in retinal:
if i in ko_match:
out_data['Retinal biosynthesis'] += 0.25
#Retinal production from apo-carotenals
if ('K00464' in ko_match):
out_data['Retinal from apo-carotenals'] = 1
return out_data
def entnerdoudoroff(ko_match):
value = 0
#H6PD; hexose-6-phosphate dehydrogenase
if 'K13937' in ko_match:
total = 1
#edd; phosphogluconate dehydratase
if 'K01690' in ko_match:
total += 1
#2-dehydro-3-deoxyphosphogluconate aldolase
if ('K01625' in ko_match or 'K17463' in ko_match or 'K11395' in ko_match):
total += 1
value = float(total) / float(3)
else:
total = 0
#G6PD; glucose-6-phosphate 1-dehydrogenase
if 'K00036' in ko_match:
total += 1
#6-phosphogluconolactonase
if ('K01057' in ko_match or 'K07404' in ko_match):
total += 1
#edd; phosphogluconate dehydratase
if 'K01690' in ko_match:
total += 1
#2-dehydro-3-deoxyphosphogluconate aldolase
if ('K01625' in ko_match or 'K17463' in ko_match or 'K11395' in ko_match):
total += 1
value = float(total) / float(4)
return {'Entner-Doudoroff Pathway': float("%.2f" % (value))}
def mixedacid(ko_match):
out_data = {'Mixed acid: Lactate':0, 'Mixed acid: Formate':0,
'Mixed acid: Formate to CO2 & H2':0, 'Mixed acid: Acetate':0,
'Mixed acid: Ethanol, Acetate to Acetylaldehyde':0,
'Mixed acid: Ethanol, Acetyl-CoA to Acetylaldehyde (reversible)':0,
'Mixed acid: Ethanol, Acetylaldehyde to Ethanol':0,
'Mixed acid: PEP to Succinate via OAA, malate & fumarate': 0}
#LDH; L-lactate dehydrogenase
if 'K00016' in ko_match:
out_data['Mixed acid: Lactate'] = 1
#pf1D; formate C-acetyltransferase
if 'K00656' in ko_match:
out_data['Mixed acid: Formate'] = 1
#formate dehydrogenase
formatedh = ['K00122', 'K00125', 'K00126', 'K00123', 'K00124', 'K00127']