<jupyter_start><jupyter_text>Load dependencies<jupyter_code>import cobra
import libsbml
import lxml

models_directory = '/media/sf_Shared/Systems_biology/Metabolic_models/'
OB3b_directory = '/media/sf_Shared/GEM_OB3b/'
memote_directory = '/home/ensakz/Desktop/memote_m_trichosporium/'
fastas_directory = '/media/sf_Shared/Systems_biology/Fastas_and_annotations/'
inparanoid_directory = '/media/sf_Shared/Systems_biology/InParanoid_runs/'
draft_gems_dir_8 = 'draft_gems/8.OB3b_draft_gem_during_pathway_manual_curation/'
iMsOB3b = cobra.io.load_json_model(memote_directory + draft_gems_dir_8 + "bigg_OB3b_13_01_2020.json")
model_Bath = cobra.io.load_json_model(models_directory + "iMcBath.json")
model_OB3b_old = cobra.io.load_json_model(memote_directory + draft_gems_dir_8 + "iMsOB3b_11_14_2019.json")
model_universal = cobra.io.load_json_model(models_directory + 'universal_model.json')
model_AM1 = cobra.io.read_sbml_model(models_directory + 'iRP911_v2016_MextorquensAM1.xml')<jupyter_output><empty_output><jupyter_text>Create list of Methylosinus trichosporium OB3b locus tags not present in OB3b GEM Loading BioPython's SeqIO library for fasta file manipulation:<jupyter_code>model = iMsOB3b
#script for renaming record description in Refseq or Genbank files

#importing Biopythom SeqIO library
from Bio import SeqIO

#loading multiple gene elements from a fasta file
records = list(SeqIO.parse(fastas_directory + "OB3b/New_2017_assembly/GenBank_ASM275265v1_translated_cds.faa", 
                           "fasta"))<jupyter_output><empty_output><jupyter_text>Create OB3b_locus_tags_and_their_description dictionary:<jupyter_code>OB3b_locus_tags_and_their_description = {}
for record in records:
    record_description = record.description.split("[") #some of elements don't have WP_ ids, only locus tags
    for element in record_description:
        if "locus_tag=" in element:
            key_element=element[10:-2]
        elif "protein=" in element:
            value_element=element[8:-2]
    OB3b_locus_tags_and_their_description[str(key_element)] = str(value_element)
print(len(OB3b_locus_tags_and_their_description))<jupyter_output>4740<jupyter_text>Write OB3b_locus_tags_and_their_description to txt file:<jupyter_code>import json
with open(memote_directory + "gem_reconstruction_supplementary_materials/" +\
          "OB3b_locus_tags_and_their_description.txt", "w") as file:
    file.write(json.dumps(OB3b_locus_tags_and_their_description))<jupyter_output><empty_output><jupyter_text>Serialization using Pickle fails: Source: https://stackoverflow.com/questions/36965507/writing-a-dictionary-to-a-text-file<jupyter_code>import _pickle as pickle
with open(memote_directory + "gem_reconstruction_supplementary_materials/" +\
          "OB3b_locus_tags_and_their_description_parallel.txt", 'wb') as file:
     file.write(pickle.dumps(OB3b_locus_tags_and_their_description))<jupyter_output><empty_output><jupyter_text>Check how much Genbank genome locus tags are present in OB3b GEM:<jupyter_code>OB3b_locus_tags_present_in_GEM = set()
for locus_tag in OB3b_locus_tags_and_their_description:
    try:
        if iMsOB3b.genes.get_by_id(locus_tag) in iMsOB3b.genes:
            OB3b_locus_tags_present_in_GEM.add(locus_tag)
    except:
        pass
OB3b_locus_tags_present_in_GEM=list(OB3b_locus_tags_present_in_GEM)
print(len(OB3b_locus_tags_present_in_GEM))<jupyter_output>537<jupyter_text>Deleting "CQW"-related genes present in OB3b GEM from OB3b_locus_tags_and_their_description:<jupyter_code>OB3b_locus_tags_present_in_GEM = set()
for locus_tag in OB3b_locus_tags_and_their_description:
    try:
        if model.genes.get_by_id(locus_tag) in model.genes:
            OB3b_locus_tags_present_in_GEM.add(locus_tag)
    except:
        pass
OB3b_locus_tags_present_in_GEM=list(OB3b_locus_tags_present_in_GEM)

for locus_tag in OB3b_locus_tags_present_in_GEM:
    del OB3b_locus_tags_and_their_description[locus_tag]
    
len(OB3b_locus_tags_and_their_description)<jupyter_output><empty_output><jupyter_text>Deleting hypothetical proteins from OB3b_locus_tags_and_their_description as they are useless for GEM reconstruction manual curation:<jupyter_code>for locus_tag in list(OB3b_locus_tags_and_their_description):
    if OB3b_locus_tags_and_their_description[locus_tag] == "hypothetical protein":
        del OB3b_locus_tags_and_their_description[locus_tag]

print("OB3b_locus_tags_and_their_description length after deletion of hypothetical proteins is",\
      len(OB3b_locus_tags_and_their_description))        
OB3b_locus_tags_and_their_description<jupyter_output><empty_output><jupyter_text>Saving model copy before moving further in case of any mistake in the code:<jupyter_code>model_copy=model.copy()<jupyter_output><empty_output><jupyter_text>Checking whether remaining 2880 locus tags from OB3b_locus_tags_and_their_description are present in KEGG  pathway database (and supposedly have EC numbers). If they are not present in KEGG pathway database, then these locus tags are deleted by the script given below. This is possible because KEGG pathway is biochemical metabolic pathway database (opinion as of 15/10/2019).<jupyter_code>import bioservices
#trying bioservices
#organism code cah

from bioservices.kegg import KEGG
k = KEGG() #you have to give the alias (psevdonim) for the KEGG database
#you specify organism name, in this case, cah, belongs to Methylosinus trichosporium

k.organism = "mtw"
for locus_tag in list(OB3b_locus_tags_and_their_description):
    try:
        if k.get_pathway_by_gene(locus_tag, "mtw") is None:
            del OB3b_locus_tags_and_their_description[locus_tag]
    except:
        pass<jupyter_output><empty_output><jupyter_text>Locus tags are not filtered properly using k.get_pathway_by_gene(locus_tag, "mtw")) is None option. Trying different locus tag option: Below is a trash to understand how to apply another solution besides None<jupyter_code>if len(k.get_pathway_by_gene('CQW49_14475', "mtw"))>0:
    print('None')
else:
    print('Not none')
len(k.get_pathway_by_gene('CQW49_14475', "mtw")) >0
checking_reactions = ['CQW49_14475', 'CQW49_00015']
for locus_tag in checking_reactions:
    try:
        if len(k.get_pathway_by_gene(locus_tag, "mtw"))>0:
            print(locus_tag, 'True')
        else:
            print(locus_tag, 'Not true')
    except:
        print(locus_tag, 'None')

check_reactions = ['CQW49_14475', 'CQW49_00015']
for reaction in check_reactions:
    try:
        if len(k.get_pathway_by_gene(reaction, "mtw"))>0:
            print(reaction, 'None')
        else:
            print(reaction, 'Not none')
    except:
        print(reaction, 'exception')<jupyter_output>CQW49_14475 None
CQW49_00015 exception<jupyter_text>Trying second option (sorting relevant locus tags by length):<jupyter_code>for locus_tag in list(OB3b_locus_tags_and_their_description):
    try:
        if len(k.get_pathway_by_gene(locus_tag, "mtw")) > 0:
            pass
        else:
            del OB3b_locus_tags_and_their_description[locus_tag]
    except:
            del OB3b_locus_tags_and_their_description[locus_tag]
