<jupyter_start><jupyter_text>Contextualizing iCdR703  Annotation conversion<jupyter_code>from riptide import *
iCdR703 = cobra.io.load_json_model('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/reconstructions/iCdR703.json')
iter1 = ['rxn02269_c', 'rxn09142_c', 'rxn09145_c', 'rxn00620_c', 'rxn01105_c', 'rxn05293_c', 'rxn02286_c', 'rxn09147_c', 
         'rxn01953_c', 'rxn02011_c', 'rxn07466_c', 'rxn09429_c', 'rxn03852_c', 'rxn13140_c', 'rxn09065_c', 'rxn01520_c', 
         'rxn13914_c', 'rxn09063_c', 'rxn09348_c', 'rxn05744_c', 'rxn08040_c']
iter2 = ['rxn02269_c', 'rxn13139_c', 'rxn00620_c', 'rxn05293_c', 'rxn09341_c', 'rxn02286_c', 'rxn01953_c', 'rxn02011_c',
         'rxn07466_c', 'rxn09429_c', 'rxn09126_c', 'rxn09124_c', 'rxn13140_c', 'rxn09065_c', 'rxn01520_c', 'rxn00553_c',
         'rxn03852_c', 'rxn13914_c', 'rxn09063_c', 'rxn05744_c', 'rxn08040_c', 'rxn09163_c']
iter3 = ['rxn02269_c', 'rxn09145_c', 'rxn13139_c', 'rxn00620_c', 'rxn05293_c', 'rxn02286_c', 'rxn09147_c', 'rxn01953_c', 'rxn00605_c',
         'rxn02011_c', 'rxn00579_c', 'rxn07466_c', 'rxn09429_c', 'rxn03852_c', 'rxn13140_c', 'rxn09065_c', 'rxn03164_c', 'rxn01520_c',
         'rxn09063_c', 'rxn09348_c', 'rxn05744_c', 'rxn08040_c', 'rxn09163_c']
iter4 = ['rxn02269_c', 'rxn13139_c', 'rxn00620_c', 'rxn05293_c', 'rxn02286_c', 'rxn01953_c', 'rxn00605_c', 'rxn02011_c', 'rxn00579_c',
         'rxn07466_c', 'rxn09429_c', 'rxn09126_c', 'rxn09124_c', 'rxn13140_c', 'rxn09065_c', 'rxn01520_c', 'rxn03852_c', 'rxn13914_c',
         'rxn09063_c', 'rxn09348_c', 'rxn05744_c', 'rxn08040_c', 'rxn09163_c']
new_rxn_ids = set(iter1 + iter2 + iter3 + iter4)


iter1_mdm = ['rxn01014_c', 'rxn10175_c', 'rxn02476_c', 'rxn00777_c', 'rxn01359_c', 'rxn12676_c', 'rxn02928_c', 'rxn01538_c', 
             'rxn01182_c', 'rxn12239_c', 'rxn03167_c', 'rxn05039_c', 'rxn10484_c', 'rxn05291_c', 'rxn10030_c', 'rxn01256_c',
             'rxn01644_c', 'rxn08131_c', 'rxn00530_c', 'rxn00010_c', 'rxn10053_c', 'rxn01669_c']
iter2_mdm = ['rxn01014_c', 'rxn10175_c', 'rxn02476_c', 'rxn00777_c', 'rxn00970_c', 'rxn13251_c', 'rxn02928_c', 'rxn01538_c', 
             'rxn12239_c', 'rxn03167_c', 'rxn05039_c', 'rxn10484_c', 'rxn05291_c', 'rxn01256_c', 'rxn01644_c', 'rxn08131_c',
             'rxn00530_c', 'rxn00958_c', 'rxn00010_c', 'rxn10053_c', 'rxn01669_c','rxn01539_c']
iter3_mdm = ['rxn01014_c', 'rxn10175_c', 'rxn02476_c', 'rxn00777_c', 'rxn12676_c', 'rxn13251_c', 'rxn02928_c', 'rxn01538_c',
             'rxn01182_c', 'rxn12239_c', 'rxn03167_c', 'rxn05039_c', 'rxn10484_c', 'rxn10030_c', 'rxn01256_c', 'rxn01644_c',
             'rxn08131_c', 'rxn00530_c', 'rxn00010_c', 'rxn10053_c', 'rxn01669_c']
mdm_rxn_ids = set(iter1_mdm + iter2_mdm + iter3_mdm)


iter1_ncmm = ['rxn00285_c', 'rxn05227_c', 'rxn10036_c', 'rxn10840_c', 'rxn00341_c', 'rxn13012_c', 'rxn09119_c',
              'rxn10663_c']
iter2_ncmm = ['rxn00285_c', 'rxn05227_c', 'rxn10036_c', 'rxn10840_c', 'rxn00341_c', 'rxn13012_c', 'rxn09119_c',
              'rxn10663_c']
ncmm_rxn_ids= set(iter1_ncmm + iter2_ncmm)


final_gapfilled = new_rxn_ids.union(mdm_rxn_ids)
final_gapfilled = final_gapfilled.union(ncmm_rxn_ids)
for x in final_gapfilled:
    print(x + '\t' + iCdR703.reactions.get_by_id(x).name)
iCdR703
# Read in gene list from iCdR703
genre_genes = set()
for gene in iCdR703.genes: genre_genes |= set([gene.id])

# Parse PATRIC lookup table
refseq_dict = {}
gene_dict = {}
with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/transcript/tamayo_etal/phase_variation/CdR20291_genes.tsv', 'r') as gene_catalog:
    header = gene_catalog.readline()
    for line in gene_catalog:
        line = line.split()
        if not line[0] in genre_genes:
            continue
        else:
            refseq_dict[line[1]] = line[0]
            gene_dict[line[2]] = line[0]
