Skip to content

Commit

Permalink
Allow multiple codon tables and update list of generators in core
Browse files Browse the repository at this point in the history
  • Loading branch information
YinHoon committed Aug 14, 2019
1 parent 546344e commit 60f8b8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wc_model_gen/eukaryote/complexation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ class ComplexationSubmodelGenerator(wc_model_gen.SubmodelGenerator):
Options:
* amino_acid_id_conversion (:obj:`dict`): a dictionary with amino acid standard ids
as keys and amino acid metabolite ids as values
* codon_table (:obj:`int`): NCBI identifier for translation table,
the default is 1 (standard table)
* codon_table (:obj:`dict`): a dictionary with protein subunit id as key and
NCBI identifier for translation table as value, the default is 1 (standard table)
for all protein
* cds (:obj:`bool`): True indicates the sequences of protein subunits are complete CDS,
the default if True
* beta (:obj:`float`, optional): ratio of Michaelis-Menten constant
Expand Down Expand Up @@ -109,8 +110,13 @@ def gen_reactions(self):
subunit_coefficient = subunit.coefficient if subunit.coefficient else 1

if subunit.species_type==compl_subunit.species_type:

if codon_table == 1:
codon_id = 1
else:
codon_id = codon_table[subunit.species_type.id]

protein_seq = subunit.species_type.get_seq(table=codon_table, cds=cds)
protein_seq = subunit.species_type.get_seq(table=codon_id, cds=cds)
aa_content = {}
for aa in protein_seq:
aa_id = amino_acid_id_conversion[aa]
Expand Down
4 changes: 4 additions & 0 deletions wc_model_gen/eukaryote/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"""

from .initialize_model import InitializeModel
from .complexation import ComplexationSubmodelGenerator
from .transcription import TranscriptionSubmodelGenerator
from .rna_degradation import RnaDegradationSubmodelGenerator
import wc_model_gen


Expand All @@ -26,7 +28,9 @@ class EukaryoteModelGenerator(wc_model_gen.ModelGenerator):

DEFAULT_COMPONENT_GENERATORS = (
InitializeModel,
ComplexationSubmodelGenerator,
TranscriptionSubmodelGenerator,
RnaDegradationSubmodelGenerator,
)

def clean_and_validate_options(self):
Expand Down

0 comments on commit 60f8b8f

Please sign in to comment.