len(OB3b_locus_tags_and_their_description)
for locus_tag in list(OB3b_locus_tags_and_their_description):
    try:
        if len(k.get_pathway_by_gene(locus_tag, "mtw")) > 0:
            print(locus_tag, k.get_pathway_by_gene(locus_tag, "mtw"))
        else:
            pass
    except:
            pass
for locus_tag in list(OB3b_locus_tags_and_their_description):
    try:
        if len(k.get_pathway_by_gene(locus_tag, "mtw")) > 0:
            pass
        else:
            pass
    except:
            print(locus_tag, k.get_pathway_by_gene(locus_tag, "mtw"))
len(OB3b_locus_tags_and_their_description)<jupyter_output><empty_output><jupyter_text>Save the OB3b_locus_tags_and_their_description temporal file with pickle:<jupyter_code># write python dict to a file
with open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
          'temporal_more_than_0.pkl', 'wb') as output:
    pickle.dump(OB3b_locus_tags_and_their_description, output)
for locus_tag in OB3b_locus_tags_and_their_description:
    print(locus_tag, k.get_pathway_by_gene(locus_tag, "mtw"))
OB3b_locus_tags_and_their_description
len(OB3b_locus_tags_and_their_description)
check_reactions = ['CQW49_19995', 'CQW49_20020', 'CQW49_23400']
for locus_tag in check_reactions:
    print(k.get_pathway_by_gene(locus_tag, "mtw"))<jupyter_output>{'mtw03440': 'Homologous recombination'}
{'mtw00630': 'Glyoxylate and dicarboxylate metabolism', 'mtw01100': 'Metabolic pathways'}
{'mtw02020': 'Two-component system'}<jupyter_text>Printing length and elements of OB3b_locus_tags_and_their_description. The number of locus tags that can be potentially included in genome-scale metabolic reconstruction is 341.<jupyter_code>print(len(OB3b_locus_tags_and_their_description))
OB3b_locus_tags_and_their_description<jupyter_output>341<jupyter_text>Writing filtered OB3b_locus_tags_and_their_description to memote/gem_reconstruction_supplementary_materials directory in pkl and txt formats. The pkl format is required to always have access to the data using Python while the txt format is required for easy data access using txt editor:<jupyter_code># write python dict to a file
with open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
          'OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl', 'wb') as output:
    pickle.dump(OB3b_locus_tags_and_their_description, output)
    
import json
with open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
          "OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.txt", "w") as file:
    file.write(json.dumps(OB3b_locus_tags_and_their_description))<jupyter_output><empty_output><jupyter_text>Easy access to OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl:<jupyter_code># read python dict back from the file
pkl_file = open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
                'OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl', 'rb')
OB3b_locus_tags_and_their_description = pickle.load(pkl_file)
pkl_file.close()

print (OB3b_locus_tags_and_their_description)<jupyter_output>{'CQW49_00005': 'chromosomal replication initiator protein DnaA', 'CQW49_00130': 'sugar transporter', 'CQW49_00190': 'amino acid ABC transporter substrate-bindnig protein', 'CQW49_00200': '30S ribosomal protein S21', 'CQW49_00370': 'prepilin-type cleavage/methylation domain-containing protein', 'CQW49_00375': 'type II secretion system protein', 'CQW49_00380': 'type II secretion system protein GspH', 'CQW49_00385': 'type II secretion system F family protein', 'CQW49_00390': 'secretion system protein E', 'CQW49_00400': 'fimbrial assembly protein', 'CQW49_00415': 'type II secretion system protein GspD', 'CQW49_00420': 'general secretion pathway protein GspK', 'CQW49_00425': 'type II secretion system protein GspG', 'CQW49_00500': 'uracil-DNA glycosylase', 'CQW49_00515': 'F0F1 ATP synthase subunit beta', 'CQW49_00520': 'F0F1 ATP synthase subunit epsilon', 'CQW49_00535': 'ATP synthase F0 subunit A', 'CQW49_00540': 'ATP synthase F0 subunit C', 'CQW49_00545': 'F0F1 ATP synthase subunit B', 'CQ[...]<jupyter_text>Leave only pathways that are directly related to metabolism:Here is the list of pathways not related to metabolism directly (starts from genetic information processing section) --> https://www.genome.jp/kegg-bin/show_organism?menu_type=pathway_maps&org=mtw:<jupyter_code>kegg_non_metabolic_pathways = ['03020', '03010', '00970', '03060', '04122', '03018', '03030', '03410', 
                               '03420','03430', '03440', '03450', '02010', '02060', '03070', '02020', 
                               '02024', '02030', '02040', '01501', '01502', '01503']
for locus_tag in list(OB3b_locus_tags_and_their_description):
    for non_metabolic_pathway in kegg_non_metabolic_pathways:
        try:
            if 'mtw' + non_metabolic_pathway in k.get_pathway_by_gene(locus_tag, "mtw"):
                del OB3b_locus_tags_and_their_description[locus_tag]
        except:
            pass
OB3b_locus_tags_and_their_description
# write python dict to a file
with open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
          'OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl', 'wb') as output:
    pickle.dump(OB3b_locus_tags_and_their_description, output)
    
import json
with open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
          "OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.txt", "w") as file:
    file.write(json.dumps(OB3b_locus_tags_and_their_description))
# read python dict back from the file
pkl_file = open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
                'OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl', 'rb')
OB3b_locus_tags_and_their_description = pickle.load(pkl_file)
pkl_file.close()