mapping_genes = ['rsbW','sigB','16S rRNA_1','23S rRNA_1','5S rRNA_1','CDR20291_0001','CDR20291_0002','serS1','CDR20291_0004','dnaH','CDR20291_0006','recD','CDR20291_0008','16S rRNA_2','23S rRNA_2','5S rRNA_2','CDR20291_0009','pyc','CDR20291_0011','ctsR','CDR20291_0013','CDR20291_0014','clpC','radA','CDR20291_0017','CDR20291_0018','CDR20291_0019','CDR20291_0020','CDR20291_0021','CDR20291_0022','CDR20291_0023','CDR20291_0024','acoA','acoB','acoC','acoL','CDR20291_0029','CDR20291_0030','CDR20291_0031','CDR20291_0032','CDR20291_0033','CDR20291_0034','CDR20291_0035','ispD_1','ispF','proS','CDR20291_0039','gltX','cysS','CDR20291_0042','CDR20291_0043','CDR20291_0044','CDR20291_0045','CDR20291_0046','CDR20291_0047','CDR20291_0048','CDR20291_0049','sigH','CDR20291_0051','rpmG','secE','nusG','rplK','rplA','rplJ','rplL','CDR20291_0059','rpoB','rpoC','rpsL','rpsG','fusA','CDR20291_0065','rpsJ','rplC','rplD','rplW','rplB','rpsS','rplV','rpsC','rplP','rpmC','rpsQ','rplN','rplX','rplE','rpsN','rpsH','rplF','rplR','rpsE','rpmD','rplO','prlA','adk','map1','CDR20291_0090','infA','rpmJ','rpsM','rpsK','rpsD','rpoA','rplQ','CDR20291_0098','CDR20291_0099','CDR20291_0100','truA1','CDR20291_0102','rpsI','cwlD','16S rRNA_3','23S rRNA_3','16S rRNA_4','23S rRNA_4','5S rRNA_3','aspC','nrdD','nrdG','23S rRNA_5','5S rRNA_4','CDR20291_0108','CDR20291_0109','CDR20291_0110','ptb','buk','CDR20291_0113','CDR20291_0114','CDR20291_0115','CDR20291_0116','CDR20291_0117','CDR20291_0118','glmS','CDR20291_0120','CDR20291_0121','murA','spoIIC','CDR20291_0124','spoIIID','mreB1','fabZ','CDR20291_0128','metE','CDR20291_0130','CDR20291_0131','CDR20291_0132','CDR20291_0133','CDR20291_0134','CDR20291_0135','CDR20291_0136','CDR20291_0137','CDR20291_0138','CDR20291_0139','CDR20291_0140','CDR20291_0141','secA1','prfB','CDR20291_0144','CDR20291_0145','CDR20291_0146','CDR20291_0147','CDR20291_0148','CDR20291_0149','rimI','gcp_1','hpdB','hpdC','hpdA','CDR20291_0155','CDR20291_0156','CDR20291_0157','CDR20291_0158','CDR20291_0159','CDR20291_0160','CDR20291_0161','CDR20291_0162','CDR20291_0163','CDR20291_0164','CDR20291_0165','CDR20291_0166','CDR20291_0167','CDR20291_0168','CDR20291_0169','CDR20291_0170','CDR20291_0171','CDR20291_0172','fdxA','CDR20291_0174','CDR20291_0175','CDR20291_0176','CDR20291_0177','CDR20291_0178','CDR20291_0179','gluD','CDR20291_0181','CDR20291_0182','CDR20291_0183','CDR20291_0184','pyrB','pyrK','pyrD_1','pyrE','CDR20291_0189','CDR20291_0190','CDR20291_0191','CDR20291_0192','cls_1','groES','groEL','CDR20291_0196','CDR20291_0197','guaA','CDR20291_0199','CDR20291_0200','CDR20291_0201','CDR20291_0202','CDR20291_0203','CDR20291_0204','CDR20291_0205','CDR20291_0206','CDR20291_0207','CDR20291_0208','CDR20291_0209','CDR20291_0210','CDR20291_0211','CDR20291_0212','CDR20291_0213','CDR20291_0214','purE','purC','purF','purG','purN','purH','purD','purL','CDR20291_0223','CDR20291_0224','CDR20291_0225','CDR20291_0226','CDR20291_0227','CDR20291_0228','fliN_1','flgM','CDR20291_0231','flgK','flgL','CDR20291_0234','csrA','fliS1','fliS2','fliD','CDR20291_0239','fliC','CDR20291_0241','CDR20291_0242','CDR20291_0243','CDR20291_0244','CDR20291_0245','CDR20291_0246','CDR20291_0247','flgB','flgC','fliE','fliF','fliG','fliH','fliI','fliJ','fliK','flgD','flgE','CDR20291_0259','motA','motB','fliL','CDR20291_0263','fliP','fliQ','flhB','flhA','flhF','fleN','fliA','CDR20291_0271','flgG','CDR20291_0273','fliM','fliN_2','CDR20291_0276','htpG','dhaT','spl','CDR20291_0280','CDR20291_0281','CDR20291_0282','CDR20291_0283','CDR20291_0284','CDR20291_0285','CDR20291_0286','CDR20291_0287','CDR20291_0288','CDR20291_0289','CDR20291_0290','CDR20291_0291','CDR20291_0292','CDR20291_0293','CDR20291_0294','CDR20291_0295','CDR20291_0296','CDR20291_0297','CDR20291_0298','CDR20291_0299','CDR20291_0300','rbsR','rbsK','rbsB','rbsA','rbsC','argE','CDR20291_0307','abgB1','CDR20291_0309','CDR20291_0310','CDR20291_0311','CDR20291_0312','CDR20291_0313','CDR20291_0314','CDR20291_0315','CDR20291_0316','CDR20291_0317','CDR20291_0318','16S rRNA_5','23S rRNA_6','5S rRNA_5','CDR20291_0319','CDR20291_0320','CDR20291_0321','CDR20291_0322','CDR20291_0323','CDR20291_0324','CDR20291_0325','CDR20291_0326','CDR20291_0327','CDR20291_0328','cbiM','cbiN','cbiQ','cbiO','pcrA','CDR20291_0334','CDR20291_0335','ppiB','CDR20291_0337','ppaC','adhE_1','CDR20291_0340','CDR20291_0341','CDR20291_0342','CDR20291_0343','CDR20291_0344','CDR20291_0345','CDR20291_0346','CDR20291_0347','CDR20291_0348','CDR20291_0349','CDR20291_0350','CDR20291_0351','CDR20291_0352','CDR20291_0353','CDR20291_0354','CDR20291_0355','CDR20291_0356','CDR20291_0357','CDR20291_0358','bglF_1','bglA','bglG_1','CDR20291_0362','CDR20291_0363','CDR20291_0364','ldhA','hadA','hadI','hadB','hadC','acdB','etfB1','etfA1','CDR20291_0373','fba','CDR20291_0375','CDR20291_0376','CDR20291_0377','CDR20291_0378','CDR20291_0379','CDR20291_0380','CDR20291_0381','CDR20291_0382','CDR20291_0383','rocR','CDR20291_0385','CDR20291_0386','CDR20291_0387','oraS','oraE','CDR20291_0390','CDR20291_0391','CDR20291_0392','CDR20291_0393','CDR20291_0394','CDR20291_0395','CDR20291_0396','CDR20291_0397','CDR20291_0398','CDR20291_0399','CDR20291_0400','CDR20291_0401','CDR20291_0402','CDR20291_0403','CDR20291_0404','CDR20291_0405','CDR20291_0406','CDR20291_0407','CDR20291_0408','CDR20291_0409','malL','CDR20291_0411','blaR','blaI','CDR20291_0414','CDR20291_0415','CDR20291_0416','CDR20291_0417','CDR20291_0418','CDR20291_0419','spaF','spaE','spaG','spaR','spaK','CDR20291_0425','CDR20291_0426','CDR20291_0427','CDR20291_0428','CDR20291_0429','CDR20291_0430','sugE','CDR20291_0432','CDR20291_0433','CDR20291_0434','CDR20291_0435','CDR20291_0436','CDR20291_0437','CDR20291_0438','CDR20291_0439','CDR20291_0440','CDR20291_0441','CDR20291_0442','CDR20291_0443','CDR20291_0444','CDR20291_0445','CDR20291_0446','CDR20291_0447','CDR20291_0448','CDR20291_0449','CDR20291_0450','CDR20291_0451','CDR20291_0452','CDR20291_0453','CDR20291_0454','CDR20291_0455','CDR20291_0456','CDR20291_0457','cheB','cheC','cheD','cheW','CDR20291_0462','CDR20291_0463','cheA','CDR20291_0465','cheR','CDR20291_0467','CDR20291_0468','CDR20291_0469','CDR20291_0470','CDR20291_0471','CDR20291_0472','CDR20291_0473','CDR20291_0474','CDR20291_0475','sleC','sleB','CDR20291_0478','sip2_1','sip2_2','CDR20291_0481','CDR20291_0482','glsA','CDR20291_0484','nfo','CDR20291_0486','CDR20291_0487','CDR20291_0488','CDR20291_0489','nth','CDR20291_0491','CDR20291_0492','CDR20291_0493','CDR20291_0494','CDR20291_0495','CDR20291_0496','CDR20291_0497','thrS','CDR20291_0499','CDR20291_0500','CDR20291_0501','CDR20291_0502','CDR20291_0503','CDR20291_0504','CDR20291_0505','CDR20291_0506','gapN','CDR20291_0508','CDR20291_0509','CDR20291_0510','CDR20291_0511','CDR20291_0512','CDR20291_0513','CDR20291_0514','CDR20291_0515','CDR20291_0516','CDR20291_0517','CDR20291_0518','CDR20291_0519','CDR20291_0520','CDR20291_0521','cotJB1','cotJC1','ogt1','CDR20291_0525','CDR20291_0526','CDR20291_0527','CDR20291_0528','CDR20291_0529','CDR20291_0530','CDR20291_0531','CDR20291_0532','CDR20291_0533','CDR20291_0534','CDR20291_0535','CDR20291_0536','CDR20291_0537','CDR20291_0538','CDR20291_0539','CDR20291_0540','CDR20291_0541','CDR20291_0542','CDR20291_0543','CDR20291_0544','CDR20291_0545','CDR20291_0546','CDR20291_0547','CDR20291_0548','CDR20291_0549','CDR20291_0550','CDR20291_0551','CDR20291_0552','CDR20291_0553','CDR20291_0554','CDR20291_0555','CDR20291_0556','CDR20291_0557','CDR20291_0558','CDR20291_0559','CDR20291_0560','CDR20291_0561','CDR20291_0562','CDR20291_0563','CDR20291_0564','CDR20291_0565','CDR20291_0566','CDR20291_0567','CDR20291_0568','CDR20291_0569','CDR20291_0570','CDR20291_0571','CDR20291_0572','CDR20291_0573','CDR20291_0574','CDR20291_0575','CDR20291_0576','CDR20291_0577','CDR20291_0578','u2','u1','tcdD','tcdB','tcdE','tcdA','dtxA','d1','CDR20291_0587','d2','d3','d4','CDR20291_0591','CDR20291_0592','CDR20291_0593','CDR20291_0594','CDR20291_0595','CDR20291_0596','CDR20291_0597','CDR20291_0598','CDR20291_0599','CDR20291_0600','CDR20291_0601','CDR20291_0602','CDR20291_0603','CDR20291_0604','CDR20291_0605','CDR20291_0606','CDR20291_0607','CDR20291_0608','CDR20291_0609','CDR20291_0610','infC','rpmI','rplT','CDR20291_0614','CDR20291_0615','CDR20291_0616','CDR20291_0617','CDR20291_0618','CDR20291_0619','CDR20291_0620','CDR20291_0621','CDR20291_0622','CDR20291_0623','CDR20291_0624','pheS','pheT','CDR20291_0627','CDR20291_0628','CDR20291_0629','CDR20291_0630','CDR20291_0631','CDR20291_0632','CDR20291_0633','pepD','CDR20291_0635','CDR20291_0636','argS','CDR20291_0638','CDR20291_0639','CDR20291_0640','CDR20291_0641','CDR20291_0642','cooS','cooC','fhs','fchA','folD','CDR20291_0648','CDR20291_0649','CDR20291_0650','CDR20291_0651','CDR20291_0652','CDR20291_0653','CDR20291_0654','CDR20291_0655','gcvH','CDR20291_0657','CDR20291_0658','CDR20291_0659','CDR20291_0660','CDR20291_0661','CDR20291_0662','CDR20291_0663','hisK','CDR20291_0665','CDR20291_0666','CDR20291_0667','CDR20291_0668','glpK1','CDR20291_0670','CDR20291_0671','CDR20291_0672','CDR20291_0673','CDR20291_0674','CDR20291_0675','CDR20291_0676','CDR20291_0677','CDR20291_0678','CDR20291_0679','CDR20291_0680','iscS1','thiI','CDR20291_0683','CDR20291_0684','CDR20291_0685','plfA','plfB','CDR20291_0688','CDR20291_0689','CDR20291_0690','gutM','gutA','srlE_1','srlE',
'srlB_1','gutD','CDR20291_0697','CDR20291_0698','spoIIAA','spoIIAB','sigF','spoVAC','spoVAD','spoVAE','CDR20291_0705','CDR20291_0706','CDR20291_0707','CDR20291_0708','CDR20291_0709','CDR20291_0710','CDR20291_0711','CDR20291_0712','CDR20291_0713','CDR20291_0714','CDR20291_0715','CDR20291_0716','CDR20291_0717','CDR20291_0718','CDR20291_0719','CDR20291_0720','CDR20291_0721','CDR20291_0722','CDR20291_0723','CDR20291_0724','nadE','CDR20291_0726','CDR20291_0727','CDR20291_0728','CDR20291_0729','act','crt1','CDR20291_0732','CDR20291_0733','CDR20291_0734','CDR20291_0735','CDR20291_0736','CDR20291_0737','CDR20291_0738','CDR20291_0739','CDR20291_0740','floX','CDR20291_0742','CDR20291_0743','CDR20291_0744','CDR20291_0745','CDR20291_0746','CDR20291_0747','CDR20291_0748','CDR20291_0749','CDR20291_0750','CDR20291_0751','CDR20291_0752','CDR20291_0753','CDR20291_0754','rbr_1','CDR20291_0756','rbo','CDR20291_0758','CDR20291_0759','CDR20291_0760','CDR20291_0761','CDR20291_0762','CDR20291_0763','CDR20291_0764','CDR20291_0765','CDR20291_0766','CDR20291_0767','CDR20291_0768','CDR20291_0769','CDR20291_0770','CDR20291_0771','CDR20291_0772','CDR20291_0773','CDR20291_0774','CDR20291_0775','CDR20291_0776','CDR20291_0777','CDR20291_0778','abgB2','CDR20291_0780','CDR20291_0781','CDR20291_0782','oppB','oppC','oppA','oppD','oppF','CDR20291_0788','CDR20291_0789','CDR20291_0790','CDR20291_0791','CDR20291_0792','CDR20291_0793','CDR20291_0794','CDR20291_0795','CDR20291_0796','CDR20291_0797','modA','modB_1','modC','maa','CDR20291_0802','CDR20291_0803','CDR20291_0804','CDR20291_0805','CDR20291_0806','CDR20291_0807','CDR20291_0808','tlpB_1','CDR20291_0810','CDR20291_0811','glgC','glgD','glgA','glgP','CDR20291_0816','CDR20291_0817','speA_1','speD','speE','speB','cspA','CDR20291_0823','CDR20291_0824','CDR20291_0825','tlpB_2','CDR20291_0827','CDR20291_0828','dinB','opuCA','opuCC','CDR20291_0832','CDR20291_0833','CDR20291_0834','CDR20291_0835','CDR20291_0836','CDR20291_0837','CDR20291_0838','CDR20291_0839','CDR20291_0840','CDR20291_0841','leuA','leuC','leuD','leuB','CDR20291_0846','CDR20291_0847','serA','CDR20291_0849','CDR20291_0850','CDR20291_0851','CDR20291_0852','CDR20291_0853','CDR20291_0854','CDR20291_0855','fumA','fumB','CDR20291_0858','CDR20291_0859','CDR20291_0860','CDR20291_0861','CDR20291_0862','CDR20291_0863','CDR20291_0864','CDR20291_0865','nagA','glmD','CDR20291_0868','CDR20291_0869','CDR20291_0870','CDR20291_0871','CDR20291_0872','CDR20291_0873','CDR20291_0874','CDR20291_0875','CDR20291_0876','CDR20291_0877','CDR20291_0878','CDR20291_0879','potA','potB','potC','potD','CDR20291_0884','CDR20291_0885','CDR20291_0886','CDR20291_0887','CDR20291_0888','mnaA','CDR20291_0890','16S rRNA_6','23S rRNA_7','5S rRNA_6','CDR20291_0891','CDR20291_0892','CDR20291_0893','CDR20291_0894','CDR20291_0895','addB','addA','sbcD','sbcC','CDR20291_0900','CDR20291_0901','pepT','CDR20291_0903','CDR20291_0904','CDR20291_0905','CDR20291_0906','CDR20291_0907','CDR20291_0908','CDR20291_0909','bcd2','etfB2','etfA2','crt2','hbd','thlA1','CDR20291_0916','CDR20291_0917','acpP_1','CDR20291_0919','CDR20291_0920','CDR20291_0921','CDR20291_0922','ccpA','CDR20291_0924','CDR20291_0925','CDR20291_0926','CDR20291_0927','CDR20291_0928','CDR20291_0929','CDR20291_0930','CDR20291_0931','CDR20291_0932','CDR20291_0933','CDR20291_0934','CDR20291_0935','CDR20291_0936','CDR20291_0937','CDR20291_0938','CDR20291_0939','moeA','mobB','CDR20291_0942','CDR20291_0943','CDR20291_0944','CDR20291_0945','zupT','CDR20291_0947','CDR20291_0948','CDR20291_0949','CDR20291_0950','dhaB1','dhaB2','CDR20291_0953','CDR20291_0954','CDR20291_0955','CDR20291_0956','CDR20291_0957','CDR20291_0958','CDR20291_0959','CDR20291_0960','CDR20291_0961','CDR20291_0962','CDR20291_0963','polA','coaE','CDR20291_0966','CDR20291_0967','CDR20291_0968','CDR20291_0969','gloA','CDR20291_0971','CDR20291_0972','rnfC','rnfD','rnfG','rnfE','rnfA','rnfB','CDR20291_0979','maf','radC','mreB2','mreC','CDR20291_0984','CDR20291_0985','minC','divIVB','minE','mrdB','mgsA','CDR20291_0991','CDR20291_0992','CDR20291_0993','norV','CDR20291_0995','CDR20291_0996','cafA','rplU','CDR20291_0999','rpmA','obg','CDR20291_1002','hom1','CDR20291_1004','CDR20291_1005','CDR20291_1006','CDR20291_1007','etfB3','etfA3','CDR20291_1010','CDR20291_1011','ackA','CDR20291_1013','rpmF','fapR','plsX','fabH','fabK','fabD','fabG','acpP_2','fabF','CDR20291_1023','CDR20291_1024','CDR20291_1025','CDR20291_1026','CDR20291_1027','CDR20291_1028','fbp','spoIIIAA','spoIIIAB','spoIIIAC','spoIIIAD','spoIIIAE','spoiIIIAF','spoIIIAG','spoIIIAH','CDR20291_1038','nusB','gcp_2','xseA','xseB','ispA','CDR20291_1044','dxs','CDR20291_1046','recN','CDR20291_1048','CDR20291_1049','bltD','spoIVB','spo0A','CDR20291_1053','CDR20291_1054','CDR20291_1055','CDR20291_1056','CDR20291_1057','nudF','CDR20291_1059','xerD1','deoB','deoD','deoA','CDR20291_1064','CDR20291_1065','CDR20291_1066','CDR20291_1067','CDR20291_1068','CDR20291_1069','CDR20291_1070','CDR20291_1071','CDR20291_1072','CDR20291_1073','CDR20291_1074','CDR20291_1075','CDR20291_1076','CDR20291_1077','CDR20291_1078','vanZ','CDR20291_1080','CDR20291_1081','CDR20291_1082','CDR20291_1083','CDR20291_1084','efp','CDR20291_1086','rnc','CDR20291_1088','smc','ftsY','CDR20291_1091','ffh','rpsP','CDR20291_1094','rimM','trmD','rplS','CDR20291_1098','CDR20291_1099','CDR20291_1100','CDR20291_1101','rnhB','CDR20291_1103','CDR20291_1104','CDR20291_1105','CDR20291_1106','CDR20291_1107','CDR20291_1108','CDR20291_1109','CDR20291_1110','CDR20291_1111','CDR20291_1112','CDR20291_1113','topA','codY','CDR20291_1116','CDR20291_1117','CDR20291_1118','iscS2','CDR20291_1120','trmU','alaS','CDR20291_1123','CDR20291_1124','CDR20291_1125','CDR20291_1126','fur','CDR20291_1128','CDR20291_1129','CDR20291_1130','dacF','CDR20291_1132','CDR20291_1133','CDR20291_1134','scpA','scpB','CDR20291_1137','CDR20291_1138','CDR20291_1139','pepA','CDR20291_1141','CDR20291_1142','CDR20291_1143','CDR20291_1144','acd','dnaF','CDR20291_1147','nusA','CDR20291_1149','CDR20291_1150','infB','rbfA','CDR20291_1153','truB','ribC','CDR20291_1156','rpsO','CDR20291_1158','comR','CDR20291_1160','CDR20291_1161','CDR20291_1162','dapG','tepA','ftsK','CDR20291_1166','CDR20291_1167','pgsA','recA','CDR20291_1170','CDR20291_1171','sip3','bacA1','xerD2','CDR20291_1175','CDR20291_1176','malX_1','CDR20291_1178','glvG','CDR20291_1180','CDR20291_1181','exoA','CDR20291_1183','CDR20291_1184','glnA','CDR20291_1186','CDR20291_1187','CDR20291_1188','CDR20291_1189','CDR20291_1190','CDR20291_1191','CDR20291_1192','CDR20291_1193','CDR20291_1194','CDR20291_1195','CDR20291_1196','cspB','CDR20291_1198','CDR20291_1199','CDR20291_1200','CDR20291_1201','CDR20291_1202','CDR20291_1203','CDR20291_1204','CDR20291_1205','CDR20291_1206','CDR20291_1207','CDR20291_1208','CDR20291_1209','CDR20291_1210','CDR20291_1211','CDR20291_1212','CDR20291_1213','CDR20291_1214','CDR20291_1215','CDR20291_1216','CDR20291_1217','CDR20291_1218','CDR20291_1219','CDR20291_1220','CDR20291_1221','CDR20291_1222','CDR20291_1223','CDR20291_1224','CDR20291_1225','CDR20291_1226','CDR20291_1227','glpK2','CDR20291_1229','CDR20291_1230','CDR20291_1231','CDR20291_1232','CDR20291_1233','CDR20291_1234','CDR20291_1235','CDR20291_1236','CDR20291_1237','CDR20291_1238','CDR20291_1239','CDR20291_1240','CDR20291_1241','CDR20291_1242','CDR20291_1243','CDR20291_1244','CDR20291_1245','CDR20291_1246','CDR20291_1247','glpQ','CDR20291_1249','CDR20291_1250','CDR20291_1251','CDR20291_1252','CDR20291_1253','CDR20291_1254','ddl','CDR20291_1256','CDR20291_1257','CDR20291_1258','CDR20291_1259','CDR20291_1260','CDR20291_1261','CDR20291_1262','CDR20291_1263','CDR20291_1264','CDR20291_1265','CDR20291_1266','CDR20291_1267','CDR20291_1268','CDR20291_1269','CDR20291_1270','CDR20291_1271','CDR20291_1272','CDR20291_1273','CDR20291_1274','CDR20291_1275','CDR20291_1276','CDR20291_1277','CDR20291_1278','CDR20291_1279','CDR20291_1280','CDR20291_1281','CDR20291_1282','CDR20291_1283','CDR20291_1284','CDR20291_1285','CDR20291_1286','CDR20291_1287','CDR20291_1288','CDR20291_1289','CDR20291_1290','CDR20291_1291','CDR20291_1292','CDR20291_1293','pabA','pabB','pabC','CDR20291_1297','folE','folP','folB','folK','CDR20291_1302','dnaG','rpoD1','CDR20291_1305','CDR20291_1306','wrbA','CDR20291_1308','CDR20291_1309','CDR20291_1310','CDR20291_1311','CDR20291_1312','CDR20291_1313','CDR20291_1314','CDR20291_1315','CDR20291_1316','CDR20291_1317','CDR20291_1318','CDR20291_1319','CDR20291_1320','CDR20291_1321','CDR20291_1322','CDR20291_1323','CDR20291_1324','CDR20291_1325','CDR20291_1326','feoA1','feoB1','CDR20291_1329','CDR20291_1330','ssuC','ssuB','ssuA','CDR20291_1334','CDR20291_1335','CDR20291_1336','CDR20291_1337','CDR20291_1338','metN','metI','metQ','CDR20291_1342','CDR20291_1343','CDR20291_1344','proC1','CDR20291_1346','CDR20291_1347','rpoD2','CDR20291_1349','deoC','CDR20291_1351','CDR20291_1352','CDR20291_1353','CDR20291_1354','CDR20291_1355','CDR20291_1356','CDR20291_1357','CDR20291_1358','CDR20291_1359','CDR20291_1360','panC','panB','CDR20291_1363','CDR20291_1364','CDR20291_1365','feoB2','feoA2','CDR20291_1368','CDR20291_1369','tyrR','CDR20291_1371','CDR20291_1372','CDR20291_1373','CDR20291_1374','pyrC','CDR20291_1376','CDR20291_1377','CDR20291_1378','CDR20291_1379','CDR20291_1380','CDR20291_1381','CDR20291_1382','CDR20291_1383','sseA','CDR20291_1385','aspB','CDR20291_1387','CDR20291_1388','CDR20291_1389','CDR20291_1390','CDR20291_1391','CDR20291_1392','CDR20291_1393','CDR20291_1394','CDR20291_1395','hisZ','hisG','hisC','hisB','hisH','hisA','hisF','hisI','CDR20291_1404','CDR20291_1405','CDR20291_1406','sigV','CDR20291_1408','CDR20291_1409','CDR20291_1410','CDR20291_1411','CDR20291_1412','ilvC','ilvB','CDR20291_1415','CDR20291_1416','CDR20291_1417','CDR20291_1418','CDR20291_1419','CDR20291_1420','CDR20291_1421','CDR20291_1422','CDR20291_1423','CDR20291_1424','CDR20291_1425','CDR20291_1426','CDR20291_1427','CDR20291_1428','CDR20291_1429','CDR20291_1430','CDR20291_1431','CDR20291_1432','CDR20291_1433','CDR20291_1434',
         'CDR20291_1435','CDR20291_1436','CDR20291_1437','CDR20291_1438','CDR20291_1439','CDR20291_1440','CDR20291_1441','CDR20291_1442','CDR20291_1443','CDR20291_1444','CDR20291_1445','CDR20291_1446','CDR20291_1447','CDR20291_1448','CDR20291_1449','CDR20291_1450','CDR20291_1451','CDR20291_1452','CDR20291_1453','CDR20291_1454','CDR20291_1455','CDR20291_1456','CDR20291_1457','CDR20291_1458','CDR20291_1459','CDR20291_1460','CDR20291_1461','CDR20291_1462','CDR20291_1463','CDR20291_1464','CDR20291_1465','CDR20291_1466','CDR20291_1467','CDR20291_1468','CDR20291_1469','CDR20291_1470','CDR20291_1471','CDR20291_1472','CDR20291_1473','pgm1','CDR20291_1475','CDR20291_1476','hom2','CDR20291_1478','hisD','CDR20291_1480','CDR20291_1481','CDR20291_1482','CDR20291_1483','CDR20291_1484','CDR20291_1485','CDR20291_1486','CDR20291_1487','CDR20291_1488','kdpA','kdpB','kdpC','cysM','cysA','map2','CDR20291_1495','CDR20291_1496','thiD','thiK','thiE1','CDR20291_1500','CDR20291_1501','CDR20291_1502','CDR20291_1503','CDR20291_1504','CDR20291_1505','CDR20291_1506','CDR20291_1507','CDR20291_1508','CDR20291_1509','CDR20291_1510','CDR20291_1511','CDR20291_1512','CDR20291_1513','CDR20291_1514','CDR20291_1515','CDR20291_1516','CDR20291_1517','CDR20291_1518','CDR20291_1519','CDR20291_1520','CDR20291_1521','vanR','vanS','vanG','CDR20291_1525','vanTG','CDR20291_1527','CDR20291_1528','sodA','asnB','CDR20291_1531','CDR20291_1532','CDR20291_1533','CDR20291_1534','CDR20291_1535','CDR20291_1536','CDR20291_1537','CDR20291_1538','CDR20291_1539','CDR20291_1540','CDR20291_1541','CDR20291_1542','CDR20291_1543','CDR20291_1544','CDR20291_1545','CDR20291_1546','CDR20291_1547','CDR20291_1548','CDR20291_1549','CDR20291_1550','CDR20291_1551','lplA','CDR20291_1553','CDR20291_1554','CDR20291_1555','gcvPB','CDR20291_1557','CDR20291_1558','CDR20291_1559','guaD','CDR20291_1561','cysK','CDR20291_1563','CDR20291_1564','CDR20291_1565','CDR20291_1566','CDR20291_1567','CDR20291_1568','CDR20291_1569','CDR20291_1570','CDR20291_1571','CDR20291_1572','pcp','CDR20291_1574','CDR20291_1575','CDR20291_1576','CDR20291_1577','CDR20291_1578','CDR20291_1579','iunH','CDR20291_1581','CDR20291_1582','CDR20291_1583','CDR20291_1584','CDR20291_1585','CDR20291_1586','CDR20291_1587','trxA1','trxB1','CDR20291_1590','CDR20291_1591','CDR20291_1592','CDR20291_1593','CDR20291_1594','ribH','ribA','ribB','ribD','recQ','thiC','thiS','thiF','thiG','thiH','thiE2','CDR20291_1606','CDR20291_1607','CDR20291_1608','CDR20291_1609','CDR20291_1610','moaB','moaA','moaC','CDR20291_1614','CDR20291_1615','CDR20291_1616','CDR20291_1617','CDR20291_1618','CDR20291_1619','CDR20291_1620','CDR20291_1621','CDR20291_1622','CDR20291_1623','CDR20291_1624','CDR20291_1625','CDR20291_1626','CDR20291_1627','CDR20291_1628','CDR20291_1629','CDR20291_1630','CDR20291_1631','CDR20291_1632','CDR20291_1633','CDR20291_1634','CDR20291_1635','CDR20291_1636','grdG','grdF','CDR20291_1639','gltC','add','CDR20291_1642','CDR20291_1643','hgdC','CDR20291_1645','CDR20291_1646','CDR20291_1647','CDR20291_1648','CDR20291_1649','CDR20291_1650','def1','CDR20291_1652','CDR20291_1653','CDR20291_1654','CDR20291_1655','CDR20291_1656','CDR20291_1657','CDR20291_1658','CDR20291_1659','CDR20291_1660','CDR20291_1661','gapA','CDR20291_1663','CDR20291_1664','ogt2','CDR20291_1666','CDR20291_1667','CDR20291_1668','CDR20291_1669','CDR20291_1670','CDR20291_1671','CDR20291_1672','CDR20291_1673','CDR20291_1674','CDR20291_1675','CDR20291_1676','CDR20291_1677','CDR20291_1678','truA2','argG','CDR20291_1681','CDR20291_1682','CDR20291_1683','CDR20291_1684','CDR20291_1685','CDR20291_1686','CDR20291_1687','CDR20291_1688','CDR20291_1689','CDR20291_1690','CDR20291_1691','CDR20291_1692','CDR20291_1693','CDR20291_1694','CDR20291_1695','CDR20291_1696','CDR20291_1697','CDR20291_1698','scrR','sacA','scrK','CDR20291_1702','CDR20291_1703','CDR20291_1704','CDR20291_1705','CDR20291_1706','CDR20291_1707','CDR20291_1708','CDR20291_1709','CDR20291_1710','cmk','CDR20291_1712','ispH','CDR20291_1714','ade','bcp','CDR20291_1717','CDR20291_1718','cysD','metA','CDR20291_1721','ftsH1','kdpD','kdpE','CDR20291_1725','CDR20291_1726','CDR20291_1727','aroB','aroA','aroC','pheA','aroE','aroK','tyrC','CDR20291_1735','CDR20291_1736','CDR20291_1737','CDR20291_1738','CDR20291_1739','CDR20291_1740','CDR20291_1741','CDR20291_1742','CDR20291_1743','CDR20291_1744','CDR20291_1745','CDR20291_1746','CDR20291_1747','CDR20291_1748','CDR20291_1749','CDR20291_1750','CDR20291_1751','CDR20291_1752','CDR20291_1753','CDR20291_1754','CDR20291_1755','CDR20291_1756','CDR20291_1757','CDR20291_1758','CDR20291_1759','CDR20291_1760','CDR20291_1761','CDR20291_1762','CDR20291_1763','CDR20291_1764','CDR20291_1765','yobD','CDR20291_1767','CDR20291_1768','CDR20291_1769','CDR20291_1770','CDR20291_1771','CDR20291_1772','CDR20291_1773','CDR20291_1774','CDR20291_1775','CDR20291_1776','CDR20291_1777','CDR20291_1778','CDR20291_1779','CDR20291_1780','CDR20291_1781','CDR20291_1782','CDR20291_1783','CDR20291_1784','CDR20291_1785','CDR20291_1786','CDR20291_1787','CDR20291_1788','CDR20291_1789','CDR20291_1790','CDR20291_1791','CDR20291_1792','CDR20291_1793','CDR20291_1794','CDR20291_1795','CDR20291_1796','CDR20291_1797','CDR20291_1798','CDR20291_1799','CDR20291_1800','CDR20291_1801','CDR20291_1802','CDR20291_1803','CDR20291_1804','CDR20291_1805','vncR','vncS','CDR20291_1808','CDR20291_1809','CDR20291_1810','CDR20291_1811','CDR20291_1812','CDR20291_1813','CDR20291_1814','CDR20291_1815','CDR20291_1816','CDR20291_1817','CDR20291_1818','CDR20291_1819','CDR20291_1820','CDR20291_1821','CDR20291_1822','CDR20291_1823','CDR20291_1824','CDR20291_1825','CDR20291_1826','CDR20291_1827','pduQ','pduU','pduV','CDR20291_1831','CDR20291_1832','eutA','eutB','eutC','eutL','CDR20291_1837','CDR20291_1838','eutM','eutT','CDR20291_1841','CDR20291_1842','eutN','CDR20291_1844','eutH','eutQ','CDR20291_1847','CDR20291_1848','CDR20291_1849','CDR20291_1850','CDR20291_1851','CDR20291_1852','CDR20291_1853','dinR','CDR20291_1855','CDR20291_1856','CDR20291_1857','spoVS','accA','accD','accC','accB','CDR20291_1863','CDR20291_1864','CDR20291_1865','CDR20291_1866','CDR20291_1867','CDR20291_1868','CDR20291_1869','CDR20291_1870','CDR20291_1871','CDR20291_1872','CDR20291_1873','CDR20291_1874','CDR20291_1875','CDR20291_1876','CDR20291_1877','CDR20291_1878','CDR20291_1879','CDR20291_1880','CDR20291_1881','CDR20291_1882','CDR20291_1883','CDR20291_1884','CDR20291_1885','CDR20291_1886','CDR20291_1887','CDR20291_1888','CDR20291_1889','CDR20291_1890','CDR20291_1891','CDR20291_1892','CDR20291_1893','CDR20291_1894','CDR20291_1895','CDR20291_1896','hfQ','miaA','mutL','mutS','CDR20291_1901','CDR20291_1902','CDR20291_1903','CDR20291_1904','CDR20291_1905','CDR20291_1906','CDR20291_1907','CDR20291_1908','CDR20291_1909','CDR20291_1910','CDR20291_1911','trpP','CDR20291_1913','CDR20291_1914','cspC_1','CDR20291_1916','CDR20291_1917','CDR20291_1918','CDR20291_1919','CDR20291_1920','CDR20291_1921','CDR20291_1922','CDR20291_1923','CDR20291_1924','fldX','ispD_2','ilvD','CDR20291_1928','CDR20291_1929','CDR20291_1930','CDR20291_1931','CDR20291_1932','clpB','CDR20291_1934','CDR20291_1935','CDR20291_1936','CDR20291_1937','CDR20291_1938','CDR20291_1939','CDR20291_1940','racX','CDR20291_1942','argF','argM','argB','argJ','argC','CDR20291_1948','CDR20291_1949','CDR20291_1950','CDR20291_1951','CDR20291_1952','CDR20291_1953','CDR20291_1954','CDR20291_1955','CDR20291_1956','rluB','CDR20291_1958','CDR20291_1959','lysA','lysC','CDR20291_1962','CDR20291_1963','CDR20291_1964','CDR20291_1965','glnS','CDR20291_1967','CDR20291_1968','CDR20291_1969','CDR20291_1970','CDR20291_1971','CDR20291_1972','CDR20291_1973','CDR20291_1974','CDR20291_1975','CDR20291_1976','CDR20291_1977','CDR20291_1978','CDR20291_1979','xdhA1','pucC1','pbuX_1','CDR20291_1983','pyrD_2','CDR20291_1985','xdhA2','pucC2','xdhC','CDR20291_1989','CDR20291_1990','CDR20291_1991','dpaL1','CDR20291_1993','CDR20291_1994','cutS','CDR20291_1996','CDR20291_1997','CDR20291_1998','CDR20291_1999','CDR20291_2000','CDR20291_2001','CDR20291_2002','CDR20291_2003','CDR20291_2004','CDR20291_2005','CDR20291_2006','CDR20291_2007','CDR20291_2008','CDR20291_2009','CDR20291_2010','CDR20291_2011','CDR20291_2012','CDR20291_2013','CDR20291_2014','CDR20291_2015','CDR20291_2016','fsaB','CDR20291_2018','CDR20291_2019','CDR20291_2020','CDR20291_2021','CDR20291_2022','bipA','CDR20291_2024','thrC','thrB','CDR20291_2027','CDR20291_2028','CDR20291_2029','CDR20291_2030','CDR20291_2031','CDR20291_2032','CDR20291_2033','CDR20291_2034','ispG','CDR20291_2036','dxr','CDR20291_2038','CDR20291_2039','CDR20291_2040','sA','uppS_1','CDR20291_2043','rrf','pyrH','tsf','rpsB','CDR20291_2048','CDR20291_2049','CDR20291_2050','CDR20291_2051','CDR20291_2052','CDR20291_2053','CDR20291_2054','CDR20291_2055','CDR20291_2056','CDR20291_2057','CDR20291_2058','CDR20291_2059','CDR20291_2060','CDR20291_2061','CDR20291_2062','CDR20291_2063','gabT','CDR20291_2065','CDR20291_2066','CDR20291_2067','CDR20291_2068','CDR20291_2069','ldh','CDR20291_2071','msrAB','CDR20291_2073','hcp','CDR20291_2075','CDR20291_2076','CDR20291_2077','CDR20291_2078','CDR20291_2079','CDR20291_2080','CDR20291_2081','CDR20291_2082','CDR20291_2083','CDR20291_2084','CDR20291_2085','CDR20291_2086','CDR20291_2087','csdA','CDR20291_2089','CDR20291_2090','CDR20291_2091','CDR20291_2092','CDR20291_2093','mapA','pgmB_1','CDR20291_2096','CDR20291_2097','CDR20291_2098','CDR20291_2099','CDR20291_2100','CDR20291_2101','CDR20291_2102','CDR20291_2103','CDR20291_2104','CDR20291_2105','CDR20291_2106','CDR20291_2107','CDR20291_2108','CDR20291_2109','CDR20291_2110','CDR20291_2111','CDR20291_2112','aldH','CDR20291_2114','CDR20291_2115','CDR20291_2116','CDR20291_2117','CDR20291_2118','CDR20291_2119','CDR20291_2120','CDR20291_2121','CDR20291_2122','CDR20291_2123','aroD','sat','CDR20291_2126','CDR20291_2127','CDR20291_2128','nirC','asrC','asrB','asrA','CDR20291_2133','CDR20291_2134','CDR20291_2135','CDR20291_2136','CDR20291_2137','CDR20291_2138','nanA','nanE','CDR20291_2141',
         'CDR20291_2142','CDR20291_2143','asnS','CDR20291_2145','cspC_2','cspBA','CDR20291_2148','CDR20291_2149','CDR20291_2150','CDR20291_2151','kamA','CDR20291_2153','CDR20291_2154','CDR20291_2155','CDR20291_2156','CDR20291_2157','CDR20291_2158','CDR20291_2159','CDR20291_2160','CDR20291_2161','CDR20291_2162','CDR20291_2163','CDR20291_2164','CDR20291_2165','CDR20291_2166','CDR20291_2167','fruK','CDR20291_2169','CDR20291_2170','CDR20291_2171','CDR20291_2172','CDR20291_2173','CDR20291_2174','CDR20291_2175','araD','CDR20291_2177','CDR20291_2178','CDR20291_2179','CDR20291_2180','CDR20291_2181','CDR20291_2182','CDR20291_2183','CDR20291_2184','CDR20291_2185','CDR20291_2186','CDR20291_2187','CDR20291_2188','CDR20291_2189','CDR20291_2190','CDR20291_2191','CDR20291_2192','CDR20291_2193','CDR20291_2194','CDR20291_2195','CDR20291_2196','CDR20291_2197','cspD','CDR20291_2200','modB_2','CDR20291_2202','CDR20291_2203','CDR20291_2204','CDR20291_2205','CDR20291_2206','CDR20291_2207','rpe','rpiB1','tkt\'_1','tkt_1','CDR20291_2212','gatD','gatC','gatB','gatA','CDR20291_2217','tal1','xpt','mtlD','mtlF','mtlR','mtlA','guaB','CDR20291_2225','CDR20291_2226','abfH','abfT','CDR20291_2229','abfD','sucD','cat1','CDR20291_2233','CDR20291_2234','CDR20291_2235','CDR20291_2236','grdD','grdC','grdB','grdA','grdE','trxA2','trxB3','grdX','CDR20291_2245','CDR20291_2246','CDR20291_2247','CDR20291_2248','CDR20291_2249','CDR20291_2250','CDR20291_2251','CDR20291_2252','CDR20291_2253','CDR20291_2254','CDR20291_2255','CDR20291_2256','nadC','nadB','nadA','CDR20291_2260','CDR20291_2261','CDR20291_2262','CDR20291_2263','CDR20291_2264','CDR20291_2265','CDR20291_2266','iorB','iorA','CDR20291_2269','CDR20291_2270','CDR20291_2271','CDR20291_2272','CDR20291_2273','CDR20291_2274','CDR20291_2275','CDR20291_2276','CDR20291_2277','CDR20291_2278','CDR20291_2279','CDR20291_2280','CDR20291_2281','CDR20291_2282','CDR20291_2283','CDR20291_2284','CDR20291_2285','CDR20291_2286','CDR20291_2287','CDR20291_2288','CDR20291_2289','cotJB2','cotJC2','CDR20291_2292','dut','CDR20291_2294','CDR20291_2295','CDR20291_2296','CDR20291_2297','CDR20291_2298','CDR20291_2299','CDR20291_2300','ppdK','CDR20291_2302','CDR20291_2303','CDR20291_2304','srlB_2','CDR20291_2306','CDR20291_2307','srlE_2','srlA','CDR20291_2310','CDR20291_2311','CDR20291_2312','acp','CDR20291_2314','CDR20291_2315','CDR20291_2316','CDR20291_2317','CDR20291_2318','CDR20291_2319','CDR20291_2320','CDR20291_2321','CDR20291_2322','CDR20291_2323','glyS','glyQ','CDR20291_2326','recO','CDR20291_2328','era','d','CDR20291_2331','CDR20291_2332','CDR20291_2333','spoIV','CDR20291_2335','CDR20291_2336','CDR20291_2337','rpsU_1','rpsU_2','CDR20291_2340','CDR20291_2341','CDR20291_2342','prmA','CDR20291_2344','CDR20291_2345','CDR20291_2346','CDR20291_2347','CDR20291_2348','CDR20291_2349','CDR20291_2350','CDR20291_2351','glcK','dnaJ','dnaK','grpE','hrcA','hemN','CDR20291_2358','CDR20291_2359','lepA','CDR20291_2361','spoIIP','gpr','CDR20291_2364','CDR20291_2365','rpsT','CDR20291_2367','CDR20291_2368','CDR20291_2369','CDR20291_2370','CDR20291_2371','CDR20291_2372','CDR20291_2373','ung','CDR20291_2375','CDR20291_2376','CDR20291_2377','CDR20291_2378','CDR20291_2379','CDR20291_2380','CDR20291_2381','CDR20291_2382','CDR20291_2383','pmi','CDR20291_2385','selB','fdhA','selD','comE','CDR20291_2390','CDR20291_2391','argH','CDR20291_2393','CDR20291_2394','CDR20291_2395','CDR20291_2396','CDR20291_2397','CDR20291_2398','CDR20291_2399','CDR20291_2400','CDR20291_2401','CDR20291_2402','CDR20291_2403','CDR20291_2404','CDR20291_2405','tdcB','aspD','CDR20291_2408','CDR20291_2409','leuS','CDR20291_2411','CDR20291_2412','nadD','CDR20291_2414','gbeA','CDR20291_2416','CDR20291_2417','CDR20291_2418','CDR20291_2419','CDR20291_2420','CDR20291_2421','CDR20291_2422','CDR20291_2423','CDR20291_2424','CDR20291_2425','elaC','nox','CDR20291_2428','CDR20291_2429','CDR20291_2430','CDR20291_2431','CDR20291_2432','CDR20291_2433','CDR20291_2434','CDR20291_2435','CDR20291_2436','CDR20291_2437','CDR20291_2438','tlpB_3','CDR20291_2440','CDR20291_2441','CDR20291_2442','coaD','CDR20291_2444','recG','CDR20291_2446','CDR20291_2447','rpmB','CDR20291_2449','CDR20291_2450','CDR20291_2451','CDR20291_2452','CDR20291_2453','CDR20291_2454','CDR20291_2455','CDR20291_2456','CDR20291_2457','CDR20291_2458','CDR20291_2459','CDR20291_2460','CDR20291_2461','CDR20291_2462','CDR20291_2463','stk','stp','CDR20291_2466','rsmB','CDR20291_2468','CDR20291_2469','fmt','def2','priA','coaBC','rpoZ','gmk','CDR20291_2476','dapF','ltaE','fbpA','CDR20291_2480','uraA','pyrR','CDR20291_2483','lspA','CDR20291_2485','CDR20291_2486','CDR20291_2487','CDR20291_2488','CDR20291_2489','CDR20291_2490','CDR20291_2491','CDR20291_2492','trpS','mtnN','CDR20291_2495','CDR20291_2496','CDR20291_2497','CDR20291_2498','CDR20291_2499','CDR20291_2500','CDR20291_2501','CDR20291_2502','CDR20291_2503','CDR20291_2504','CDR20291_2505','CDR20291_2506','CDR20291_2507','CDR20291_2508','CDR20291_2509','CDR20291_2510','CDR20291_2511','CDR20291_2512','spoIVA','CDR20291_2514','CDR20291_2515','CDR20291_2516','CDR20291_2517','glyC','CDR20291_2519','CDR20291_2520','CDR20291_2521','CDR20291_2522','CDR20291_2523','CDR20291_2524','CDR20291_2525','CDR20291_2526','CDR20291_2527','CDR20291_2528','CDR20291_2529','sigG','sigE','spoIIGA','CDR20291_2533','ftsZ','sbp','CDR20291_2536','CDR20291_2537','CDR20291_2538','murG','ftsW','murD','mraY','murF','spoVD','CDR20291_2545','mraW','lgt','CDR20291_2548','CDR20291_2549','CDR20291_2550','CDR20291_2551','murE','CDR20291_2553','crr_1','ptsG','licT','CDR20291_2557','appF','appD','appA','appB','appC','CDR20291_2563','thlA2','ctfA','ctfB','bdhA','CDR20291_2568','CDR20291_2569','nifJ','CDR20291_2571','CDR20291_2572','CDR20291_2573','CDR20291_2574','CDR20291_2575','sspA','CDR20291_2577','CDR20291_2578','hpt_1','CDR20291_2580','CDR20291_2581','CDR20291_2582','asnA','CDR20291_2584','CDR20291_2585','CDR20291_2586','CDR20291_2587','CDR20291_2588','CDR20291_2589','brnQ','CDR20291_2591','CDR20291_2592','CDR20291_2593','CDR20291_2594','CDR20291_2595','ydiB','CDR20291_2597','CDR20291_2598','CDR20291_2599','CDR20291_2600','CDR20291_2601','galE','gtaB_1','CDR20291_2604','CDR20291_2605','CDR20291_2606','CDR20291_2607','23S rRNA_8','16S rRNA_7','CDR20291_2608','CDR20291_2609','CDR20291_2610','CDR20291_2611','CDR20291_2612','CDR20291_2613','CDR20291_2614','glyA_1','CDR20291_2616','CDR20291_2617','CDR20291_2618','CDR20291_2619','CDR20291_2620','CDR20291_2621','CDR20291_2622','mleN','CDR20291_2624','CDR20291_2625','CDR20291_2626','CDR20291_2627','aspS','hisS','CDR20291_2630','CDR20291_2631','dtd','relA','apt','recJ','ubiB','CDR20291_2637','CDR20291_2638','agrD','agrB','CDR20291_2641','CDR20291_2642','ptsI','ptsH','CDR20291_2645','CDR20291_2646','CDR20291_2647','CDR20291_2648','CDR20291_2649','uppS_2','CDR20291_2651','CDR20291_2652','CDR20291_2653','CDR20291_2654','CDR20291_2655','CDR20291_2656','CDR20291_2657','CDR20291_2658','rkpK','tuaG','CDR20291_2661','CDR20291_2662','CDR20291_2663','CDR20291_2664','CDR20291_2665','CDR20291_2666','manC','pgm2','mviN','CDR20291_2670','CDR20291_2671','CDR20291_2672','CDR20291_2673','CDR20291_2674','CDR20291_2675','cwp84','CDR20291_2677','cwp66','CDR20291_2679','CDR20291_2680','secA2','slpA','CDR20291_2683','CDR20291_2684','CDR20291_2685','CDR20291_2686','CDR20291_2687','CDR20291_2688','CDR20291_2689','CDR20291_2690','tgt','CDR20291_2692','queA','ruvB','ruvA','ruvC','CDR20291_2697','CDR20291_2698','CDR20291_2699','CDR20291_2700','CDR20291_2701','garR','CDR20291_2703','CDR20291_2704','CDR20291_2705','CDR20291_2706','CDR20291_2707','CDR20291_2708','CDR20291_2709','CDR20291_2710','CDR20291_2711','CDR20291_2712','CDR20291_2713','CDR20291_2714','CDR20291_2715','tlpB_4','CDR20291_2717','CDR20291_2718','CDR20291_2719','CDR20291_2720','CDR20291_2721','CDR20291_2722','CDR20291_2723','CDR20291_2724','glyA_2','abgT','CDR20291_2727','CDR20291_2728','CDR20291_2729','CDR20291_2730','serS2','CDR20291_2732','CDR20291_2733','CDR20291_2734','CDR20291_2735','rbr_2','CDR20291_2737','CDR20291_2738','CDR20291_2739','CDR20291_2740','CDR20291_2741','dltC','dltB','dltA','dltD','CDR20291_2746','CDR20291_2747','CDR20291_2748','CDR20291_2749','CDR20291_2750','CDR20291_2751','CDR20291_2752','CDR20291_2753','CDR20291_2754','CDR20291_2755','CDR20291_2756','CDR20291_2757','CDR20291_2758','CDR20291_2759','CDR20291_2760','CDR20291_2761','CDR20291_2762','tldD','CDR20291_2764','CDR20291_2765','kdgT','uxaA',
'uxaA','CDR20291_2769','CDR20291_2770','fhuC','fhuG','fhuB','fhuD','CDR20291_2775','celC','CDR20291_2777','celF','celB','licB','CDR20291_2781','CDR20291_2782','CDR20291_2783','CDR20291_2784','CDR20291_2785','CDR20291_2786','ntpD','ntpB','ntpA','ntpG','ntpC','ntpE','ntpK','ntpI','CDR20291_2795','CDR20291_2796','CDR20291_2797','CDR20291_2798','CDR20291_2799','adhE_2','CDR20291_2801','dpaB','dpaA','CDR20291_2804','CDR20291_2805','bioY','CDR20291_2807','CDR20291_2808','CDR20291_2809','CDR20291_2810','CDR20291_2811','CDR20291_2812','CDR20291_2813','CDR20291_2814','CDR20291_2815','CDR20291_2816','CDR20291_2817','CDR20291_2818','CDR20291_2819','CDR20291_2820','bacA2','CDR20291_2822','CDR20291_2823','CDR20291_2824','CDR20291_2825','CDR20291_2826','CDR20291_2827','CDR20291_2828','nrdF','nrdE','CDR20291_2831','CDR20291_2832','CDR20291_2833','CDR20291_2834','CDR20291_2835','CDR20291_2836','CDR20291_2837','CDR20291_2838','CDR20291_2839','CDR20291_2840','CDR20291_2841','CDR20291_2842','CDR20291_2843','CDR20291_2844','CDR20291_2845','CDR20291_2846','CDR20291_2847','CDR20291_2848','CDR20291_2849','CDR20291_2850','CDR20291_2851','CDR20291_2852','CDR20291_2853','CDR20291_2854','CDR20291_2855','CDR20291_2856','CDR20291_2857','CDR20291_2858','CDR20291_2859','CDR20291_2860','CDR20291_2861','crr_2','CDR20291_2863','malY','malX_2','CDR20291_2866','CDR20291_2867','CDR20291_2868','CDR20291_2869','CDR20291_2870','CDR20291_2871','CDR20291_2872','CDR20291_2873','CDR20291_2874','CDR20291_2875','pepI','CDR20291_2877','CDR20291_2878','CDR20291_2879','CDR20291_2880','CDR20291_2881','CDR20291_2882','CDR20291_2883','CDR20291_2884','CDR20291_2885','CDR20291_2886','CDR20291_2887','CDR20291_2888','CDR20291_2889','CDR20291_2890','CDR20291_2891','CDR20291_2892','CDR20291_2893','glvA','glvC','glvR','CDR20291_2897','xylA','xylB','xylR','CDR20291_2901','CDR20291_2902','CDR20291_2903','CDR20291_2904','CDR20291_2905','CDR20291_2906','CDR20291_2907','CDR20291_2908','CDR20291_2909','CDR20291_2910','CDR20291_2911','CDR20291_2912','agaY_1','tagT','tagK','CDR20291_2916','CDR20291_2917','ascB','CDR20291_2919','CDR20291_2920','CDR20291_2921','CDR20291_2922','garK','CDR20291_2924','hrsA','CDR20291_2926','CDR20291_2927','CDR20291_2928','treR','treA','CDR20291_2931','CDR20291_2932','CDR20291_2933','bglA1','CDR20291_2935','bglG1','CDR20291_2937','CDR20291_2938','CDR20291_2939','CDR20291_2940','CDR20291_2941','CDR20291_2942','CDR20291_2943','CDR20291_2944','CDR20291_2945','CDR20291_2946','CDR20291_2947','CDR20291_2948','CDR20291_2949','CDR20291_2950','CDR20291_2951','CDR20291_2952','CDR20291_2953','bglA2','bglF_2','bglG_2','CDR20291_2957','CDR20291_2958','tndX','CDR20291_2960','CDR20291_2961','CDR20291_2962','CDR20291_2963','CDR20291_2964','CDR20291_2965','CDR20291_2966','CDR20291_2967','ascB2','CDR20291_2969','bglG2','CDR20291_2971','pgmB_2','CDR20291_2973','acsB3','CDR20291_2975','CDR20291_2976','CDR20291_2977','CDR20291_2978','CDR20291_2979','CDR20291_2980','CDR20291_2981','CDR20291_2982','CDR20291_2983','CDR20291_2984','CDR20291_2985','CDR20291_2986','CDR20291_2987','CDR20291_2988','CDR20291_2989','CDR20291_2990','CDR20291_2991','CDR20291_2992','CDR20291_2993','CDR20291_2994','CDR20291_2995','CDR20291_2996','CDR20291_2997','CDR20291_2998','CDR20291_2999','CDR20291_3000','CDR20291_3001','CDR20291_3002','CDR20291_3003','CDR20291_3004','CDR20291_3005','CDR20291_3006','CDR20291_3007','CDR20291_3008','CDR20291_3009','CDR20291_3010','smpB','CDR20291_3012','CDR20291_3013','CDR20291_3014','CDR20291_3015','CDR20291_3016','CDR20291_3017','rnr','CDR20291_3019','CDR20291_3020','CDR20291_3021','CDR20291_3022','CDR20291_3023','secG','CDR20291_3025','eno','gpmI','tpi','pgK','gapB','cggR','glnF','xdhA3','CDR20291_3034','CDR20291_3035','pbuX_2','CDR20291_3037','CDR20291_3038','CDR20291_3039','dpaL2','CDR20291_3041','CDR20291_3042','tdcF','CDR20291_3044','CDR20291_3045','CDR20291_3046','CDR20291_3047','CDR20291_3048','CDR20291_3049','CDR20291_3050','CDR20291_3051','CDR20291_3052','CDR20291_3053','CDR20291_3054','CDR20291_3055','CDR20291_3056','CDR20291_3057','cme','CDR20291_3059','CDR20291_3060','CDR20291_3061','CDR20291_3062','CDR20291_3063','CDR20291_3064','CDR20291_3065','CDR20291_3066','CDR20291_3067','CDR20291_3068','CDR20291_3069','CDR20291_3070','CDR20291_3071','CDR20291_3072','CDR20291_3073','CDR20291_3074','CDR20291_3075','snorO','CDR20291_3077','hslO','CDR20291_3079','CDR20291_3080','CDR20291_3081','sdaB','dapA1','asd','dapA2','dapB1','dapD','CDR20291_3088','dapB2','bclA2','hpt_2','CDR20291_3092','CDR20291_3093','CDR20291_3094','CDR20291_3095','CDR20291_3096','prdF','CDR20291_3098','CDR20291_3099','CDR20291_3100','prdB','CDR20291_3102','prdA','prdR','prdC','CDR20291_3106','sspB','CDR20291_3108','CDR20291_3109','CDR20291_3110','folC','CDR20291_3112','CDR20291_3113','valS','CDR20291_3115','CDR20291_3116','CDR20291_3117','phoU','phoT','CDR20291_3120','CDR20291_3121','CDR20291_3122','CDR20291_3123','CDR20291_3124','CDR20291_3125','CDR20291_3126','CDR20291_3127','CDR20291_3128','CDR20291_3129','pepF','CDR20291_3131','CDR20291_3132','CDR20291_3133','feoA3','feoB3','CDR20291_3136','CDR20291_3137','CDR20291_3138','CDR20291_3139','CDR20291_3140','CDR20291_3141','proC2','pflD','pflE','CDR20291_3145','pgi','CDR20291_3147','CDR20291_3148','CDR20291_3149','CDR20291_3150','CDR20291_3151','CDR20291_3152','CDR20291_3153','CDR20291_3154','CDR20291_3155','CDR20291_3156','CDR20291_3157','CDR20291_3158','CDR20291_3159','CDR20291_3160','engB','lon','chrA','chrA',
'clpX','clpP1','tig','CDR20291_3168','rph','dnaL','CDR20291_3171','CDR20291_3172','CDR20291_3173','hydN1','hydA','hydN2','CDR20291_3177','fdhD','fdhF','CDR20291_3180','CDR20291_3181','CDR20291_3182','CDR20291_3183','CDR20291_3184','CDR20291_3185','CDR20291_3186','CDR20291_3187','CDR20291_3187A','CDR20291_3188','CDR20291_3189','CDR20291_3190','CDR20291_3191','CDR20291_3192','bclA3','CDR20291_3194','clpP2','CDR20291_3196','CDR20291_3197','CDR20291_3198','CDR20291_3199','CDR20291_3200','CDR20291_3201','CDR20291_3202','CDR20291_3203','CDR20291_3204','CDR20291_3205','CDR20291_3206','CDR20291_3207','CDR20291_3208','CDR20291_3209','CDR20291_3210','CDR20291_3211','CDR20291_3212','CDR20291_3213','CDR20291_3214','CDR20291_3215','pykF','pfkA','dnaE','CDR20291_3219','CDR20291_3220','CDR20291_3221','CDR20291_3222','CDR20291_3223','murB','CDR20291_3225','cls_2','hymA','hymB','hymC','CDR20291_3230','hprK','uvrC','uvrA','uvrB','CDR20291_3235','CDR20291_3236','CDR20291_3237','CDR20291_3238','CDR20291_3239','5S rRNA_7','23S rRNA_9','16S rRNA_8','CDR20291_3240','hemB','hemD','hemC','cbiK','cbiJ','cbiH','cbiG','cbiF','cbiT','cbiE','cbiD','cbiC','CDR20291_3253','cobD','cbiB','cbiA','cbiP','CDR20291_3258','cobS','cobU','cobT','CDR20291_3262','CDR20291_3263','CDR20291_3264','CDR20291_3265','CDR20291_3266','CDR20291_3267','celM','CDR20291_3269','agaY_2','agaS','CDR20291_3272','lacC','CDR20291_3274','agaA','CDR20291_3276','CDR20291_3277','CDR20291_3278','CDR20291_3279','CDR20291_3280','CDR20291_3281','CDR20291_3282','CDR20291_3283','CDR20291_3284','CDR20291_3285','CDR20291_3286','CDR20291_3287','CDR20291_3288','CDR20291_3289','CDR20291_3290','CDR20291_3291','CDR20291_3292','CDR20291_3293','CDR20291_3294','tkt\'_2','tkt_2','CDR20291_3297','CDR20291_3298','alr','CDR20291_3300','CDR20291_3301','acpS','atpC','atpD','atpG','atpA','atpH','atpF','atpE','atpB','atpI','atpZ','CDR20291_3313','CDR20291_3314','upp','rpiB2','CDR20291_3317','CDR20291_3318','CDR20291_3319','prfA','hemK','CDR20291_3322','rpmE','rho','gtaB_2','CDR20291_3326','spoIIE','CDR20291_3328','CDR20291_3329','CDR20291_3330','CDR20291_3331','CDR20291_3332','hupA','CDR20291_3334','spoIIIF','spoVT','prsA','mfd','pth','CDR20291_3340','CDR20291_3341','CDR20291_3342','CDR20291_3343','CDR20291_3344','CDR20291_3345','CDR20291_3346','CDR20291_3347','CDR20291_3348','CDR20291_3349','CDR20291_3350','prs','gcaD','spoVG','purR','murC','CDR20291_3356','CDR20291_3357','CDR20291_3358','CDR20291_3359','ksgA','CDR20291_3361','CDR20291_3362','CDR20291_3363','CDR20291_3364','CDR20291_3365','CDR20291_3366','phnM','phnL','phnK','phnJ','phnI','phnH','phnG','CDR20291_3374','metG','spmB','spmA','CDR20291_3378','CDR20291_3379','CDR20291_3380','CDR20291_3381','CDR20291_3382','CDR20291_3383','CDR20291_3384','CDR20291_3385','speA_2','CDR20291_3387','5S rRNA_8','23S rRNA_10','16S rRNA_9','CDR20291_3388','lysS','greA','dusB','CDR20291_3392','CDR20291_3393','CDR20291_3394','birA','ftsH2','CDR20291_3397','CDR20291_3398','murI','CDR20291_3400','spoIIR','CDR20291_3402','ipk','CDR20291_3404','veg','CDR20291_3406','CDR20291_3407','CDR20291_3408','CDR20291_3409','CDR20291_3410','CDR20291_3411','CDR20291_3412','CDR20291_3413','CDR20291_3414','mdeA','CDR20291_3416','CDR20291_3417','CDR20291_3418','CDR20291_3419','CDR20291_3420','CDR20291_3421','CDR20291_3422','CDR20291_3423','CDR20291_3424','CDR20291_3425','pyrAB1','pyrAA1','pyrAB2','pyrAA2','pyrF','CDR20291_3431','CDR20291_3432','CDR20291_3433','CDR20291_3434','CDR20291_3435','luxS','CDR20291_3437','CDR20291_3438','CDR20291_3439','CDR20291_3440','CDR20291_3441','CDR20291_3442','CDR20291_3443','CDR20291_3444','CDR20291_3445','CDR20291_3446','CDR20291_3447','CDR20291_3448','CDR20291_3449','CDR20291_3450','CDR20291_3451','CDR20291_3452','CDR20291_3453','CDR20291_3454','CDR20291_3455','CDR20291_3456','CDR20291_3457','CDR20291_3458','CDR20291_3459','CDR20291_3460','CDR20291_3461','CDR20291_3462','CDR20291_3463','CDR20291_3464','CDR20291_3465','CDR20291_3466','CDR20291_3467','CDR20291_3468','CDR20291_3469','CDR20291_3470','CDR20291_3471','CDR20291_3472','CDR20291_3473','CDR20291_3474','int-Tn','CDR20291_3476','CDR20291_3477','CDR20291_3478','CDR20291_3479','CDR20291_3480','CDR20291_3481','CDR20291_3482','CDR20291_3483','phnA','CDR20291_3485','CDR20291_3486','kdgA','CDR20291_3488','CDR20291_3489','CDR20291_3490','CDR20291_3491','CDR20291_3492','CDR20291_3493','CDR20291_3494','CDR20291_3495','CDR20291_3496','CDR20291_3497','CDR20291_3498','CDR20291_3499','CDR20291_3500','CDR20291_3501','CDR20291_3502','CDR20291_3503','CDR20291_3504','CDR20291_3505','CDR20291_3506','CDR20291_3507','CDR20291_3508','CDR20291_3509','CDR20291_3510','CDR20291_3511','CDR20291_3512','CDR20291_3513','purA','CDR20291_3515','dnaB','rplI','CDR20291_3518','CDR20291_3519','CDR20291_3520','rpsR','ssb','rpsF','CDR20291_3524','CDR20291_3525','CDR20291_3526','CDR20291_3527','CDR20291_3528','CDR20291_3529','CDR20291_3530','spo0J','soj','CDR20291_3533','CDR20291_3534','gidA','trmE','jag','oxaA1','CDR20291_3539','rnpA','rpmH']
# Parse RNASeq results
rough = {}
smooth = {}

with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/transcript/tamayo_etal/phase_variation/tamayo_rnaseq.tsv', 'r') as transcription:
    header = transcription.readline()
    for line in transcription:
        line = line.split()
        if len(line) == 0: 
            continue

        try:
            gene = refseq_dict[line[0]]
        except:
            try:
                gene = gene_dict[line[0]]
            except:
                continue

        rough[gene] = (float(line[1]) + float(line[2])) / 2.0
        smooth[gene] = (float(line[3]) + float(line[4])) / 2.0<jupyter_output><empty_output><jupyter_text>Phase Variation<jupyter_code># BHI

bhi = ['cpd00001_e', # water
'cpd00035_e', # alanine
'cpd00041_e', # aspartic acid
'cpd00023_e', # glutamic acid
'cpd00119_e', # histidine
'cpd00107_e', # leucine
'cpd00060_e', # methionine
'cpd00161_e', # threonine
'cpd00069_e', # tyrosine
'cpd00084_e', # cysteine
'cpd00033_e', # glycine
'cpd00322_e', # isoleucine
'cpd00066_e', # phenylalanine
'cpd00054_e', # serine
'cpd00065_e', # tryptophan
'cpd00156_e', # valine
'cpd00220_e', # riboflavin
'cpd00644_e', # pantothentate(B5)
'cpd00393_e', # folate(B9)
'cpd00133_e', # niacin(PP)
'cpd00263_e', # Pyridoxine
'cpd00104_e', # Biotin
'cpd00149_e', # Cobalt
'cpd00971_e', # sodium
'cpd00099_e', # Chloride
'cpd00205_e', # potassium
'cpd00009_e', # phosphate
'cpd00063_e', # calcium
'cpd00254_e', # magnesium
'cpd10515_e', # Fe2+
'cpd00030_e', # Mn2+
'cpd00242_e', # Carbonate
'cpd00226_e', # hypoxanthine
'cpd01242_e', # thyminose
'cpd00307_e', # cytosine
'cpd00092_e', # uracil
'cpd00117_e', # D-Alanine
'cpd00067_e', # H+
'cpd00567_e', # D-Proline
'cpd00132_e', # L-Asparagine
'cpd00210_e', # Taurine
'cpd00320_e', # D-Aspartate
'cpd03279_e', # Deoxyinosine
'cpd00246_e', # Inosine
'cpd00311_e', # Guanosine
'cpd00367_e', # Cytidine
'cpd00277_e', # Deoxyguanosine
'cpd00182_e', # Adenosine
'cpd00654_e', # Deoxycytidine
'cpd00412_e', # Deoxyuridine
'cpd00438_e', # Deoxyadenosine
'cpd00274_e', # Citrulline
'cpd00186_e', # D-Glutamate
'cpd00637_e', # D-Methionine
'cpd00105_e', # D-Ribose
'cpd00305_e', # Thiamin
'cpd00309_e', # Xanthine
'cpd00098_e', # Choline     
'cpd00053_e', # L-Glutamine
'cpd00039_e', # Lysine
'cpd00027_e', # D-glucose      
'cpd00079_e', # D-glucose-6-phosphate
'cpd00064_e', # Ornithine
'cpd00051_e', # D-arginine  
'cpd00207_e'] # Guanine