print (len(OB3b_locus_tags_and_their_description), '\n', OB3b_locus_tags_and_their_description)<jupyter_output>164 
 {'CQW49_00415': 'type II secretion system protein GspD', 'CQW49_00425': 'type II secretion system protein GspG', 'CQW49_00500': 'uracil-DNA glycosylase', 'CQW49_00515': 'F0F1 ATP synthase subunit beta', 'CQW49_00520': 'F0F1 ATP synthase subunit epsilon', 'CQW49_00535': 'ATP synthase F0 subunit A', 'CQW49_00540': 'ATP synthase F0 subunit C', 'CQW49_00545': 'F0F1 ATP synthase subunit B', 'CQW49_00550': 'F0F1 ATP synthase subunit alpha', 'CQW49_00555': 'H(+)-transporting ATPase', 'CQW49_00610': 'exodeoxyribonuclease VII large subunit', 'CQW49_00660': 'recombination protein RecR', 'CQW49_00670': 'DNA polymerase III subunit gamma/tau', 'CQW49_00695': 'glutathione S-transferase family protein', 'CQW49_00740': 'nucleotide sugar dehydrogenase', 'CQW49_00750': 'glycosyl transferase family 1', 'CQW49_00915': 'molybdenum cofactor guanylyltransferase MobA', 'CQW49_00955': 'histidinol-phosphatase', 'CQW49_01035': 'phosphoenolpyruvate--protein phosphotransferase', 'CQW49_01055': 'NAD-dependent[...]<jupyter_text>Add reactions based on the files:2 files to look for are reactions are OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl and OB3b_locus_tags_EC_number_no_KEGG_subsystems_filtered.pkl**Note:** Ignore genes which have unspecified metabolites in reactions<jupyter_code>for locus_tag in OB3b_locus_tags_and_their_description:
    gene_entry = genes["mtw:"+locus_tag]
    print(locus_tag, gene_entry.orthology)
len(OB3b_locus_tags_and_their_description)
for locus_tag in temporal_file:
    gene_entry = genes["mtw:"+locus_tag]
    print(locus_tag, gene_entry.orthology)
len(temporal_file)<jupyter_output><empty_output><jupyter_text>Try manual way to add reactions  ATPase genes: CQW49_00515, CQW49_00550<jupyter_code>import re
for reaction in iMsOB3b.reactions:
    if re.search("ATP", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.ATPS4rpp.gene_reaction_rule = 'CQW49_19220 and CQW49_00300 and CQW49_19240 and CQW49_19235 and CQW49_00305 and CQW49_19230 and CQW49_19225 and CQW49_00310 and CQW49_00290 and CQW49_00295 and CQW49_00515 and CQW49_00550'<jupyter_output><empty_output><jupyter_text>CQW49_00695 --> unspecified, vague metaboliteshttps://www.genome.jp/dbget-bin/www_bget?ec:192.168.3.11<jupyter_code>import re
for reaction in iMsOB3b.reactions:
    if re.search("glutathione", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
for reaction in model_OB3b_old.reactions:
    if re.search("glutathione
                 ", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
model_OB3b_old.reactions.DSBGGT<jupyter_output><empty_output><jupyter_text>CQW49_00740<jupyter_code>iMsOB3b.add_reaction(model_universal.reactions.UDPACGA6D)
iMsOB3b.reactions.UDPACGA6D.gene_reaction_rule = "CQW49_00740"<jupyter_output><empty_output><jupyter_text>Semiautomatic way of adding reactions to GEM: List of models from which I can take reactions based on gene reaction rules:- old OB3b Carveme-based model List of models from which I take reactions based on reaction name:- old AM1 model (this is not possible as ortholog analysis for old AM1 model has been already done) Reload pickle again:<jupyter_code>import pickle
pkl_file = open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
                'OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs.pkl', 'rb')
OB3b_locus_tags_and_their_description = pickle.load(pkl_file)
pkl_file.close()

print (len(OB3b_locus_tags_and_their_description))
import pickle
pkl_file = open(memote_directory + "gem_reconstruction_supplementary_materials/AM1_based_GEM/" +\
                'OB3b_locus_tags_EC_number_no_KEGG_subsystems_filtered.pkl', 'rb')
temporal_file = pickle.load(pkl_file)
pkl_file.close()

print (len(temporal_file))<jupyter_output>65<jupyter_text>Temporal_file<jupyter_code>for locus_tag in temporal_file:
    try:
        print(model_OB3b_old.genes.get_by_id(locus_tag).id, 
              model_OB3b_old.genes.get_by_id(locus_tag).reactions)
    except:
        pass<jupyter_output>CQW49_01205 frozenset({<Reaction CyLCyHORpp at 0x7f32911025c0>, <Reaction CYTBCYTC at 0x7f3290c26ef0>})
CQW49_01435 frozenset({<Reaction ANHMK at 0x7f329069dc18>})
CQW49_08960 frozenset({<Reaction NTRLASE at 0x7f32901cf0f0>})
CQW49_11545 frozenset({<Reaction KAS16 at 0x7f3290da3d30>, <Reaction KAS17 at 0x7f3290da3358>, <Reaction KAS13 at 0x7f3290da3668>, <Reaction KAS8 at 0x7f3290e06d68>, <Reaction KAS2 at 0x7f3290da3898>, <Reaction KAS7 at 0x7f3290e06eb8>})
CQW49_12190 frozenset({<Reaction METSOXR2 at 0x7f3290e94278>})
CQW49_13155 frozenset({<Reaction METSOXR1 at 0x7f3290e943c8>})
CQW49_15865 frozenset()
CQW49_17395 frozenset({<Reaction NI2uabcpp at 0x7f32901226a0>, <Reaction MG2uabcpp at 0x7f3290100fd0>})
CQW49_18215 frozenset({<Reaction NADPHQR2 at 0x7f3290ec3550>})
CQW49_21560 frozenset({<Reaction QRr at 0x7f3290fa2e10>})<jupyter_text>CQW49_01205<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01205.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
gene_entry = genes["mtw:"+"CQW49_01205"]
print(gene_entry.orthology)
model_OB3b_old.reactions.CYTBCYTC
iMsOB3b.metabolites.focytc_c.summary()<jupyter_output>PRODUCING REACTIONS -- reduced_cytochrome_c (focytc_c)
------------------------------------------------------
%       FLUX  RXN ID     REACTION
----  ------  ---------  --------------------------------------------------
90%    8.16   MEOHDH     2.0 ficytc_c + meoh_p --> fald_p + 2.0 focytc_c...
10%    0.944  UQCYOR_2p  2.0 ficytc_c + qh2_c --> 2.0 focytc_c + 2.0 h_p...

CONSUMING REACTIONS -- reduced_cytochrome_c (focytc_c)
------------------------------------------------------
%       FLUX  RXN ID     REACTION
----  ------  ---------  --------------------------------------------------
101%   9.18   CYO_2p     2.0 focytc_c + 4.0 h_c + 0.5 o2_c --> 2.0 ficyt...<jupyter_text>CQW49_01435<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01435.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.ANHMK)
iMsOB3b.reactions.ANHMK<jupyter_output><empty_output><jupyter_text>CQW49_08960<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_08960.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.reactions.NTRLASE<jupyter_output><empty_output><jupyter_text>CQW49_11545 --> unclear EC number convention (nodulation protein E [EC:2.3.1.-])<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_11545.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>KAS16 3-hydroxy-myristoyl-ACP synthesis ddcaACP_c + 2.0 h_c + malACP_c + nadph_c --> 3hmrsACP_c + ACP_c + co2_c + nadp_c
KAS17 B-ketoacyl synthetase (n-C18:1) accoa_c + 22.0 h_c + 8.0 malcoa_c + 15.0 nadph_c --> 8.0 co2_c + 9.0 coa_c + 7.0 h2o_c + 15.0 nadp_c + ocdcea_c
KAS13 B-ketoacyl synthetase (octadecanoate) accoa_c + 23.0 h_c + 8.0 malcoa_c + 16.0 nadph_c --> 8.0 co2_c + 9.0 coa_c + 7.0 h2o_c + 16.0 nadp_c + ocdca_c
KAS8 B-ketoacyl synthetase (palmitate, n-C16:0) accoa_c + 20.0 h_c + 7.0 malcoa_c + 14.0 nadph_c --> 7.0 co2_c + 8.0 coa_c + 6.0 h2o_c + hdca_c + 14.0 nadp_c
KAS2 B-ketoacyl synthetase (n-C14:0) accoa_c + 17.0 h_c + 6.0 malcoa_c + 12.0 nadph_c --> 6.0 co2_c + 7.0 coa_c + 5.0 h2o_c + 12.0 nadp_c + ttdca_c
KAS7 B-ketoacyl synthetase (n-C16:1) accoa_c + 19.0 h_c + 7.0 malcoa_c + 13.0 nadph_c --> 7.0 co2_c + 8.0 coa_c + 6.0 h2o_c + hdcea_c + 13.0 nadp_c<jupyter_text>CQW49_12190<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12190.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.METSOXR2)<jupyter_output>Ignoring reaction 'METSOXR2' since it already exists.<jupyter_text>CQW49_13155<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_13155.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.METSOXR2)<jupyter_output>Ignoring reaction 'METSOXR2' since it already exists.<jupyter_text>CQW49_15865 --> not added, no corresponding reaction<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_15865.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output><empty_output><jupyter_text>CQW49_17395<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17395.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>NI2uabcpp Nickel transport via ABC system (uptake, periplasm) atp_c + h2o_c + ni2_p --> adp_c + h_c + ni2_c + pi_c
MG2uabcpp Magnesium (Mg+2) ABC transporter (ubtake, periplasm) atp_c + h2o_c + mg2_p --> adp_c + h_c + mg2_c + pi_c<jupyter_text>CQW49_18215<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_18215.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NADPHQR2)
iMsOB3b.reactions.get_by_id('NADPHQR2').reaction = 'h_c + nadph_c + q_c --> nadp_c + qh2_c'<jupyter_output><empty_output><jupyter_text>CQW49_21560<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21560.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.QRr)<jupyter_output>Ignoring reaction 'QRr' since it already exists.<jupyter_text>Save model for now:<jupyter_code>cobra.io.save_json_model(iMsOB3b, memote_directory + draft_gems_dir_8 + "bigg_OB3b_14_01_2020.json")<jupyter_output><empty_output><jupyter_text>OB3b_locus_tags_and_their_description_not_included_in_automatic_GEMs<jupyter_code>for locus_tag in OB3b_locus_tags_and_their_description:
    try:
        print(model_OB3b_old.genes.get_by_id(locus_tag).id, 
              model_OB3b_old.genes.get_by_id(locus_tag).reactions)
    except:
        pass<jupyter_output>CQW49_00515 frozenset({<Reaction ATPSipp at 0x7f32910a10f0>})