bhi_exch = set(['EX_' + x for x in bhi])
for rxn in iCdR703.exchanges:
    rxn.lower_bound = 0.
    if rxn.id in bhi_exch:
        rxn.lower_bound = -1000.
        
iCdR703_rough = riptide.maxfit_contextualize(model=iCdR703, transcriptome=rough)
iCdR703_smooth = riptide.maxfit_contextualize(model=iCdR703, transcriptome=smooth)
riptide.save_output(riptide_obj=iCdR703_rough, path='/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/transcript/tamayo_etal/phase_variation/riptide_rough_maxfit')
riptide.save_output(riptide_obj=iCdR703_smooth, path='/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/transcript/tamayo_etal/phase_variation/riptide_smooth_maxfit')
iCdR703_smooth = riptide.contextualize(model=iCdR703, transcriptome=smooth, fraction=0.325)
iCdR703_rough = riptide.contextualize(model=iCdR703, transcriptome=rough, fraction=0.375)<jupyter_output>Initializing model and integrating transcriptomic data...
Pruning zero flux subnetworks...
Analyzing context-specific flux distributions...

Reactions pruned to 284 from 1313 (78.37% change)
Metabolites pruned to 283 from 1243 (77.23% change)
Flux through the objective DECREASED to ~46.05 from ~125.62 (63.34% change)
Context-specific metabolism correlates with transcriptome (r=0.149, p=0.012 *)

RIPTiDe completed in 18 seconds


Initializing model and integrating transcriptomic data...
Pruning zero flux subnetworks...
Analyzing context-specific flux distributions...

Reactions pruned to 284 from 1313 (78.37% change)
Metabolites pruned to 283 from 1243 (77.23% change)
Flux through the objective DECREASED to ~53.07 from ~125.62 (57.75% change)
Context-specific metabolism does not correlate with transcriptome (r=0.106, n.s.)

RIPTiDe completed in 18 seconds<jupyter_text>Analysis  Growth rate<jupyter_code>from scipy import stats
from random import sample

rough_growth = [(1. / numpy.median(x)) * 3600. for x in list(set(iCdR703_rough.flux_samples['biomass']))]
print('Rough doubling time: ' + str(round(numpy.median(rough_growth), 2)) + ' minutes')

smooth_growth = [(1. / numpy.median(x)) * 3600. for x in list(set(iCdR703_smooth.flux_samples['biomass']))]
print('Smooth doubling time: ' + str(round(numpy.median(smooth_growth), 2)) + ' minutes')

pvals = []
maxRange = len(list(iCdR703_rough.flux_samples['biomass'])) * 10
for x in range(1, maxRange):
        rough_sample = sample(list(iCdR703_rough.flux_samples['biomass']), 10)
        smooth_sample = sample(list(iCdR703_smooth.flux_samples['biomass']), 10)
        pvals.append(stats.wilcoxon(x=rough_sample, y=smooth_sample)[1])