CQW49_00550 frozenset({<Reaction ATPSipp at 0x7f32910a10f0>})
CQW49_00740 frozenset({<Reaction UACMAMO at 0x7f3290abfef0>})
CQW49_00915 frozenset({<Reaction BMOGDS2 at 0x7f3290c126a0>, <Reaction BMOGDS1 at 0x7f3290bfdcf8>})
CQW49_01170 frozenset({<Reaction DPR at 0x7f328fdc6588>})
CQW49_01220 frozenset({<Reaction PMMODCipp at 0x7f32910e5e80>, <Reaction PMMOipp at 0x7f32911026a0>})
CQW49_01360 frozenset({<Reaction NDPK4 at 0x7f3290142208>, <Reaction NDPK6 at 0x7f3290122e48>, <Reaction NDPK7 at 0x7f3290122c88>, <Reaction NDPK1 at 0x7f3290142eb8>, <Reaction NDPK5 at 0x7f32901428d0>, <Reaction NDPK2 at 0x7f3290142518>, <Reaction NDPK8 at 0x7f3290122b38>, <Reaction NDPK10 at 0x7f3290142748>, <Reaction NDPK3 at 0x7f3290142358>, <Reaction PYK at 0x7f3290277748>, <Reaction NDPK9 at 0x7f3290122978>})
CQW49_01705 frozenset({<Reaction LIPOS at 0x7f32908079e8>})
CQW49_01990 frozenset({<Reaction LPLIPAL1A160pp at 0x7f3290807048>, <Reacti[...]<jupyter_text>CQW49_00515<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_00515.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.ATPS4rpp.gene_reaction_rule<jupyter_output><empty_output><jupyter_text>CQW49_00550<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_00550.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.ATPS4rpp.gene_reaction_rule<jupyter_output><empty_output><jupyter_text>CQW49_00740<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_00740.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.UACMAMO)<jupyter_output><empty_output><jupyter_text>CQW49_00915<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_00915.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>BMOGDS2 Bis-molybdopterin guanine dinucleotide synthase bmoco1gdp_c + gtp_c + h_c --> bmocogdp_c + ppi_c
BMOGDS1 Bis-molybdopterin guanine dinucleotide synthase (single GDP) bmoco_c + gtp_c + h_c --> bmoco1gdp_c + ppi_c<jupyter_text>CQW49_01170<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01170.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.DPR.gene_reaction_rule = 'CQW49_01170'<jupyter_output><empty_output><jupyter_text>CQW49_01220<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01220.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.genes.CQW49_01220<jupyter_output><empty_output><jupyter_text>CQW49_01360<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01360.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK1)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK2)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK3)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK4)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK5)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK6)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK7)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK8)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK9)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NDPK10)<jupyter_output>Ignoring reaction 'NDPK1' since it already exists.
Ignoring reaction 'NDPK2' since it already exists.
Ignoring reaction 'NDPK3' since it already exists.
Ignoring reaction 'NDPK4' since it already exists.
Ignoring reaction 'NDPK5' since it already exists.
Ignoring reaction 'NDPK6' since it already exists.
Ignoring reaction 'NDPK7' since it already exists.
Ignoring reaction 'NDPK8' since it already exists.
Ignoring reaction 'NDPK9' since it already exists.
Ignoring reaction 'NDPK10' since it already exists.<jupyter_text>CQW49_01705<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01705.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.LIPOS)<jupyter_output><empty_output><jupyter_text>CQW49_01990<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_01990.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
for reaction in iMsOB3b.reactions:
    if "thioeste" in reaction.name:
        print(reaction.name, reaction.id, reaction.gene_reaction_rule)
iMsOB3b.reactions.HFACOAE60.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE180.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE160.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE140.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.HFACOAE80.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE60.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE80.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.HFACOAE180.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.HFACOAE120.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE120.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.HFACOAE100.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.FACOAE100.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.HFACOAE160.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'
iMsOB3b.reactions.HFACOAE140.gene_reaction_rule = 'CQW49_00725 or CQW49_04870 or CQW49_01990'<jupyter_output><empty_output><jupyter_text>CQW49_02400<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_02400.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.GTHRDHpp)<jupyter_output><empty_output><jupyter_text>CQW49_02415<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_02415.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.PPS)<jupyter_output><empty_output><jupyter_text>CQW49_02635<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_02635.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.ORNTA)<jupyter_output><empty_output><jupyter_text>CQW49_02865 build reaction based on http://bigg.ucsd.edu/universal/reactions/CLS_m these reactions belong to glycerolphospholipid metabolism<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_02865.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("cardiolipin", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.metabolites.clpnd161_c
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("phosphatidylglycerol", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.metabolites.pg160_c
iMsOB3b.reactions.PGPP160
import re
for reaction in iMsOB3b.reactions:
    if re.search("CDP", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
#iMsOB3b.reactions.DASYN160
#iMsOB3b.reactions.DASYN161
#iMsOB3b.reactions.DASYN180
iMsOB3b.reactions.DASYN181
iMsOB3b.reactions.CLPNS160

iMsOB3b.reactions.CLPNS161

iMsOB3b.reactions.CLPNS180

iMsOB3b.reactions.CLPNS181

cdp12dgr160_m + pg160_m ⇌ cmp_m + h_m + clpn160_m
from cobra import Model, Reaction, Metabolite
# Best practise: SBML compliant IDs

reaction = Reaction('CLPNS160')
reaction.name = 'Cardiolipin synthase (n-16:0)'
reaction.lower_bound = -1000.  # This is the default
reaction.upper_bound = 1000.  # This is the default

iMsOB3b.add_reaction(reaction)
iMsOB3b.reactions.CLPNS160.reaction = 'cdpdhdecg_c + pg160_c <=> cmp_c + clpnd160_c'
from cobra import Model, Reaction, Metabolite
# Best practise: SBML compliant IDs

reaction = Reaction('CLPNS161')
reaction.name = 'Cardiolipin synthase (n-16:1)'
reaction.lower_bound = -1000.  # This is the default
reaction.upper_bound = 1000.  # This is the default

iMsOB3b.add_reaction(reaction)
iMsOB3b.reactions.CLPNS161.reaction = 'cdpdhdec9eg_c + pg161_c <=> cmp_c + clpnd161_c'
from cobra import Model, Reaction, Metabolite
# Best practise: SBML compliant IDs

reaction = Reaction('CLPNS180')
reaction.name = 'Cardiolipin synthase (n-18:0)'
reaction.lower_bound = -1000.  # This is the default
reaction.upper_bound = 1000.  # This is the default

iMsOB3b.add_reaction(reaction)
iMsOB3b.reactions.CLPNS180.reaction = 'cdpdodecg_c + pg180_c <=> cmp_c + clpnd180_c'
from cobra import Model, Reaction, Metabolite
# Best practise: SBML compliant IDs

reaction = Reaction('CLPNS181')
reaction.name = 'Cardiolipin synthase (n-18:1)'
reaction.lower_bound = -1000.  # This is the default
reaction.upper_bound = 1000.  # This is the default

iMsOB3b.add_reaction(reaction)
iMsOB3b.reactions.CLPNS181.reaction = 'cdpdodec11eg_c + pg181_c <=> cmp_c + clpnd181_c'
iMsOB3b.reactions.CLPNS160.gene_reaction_rule = 'CQW49_02865'
iMsOB3b.reactions.CLPNS161.gene_reaction_rule = 'CQW49_02865'
iMsOB3b.reactions.CLPNS180.gene_reaction_rule = 'CQW49_02865'
iMsOB3b.reactions.CLPNS181.gene_reaction_rule = 'CQW49_02865'<jupyter_output><empty_output><jupyter_text>CQW49_02960<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_02960.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.SHSL2)<jupyter_output><empty_output><jupyter_text>CQW49_03300<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_03300.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.CA2abctpp.gene_reaction_rule = 'CQW49_03300'<jupyter_output><empty_output><jupyter_text>CQW49_03485<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_03485.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.NADH11.gene_reaction_rule = 'CQW49_05325 and CQW49_05330 and CQW49_18615 and CQW49_05310 and CQW49_05315 and CQW49_05300 and CQW49_05305 and CQW49_05290 and CQW49_05335 and CQW49_05295 and CQW49_05340 and CQW49_05345 and CQW49_05285 and CQW49_05350 and CQW49_05320 and CQW49_03485'<jupyter_output><empty_output><jupyter_text>CQW49_03930<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_03930.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.XPPT)<jupyter_output><empty_output><jupyter_text>CQW49_04245 Add reaction since it is present in genbank annotation<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_04245.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.MSAR)<jupyter_output><empty_output><jupyter_text>CQW49_04395<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_04395.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output><empty_output><jupyter_text>CQW49_04465<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_04465.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output><empty_output><jupyter_text>CQW49_05060 --> too broad definition<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_05060.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>AMPTASECG Alanyl aminopeptidase (cys-gly) cgly_c + h2o_c --> cys__L_c + gly_c
AMPTASEPG Aminopeptidase (pro-gly) h2o_c + progly_c --> gly_c + pro__L_c<jupyter_text>CQW49_05095<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_05095.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.PPC.gene_reaction_rule<jupyter_output><empty_output><jupyter_text>CQW49_05280<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_05280.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.BACCL)<jupyter_output><empty_output><jupyter_text>CQW49_05640<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_05640.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.HGNTOR)<jupyter_output>Ignoring reaction 'HGNTOR' since it already exists.<jupyter_text>CQW49_05645<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_05645.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.get_by_id('34HPPOR'))<jupyter_output>Ignoring reaction '34HPPOR' since it already exists.<jupyter_text>CQW49_06015<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06015.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("glutathione", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.reactions.GTHPp.gene_reaction_rule = "CQW49_06010 or CQW49_06015"<jupyter_output><empty_output><jupyter_text>Save model for now:<jupyter_code>cobra.io.save_json_model(iMsOB3b, memote_directory + draft_gems_dir_8 + "bigg_OB3b_15_01_2020.json")<jupyter_output><empty_output><jupyter_text>CQW49_06060  too broad definition not added<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06060.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>AMPTASEPG Aminopeptidase (pro-gly) h2o_c + progly_c --> gly_c + pro__L_c<jupyter_text>CQW49_06175<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06175.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.FTHFCL)<jupyter_output><empty_output><jupyter_text>CQW49_06290<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06290.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
print(iMsOB3b.metabolites.cpppg3_c.name)
print(iMsOB3b.metabolites.amet_c.name)
print(iMsOB3b.metabolites.dad_5_c.name)
print(iMsOB3b.metabolites.pppg9_c.name)
iMsOB3b.add_reaction(model_OB3b_old.reactions.CPPPGO2)<jupyter_output><empty_output><jupyter_text>CQW49_06695<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06695.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("ornithine", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.metabolites.orn_c.reactions
iMsOB3b.reactions.ORNDC.gene_reaction_rule = 'CQW49_06695'<jupyter_output><empty_output><jupyter_text>CQW49_06715 change reaction bounds so that nh4_c is not assimilated via glutamate dehydrogenase<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06715.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("glutamate", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
for reaction in iMsOB3b.metabolites.glu_D_c.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
print(iMsOB3b.reactions.GLNS)
print(iMsOB3b.reactions.GLUSy)
iMsOB3b.add_reaction(model_OB3b_old.reactions.GLUDy)
iMsOB3b.add_reaction(model_OB3b_old.reactions.GLUDxi)
iMsOB3b.reactions.GLUDy.bounds = (0, 1000)
iMsOB3b.reactions.GLUDxi.bounds = (0, 1000)<jupyter_output><empty_output><jupyter_text>CQW49_06730<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06730.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("pyruvate", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.PDH.gene_reaction_rule = 'CQW49_01940 and CQW49_01945 and CQW49_01950 and CQW49_06860 and CQW49_06730'<jupyter_output><empty_output><jupyter_text>CQW49_06735 "Dihydrolipoyl transacetylase (or dihydrolipoamide acetyltransferase) is an enzyme component of the multienzyme pyruvate dehydrogenase complex. The pyruvate dehydrogenase complex is responsible for the pyruvate decarboxylation step that links glycolysis to the citric acid cycle. This involves the transformation of pyruvate from glycolysis into acetyl-CoA which is then used in the citric acid cycle to carry out cellular respiration." --> https://en.wikipedia.org/wiki/Dihydrolipoyl_transacetylase<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06735.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.PDH.gene_reaction_rule = 'CQW49_01940 and CQW49_01945 and CQW49_01950 and CQW49_06860 and CQW49_06730 and CQW49_06735'<jupyter_output><empty_output><jupyter_text>CQW49_06750<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06750.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("glyoxylate", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.GLYCLTDx.gene_reaction_rule = 'CQW49_04355 and CQW49_04350 and CQW49_04360 and CQW49_06750'<jupyter_output><empty_output><jupyter_text>CQW49_06900<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_06900.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.UDPGDC)<jupyter_output><empty_output><jupyter_text>CQW49_07145<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_07145.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.metabolites.hisp_c
iMsOB3b.metabolites.imacp_c
iMsOB3b.reactions.HSTPTr.gene_reaction_rule = "CQW49_07145 or CQW49_08850"<jupyter_output><empty_output><jupyter_text>CQW49_07785 'DNA (cytosine-5)-methyltransferase 3A is an enzyme that catalyzes the transfer of methyl groups to specific CpG structures in DNA, a process called DNA methylation.' --> https://en.wikipedia.org/wiki/DNA_(cytosine-5)-methyltransferase_3A<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_07785.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>CYTOM Cytosine 5 methyltransferase amet_c + csn_c <=> 5mcsn_c + ahcys_c + h_c<jupyter_text>CQW49_08660<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_08660.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.SERAT.gene_reaction_rule = 'CQW49_00250 or CQW49_08660 or (CQW49_00250 and CQW49_10340)'<jupyter_output><empty_output><jupyter_text>CQW49_08665<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_08665.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.HCITS)<jupyter_output><empty_output><jupyter_text>CQW49_08720 and CQW49_08725<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_08720.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
for reaction in model_OB3b_old.genes.CQW49_08725.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.NIT_mc.gene_reaction_rule = 'CQW49_08720 and CQW49_08725'<jupyter_output><empty_output><jupyter_text>CQW49_09160<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_09160.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.TRPAS2)
iMsOB3b.reactions.TRPAS2.bounds = (0, 1000)
iMsOB3b.reactions.TRPAS2.reaction = 'h2o_c + trp_L_c --> indole_c + nh4_c + pyr_c'<jupyter_output><empty_output><jupyter_text>CQW49_09295 https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_09295 CQW49_09405 (GenBank) complex I NDUFA9 subunit family protein --> not addedhttps://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_09405<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_09405.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>NADH16pp type-1 nadh:quinone oxidoreductase (H+-translocating) 4.0 h_c + nadh_c + q8_im --> 3.0 h_p + nad_c + q8h2_im<jupyter_text>CQW49_09415<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_09415.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.NTPTP1)<jupyter_output><empty_output><jupyter_text>CQW49_09715<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_09715.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("oxopentanoate", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.add_reaction(model_OB3b_old.reactions.HOPNTAL)<jupyter_output><empty_output><jupyter_text>CQW49_09940<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_09940.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("glucose", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
for reaction in iMsOB3b.metabolites.f6p_c.reactions:
    print(reaction)
iMsOB3b.reactions.PGI.gene_reaction_rule = 'CQW49_09940'<jupyter_output><empty_output><jupyter_text>CQW49_10130<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_10130.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.CCGS)
iMsOB3b.reactions.CCGS.bounds = (-1000, 0)<jupyter_output><empty_output><jupyter_text>CQW49_10255<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_10255.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.genes.CQW49_10255<jupyter_output><empty_output><jupyter_text>CQW49_10875<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_10875.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("carbonic", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.HCO3E.gene_reaction_rule = 'CQW49_10875 or CQW49_20715'<jupyter_output><empty_output><jupyter_text>CQW49_10980<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_10980.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.DAAD)<jupyter_output><empty_output><jupyter_text>CQW49_12035<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12035.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("nicotinate", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.NAPRTr.gene_reaction_rule = 'CQW49_12035'<jupyter_output><empty_output><jupyter_text>CQW49_12245<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12245.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.GLYCK2.gene_reaction_rule<jupyter_output><empty_output><jupyter_text>CQW49_12295inconsistent annotation for this gene --> https://www.genome.jp/dbget-bin/www_bget?ec:3.7.1.20<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12295.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>OPTCCL 5 carboxy 2 oxohept 3 enedioate decarboxylation 5cohe_c + h_c --> 2hh24dd_c + co2_c
HHDDI 2-hydroxyhepta-2,4-diene-1,7-dioate isomerase 2hh24dd_c <=> 2ohed_c<jupyter_text>CQW49_12520not added, not directly related to cellular metabolism --> https://www.genome.jp/dbget-bin/www_bget?ec:2.1.1.37<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12520.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>DMT DNA (cytosine-5-)-methyltransferase ahcys_c + dna5mtc_c + h_c --> amet_c + dnac_c<jupyter_text>CQW49_12845<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12845.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("carbonic", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.HCO3E.gene_reaction_rule = 'CQW49_10875 or CQW49_20715 or CQW49_12845'<jupyter_output><empty_output><jupyter_text>CQW49_12940<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12940.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("glutar", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.add_reaction(model_OB3b_old.reactions.HMGL)<jupyter_output>Ignoring reaction 'HMGL' since it already exists.<jupyter_text>CQW49_12970<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_12970.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("trehal", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.TRE6PP.gene_reaction_rule = 'CQW49_03340 or CQW49_12970'<jupyter_output><empty_output><jupyter_text>CQW49_13000 and CQW49_13005<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_13000.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
for reaction in model_OB3b_old.genes.CQW49_13005.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("cytochrome", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.CYO_2p.gene_reaction_rule = '((CQW49_10040 and CQW49_10020) or CQW49_13005) and (CQW49_10045 or CQW49_13000)'<jupyter_output><empty_output><jupyter_text>CQW49_13305  unclear metabolites --> https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_13305 CQW49_13350 and CQW49_13355 this reaction will be added from old AM1 model<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_13350.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
for reaction in model_OB3b_old.genes.CQW49_13355.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("glycin", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)<jupyter_output>DALAOX glycine oxidase 2
PRFGS phosphoribosylformylglycinamide synthetase
GLYAMDTRc glycine amidinotransferase
GLYTRS glycine tRNA synthetase
GLYCOX3 glycine oxidase 3
GLYCOX4 glycine oxidase 4
GLYCOX5 glycine oxidase 5
GARFT phosphoribosylglycinamide formyltransferase
PRAGSr phosphoribosylglycinamide synthetase
GLYO1 glycine oxidase 1<jupyter_text>CQW49_13470<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_13470.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("formi", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.PRMICI.gene_reaction_rule = 'CQW49_07615 or CQW49_13470'<jupyter_output><empty_output><jupyter_text>CQW49_14985 https://en.wikipedia.org/wiki/Hydroxylamine_reductase https://www.genome.jp/dbget-bin/www_bget?ec:1.7.99.1<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_14985.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.PAMMOipp.gene_reaction_rule = 'CQW49_14985'<jupyter_output><empty_output><jupyter_text>CQW49_15360<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_15360.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("Hexokinase", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
for reaction in iMsOB3b.metabolites.f6p_c.reactions:
    print(reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.HEX7)<jupyter_output><empty_output><jupyter_text>CQW49_15505<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_15505.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.metabolites.ACP_c.name
model_OB3b_old.metabolites.ocACP_c.name
model_OB3b_old.metabolites.octapb_c.name
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("octanoyl", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("acyl_carri", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.metabolites.octapb_c
iMsOB3b.add_reaction(model_OB3b_old.reactions.LIPOCT)<jupyter_output><empty_output><jupyter_text>CQW49_16115 https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_16115<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_16115.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.PFK_ppi)
from cobra import Model, Reaction, Metabolite
# Best practise: SBML compliant IDs

reaction = Reaction('PFK')
reaction.name = 'Phosphofructokinase'
reaction.lower_bound = -1000.  # This is the default
reaction.upper_bound = 1000.  # This is the default

iMsOB3b.add_reaction(reaction)
iMsOB3b.reactions.PFK.reaction = 'atp_c + f6p_c <=> adp_c + fdp_c + h_c'<jupyter_output><empty_output><jupyter_text>CQW49_16125<jupyter_code>iMsOB3b.reactions.FDHr.gene_reaction_rule = 'CQW49_16615 and CQW49_16630 and (CQW49_16625 or CQW49_16125) and CQW49_16635'<jupyter_output><empty_output><jupyter_text>CQW49_16180<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_16180.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for metabolite in iMsOB3b.metabolites:
    if re.search("Orotate", metabolite.name, re.IGNORECASE):
        print(metabolite.id, metabolite.name)
iMsOB3b.reactions.ORPT.gene_reaction_rule = 'CQW49_16180'<jupyter_output><empty_output><jupyter_text>CQW49_16905<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_16905.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.PGM.gene_reaction_rule = 'CQW49_16905'<jupyter_output><empty_output><jupyter_text>CQW49_17075<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17075.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("lactate", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.LDH_D3.gene_reaction_rule = 'CQW49_17075 or CQW49_10060'<jupyter_output><empty_output><jupyter_text>CQW49_17110<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17110.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.metabolites.sql_c
model_OB3b_old.metabolites.dpterol_c
model_OB3b_old.metabolites.dplpt_c
iMsOB3b.add_reaction(model_OB3b_old.reactions.SQLC)
iMsOB3b.add_reaction(model_OB3b_old.reactions.SQLC2)<jupyter_output><empty_output><jupyter_text>Checkpoint: save gem now:<jupyter_code>cobra.io.save_json_model(iMsOB3b, memote_directory + draft_gems_dir_8 + "bigg_OB3b_15_01_2020.json")<jupyter_output><empty_output><jupyter_text>CQW49_17220<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17220.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.ACM6PH)<jupyter_output><empty_output><jupyter_text>CQW49_17240<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17240.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.metabolites.betald_c
iMsOB3b.metabolites.chol_c
iMsOB3b.add_reaction(model_OB3b_old.reactions.CHOLD)<jupyter_output><empty_output><jupyter_text>CQW49_17595Gene annotation does not match up with the KEGG definition or genbank annotation --> https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_17595<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17595.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>FBP Fructose-bisphosphatase fdp_c + h2o_c --> f6p_c + pi_c<jupyter_text>CQW49_17895<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17895.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.ORNTA.gene_reaction_rule = 'CQW49_02635 or CQW49_17895'<jupyter_output><empty_output><jupyter_text>CQW49_17905unclear definition, I am not sure which aldehyde dehydrogenase it is. https://www.genome.jp/dbget-bin/www_bget?ec:1.2.1.3<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_17905.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>AASAD3 AASAD3 L2aadp6sa_c + h2o_c + nad_c --> L2aadp_c + 2.0 h_c + nadh_c
ALDD2x Aldehyde dehydrogenase (acetaldehyde, NAD) acald_c + h2o_c + nad_c --> ac_c + 2.0 h_c + nadh_c<jupyter_text>CQW49_18435<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_18435.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
print(iMsOB3b.metabolites.dump_c.reactions)
print(iMsOB3b.metabolites.mlthf_c.reactions)
print(iMsOB3b.metabolites.dtmp_c.reactions)
print(iMsOB3b.metabolites.thf_c.reactions)
iMsOB3b.add_reaction(model_OB3b_old.reactions.TMDS3)<jupyter_output><empty_output><jupyter_text>CQW49_18575 Gene codes for tRNA dimethylallyltransferase [EC:2.5.1.75] which cannot be included into GEM https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_18575<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_18575.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output><empty_output><jupyter_text>CQW49_18780<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_18780.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("nucleoside triphosphate", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.NTPP8.gene_reaction_rule = 'CQW49_01615 or CQW49_18780'
iMsOB3b.reactions.NTPP6.gene_reaction_rule = 'CQW49_01615 or CQW49_11120'
iMsOB3b.reactions.NTPP4.gene_reaction_rule = 'CQW49_01615 or CQW49_11120'
iMsOB3b.reactions.NTPP2.gene_reaction_rule = 'CQW49_01615 or CQW49_11120'<jupyter_output><empty_output><jupyter_text>CQW49_19460 Not clarified enough https://www.genome.jp/dbget-bin/www_bget?ec:3.4.11.2<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_19460.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>AMPTASEPG Aminopeptidase (pro-gly) h2o_c + progly_c --> gly_c + pro__L_c
AMPTASECG Alanyl aminopeptidase (cys-gly) cgly_c + h2o_c --> cys__L_c + gly_c<jupyter_text>CQW49_20020<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_20020.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.OXADC)<jupyter_output><empty_output><jupyter_text>CQW49_20165 https://www.genome.jp/dbget-bin/www_bget?ec:2.10.1.1<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_20165.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.reactions.BMOCOS
model_OB3b_old.reactions.BWCOS
model_OB3b_old.reactions.WCOS
model_OB3b_old.reactions.MOCOS
import re
for reaction in iMsOB3b.reactions:
    if re.search("molybdo", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.MOBDMPTL.gene_reaction_rule = 'CQW49_20165'<jupyter_output><empty_output><jupyter_text>CQW49_20215<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_20215.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("carbonic", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.HCO3E.gene_reaction_rule = 'CQW49_10875 or CQW49_20715 or CQW49_12845 or CQW49_20215'<jupyter_output><empty_output><jupyter_text>CQW49_20655 different annotation between kegg, genbank and OB3b-related gem https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_20655<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_20655.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
print(iMsOB3b.metabolites.get_by_id('2h3kmpt_c'))
print(iMsOB3b.metabolites.get_by_id('12dmpo_c'))<jupyter_output><empty_output><jupyter_text>CQW49_20795 https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_20795<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_20795.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.ACS.gene_reaction_rule = 'CQW49_20795 or CQW49_13835'<jupyter_output><empty_output><jupyter_text>CQW49_21030<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21030.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.reactions.METGL
iMsOB3b.metabolites.met__L_c
iMsOB3b.metabolites.get_by_id('2obut_c')
iMsOB3b.add_reaction(model_OB3b_old.reactions.METGL)<jupyter_output><empty_output><jupyter_text>CQW49_21250 --> too broad definition --> https://www.genome.jp/dbget-bin/www_bget?ec:4.2.1.17<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21250.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>ECOAH2 3-hydroxyacyl-CoA dehydratase (3-hydroxyhexanoyl-CoA) 3hhcoa_c <=> h2o_c + hx2coa_c
ECOAH7 3-hydroxyacyl-CoA dehydratase (3-hydroxyhexadecanoyl-CoA) 3hhdcoa_c <=> h2o_c + hdd2coa_c
ECOAH3 3-hydroxyacyl-CoA dehydratase (3-hydroxyoctanoyl-CoA) 3hocoa_c <=> h2o_c + oc2coa_c
DHACOAH 2,3-dehydroadipyl-CoA hydratase 23dhacoa_c + h2o_c <=> 3hadpcoa_c
ECOAH6 3-hydroxyacyl-CoA dehydratase (3-hydroxytetradecanoyl-CoA) 3htdcoa_c <=> h2o_c + td2coa_c
ECOAH5 3-hydroxyacyl-CoA dehydratase (3-hydroxydodecanoyl-CoA) 3hddcoa_c <=> dd2coa_c + h2o_c
ECOAH4 3-hydroxyacyl-CoA dehydratase (3-hydroxydecanoyl-CoA) 3hdcoa_c <=> dc2coa_c + h2o_c<jupyter_text>CQW49_21325 and CQW49_21330 and CQW49_21335<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21325.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
for reaction in model_OB3b_old.genes.CQW49_21330.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
for reaction in model_OB3b_old.genes.CQW49_21335.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("urea", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.add_reaction(model_OB3b_old.reactions.UREA)
iMsOB3b.reactions.UREA.gene_reaction_rule = 'CQW49_21325 and CQW49_21330 and CQW49_21335'<jupyter_output><empty_output><jupyter_text>CQW49_21545 unclear enzyme function --> https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_21545<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21545.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>ACPS1 Acyl-carrier protein synthase apoACP_c + coa_c --> ACP_c + h_c + pap_c<jupyter_text>CQW49_21585<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21585.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>NICRNS NICRNS atp_c + nicrns_c --> adp_c + h_c + nicrnt_c
NMNHYD Nicotinamide ribonucleotide phosphohydrolase h2o_c + nmn_c --> pi_c + rnam_c<jupyter_text>CQW49_21985<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_21985.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.SCYSDS)<jupyter_output><empty_output><jupyter_text>CQW49_22035<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_22035.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.reactions.MOCDS
iMsOB3b.metabolites.moco_c
iMsOB3b.reactions.MOGDS
iMsOB3b.reactions.MOBDMPTL
iMsOB3b.add_reaction(model_OB3b_old.reactions.MOCDS)<jupyter_output><empty_output><jupyter_text>CQW49_22875<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_22875.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.SUCCD1<jupyter_output><empty_output><jupyter_text>CQW49_22910<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_22910.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_OB3b_old.reactions.MCITD)<jupyter_output><empty_output><jupyter_text>CQW49_22935 https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_22935<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_22935.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("nitri", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)
iMsOB3b.reactions.NORZ2pp.gene_reaction_rule = 'CQW49_22935'<jupyter_output><empty_output><jupyter_text>CQW49_23115 too broad definition in the KEGG https://www.genome.jp/dbget-bin/www_bget?mtw:CQW49_23115<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_23115.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in iMsOB3b.reactions:
    if re.search("glutath", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name)<jupyter_output>GTHS glutathione synthetase
LGTHL lactoylglutathione lyase
GTHPp glutathione peroxidase  periplasmic 
GTHOr glutathione reductase
GLYOX S lactoylglutathione hydrolase
GTHRDHpp Glutathione hydralase (periplasmic)<jupyter_text>CQW49_23740 too broad definition<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_23740.reactions:
    print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>KAS2 B-ketoacyl synthetase (n-C14:0) accoa_c + 17.0 h_c + 6.0 malcoa_c + 12.0 nadph_c --> 6.0 co2_c + 7.0 coa_c + 5.0 h2o_c + 12.0 nadp_c + ttdca_c
KAS13 B-ketoacyl synthetase (octadecanoate) accoa_c + 23.0 h_c + 8.0 malcoa_c + 16.0 nadph_c --> 8.0 co2_c + 9.0 coa_c + 7.0 h2o_c + 16.0 nadp_c + ocdca_c
KAS16 3-hydroxy-myristoyl-ACP synthesis ddcaACP_c + 2.0 h_c + malACP_c + nadph_c --> 3hmrsACP_c + ACP_c + co2_c + nadp_c
KAS8 B-ketoacyl synthetase (palmitate, n-C16:0) accoa_c + 20.0 h_c + 7.0 malcoa_c + 14.0 nadph_c --> 7.0 co2_c + 8.0 coa_c + 6.0 h2o_c + hdca_c + 14.0 nadp_c
KAS7 B-ketoacyl synthetase (n-C16:1) accoa_c + 19.0 h_c + 7.0 malcoa_c + 13.0 nadph_c --> 7.0 co2_c + 8.0 coa_c + 6.0 h2o_c + hdcea_c + 13.0 nadp_c
KAS17 B-ketoacyl synthetase (n-C18:1) accoa_c + 22.0 h_c + 8.0 malcoa_c + 15.0 nadph_c --> 8.0 co2_c + 9.0 coa_c + 7.0 h2o_c + 15.0 nadp_c + ocdcea_c<jupyter_text>CQW49_23910<jupyter_code>for reaction in model_OB3b_old.genes.CQW49_23910.reactions:
    print(reaction.id, reaction.name, reaction.reaction)
model_OB3b_old.reactions.NMNS
iMsOB3b.add_reaction(model_OB3b_old.reactions.NMNS)<jupyter_output><empty_output><jupyter_text>Save model again:<jupyter_code>cobra.io.save_json_model(iMsOB3b, memote_directory + draft_gems_dir_8 + "bigg_OB3b_16_01_2020.json")<jupyter_output><empty_output><jupyter_text>CQW49_00915<jupyter_code>import re
for reaction in model_AM1.reactions:
    if re.search("molyb", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.MOGDS.gene_reaction_rule = 'CQW49_12160 or CQW49_00915'<jupyter_output><empty_output><jupyter_text>CQW49_13350 and CQW49_13355<jupyter_code>import re
for reaction in model_AM1.reactions:
    if re.search("glycin", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name, reaction.reaction)
model_AM1.reactions.GCCa.gene_reaction_rule = 'CQW49_13350 and CQW49_13355'<jupyter_output><empty_output><jupyter_text>CQW49_01205<jupyter_code>import re
for reaction in model_AM1.reactions:
    if re.search("di_haem", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.add_reaction(model_AM1.reactions.DHCYTCPEROX)
iMsOB3b.reactions.DHCYTCPEROX.gene_reaction_rule = 'CQW49_01205'<jupyter_output><empty_output><jupyter_text>CQW49_08960<jupyter_code>import re
for reaction in model_AM1.reactions:
    if re.search("glutathione", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name, reaction.reaction)
import re
for reaction in model_AM1.reactions:
    if re.search("deaminase", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name, reaction.reaction)<jupyter_output>THRD_L threonine_deaminase thr_L_c --> 2obut_c + nh4_c
DHPPDA2 diaminohydroxyphosphoribosylaminopyrimidine_deaminase 25drapp_c + h2o_c + h_c --> 5apru_c + nh4_c
ADD adenine_deaminase ade_c + h2o_c + h_c --> hxan_c + nh4_c
DCYTD cytidine_deaminase_2 dcyt_c + h2o_c + h_c --> duri_c + nh4_c
ORNCD ornithine_cyclodeaminase orn_c --> nh4_c + pro_L_c
SERD_L L_serine_deaminase ser_L_c --> nh4_c + pyr_c
HMBS porphobilinogen_deaminase h2o_c + 4.0 ppbng_c <=> hmbil_c + 4.0 nh4_c
DCTPD dCTP_deaminase dctp_c + h2o_c + h_c --> dutp_c + nh4_c
CYTD cytidine_deaminase_1 cytd_c + h2o_c + h_c --> nh4_c + uri_c
GUAD guanine_deaminase gua_c + h2o_c + h_c <=> nh4_c + xan_c<jupyter_text>CQW49_17395<jupyter_code>import re
for reaction in model_AM1.reactions:
    if re.search("magnesium", reaction.name, re.IGNORECASE):
        print(reaction.id, reaction.name, reaction.reaction)
iMsOB3b.reactions.MG2uabcpp.gene_reaction_rule = 'CQW49_12745 or CQW49_17395'<jupyter_output><empty_output><jupyter_text>Save model before proceeding further:<jupyter_code>cobra.io.save_json_model(iMsOB3b, memote_directory + draft_gems_dir_8 + "bigg_OB3b_16_01_2020.json")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09893591935388787, 'fraction_numerical': 0.07796380357248128, 'mean_word_length': 6.620507637017071, 'pattern_counts': {'":': 1, '<': 574, '<?xml version=': 0, '>': 638, 'https://': 24, 'lorem ipsum': 0, 'www.': 39, 'xml': 2}, 'pii_count': 9, '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': '139', 'dir': 'jupyter-structured-clean-dedup', 'id': '421969', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 31535, 'n_tokens_neox': 26795, 'n_words': 4059, 'path': 'supplementary_scripts/4. Add reactions not present in OB3b GEM.ipynb', 'repo_name': 'ensakz/gem_methylosinus_trichosporium', 'size': '67848'}