print('p-value', numpy.median(pvals))

with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/transcript/tamayo_etal/phase_variation/doubling_times.tsv', 'w') as outFile:
    rough_growth = 'rough\t' + '\t'.join([str(round(x,2)) for x in rough_growth]) + '\n'
    outFile.write(rough_growth)
    smooth_growth = 'smooth\t' + '\t'.join([str(round(x,2)) for x in smooth_growth]) + '\n'
    outFile.write(smooth_growth)<jupyter_output>Rough doubling time: 140.71 minutes
Smooth doubling time: 94.05 minutes
p-value 0.05933611988090862<jupyter_text>Subrate utilization / Secretion<jupyter_code># Inferring media condition

def find_growth_substrates(riptide):
    substrates = []
    exchanges = list(set([x.id for x in riptide.model.reactions if 'EX_' in x.id]))
    for rxn in exchanges:
        if numpy.median(riptide.flux_samples[rxn]) < 0.0:
            substrate_id = riptide.model.reactions.get_by_id(rxn).reactants[0].id
            substrates.append(substrate_id)
    
    substrates = set(substrates)
    print(str(len(substrates)) + ' growth substrates found')

    return substrates

def find_byproducts(riptide):
    byproducts = []
    exchanges = list(set([x.id for x in riptide.model.reactions if 'EX_' in x.id]))
    for rxn in exchanges:
        if numpy.median(riptide.flux_samples[rxn]) > 0.0:
            byproduct_id = riptide.model.reactions.get_by_id(rxn).reactants[0].id
            byproducts.append(byproduct_id)
    
    byproducts = set(byproducts)
    print(str(len(byproducts)) + ' secreted byproducts found')

    return byproducts


def find_element_sources(riptide):
    
    # Isolate exchange reactions
    exchanges = []
    for rxn in riptide.model.reactions:
        if len(rxn.reactants) == 0 or len(rxn.products) == 0:
            exchanges.append(rxn.id)
    
    sources = {}
    c_source = ['cpd_id', 0.0]
    n_source = ['cpd_id', 0.0]
    
    # PArse exchange flux samples for imported metabolites
    for rxn in exchanges:
        flux = abs(numpy.median(riptide.flux_samples[rxn]))
        if flux > 1e-6:
            metabolite = riptide.model.reactions.get_by_id(rxn).reactants[0]
            sources[metabolite.id] = {}
            
            # Multiply elemental components by median flux absolute value
            for element in metabolite.elements.keys():
                element_supply = round(float(metabolite.elements[element]) * flux, 3)
                sources[metabolite.id][element] = element_supply
                
                # Identify largest sources of carbon and nitrogen
                if element == 'C' and element_supply > c_source[1]:
                    c_source = [metabolite.id, element_supply]
                elif element == 'N' and element_supply > n_source[1]:
                    n_source = [metabolite.id, element_supply]
                    
    print('Primary carbon source: ' + riptide.model.metabolites.get_by_id(c_source[0]).name + ' (' + str(c_source[1]) + ')')
    print('Primary nitrogen source: ' + riptide.model.metabolites.get_by_id(n_source[0]).name + ' (' + str(n_source[1]) + ')')

    return sources
rough_substrates = find_growth_substrates(iCdR703_rough)
rough_sources = find_element_sources(iCdR703_rough)
rough_byproducts = find_byproducts(iCdR703_rough)
smooth_substrates = find_growth_substrates(iCdR703_smooth)
smooth_sources = find_element_sources(iCdR703_smooth)
smooth_byproducts = find_byproducts(iCdR703_smooth)
rough_only_substrates = rough_substrates.difference(smooth_substrates)
smooth_only_substrates = smooth_substrates.difference(rough_substrates)

print('Rough only substrates:')
for x in rough_only_substrates:
    print(x + '\t' + iCdR703.metabolites.get_by_id(x).name)
print('\nSmooth only substrates:')
for x in smooth_only_substrates:
    print(x + '\t' + iCdR703.metabolites.get_by_id(x).name)
rough_only_byproducts = rough_byproducts.difference(smooth_byproducts)
smooth_only_byproducts = smooth_byproducts.difference(rough_byproducts)

print('Rough only byproducts:')
for x in rough_only_byproducts:
    print(x + '\t' + iCdR703.metabolites.get_by_id(x).name)
print('\nSmooth only byproducts:')
for x in smooth_only_byproducts:
    print(x + '\t' + iCdR703.metabolites.get_by_id(x).name)
a = [2345,1,342,2,4,34,234,234,5,65,4,7,54,4,8,8,56,354,6,4,7,865,84,3,45]
list(numpy.quantile(a, [0.25, 0.5, 0.75]))
# Save median flux sampled values to supplementary table

with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/results/tables/rough_exchange_flux.tsv', 'w') as outFile:
    outFile.write('id\tname\tq1\tmedian\tq3\n')
    exchanges = [x.id for x in iCdR703_rough.model.boundary]
    
    for rxn in exchanges:
        curr_name = iCdR703_rough.model.reactions.get_by_id(rxn).name
        curr_fluxes = list(iCdR703_rough.flux_samples[rxn])
        flux_summary = list(numpy.quantile(curr_fluxes, [0.25, 0.5, 0.75]))
        flux_summary = [str(round(x,3)) for x in flux_summary]
        entry = rxn + '\t' + curr_name + '\t' + flux_summary[0] + '\t' + flux_summary[1] + '\t' + flux_summary[2] + '\n'
        outFile.write(entry)
    
with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/results/tables/smooth_exchange_flux.tsv', 'w') as outFile:
    outFile.write('id\tname\tq1\tmedian\tq3\n')
    exchanges = [x.id for x in iCdR703_smooth.model.boundary]
    
    for rxn in exchanges:
        curr_name = iCdR703_smooth.model.reactions.get_by_id(rxn).name
        curr_fluxes = list(iCdR703_smooth.flux_samples[rxn])
        flux_summary = list(numpy.quantile(curr_fluxes, [0.25, 0.5, 0.75]))
        flux_summary = [str(round(x,3)) for x in flux_summary]
        entry = rxn + '\t' + curr_name + '\t' + flux_summary[0] + '\t' + flux_summary[1] + '\t' + flux_summary[2] + '\n'
        outFile.write(entry)<jupyter_output><empty_output><jupyter_text>Gene Essentiality<jupyter_code>import cobra
import cobra.flux_analysis
minGrowth = iCdR703.slim_optimize() * 0.01
base_essential_genes = cobra.flux_analysis.find_essential_genes(iCdR703, threshold=minGrowth)
base_essential_genes = set([x.id for x in base_essential_genes])
print(str(len(base_essential_genes)) + ' core essential genes found')
minGrowth = iCdR703_rough.model.slim_optimize() * 0.01
rough_essential_genes = cobra.flux_analysis.find_essential_genes(iCdR703_rough.model, threshold=minGrowth)
rough_essential_genes = set([x.id for x in rough_essential_genes])
#rough_essential_genes = rough_essential_genes.difference(base_essential_genes)
print(str(len(rough_essential_genes)) + ' rough-specific essential genes')
minGrowth = iCdR703_smooth.model.slim_optimize() * 0.01
smooth_essential_genes = cobra.flux_analysis.find_essential_genes(iCdR703_smooth.model, threshold=minGrowth)
smooth_essential_genes = set([x.id for x in smooth_essential_genes])
#smooth_essential_genes = smooth_essential_genes.difference(base_essential_genes)
print(str(len(smooth_essential_genes)) + ' smooth-specific essential genes')
# Contrast groups
overlap_essential = smooth_essential_genes.intersection(rough_essential_genes)
smooth_only_essential = smooth_essential_genes.difference(rough_essential_genes)
rough_only_essential = rough_essential_genes.difference(smooth_essential_genes)

# Display results
print('Rough-only essential genes:')
for x in rough_only_essential:
    print(x + '\t' + iCdR703.genes.get_by_id(x).name)
print('\nSmooth-only essential genes:')
for x in smooth_only_essential:
    print(x + '\t' + iCdR703.genes.get_by_id(x).name)
print('Overlap essential genes, total:', len(overlap_essential))
for x in overlap_essential:
    print(x + '\t' + iCdR703.genes.get_by_id(x).name)
# Save results to a table
with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/results/tables/genes_table_S4.tsv','w') as outfile:
    outfile.write('condition\tgene_id\tgene_name\n')
    
    for w in base_essential_genes:
        w = iCdR703.genes.get_by_id(w)
        entry = 'uncontextualized\t' + w.id + '\t' + w.name.replace(' ', '_') + '\n'
        outfile.write(entry)
        
    for x in overlap_essential:
        x = iCdR703.genes.get_by_id(x)
        entry = 'both_contexts\t' + x.id + '\t' + x.name.replace(' ', '_') + '\n'
        outfile.write(entry)
    
    for y in smooth_only_essential:
        y = iCdR703.genes.get_by_id(y)
        entry = 'smooth_only\t' + y.id + '\t' + y.name.replace(' ', '_') + '\n'
        outfile.write(entry)
    
    for z in rough_only_essential:
        z = iCdR703.genes.get_by_id(z)
        entry = 'rough_sporulation_only\t' + z.id + '\t' + z.name.replace(' ', '_') + '\n'
        outfile.write(entry)<jupyter_output><empty_output><jupyter_text>Reaction Essentiality<jupyter_code>minGrowth = iCdR703.slim_optimize() * 0.01
base_essential_reactions = cobra.flux_analysis.find_essential_reactions(iCdR703, threshold=minGrowth)
base_essential_reactions = set([x.id for x in base_essential_reactions])
print(str(len(base_essential_reactions)) + ' core essential reactions found')
minGrowth = iCdR703_rough.model.slim_optimize() * 0.01
rough_essential_reactions = cobra.flux_analysis.find_essential_reactions(iCdR703_rough.model, threshold=minGrowth)
rough_essential_reactions = set([x.id for x in rough_essential_reactions])
print(str(len(rough_essential_reactions)) + ' rough-specific essential reactions')
minGrowth = iCdR703_smooth.model.slim_optimize() * 0.01
smooth_essential_reactions = cobra.flux_analysis.find_essential_reactions(iCdR703_smooth.model, threshold=minGrowth)
smooth_essential_reactions = set([x.id for x in smooth_essential_reactions])
print(str(len(smooth_essential_reactions)) + ' smooth-specific essential reactions')
# Contrast groups
overlap_essential_rxns = smooth_essential_reactions.intersection(rough_essential_reactions)
smooth_only_essential_rxns = smooth_essential_reactions.difference(rough_essential_reactions)
rough_only_essential_rxns = rough_essential_reactions.difference(smooth_essential_reactions)

# Display results
print('Rough-only essential reactions:')
for x in rough_only_essential_rxns:
    print(x + '\t' + iCdR703.reactions.get_by_id(x).name)
print('\nSmooth-only essential reactions:')
for x in smooth_only_essential_rxns:
    print(x + '\t' + iCdR703.reactions.get_by_id(x).name)
# Save results to a table
with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/results/tables/reactions_table_S4.tsv','w') as outfile:
    outfile.write('condition\treaction_id\treaction_name\n')
    
    for w in base_essential_reactions:
        w = iCdR703.reactions.get_by_id(w)
        entry = 'uncontextualized\t' + w.id + '\t' + w.name.replace(' ', '_') + '\n'
        outfile.write(entry)
        
    for x in overlap_essential_rxns:
        x = iCdR703.reactions.get_by_id(x)
        entry = 'both_contexts\t' + x.id + '\t' + x.name.replace(' ', '_') + '\n'
        outfile.write(entry)
    
    for y in smooth_only_essential_rxns:
        y = iCdR703.reactions.get_by_id(y)
        entry = 'smooth_only\t' + y.id + '\t' + y.name.replace(' ', '_') + '\n'
        outfile.write(entry)
    
    for z in rough_only_essential_rxns:
        z = iCdR703.reactions.get_by_id(z)
        entry = 'rough_sporulation_only\t' + z.id + '\t' + z.name.replace(' ', '_') + '\n'
        outfile.write(entry)<jupyter_output><empty_output><jupyter_text>Topology<jupyter_code># Genes
r_genes = set([x.id for x in iCdR703_rough.model.genes])
s_genes = set([x.id for x in iCdR703_smooth.model.genes])

print('Rough-only genes:', len(r_genes.difference(s_genes)))
print('Smooth-only genes:', len(s_genes.difference(r_genes)))
# Reactions
r_reactions = set([x.id for x in iCdR703_rough.model.reactions])
s_reactions = set([x.id for x in iCdR703_smooth.model.reactions])

print('Rough-only reactions:', len(r_reactions.difference(s_reactions)))
print('Smooth-only reactions:', len(s_reactions.difference(r_reactions)))
# Metabolites
r_metabolites = set([x.id for x in iCdR703_rough.model.metabolites])
s_metabolites = set([x.id for x in iCdR703_smooth.model.metabolites])

print('Rough-only metabolites:', len(r_metabolites.difference(s_metabolites)))
print('Smooth-only metabolites:', len(s_metabolites.difference(r_metabolites)))
# Compare gene pruning between groups
rough_pruned = iCdR703_rough.pruned['genes']
smooth_pruned = iCdR703_smooth.pruned['genes']
rough_only_genes = smooth_pruned.difference(rough_pruned)
smooth_only_genes = rough_pruned.difference(smooth_pruned)

print('Rough only genes:')
for x in rough_only_genes:
    print(x + '\t' + iCdR703.genes.get_by_id(x).name)
print('\nSmooth only genes:')
for x in smooth_only_genes:
    print(x + '\t' + iCdR703.genes.get_by_id(x).name)
# Reactions
rough_pruned = iCdR703_rough.pruned['reactions']
smooth_pruned = iCdR703_smooth.pruned['reactions']
rough_only_reactions = smooth_pruned.difference(rough_pruned)
smooth_only_reactions = rough_pruned.difference(smooth_pruned)

print('Rough only reactions:')
for x in rough_only_reactions:
    print(x + '\t' + iCdR703.reactions.get_by_id(x).name)
print('\nSmooth only reactions:')
for x in smooth_only_reactions:
    print(x + '\t' + iCdR703.reactions.get_by_id(x).name)
# Metabolites
rough_pruned = iCdR703_rough.pruned['metabolites']
smooth_pruned = iCdR703_smooth.pruned['metabolites']
rough_only_metabolites = smooth_pruned.difference(rough_pruned)
smooth_only_metabolites = rough_pruned.difference(smooth_pruned)

print('Rough only metabolites:')
for x in rough_only_metabolites:
    print(x + '\t' + iCdR703.metabolites.get_by_id(x).name)
print('\nSmooth only metabolites:')
for x in smooth_only_metabolites:
    print(x + '\t' + iCdR703.metabolites.get_by_id(x).name)
import numpy
import cobra
import cobra.flux_analysis

def _getKey(item):
    return item[1]

# Scale each active exchange back and examine its influence on objective flux
def find_primary_sources(model, flux_samples=False, fraction=0.01, cutoff=0.8, pfba_fraction=0.8):
    # Requires a model 
    # Optional: flux_samples = flux samples pandas dataframe associated with model
    #           fraction = percent of median flux to limit exchange reactions by
    #           cutoff = quantile of top C and N sources to report
    #           pfba_fraction = fraction of optimal objective value for pfba solution

    sources = {}
    c_sources = []
    c_influence = []
    n_sources = []
    n_influence = []
    p_source = ['p_source', -1.0]
    s_source = ['s_source', -1.0]
    objVal = model.slim_optimize()
    pfba_solution = cobra.flux_analysis.pfba(model, fraction_of_optimum=pfba_fraction)
    
    # Parse exchange flux samples for imported metabolites
    exchanges = [rxn.id for rxn in model.boundary]
    for rxn in exchanges:
        if isinstance(flux_samples, pandas.DataFrame):
            current_samples = list(set(flux_samples[rxn]))
            flux = numpy.mean(current_samples)
        else:
            flux = pfba_solution.fluxes[rxn]
        if flux >= -1e-6: continue # Skip exported byproducts or unused reactions
        bound = flux * fraction
        
        # Test for disproportionate effect on objective
        old_bounds = model.reactions.get_by_id(rxn).bounds
        model.reactions.get_by_id(rxn).bounds = (bound, bound)        
        new_objVal = model.slim_optimize()
        model.reactions.get_by_id(rxn).bounds = old_bounds # Reset bounds
        if str(new_objVal) == 'nan': new_objVal = objVal * fraction # Correct for nan
        
        # Calculate the degree of change to objective value
        if new_objVal != objVal:
            flux_ratio = objVal / new_objVal
            adjustment = abs(flux) * flux_ratio
        else:
            adjustment = 1.
        
        # Normalize elemental component contributions
        metabolite = model.reactions.get_by_id(rxn).reactants[0]
        sources[metabolite.id] = {}
        for element in metabolite.elements.keys():
            element_supply = float(metabolite.elements[element]) * adjustment
            if element_supply > 0.: element_supply = numpy.log(element_supply)
            sources[metabolite.id][element] = element_supply
                
            # Identify largest sources of main elements
            if element == 'C' and element_supply > 0.0:
                c_sources.append([metabolite.id, element_supply])
                c_influence.append(element_supply)
            elif element == 'N' and element_supply > 0.0:
                n_sources.append([metabolite.id, element_supply])
                n_influence.append(element_supply)
            elif element == 'P' and element_supply > 0.0:
                p_source = [metabolite.id, element_supply]
            elif element == 'S' and element_supply > 0.0:
                s_source = [metabolite.id, element_supply]
    
    # Rank by largest contributions
    c_sources = sorted(c_sources, reverse=True, key=_getKey)
    n_sources = sorted(n_sources, reverse=True, key=_getKey)
    
    print('Top carbon sources:')
    current = max(c_influence)
    x = 0
    while current >= numpy.quantile(c_influence, cutoff):
        print(model.metabolites.get_by_id(c_sources[x][0]).name + ' (' + str(round(c_sources[x][1],3)) + ')')
        current = c_sources[x][1]
        x += 1
        
    print('\nTop nitrogen sources:')
    current = max(n_influence)
    x = 0
    while current >= numpy.quantile(n_influence, cutoff):
        print(model.metabolites.get_by_id(n_sources[x][0]).name + ' (' + str(round(n_sources[x][1],3)) + ')')
        current = n_sources[x][1]
        x += 1
        
    print('\nPrimary phosphorous source:')
    print(model.metabolites.get_by_id(p_source[0]).name + ' (' + str(round(p_source[1],3)) + ')')
    
    print('\nPrimary sulfur source:')
    print(model.metabolites.get_by_id(s_source[0]).name + ' (' + str(round(s_source[1],3)) + ')')
    
    return sources

rough_sources = find_primary_sources(iCdR703_rough.model, flux_samples=iCdR703_rough.flux_samples)
smooth_sources = find_primary_sources(iCdR703_smooth.model, flux_samples=iCdR703_smooth.flux_samples)
smooth_ex = set([x.id for x in iCdR703_smooth.model.exchanges])
rough_ex = set([x.id for x in iCdR703_rough.model.exchanges])
smooth_only = smooth_ex.difference(rough_ex)
rough_only = rough_ex.difference(smooth_ex)

print('Smooth')
for rxn in smooth_only:
    flux = numpy.mean(iCdR703_smooth.flux_samples[rxn])
    print(rxn, iCdR703_smooth.model.reactions.get_by_id(rxn).name, flux)

print('\nRough')
for rxn in rough_only:
    flux = numpy.mean(iCdR703_rough.flux_samples[rxn])
    print(rxn, iCdR703_rough.model.reactions.get_by_id(rxn).name, flux)
    
for rxn_a in iCdR703_smooth.model.boundary:
    try:
        fluxes_a = numpy.mean(iCdR703_smooth.flux_samples[rxn_a.id])
        fluxes_b = numpy.mean(iCdR703_rough.flux_samples[rxn_a.id])
    except:
        continue
    if fluxes_a < 0 or fluxes_b < 0:
        print(rxn_a.id, iCdR703.reactions.get_by_id(rxn_a.id).name, round(fluxes_a,3), round(fluxes_b,3))

for rxn_a in iCdR703_smooth.model.boundary:
    try:
        fluxes_a = numpy.mean(iCdR703_smooth.flux_samples[rxn_a.id])
        fluxes_b = numpy.mean(iCdR703_rough.flux_samples[rxn_a.id])
    except:
        continue
    if fluxes_a > 0 or fluxes_b > 0:
        print(rxn_a.id, iCdR703.reactions.get_by_id(rxn_a.id).name, round(fluxes_a,3), round(fluxes_b,3))

with open('/home/mjenior/Desktop/repos/Jenior_Cdifficile_2019/data/transcript/tamayo_etal/phase_variation/exch_fluxes_maxfit.tsv', 'w') as outFile:
    outFile.write('reaction_id\tsubstrate\tsmooth\trough\n')
    for exch in iCdR703.exchanges:
    
        try:
            flux_smooth = str(round(numpy.mean(iCdR703_smooth.flux_samples[exch.id]), 3))
        except:   
            flux_smooth = 'NA'
        try:  
            flux_rough = str(round(numpy.mean(iCdR703_rough.flux_samples[exch.id]), 3))
        except:
            flux_rough = 'NA'
        
        line = exch.id + '\t' + list(exch.reactants)[0].name + '\t' + flux_smooth + '\t' + flux_rough + '\n'
        outFile.write(line)<jupyter_output><empty_output><jupyter_text>Contribution to Biomass<jupyter_code>import cobra
import symengine
import pandas
from scipy import stats
from random import sample
import cobra.flux_analysis
import numpy
import warnings

# Contribution to biomass
def find_contribution(genre):
    warnings.filterwarnings('ignore')

    # Test each exchange metabolite's contribute to the objective
    biomass = genre.slim_optimize()
    consume = {}
    produce = {}
    with genre as g:
        for rxn in g.exchanges:
            if rxn.lower_bound < 0.0:
                substrate = list(rxn.metabolites)[0].name
                old_bound = rxn.lower_bound
                rxn.lower_bound = old_bound * 0.01
                new_biomass = g.slim_optimize()
                if str(new_biomass) == 'nan':
                    rxn.lower_bound = old_bound
                    continue
                else:
                    effect = (g.slim_optimize() / biomass) * 100.0
                    effect = round(100.0 - effect, 3)
                    if effect > 1.0: consume[substrate] = effect
                    rxn.lower_bound = old_bound
                    
            elif rxn.upper_bound > 0.0:
                substrate = list(rxn.metabolites)[0].name
                old_bound = rxn.upper_bound
                rxn.upper_bound = old_bound * 0.01
                new_biomass = g.slim_optimize()
                if str(new_biomass) == 'nan':
                    rxn.upper_bound = old_bound
                    continue
                else:
                    effect = (g.slim_optimize() / biomass) * 100.0
                    effect = round(100.0 - effect, 3)
                    if effect > 1.0: produce[substrate] = effect
                    rxn.upper_bound = old_bound
    
    warnings.filterwarnings('default')
    return {'consumes' : consume, 'produces' : produce}
# Find respective contributions to optimal biomass
smooth_important = find_contribution(iCdR703_smooth.model)
rough_important = find_contribution(iCdR703_rough.model)
smooth_important
rough_important<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18436975002210518, 'fraction_numerical': 0.31700077052307146, 'mean_word_length': 11.582326764144947, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '97081', 'license': 'MIT', 'n_tokens_mistral': 50517, 'n_tokens_neox': 35593, 'n_words': 2014, 'path': 'notebooks/Phase Variation R20291.ipynb', 'repo_name': 'mjenior/Jenior_CdifficileGENRE_2021', 'size': '79167'}