2.1. wc_kb package

2.1.1. Submodules

2.1.2. wc_kb.__main__ module

Command line programs for managing knowledge bases for whole-cell models

Author:Jonathan Karr <karr@mssm.edu>
Date:2018-04-20
Copyright:2018, Karr Lab
License:MIT
class wc_kb.__main__.App(label=None, **kw)[source]

Bases: cement.core.foundation.App

Command line application

class Meta[source]

Bases: object

base_controller = 'base'[source]
handlers = [<class 'wc_kb.__main__.BaseController'>, <class 'wc_kb.__main__.ValidateController'>, <class 'wc_kb.__main__.DifferenceController'>, <class 'wc_kb.__main__.NormalizeController'>, <class 'wc_kb.__main__.ConvertController'>, <class 'wc_kb.__main__.CreateTemplateController'>, <class 'wc_kb.__main__.UpdateVersionMetadataController'>][source]
label = 'wc_kb'[source]
class wc_kb.__main__.BaseController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Base controller for command line application

class Meta[source]

Bases: object

arguments = [(['-v', '--version'], {'action': 'version', 'version': '0.0.1'})][source]
description = 'Command line programs for managing knowledge bases for whole-cell models'[source]
label = 'base'[source]
class wc_kb.__main__.ConvertController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Convert knowledge base among Excel (.xlsx), comma separated (.csv), JavaScript Object Notation (.json), tab separated (.tsv), and Yet Another Markup Language (.yaml, .yml) formats

class Meta[source]

Bases: object

arguments = [(['source_core'], {'type': <class 'str'>, 'help': 'Path to core of the knowledge base'}), (['source_seq'], {'type': <class 'str'>, 'help': 'Path to FASTA-formatted genome sqeuence of the knowledge base'}), (['dest_core'], {'type': <class 'str'>, 'help': 'Path to save the converted core of the knowledge base'}), (['dest_seq'], {'type': <class 'str'>, 'help': 'Path to save the converted FASTA-formatted genome sequence of the knowledge base'}), (['--sloppy'], {'dest': 'strict', 'default': True, 'action': 'store_false', 'help': 'If set, do not validate the format of the knowledge base file(s)'})][source]
description = 'Convert knowledge base among .csv, .json, .tsv, .xlsx, .yaml, and .yml formats'[source]
label = 'convert'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_kb.__main__.CreateTemplateController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Create file with knowledge base template (i.e. create file with row and column labels)

class Meta[source]

Bases: object

arguments = [(['path_core'], {'metavar': 'path-core', 'type': <class 'str'>, 'help': 'Path to save a template of the core of a knowledge base'}), (['path_seq'], {'metavar': 'path-seq', 'type': <class 'str'>, 'help': 'Path to save a template of the genome sequence of a knowledge base'}), (['--ignore-repo-metadata'], {'dest': 'set_repo_metadata_from_path', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the parent directory of `path-core`'})][source]
description = 'Create file with knowledge base template: blank file(s) with row and column labels'[source]
label = 'create-template'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_kb.__main__.DifferenceController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Display difference between two knowledge bases

class Meta[source]

Bases: object

arguments = [(['core_path_1'], {'type': <class 'str'>, 'help': 'Path to core for first knowledge base'}), (['seq_path_1'], {'type': <class 'str'>, 'help': 'Path to FASTA-formatted genome sequence for first knowledge base'}), (['core_path_2'], {'type': <class 'str'>, 'help': 'Path to core for second knowledge base'}), (['seq_path_2'], {'type': <class 'str'>, 'help': 'Path to FASTA-formatted genome sequence for second knowledge base'}), (['--compare-files'], {'dest': 'compare_files', 'default': False, 'action': 'store_true', 'help': 'If true, compare knowledge bases; otherwise compare files directly'}), (['--sloppy'], {'dest': 'strict', 'default': True, 'action': 'store_false', 'help': 'If set, do not validate the format of the knowledge base file(s)'})][source]
description = 'Get difference between two knowledge bases'[source]
label = 'difference'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_kb.__main__.NormalizeController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Normalize knowledge base

class Meta[source]

Bases: object

arguments = [(['source_core'], {'type': <class 'str'>, 'help': 'Path to core of the knowledge base'}), (['source_seq'], {'type': <class 'str'>, 'help': 'Path to FASTA-formatted genome sequence for the knowledge base'}), (['--dest-core'], {'default': '', 'type': <class 'str'>, 'help': 'Path to save normalized core of the knowledge base'}), (['--dest-seq'], {'default': '', 'type': <class 'str'>, 'help': 'Path to save normalized FASTA-formatted genome sequence for the knowledge base'}), (['--sloppy'], {'dest': 'strict', 'default': True, 'action': 'store_false', 'help': 'If set, do not validate the format of the knowledge base file(s)'})][source]
description = 'Normalize knowledge base'[source]
label = 'normalize'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_kb.__main__.UpdateVersionMetadataController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Update version metadata of a knowledge base (URL, branch, revision, wc_kb version)

class Meta[source]

Bases: object

arguments = [(['path_core'], {'type': <class 'str'>, 'help': 'Path to the core of the knowledge base'}), (['path_seq'], {'type': <class 'str'>, 'help': 'Path to the FASTA-formatted genome sequence of a knowledge base'}), (['--ignore-repo-metadata'], {'dest': 'set_repo_metadata_from_path', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the parent directory of `path-core`'}), (['--sloppy'], {'dest': 'strict', 'default': True, 'action': 'store_false', 'help': 'If set, do not validate the format of the knowledge base file(s)'})][source]
description = 'Update version metadata of a knowledge base (URL, branch, revision, wc_kb version)'[source]
label = 'update-version-metadata'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_kb.__main__.ValidateController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Validate knowledge base and display errors

class Meta[source]

Bases: object

arguments = [(['core_path'], {'type': <class 'str'>, 'help': 'Path to knowledge base core'}), (['seq_path'], {'type': <class 'str'>, 'help': 'Path to FASTA-formatted genome sequence'}), (['--sloppy'], {'dest': 'strict', 'default': True, 'action': 'store_false', 'help': 'If set, do not validate the format of the knowledge base core file(s)'})][source]
description = 'Validate knowledge base and display errors'[source]
label = 'validate'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
wc_kb.__main__.main()[source]

2.1.3. wc_kb.core module

Core schema to represent a knowledge base to build models

Author:Balazs Szigeti <balazs.szigeti@mssm.edu>
Author:Jonathan Karr <jonrkarr@gmail.com>
Author:Bilal Shaikh <bilal.shaikh@columbia.edu>
Author:Arthur Goldberg <Arthur.Goldberg@mssm.edu>
Author:Yin Hoon Chew <yinhoon.chew@mssm.edu>
Date:2018-02-07
Copyright:2018, Karr Lab
License:MIT
class wc_kb.core.Cell(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of a cell

knowledge_base[source]

knowledge base

Type:KnowledgeBase
taxon[source]

NCBI taxon identifier

Type:int
Related attributes:
references (list of Reference): references compartments (list of Compartment): compartments species_types (list of SpeciesType): species types concentrations (list of Concentration): concentrations observables (list or Observable) : observables loci (list of PolymerLocus): locus reactions (list of Reaction): reactions
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'taxon', 'comments')[source]
attributes = {'comments': <obj_model.core.LongStringAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'knowledge_base': <obj_model.core.OneToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'taxon': <obj_model.core.IntegerAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Cell'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'concentrations': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'knowledge_base': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'properties': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'compartments': <obj_model.core.ManyToOneAttribute object>, 'concentrations': <obj_model.core.ManyToOneAttribute object>, 'loci': <obj_model.core.ManyToOneAttribute object>, 'observables': <obj_model.core.ManyToOneAttribute object>, 'properties': <obj_model.core.ManyToOneAttribute object>, 'reactions': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToOneAttribute object>, 'species_types': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 2[source]
unique_together = ()[source]
verbose_name = 'Cell'[source]
verbose_name_plural = 'Cells'[source]
knowledge_base = <obj_model.core.OneToOneAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
taxon = <obj_model.core.IntegerAttribute object>[source]
class wc_kb.core.Compartment(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of a subcellular compartment

cell[source]

cell

Type:Cell
volumetric_fraction[source]

average volumetric fraction relative to the cell volume

Type:float
references[source]

references

Type:list
database_references[source]

database references

Type:list
Related attributes:
reaction_participants (list of ReactionParticipant): reaction participants
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'volumetric_fraction', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'volumetric_fraction': <obj_model.core.FloatAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Compartment'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'volumetric_fraction': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'species': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Compartment'[source]
verbose_name_plural = 'Compartments'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
volumetric_fraction = <obj_model.core.FloatAttribute object>[source]
class wc_kb.core.ComplexFormationType[source]

Bases: enum.Enum

Type of complex formation

process_ChromosomeCondensation = 0[source]
process_FtsZPolymerization = 1[source]
process_MacromolecularComplexation = 2[source]
process_Metabolism = 3[source]
process_ProteinModification = 4[source]
process_Replication = 5[source]
process_ReplicationInitiation = 6[source]
process_RibosomeAssembly = 7[source]
process_Transcription = 8[source]
process_Translation = 9[source]
class wc_kb.core.ComplexSpeciesType(**kwargs)[source]

Bases: wc_kb.core.SpeciesType

Knowledge of a protein complex

formation_process[source]

type of formation process

Type:ComplexFormationType
subunits[source]

subunits

Type:list
composition_in_uniprot[source]

protein subunit composition in uniprot IDs

Type:str
complex_type[source]

type of complex

Type:ComplexType
binding[source]

strand of DNA bound if involved

Type:str
region[source]

region where DNA is bound if involved

Type:str
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'formation_process', 'subunits', 'composition_in_uniprot', 'complex_type', 'binding', 'region', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'binding': <obj_model.core.StringAttribute object>, 'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'complex_type': <obj_model.core.StringAttribute object>, 'composition_in_uniprot': <obj_model.core.StringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'formation_process': <obj_model.core.EnumAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'region': <obj_model.core.StringAttribute object>, 'subunits': <wc_kb.core.SubunitAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.ComplexSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'binding': <obj_model.core.LocalAttribute object>, 'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'complex_type': <obj_model.core.LocalAttribute object>, 'composition_in_uniprot': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'formation_process': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'region': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>, 'subunits': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Complex species type'[source]
verbose_name_plural = 'Complex species types'[source]
binding = <obj_model.core.StringAttribute object>[source]
complex_type = <obj_model.core.StringAttribute object>[source]
composition_in_uniprot = <obj_model.core.StringAttribute object>[source]
formation_process = <obj_model.core.EnumAttribute object>[source]
get_charge()[source]

Get the charge at physiological pH

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight

Returns:molecular weight
Return type:float
objects = <obj_model.core.Manager object>[source]
region = <obj_model.core.StringAttribute object>[source]
subunits = <wc_kb.core.SubunitAttribute object>[source]
class wc_kb.core.ComplexType[source]

Bases: enum.Enum

Type of complex

FattyAcylAcp = 1[source]
tRnaSynthClassII = 0[source]
class wc_kb.core.Concentration(**kwargs)[source]

Bases: obj_model.core.Model

Species concentration

cell[source]

cell

Type:Cell
species[source]

species

Type:Species
value[source]

value

Type:float
units[source]

units; default units is ‘M’

Type:str
comments[source]

comments

Type:str
references[source]

references

Type:list
database_references[source]

database references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('species', 'value', 'units', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'species': <wc_kb.core.OneToOneSpeciesAttribute object>, 'units': <obj_model.core.EnumAttribute object>, 'value': <obj_model.core.FloatAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Concentration'>,)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ('species',)[source]
primary_attribute = None[source]
related_attributes = {}[source]
unique_together = (('species',),)[source]
verbose_name = 'Concentration'[source]
verbose_name_plural = 'Concentrations'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
comments = <obj_model.core.LongStringAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation :returns: value of primary attribute :rtype: str

species = <wc_kb.core.OneToOneSpeciesAttribute object>[source]
units = <obj_model.core.EnumAttribute object>[source]
value = <obj_model.core.FloatAttribute object>[source]
class wc_kb.core.ConcentrationUnit[source]

Bases: int, enum.Enum

An enumeration.

M = 2[source]
aM = 8[source]
fM = 7[source]
mM = 3[source]
molecules = 1[source]
nM = 5[source]
pM = 6[source]
uM = 4[source]
class wc_kb.core.DatabaseReference(**kwargs)[source]

Bases: obj_model.core.Model

Reference to an entity in an external database

database[source]

name of the external database

Type:str
id[source]

identifier within the database

Type:str
Related attributes:
compartments (list of Compartment): compartments species_types (list of SpeciesType): species_types concentrations (list of Concentration): concentrations loci (list of PolymerLocus): loci properties (list of Property): properties reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate_laws observables (list of Observable): observables
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('database', 'id')[source]
attributes = {'database': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.DatabaseReference'>,)[source]
local_attributes = {'compartments': <obj_model.core.LocalAttribute object>, 'concentrations': <obj_model.core.LocalAttribute object>, 'database': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'properties': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'regulatory_modules': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>}[source]
ordering = ('database', 'id')[source]
primary_attribute = None[source]
related_attributes = {'compartments': <wc_kb.core.DatabaseReferenceAttribute object>, 'concentrations': <wc_kb.core.DatabaseReferenceAttribute object>, 'loci': <wc_kb.core.DatabaseReferenceAttribute object>, 'observables': <wc_kb.core.DatabaseReferenceAttribute object>, 'parameters': <wc_kb.core.DatabaseReferenceAttribute object>, 'properties': <wc_kb.core.DatabaseReferenceAttribute object>, 'rate_laws': <wc_kb.core.DatabaseReferenceAttribute object>, 'reactions': <wc_kb.core.DatabaseReferenceAttribute object>, 'regulatory_modules': <wc_kb.core.DatabaseReferenceAttribute object>, 'species_types': <wc_kb.core.DatabaseReferenceAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = (('database', 'id'),)[source]
verbose_name = 'Database reference'[source]
verbose_name_plural = 'Database references'[source]
database = <obj_model.core.StringAttribute object>[source]
id = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:value of primary attribute
Return type:str
class wc_kb.core.DatabaseReferenceAttribute(related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

Database reference attribute

deserialize(value, objects, decoded=None)[source]

Deserialize value :param value: String representation :type value: str :param objects: dictionary of objects, grouped by model :type objects: dict :param decoded: dictionary of objects that have already been decoded :type decoded: dict, optional

Returns:
tuple of cleaned value
and cleaning error
Return type:tuple of list of DatabaseReference, InvalidAttribute or None
serialize(database_references, encoded=None)[source]

Serialize related object :param database_references: a list of instances of DatabaseReference Python representation :type database_references: list of Model :param encoded: dictionary of objects that have already been encoded :type encoded: dict, optional

Returns:simple Python representation
Return type:str
class wc_kb.core.DnaSpeciesType(**kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a DNA species

seq_path[source]

path to sequence fasta file

Type:str
ploidy[source]

ploidy

Type:int
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'sequence_path', 'circular', 'double_stranded', 'ploidy', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'ploidy': <obj_model.core.IntegerAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'sequence_path': <obj_model.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.DnaSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'ploidy': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'sequence_path': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'DNA species type'[source]
verbose_name_plural = 'DNA species types'[source]
get_charge()[source]

Get the charge for a DNA molecule with

  • 5’ monophosphate (for linear molecules)

  • Deprotonated phosphate oxygens

  • Linear DNA

    \(-L - 1\)

  • Circular DNA

    \(-L\)

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula for a DNA molecule with

  • 5’ monophosphate (for linear molecules)

  • Deprotonated phosphate oxygens

  • Linear DNA

    \(N_A * dAMP + N_C * dCMP + N_G * dGMP + N_T * dTMP - (L - 1) * OH\)

  • Circular DNA

    \(N_A * dAMP + N_C * dCMP + N_G * dGMP + N_T * dTMP - L * OH\)

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight for a DNA molecule with

  • 5’ monophosphate (for linear molecules)

  • Deprotonated phosphate oxygens

  • Linear DNA

    \(N_A * MW_{dAMP} + N_C * MW_{dCMP} + N_G * MW_{dGMP} + N_T * MW_{dTMP} - (L - 1) * MW_{OH}\)

  • Circular DNA

    \(N_A * MW_{dAMP} + N_C * MW_{dCMP} + N_G * MW_{dGMP} + N_T * MW_{dTMP} - L * MW_{OH}\)

Returns:molecular weight
Return type:float
get_seq(start=None, end=None)[source]

Get the sequence

Parameters:
  • start (int, optional) – start coordinate of the queried subsequence, default is the start of the full sequence
  • end (int, optional) – end coordinate of the queried subsequence, default is the end of the full sequence
Returns:

structure

Return type:

Bio.Seq.Seq

objects = <obj_model.core.Manager object>[source]
ploidy = <obj_model.core.IntegerAttribute object>[source]
sequence_path = <obj_model.core.StringAttribute object>[source]
class wc_kb.core.GeneType[source]

Bases: enum.Enum

Type of gene

mRna = 0[source]
rRna = 1[source]
sRna = 2[source]
tRna = 3[source]
class wc_kb.core.KnowledgeBase(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

A knowledge base

version[source]

version

Type:str
translation_table[source]

translation table

Type:int
version[source]

version of the KB

Type:str
url[source]

url of the KB Git repository

Type:str
branch[source]

branch of the KB Git repository

Type:str
revision[source]

revision of the KB Git repository

Type:str
wc_kb_version[source]

version of wc_kb

Type:str
Related attributes:
cell (Cell): cell
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'translation_table', 'version', 'url', 'branch', 'revision', 'wc_kb_version', 'comments')[source]
attributes = {'branch': <obj_model.core.StringAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'revision': <obj_model.core.StringAttribute object>, 'translation_table': <obj_model.core.IntegerAttribute object>, 'url': <obj_model.core.StringAttribute object>, 'version': <obj_model.core.RegexAttribute object>, 'wc_kb_version': <obj_model.core.RegexAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.KnowledgeBase'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'branch': <obj_model.core.LocalAttribute object>, 'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'revision': <obj_model.core.LocalAttribute object>, 'translation_table': <obj_model.core.LocalAttribute object>, 'url': <obj_model.core.LocalAttribute object>, 'version': <obj_model.core.LocalAttribute object>, 'wc_kb_version': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'cell': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 2[source]
unique_together = ()[source]
verbose_name = 'Knowledge base'[source]
verbose_name_plural = 'Knowledge bases'[source]
branch = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
revision = <obj_model.core.StringAttribute object>[source]
translation_table = <obj_model.core.IntegerAttribute object>[source]
url = <obj_model.core.StringAttribute object>[source]
version = <obj_model.core.RegexAttribute object>[source]
wc_kb_version = <obj_model.core.RegexAttribute object>[source]
class wc_kb.core.KnowledgeBaseObject(**kwargs)[source]

Bases: obj_model.core.Model

Knowledge of a biological entity

id[source]

identifier

Type:str
name[source]

name

Type:str
comments[source]

comments

Type:str
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ()[source]
attributes = {'comments': <obj_model.core.LongStringAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.KnowledgeBaseObject'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Knowledge base object'[source]
verbose_name_plural = 'Knowledge base objects'[source]
comments = <obj_model.core.LongStringAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
class wc_kb.core.MetaboliteSpeciesType(**kwargs)[source]

Bases: wc_kb.core.SpeciesType

Knowledge of a metabolite

structure[source]

InChI-encoded structure

Type:str
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'structure', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'structure': <obj_model.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.MetaboliteSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Metabolite species type'[source]
verbose_name_plural = 'Metabolite species types'[source]
get_charge()[source]

Get the charge

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight

Returns:molecular weight
Return type:float
get_structure()[source]

Get the structure

Returns:structure
Return type:str
objects = <obj_model.core.Manager object>[source]
structure = <obj_model.core.StringAttribute object>[source]
to_openbabel_mol()[source]

Convert species type to an Open Babel molecule

Returns:Open Babel molecule
Return type:openbabel.OBMol
class wc_kb.core.Observable(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of an observable to include in a model

cell[source]

The cell that the observable is in

Type:Cell
species[source]

A list of the species and the coefficients to be included in the observable

Type:list
observables[source]

list of component observables and their coefficients

Type:list
references[source]

references

Type:list
database_references[source]

database references

Type:list
Related Attributes:
observable_coefficients (list of ObservableCoefficient): Participants in observables
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'cell', 'species', 'observables', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'observables': <wc_kb.core.ObservableObservableParticipantAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'species': <wc_kb.core.ObservableSpeciesParticipantAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Observable'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observable_coefficients': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'observable_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Observable'[source]
verbose_name_plural = 'Observables'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
observables = <wc_kb.core.ObservableObservableParticipantAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
species = <wc_kb.core.ObservableSpeciesParticipantAttribute object>[source]
class wc_kb.core.ObservableCoefficient(**kwargs)[source]

Bases: obj_model.core.Model

A tuple of observable and coefficient

observable[source]

observable

Type:Observable
coefficient[source]

coefficient

Type:float
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('observable', 'coefficient')[source]
attributes = {'coefficient': <obj_model.core.FloatAttribute object>, 'observable': <obj_model.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.ObservableCoefficient'>,)[source]
local_attributes = {'coefficient': <obj_model.core.LocalAttribute object>, 'observable': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>}[source]
ordering = ('observable',)[source]
primary_attribute = None[source]
related_attributes = {'observables': <wc_kb.core.ObservableObservableParticipantAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Observable coefficient'[source]
verbose_name_plural = 'Observable coefficients'[source]
coefficient = <obj_model.core.FloatAttribute object>[source]
classmethod deserialize(attribute, value, objects)[source]

Deserialize value

Parameters:
  • attribute (Attribute) – attribute
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of ObservableCoefficient, InvalidAttribute or None

objects = <obj_model.core.Manager object>[source]
observable = <obj_model.core.ManyToOneAttribute object>[source]
serialize()[source]

Serialize related object

Returns:simple Python representation
Return type:str
class wc_kb.core.ObservableObservableParticipantAttribute(related_class, separator=' + ', related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

Inline separated list of observables and their weights of an observable

separator[source]

list separator

Type:str
deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of related_class, InvalidAttribute or None

serialize(obs_coeffs, encoded=None)[source]

Serialize related object

Parameters:
  • obs_coeffs (list of Model) – Python representation of observables and their coefficients
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation

Return type:

str

class wc_kb.core.ObservableSpeciesParticipantAttribute(related_class, separator=' + ', related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

Inline separated list of species and their weights of an observable

separator[source]

list separator

Type:str
deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of related_class, InvalidAttribute or None

serialize(spec_coeffs, encoded=None)[source]

Serialize related object

Parameters:
  • spec_coeffs (list of Model) – Python representation of species and their coefficients
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation

Return type:

str

class wc_kb.core.OneToOneSpeciesAttribute(related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.OneToOneAttribute

Species attribute

deserialize(value, objects, decoded=None)[source]

Deserialize value :param value: String representation :type value: str :param objects: dictionary of objects, grouped by model :type objects: dict :param decoded: dictionary of objects that have already been decoded :type decoded: dict, optional

Returns:
tuple of cleaned value
and cleaning error
Return type:tuple of list of Species, InvalidAttribute or None
serialize(value, encoded=None)[source]

Serialize related object :param value: Python representation :type value: Model :param encoded: dictionary of objects that have already been encoded :type encoded: dict, optional

Returns:simple Python representation
Return type:str
class wc_kb.core.Parameter(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of parameters

value[source]

value

Type:float
error[source]

measurement error

Type:float
units[source]

units of value

Type:str
references[source]

references

Type:list
database_references[source]

database references

Type:list
Related attributes:
rate_law_equations (list of RateLawEquation): rate law equations that use a Parameter
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'value', 'error', 'units', 'comments', 'references', 'database_references')[source]
attributes = {'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'error': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'units': <obj_model.core.StringAttribute object>, 'value': <obj_model.core.FloatAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Parameter'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'error': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'rate_law_equations': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'rate_law_equations': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Parameter'[source]
verbose_name_plural = 'Parameters'[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
error = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
units = <obj_model.core.StringAttribute object>[source]
value = <obj_model.core.FloatAttribute object>[source]
class wc_kb.core.PolymerLocus(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge about a locus of a polymer

polymer[source]

polymer

Type:PolymerSpeciesType
start[source]

start position

Type:int
end[source]

end position

Type:int
strand[source]

strand

Type:PolymerStrand
references[source]

references

Type:list
database_references[source]

database references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'polymer', 'strand', 'start', 'end', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Polymer locus'[source]
verbose_name_plural = 'Polymer loci'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
end = <obj_model.core.IntegerAttribute object>[source]
get_len()[source]

Get the length

Returns:length
Return type:int
get_seq()[source]

Get the sequence

Returns:sequence
Return type:Bio.Seq.Seq
objects = <obj_model.core.Manager object>[source]
polymer = <obj_model.core.ManyToOneAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
start = <obj_model.core.IntegerAttribute object>[source]
strand = <obj_model.core.EnumAttribute object>[source]
class wc_kb.core.PolymerSpeciesType(**kwargs)[source]

Bases: wc_kb.core.SpeciesType

Knowledge of a polymer

circular[source]

is the polymer circular

Type:bool
double_stranded[source]

is the polymer double stranded

Type:bool
Related attributes:
loci (list of PolymerLocus): loci
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'circular', 'double_stranded', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Polymer species type'[source]
verbose_name_plural = 'Polymer species types'[source]
circular = <obj_model.core.BooleanAttribute object>[source]
double_stranded = <obj_model.core.BooleanAttribute object>[source]
get_len()[source]

Get the polymer length

Returns:length
Return type:int
get_seq()[source]

Get the polymer sequence

Returns:sequence
Return type:Bio.Seq.Seq
get_subseq(start, end, strand=<PolymerStrand.positive: 1>)[source]

Get a subsequence

Parameters:
  • start (int) – start coordinate (1-indexed)
  • end (int) – end coordinate (1-indexed)
  • strand (PolymerStrand, optional) – strand
Returns:

sequence

Return type:

Bio.Seq.Seq

Raises:

ValueError – if the polymer is linear and the start or end coordinates are less than 1 or greater than the length of the sequence

objects = <obj_model.core.Manager object>[source]
class wc_kb.core.PolymerStrand[source]

Bases: enum.Enum

An enumeration.

negative = -1[source]
positive = 1[source]
class wc_kb.core.Property(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Other properties of cells

cell[source]

cell

Type:Cell
value[source]

value

Type:float
units[source]

units

Type:str
references[source]

references

Type:list
database_references[source]

database references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'value', 'units', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'units': <obj_model.core.StringAttribute object>, 'value': <obj_model.core.FloatAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Property'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Property'[source]
verbose_name_plural = 'Properties'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
units = <obj_model.core.StringAttribute object>[source]
value = <obj_model.core.FloatAttribute object>[source]
class wc_kb.core.RateLaw(**kwargs)[source]

Bases: obj_model.core.Model

Rate law

reaction[source]

reaction

Type:Reaction
direction[source]

direction

Type:RateLawDirection
equation[source]

equation

Type:RateLawEquation
k_cat[source]

k_cat for law with Michaelis–Menten kinetics (units: 1/sec)

Type:float
k_m[source]

K_m for law with Michaelis–Menten kinetics (units: mol/L)

Type:float
comments[source]

comments

Type:str
references[source]

references

Type:list
database_references[source]

database references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('reaction', 'direction', 'equation', 'k_cat', 'k_m', 'comments', 'references', 'database_references')[source]
attributes = {'comments': <obj_model.core.StringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'direction': <obj_model.core.EnumAttribute object>, 'equation': <wc_kb.core.RateLawEquationAttribute object>, 'k_cat': <obj_model.core.FloatAttribute object>, 'k_m': <obj_model.core.FloatAttribute object>, 'reaction': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.RateLaw'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'direction': <obj_model.core.LocalAttribute object>, 'equation': <obj_model.core.LocalAttribute object>, 'k_cat': <obj_model.core.LocalAttribute object>, 'k_m': <obj_model.core.LocalAttribute object>, 'reaction': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>}[source]
ordering = ('reaction', 'direction')[source]
primary_attribute = None[source]
related_attributes = {}[source]
unique_together = (('direction', 'reaction'),)[source]
verbose_name = 'Rate law'[source]
verbose_name_plural = 'Rate laws'[source]
comments = <obj_model.core.StringAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
direction = <obj_model.core.EnumAttribute object>[source]
equation = <wc_kb.core.RateLawEquationAttribute object>[source]
k_cat = <obj_model.core.FloatAttribute object>[source]
k_m = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
reaction = <obj_model.core.ManyToOneAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns:value of primary attribute
Return type:str
class wc_kb.core.RateLawDirection[source]

Bases: int, wc_utils.util.enumerate.CaseInsensitiveEnum

Rate law directions

backward = -1[source]
forward = 1[source]
class wc_kb.core.RateLawEquation(**kwargs)[source]

Bases: obj_model.core.Model

Rate law equation

expression[source]

mathematical expression of the rate law

Type:str
modifiers[source]

species whose concentrations are used in the rate law

Type:list
parameters[source]

parameters whose values are used in the rate law

Type:list
Related attributes:
rate_law (RateLaw): the RateLaw which uses this RateLawEquation
class Meta[source]

Bases: obj_model.core.Meta

valid_functions[source]

tuple of functions that can be used in a RateLawEquation`s `expression

Type:tuple
valid_models[source]

names of obj_model.Model`s in this module that a `RateLawEquation is allowed to reference in its expression

Type:tuple
attribute_order = ('expression', 'modifiers', 'parameters')[source]
attributes = {'expression': <obj_model.core.LongStringAttribute object>, 'modifiers': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.RateLawEquation'>,)[source]
local_attributes = {'expression': <obj_model.core.LocalAttribute object>, 'modifiers': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>}[source]
ordering = ('rate_law',)[source]
primary_attribute = <obj_model.core.LongStringAttribute object>[source]
related_attributes = {'rate_laws': <wc_kb.core.RateLawEquationAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
valid_functions = (<built-in function ceil>, <built-in function floor>, <built-in function exp>, <built-in function pow>, <built-in function log>, <built-in function log10>, <built-in function min>, <built-in function max>)[source]
valid_models = ('Species', 'Parameter')[source]
verbose_name = 'Rate law equation'[source]
verbose_name_plural = 'Rate law equations'[source]
classmethod deserialize(attribute, value, objects)[source]

Deserialize value

Parameters:
  • attribute (Attribute) – attribute
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value and cleaning error

Return type:

tuple of object, InvalidAttribute or None

expression = <obj_model.core.LongStringAttribute object>[source]
modifiers = <obj_model.core.ManyToManyAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
parameters = <obj_model.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns:value of primary attribute
Return type:str
class wc_kb.core.RateLawEquationAttribute(related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToOneAttribute

Rate law equation

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

tuple of cleaned value and cleaning error

Return type:

tuple of object, InvalidAttribute or None

serialize(rate_law_equation, encoded=None)[source]

Serialize related object

Parameters:
  • rate_law_equation (RateLawEquation) – the related RateLawEquation
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation of the rate law equation

Return type:

str

class wc_kb.core.Reaction(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of reactions

cell[source]

cell

Type:Cell
submodel[source]

submodel where reaction belongs to

Type:str
participants[source]

participants

Type:list
reversible[source]

denotes whether reaction is reversible

Type:boolean
references[source]

references

Type:list
database_references[source]

database references

Type:list
Related attributes:
rate_laws (list of RateLaw): rate laws; if present, rate_laws[0] is the forward
rate law, and rate_laws[1] is the backward rate law
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'submodel', 'participants', 'reversible', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'participants': <wc_kb.core.ReactionParticipantAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'reversible': <obj_model.core.BooleanAttribute object>, 'submodel': <obj_model.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Reaction'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'participants': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'reversible': <obj_model.core.LocalAttribute object>, 'submodel': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'rate_laws': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Reaction'[source]
verbose_name_plural = 'Reactions'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
participants = <wc_kb.core.ReactionParticipantAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
reversible = <obj_model.core.BooleanAttribute object>[source]
submodel = <obj_model.core.StringAttribute object>[source]
class wc_kb.core.ReactionParticipantAttribute(related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

Reaction participants

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of SpeciesCoefficient, InvalidAttribute or None

deserialize_side(direction, value, objects, global_comp)[source]

Deserialize the LHS or RHS of a reaction equation :param direction: -1. indicates LHS, +1. indicates RHS :type direction: float :param value: String representation :type value: str :param objects: dictionary of objects, grouped by model :type objects: dict :param global_comp: global compartment of the reaction :type global_comp: Compartment

Returns:
  • list of SpeciesCoefficient: list of species coefficients
  • list of Exception: list of errors
Return type:tuple
serialize(participants, encoded=None)[source]

Serialize related object

Parameters:
  • participants (list of SpeciesCoefficient) – Python representation of reaction participants
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation

Return type:

str

class wc_kb.core.Reference(**kwargs)[source]

Bases: obj_model.core.Model

Reference to the literature

id[source]

identifier

Type:str
standard_id[source]

standard identifier such as DOI or PubMed ID

Type:str
cell[source]

cell

Type:Cell
Related attributes:
compartments (list of Compartment): compartments species_types (list of SpeciesType): species_types concentrations (list of Concentration): concentrations loci (list of PolymerLocus): loci properties (list of Property): properties reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate_laws observables (list of Observable): observables
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'standard_id')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'standard_id': <obj_model.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Reference'>,)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'concentrations': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'properties': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'regulatory_modules': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'standard_id': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'compartments': <obj_model.core.ManyToManyAttribute object>, 'concentrations': <obj_model.core.ManyToManyAttribute object>, 'loci': <obj_model.core.ManyToManyAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>, 'properties': <obj_model.core.ManyToManyAttribute object>, 'rate_laws': <obj_model.core.ManyToManyAttribute object>, 'reactions': <obj_model.core.ManyToManyAttribute object>, 'regulatory_modules': <obj_model.core.ManyToManyAttribute object>, 'species_types': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Reference'[source]
verbose_name_plural = 'References'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
standard_id = <obj_model.core.StringAttribute object>[source]
class wc_kb.core.RnaType[source]

Bases: enum.Enum

Type of RNA

mRna = 0[source]
mixed = 4[source]
rRna = 1[source]
sRna = 2[source]
tRna = 3[source]
class wc_kb.core.Species(tuple of species type, compartment)[source]

Bases: obj_model.core.Model

species_type[source]

species type

Type:SpeciesType
compartment[source]

compartment

Type:Compartment
Related attributes:
concentration (Concentration): concentration species_coefficients (list of SpeciesCoefficient): participations in reactions and observables
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('species_type', 'compartment')[source]
attributes = {'compartment': <obj_model.core.ManyToOneAttribute object>, 'species_type': <obj_model.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Species'>,)[source]
local_attributes = {'compartment': <obj_model.core.LocalAttribute object>, 'concentration': <obj_model.core.LocalAttribute object>, 'rate_law_equations': <obj_model.core.LocalAttribute object>, 'species_coefficients': <obj_model.core.LocalAttribute object>, 'species_type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('species_type', 'compartment')[source]
primary_attribute = None[source]
related_attributes = {'concentration': <wc_kb.core.OneToOneSpeciesAttribute object>, 'rate_law_equations': <obj_model.core.ManyToManyAttribute object>, 'species_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = (('compartment', 'species_type'),)[source]
verbose_name = 'Species'[source]
verbose_name_plural = 'Species'[source]
compartment = <obj_model.core.ManyToOneAttribute object>[source]
classmethod deserialize(attribute, value, objects)[source]

Deserialize value

Parameters:
  • attribute (Attribute) – attribute
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value and cleaning error

Return type:

tuple of object, InvalidAttribute or None

static gen_id(species_type, compartment)[source]

Generate a Species’ primary identifier

Parameters:
  • species_type (object) – a SpeciesType, or its id
  • compartment (object) – a Compartment, or its id
Returns:

canonical identifier for a specie in a compartment, ‘species_type_id[compartment_id]’

Return type:

str

id()[source]

Provide a Species’ primary identifier

Returns:canonical identifier for a specie in a compartment, ‘specie_id[compartment_id]’
Return type:str
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Provide a Species’ primary identifier

Returns:canonical identifier for a specie in a compartment, ‘specie_id[compartment_id]’
Return type:str
species_type = <obj_model.core.ManyToOneAttribute object>[source]
class wc_kb.core.SpeciesCoefficient(**kwargs)[source]

Bases: obj_model.core.Model

A tuple of a species and a coefficient

species[source]

species

Type:Species
coefficient[source]

coefficient

Type:float
Related attributes:
reaction (Reaction): reaction
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('species', 'coefficient')[source]
attributes = {'coefficient': <obj_model.core.FloatAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.SpeciesCoefficient'>,)[source]
local_attributes = {'coefficient': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>}[source]
ordering = ('species',)[source]
primary_attribute = None[source]
related_attributes = {'observables': <wc_kb.core.ObservableSpeciesParticipantAttribute object>, 'reactions': <wc_kb.core.ReactionParticipantAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Species coefficient'[source]
verbose_name_plural = 'Species coefficients'[source]
coefficient = <obj_model.core.FloatAttribute object>[source]
classmethod deserialize(attribute, value, objects, compartment=None)[source]

Deserialize value

Parameters:
  • attribute (Attribute) – attribute
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • compartment (Compartment, optional) – compartment
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of SpeciesCoefficient, InvalidAttribute or None

objects = <obj_model.core.Manager object>[source]
serialize(show_compartment=True, show_coefficient_sign=True)[source]

Serialize related object

Parameters:
  • show_compartment (bool, optional) – if true, show compartment
  • show_coefficient_sign (bool, optional) – if true, show coefficient sign
Returns:

string representation of a species and a coefficient

Return type:

str

species = <obj_model.core.ManyToOneAttribute object>[source]
class wc_kb.core.SpeciesType(**kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of a molecular species

cell[source]

cell

Type:Cell
half_life[source]

half life (s)

Type:float
references[source]

references

Type:list
database_references[source]

database references

Type:list
Related attributes:
reaction_participants (list of ReactionParticipant): reaction participants
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Species type'[source]
verbose_name_plural = 'Species types'[source]
cell = <obj_model.core.ManyToOneAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
get_charge()[source]

Get the charge

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight

Returns:molecular weight
Return type:float
half_life = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
class wc_kb.core.SpeciesTypeCoefficient(**kwargs)[source]

Bases: obj_model.core.Model

A tuple of a species type and a coefficient

species_type[source]

species_type

Type:SpeciesType
coefficient[source]

coefficient

Type:float
Related attributes:
complex (ComplexSpeciesType): complex
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('species_type', 'coefficient')[source]
attributes = {'coefficient': <obj_model.core.FloatAttribute object>, 'species_type': <obj_model.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.SpeciesTypeCoefficient'>,)[source]
local_attributes = {'coefficient': <obj_model.core.LocalAttribute object>, 'complex': <obj_model.core.LocalAttribute object>, 'species_type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('species_type',)[source]
primary_attribute = None[source]
related_attributes = {'complex': <wc_kb.core.SubunitAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Species type coefficient'[source]
verbose_name_plural = 'Species type coefficients'[source]
coefficient = <obj_model.core.FloatAttribute object>[source]
classmethod deserialize(attribute, value, objects)[source]

Deserialize value

Parameters:
  • attribute (Attribute) – attribute
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of SpeciesTypeCoefficient, InvalidAttribute or None

objects = <obj_model.core.Manager object>[source]
serialize()[source]

Serialize related object

Returns:string representation of a species type and a coefficient
Return type:str
species_type = <obj_model.core.ManyToOneAttribute object>[source]
class wc_kb.core.SubunitAttribute(related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

Subunits

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

tuple of cleaned value and cleaning error

Return type:

tuple of object, InvalidAttribute or None

serialize(subunits, encoded=None)[source]

Serialize related object

Parameters:
  • subunits (list of SpeciesTypeCoefficient) – Python representation of subunits
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation

Return type:

str

2.1.4. wc_kb.eukaryote_schema module

Schema to represent a knowledge base to build models of eukaryotes

Author:Yin Hoon Chew <yinhoon.chew@mssm.edu>
Date:2018-09-10
Copyright:2018, Karr Lab
License:MIT
class wc_kb.eukaryote_schema.ActivityLevel[source]

Bases: enum.Enum

An enumeration.

active = 1[source]
inactive = 4[source]
na = 5[source]
poised = 2[source]
repressed = 3[source]
class wc_kb.eukaryote_schema.CdsLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of an coding region

Related attributes:
protein (ProteinSpeciesType): protein
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'start', 'end', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.CdsLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'protein': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'protein': <obj_model.core.OneToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'CDS loci'[source]
verbose_name_plural = 'CDS locis'[source]
objects = <obj_model.core.Manager object>[source]
class wc_kb.eukaryote_schema.ExonLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of an exon

Related attributes:
transcript (TranscriptSpeciesType): transcript
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'start', 'end', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.ExonLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>, 'transcripts': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'transcripts': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Exon locus'[source]
verbose_name_plural = 'Exon loci'[source]
objects = <obj_model.core.Manager object>[source]
class wc_kb.eukaryote_schema.GeneLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of a gene

symbol[source]

symbol

Type:str
type[source]

type of gene

Type:GeneType
Related attributes:
rna (list of PreRnaSpeciesType): rna regulatory_modules (RegulatoryModule): regulatory_modules
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'symbol', 'type', 'strand', 'start', 'end', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>, 'symbol': <obj_model.core.StringAttribute object>, 'type': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.GeneLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'regulatory_modules': <obj_model.core.LocalAttribute object>, 'rna': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>, 'symbol': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'regulatory_modules': <obj_model.core.OneToOneAttribute object>, 'rna': <obj_model.core.OneToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Gene locus'[source]
verbose_name_plural = 'Gene loci'[source]
objects = <obj_model.core.Manager object>[source]
symbol = <obj_model.core.StringAttribute object>[source]
type = <obj_model.core.EnumAttribute object>[source]
class wc_kb.eukaryote_schema.PreRnaSpeciesType(**kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a transcribed RNA species before splicing

gene[source]

gene

Type:GeneLocus
type[source]

type

Type:RnaType
Related attributes:
transcripts (list of TranscriptSpeciesType): transcript(s)
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'type', 'gene', 'circular', 'double_stranded', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'gene': <obj_model.core.OneToOneAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'type': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.PreRnaSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'gene': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>, 'transcripts': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>, 'transcripts': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'pre-RNA species type'[source]
verbose_name_plural = 'pre-RNA species types'[source]
gene = <obj_model.core.OneToOneAttribute object>[source]
get_charge()[source]

Get the charge for a transcribed RNA species before splicing with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens

\(-L - 1\)

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula for a transcribed RNA species before splicing with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens

\(N_A * AMP + N_C * CMP + N_G * GMP + N_U * UMP - (L-1) * OH\)

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight for a transcribed RNA species before splicing with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens
Returns:molecular weight (Da)
Return type:float
get_seq()[source]

Get the 5’ to 3’ sequence

Returns:sequence
Return type:Bio.Seq.Seq
objects = <obj_model.core.Manager object>[source]
type = <obj_model.core.EnumAttribute object>[source]
class wc_kb.eukaryote_schema.ProteinSpeciesType(**kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a protein monomer

uniprot[source]

uniprot id

Type:str
transcript[source]

transcript

Type:TranscriptSpeciesType
coding_region[source]

CDS Locus

Type:CdsLocus
Related attributes:
regulatory_elements (RegulatoryElementLocus): protein binding sites
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'uniprot', 'transcript', 'coding_region', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'coding_region': <obj_model.core.OneToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'transcript': <obj_model.core.OneToOneAttribute object>, 'uniprot': <obj_model.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.ProteinSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'coding_region': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'regulatory_elements': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>, 'transcript': <obj_model.core.LocalAttribute object>, 'uniprot': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'regulatory_elements': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Protein species type'[source]
verbose_name_plural = 'Protein species types'[source]
coding_region = <obj_model.core.OneToOneAttribute object>[source]
get_charge(table=1, cds=True)[source]

Get the charge at physiological pH

Parameters:
  • table (int, optional) – NCBI identifier for translation table (default = standard table)
  • cds (bool, optional) – True indicates the sequence is a complete CDS
Returns:

charge

Return type:

int

get_empirical_formula(table=1, cds=True)[source]

Get the empirical formula

Parameters:
  • table (int, optional) – NCBI identifier for translation table (default = standard table)
  • cds (bool, optional) – True indicates the sequence is a complete CDS
Returns:

empirical formula

Return type:

chem.EmpiricalFormula

get_mol_wt(table=1, cds=True)[source]

Get the molecular weight

Parameters:
  • table (int, optional) – NCBI identifier for translation table (default = standard table)
  • cds (bool, optional) – True indicates the sequence is a complete CDS
Returns:

molecular weight

Return type:

float

get_seq(table=1, cds=True)[source]

Get the 5’ to 3’ sequence

Parameters:
  • table (int, optional) – NCBI identifier for translation table (default = standard table)
  • cds (bool, optional) – True indicates the sequence is a complete CDS
Returns:

sequence

Return type:

Bio.Seq.Seq

objects = <obj_model.core.Manager object>[source]
transcript = <obj_model.core.OneToOneAttribute object>[source]
uniprot = <obj_model.core.StringAttribute object>[source]
class wc_kb.eukaryote_schema.RegulatoryElementLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of a regulatory element of a gene

type[source]

type of regulatory element

Type:RegulatoryElementType
activity[source]

cell-type specific activity level

Type:ActivityLevel
bound_start[source]

start coordinate of binding

Type:int
bound_end[source]

end coordinate of binding

Type:int
motif_features[source]

proteins that bind to the site

Type:list
Related attributes:
regulatory_modules (list of RegulatoryModule): regulatory_modules
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'type', 'activity', 'start', 'end', 'bound_start', 'bound_end', 'motif_features', 'comments', 'references', 'database_references')[source]
attributes = {'activity': <obj_model.core.EnumAttribute object>, 'bound_end': <obj_model.core.PositiveIntegerAttribute object>, 'bound_start': <obj_model.core.PositiveIntegerAttribute object>, 'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'motif_features': <obj_model.core.ManyToManyAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>, 'type': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.RegulatoryElementLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'activity': <obj_model.core.LocalAttribute object>, 'bound_end': <obj_model.core.LocalAttribute object>, 'bound_start': <obj_model.core.LocalAttribute object>, 'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'motif_features': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'regulatory_modules': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'regulatory_modules': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Regulatory element locus'[source]
verbose_name_plural = 'Regulatory element loci'[source]
activity = <obj_model.core.EnumAttribute object>[source]
bound_end = <obj_model.core.PositiveIntegerAttribute object>[source]
bound_start = <obj_model.core.PositiveIntegerAttribute object>[source]
motif_features = <obj_model.core.ManyToManyAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
type = <obj_model.core.EnumAttribute object>[source]
class wc_kb.eukaryote_schema.RegulatoryElementType[source]

Bases: enum.Enum

Type of regulatory element

CTCF_binding_site = 4[source]
TF_binding_site = 5[source]
enhancer = 3[source]
open_chromatin_region = 6[source]
promoter = 1[source]
promoter_flanking_region = 2[source]
class wc_kb.eukaryote_schema.RegulatoryModule(**kwargs)[source]

Bases: obj_model.core.Model

Knowledge about regulatory modules

gene[source]

gene

Type:GeneLocus
regulatory_elements[source]

regulatory elements

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
database_references[source]

database references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('gene', 'regulatory_elements', 'comments', 'references', 'database_references')[source]
attributes = {'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'gene': <obj_model.core.OneToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'regulatory_elements': <obj_model.core.ManyToManyAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.RegulatoryModule'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'gene': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'regulatory_elements': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Regulatory module'[source]
verbose_name_plural = 'Regulatory modules'[source]
comments = <obj_model.core.LongStringAttribute object>[source]
database_references = <wc_kb.core.DatabaseReferenceAttribute object>[source]
gene = <obj_model.core.OneToOneAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
regulatory_elements = <obj_model.core.ManyToManyAttribute object>[source]
class wc_kb.eukaryote_schema.TranscriptSpeciesType(**kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a transcript (spliced RNA) species

rna[source]

transcribed RNA species before splicing

Type:RnaSpeciesType
exons[source]

exons

Type:list
Related attributes:
protein (ProteinSpeciesType): protein
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'rna', 'exons', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'exons': <obj_model.core.ManyToManyAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'rna': <obj_model.core.ManyToOneAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote_schema.TranscriptSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'exons': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'protein': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'rna': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'protein': <obj_model.core.OneToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Transcript species type'[source]
verbose_name_plural = 'Transcript species types'[source]
exons = <obj_model.core.ManyToManyAttribute object>[source]
get_charge()[source]

Get the charge for a transcript (spliced RNA) species with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens

\(-L - 1\)

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula for a transcript (spliced RNA) species with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens

\(N_A * AMP + N_C * CMP + N_G * GMP + N_U * UMP - (L-1) * OH\)

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight for a transcript (spliced RNA) species with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens
Returns:molecular weight (Da)
Return type:float
get_seq()[source]

Get the 5’ to 3’ sequence

Returns:sequence
Return type:Bio.Seq.Seq
objects = <obj_model.core.Manager object>[source]
rna = <obj_model.core.ManyToOneAttribute object>[source]

2.1.5. wc_kb.io module

Reading and writing knowledge bases to/from files.

Supported file types:

  • Comma separated values (.csv)
  • Excel (.xlsx)
  • Tab separated values (.tsv)
Author:Jonathan Karr <karr@mssm.edu>
Date:2018-02-12
Copyright:2018, Karr Lab
License:MIT
class wc_kb.io.Reader[source]

Bases: object

Read knowledge base from file(s)

run(core_path, seq_path, rewrite_seq_path=True, schema=True, strict=True)[source]

Read knowledge base from file(s)

Parameters:
  • core_path (str) – path to core knowledge base
  • seq_path (str) – path to genome sequence
  • rewrite_seq_path (bool, optional) – if True, the path to genome sequence in the knowledge base will be updated to the provided seq_path
  • schema (bool, optional) – if True, use model order for prokaryote, else use model order for eukaryote
  • strict (bool, optional) –

    if True, validate that the the model file(s) strictly follow the obj_model serialization format:

    • The worksheets are in the expected order
    • There are no missing worksheets
    • There are no extra worksheets
    • The columns are in the expected order
    • There are no missing columns
    • There are no extra columns
Returns:

knowledge base

Return type:

core.KnowledgeBase

Raises:

ValueError – if core_path

  • Defines multiple knowledge bases or cells
  • Represents objects that cannot be linked to a knowledge base and/or cell
class wc_kb.io.Writer[source]

Bases: object

Write knowledge base to file(s)

run(knowledge_base, core_path, seq_path=None, rewrite_seq_path=False, schema=True, set_repo_metadata_from_path=True)[source]

Write knowledge base to file(s)

Parameters:
  • knowledge_base (core.KnowledgeBase) – knowledge base
  • core_path (str) – path to save core knowledge base
  • seq_path (str, optional) – path to save genome sequence
  • rewrite_seq_path (bool, optional) – if True, the path to genome sequence in the saved knowledge base will be updated to the newly saved seq_path
  • schema (bool, optional) – if True, use model order for prokaryote, else use model order for eukaryote
  • set_repo_metadata_from_path (bool, optional) – if True, set the Git repository metadata (URL, branch, revision) for the knowledge base from the parent directory of core_path
Raises:

ValueError – if any of the relationships with knowledge bases and cells are not set

classmethod validate_implicit_relationships()[source]

Check that relationships to core.KnowledgeBase and core.Cell do not need to be explicitly written to workbooks because they can be inferred by Reader.run

Raises:Exception – if the Excel serialization involves an unsupported implicit relationship
wc_kb.io.convert(source_core, source_seq, dest_core, dest_seq, rewrite_seq_path=False, strict=True)[source]

Convert among Excel (.xlsx), comma separated (.csv), and tab separated (.tsv) file formats

Read a knowledge base from the source files(s) and write it to the destination files(s). A path to a delimiter separated set of knowledge base files must be represented by a Unix glob pattern (with a *) that matches all delimiter separated files.

Parameters:
  • source_core (str) – path to the core of the source knowledge base
  • source_seq (str) – path to the genome sequence of the source knowledge base
  • dest_core (str) – path to save the converted core of the knowledge base
  • dest_seq (str) – path to save the converted genome sequence of the knowledge base
  • rewrite_seq_path (bool, optional) – if True, the path to genome sequence in the converted core of the knowledge base will be updated to the path of the converted genome sequence
  • strict (bool, optional) –

    if True, validate that the the model file(s) strictly follow the obj_model serialization format:

    • The worksheets are in the expected order
    • There are no missing worksheets
    • There are no extra worksheets
    • The columns are in the expected order
    • There are no missing columns
    • There are no extra columns
wc_kb.io.create_template(core_path, seq_path, set_repo_metadata_from_path=True)[source]

Create file with knowledge base template, including row and column headings

Parameters:
  • core_path (str) – path to save template of core knowledge base
  • seq_path (str) – path to save genome sequence
  • set_repo_metadata_from_path (bool, optional) – if True, set the Git repository metadata (URL, branch, revision) for the knowledge base from the parent directory of core_path

2.1.6. wc_kb.prokaryote_schema module

Schema to represent a knowledge base to build models of prokaryotes

Author:Balazs Szigeti <balazs.szigeti@mssm.edu>
Author:Jonathan Karr <jonrkarr@gmail.com>
Author:Bilal Shaikh <bilal.shaikh@columbia.edu>
Author:Arthur Goldberg <Arthur.Goldberg@mssm.edu>
Author:Yin Hoon Chew <yinhoon.chew@mssm.edu>
Date:2018-09-10
Copyright:2018, Karr Lab
License:MIT
class wc_kb.prokaryote_schema.GeneLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of a gene

symbol[source]

symbol

Type:str
Related attributes:
proteins (list of ProteinSpeciesType): protein
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'symbol', 'type', 'strand', 'start', 'end', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>, 'symbol': <obj_model.core.StringAttribute object>, 'type': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote_schema.GeneLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'proteins': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>, 'symbol': <obj_model.core.LocalAttribute object>, 'transcription_units': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'proteins': <obj_model.core.ManyToOneAttribute object>, 'transcription_units': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Gene locus'[source]
verbose_name_plural = 'Gene loci'[source]
objects = <obj_model.core.Manager object>[source]
symbol = <obj_model.core.StringAttribute object>[source]
type = <obj_model.core.EnumAttribute object>[source]
class wc_kb.prokaryote_schema.PromoterLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of a promoter for a transcription unit

pribnow_start[source]

Pribnow box start coordinate

Type:int
pribnow_end[source]

Pribnow box end coordinate

Type:int
up_35_start[source]

-35 promoter start coordinate

Type:int
up_35_end[source]

-35 promoter end coordinate

Type:int
Related attributes:
transcription_units (list of TranscriptionUnitLocus)
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'pribnow_start', 'pribnow_end', 'strand', 'start', 'end', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'pribnow_end': <obj_model.core.IntegerAttribute object>, 'pribnow_start': <obj_model.core.IntegerAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>, 'up_35_end': <obj_model.core.IntegerAttribute object>, 'up_35_start': <obj_model.core.IntegerAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote_schema.PromoterLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'pribnow_end': <obj_model.core.LocalAttribute object>, 'pribnow_start': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>, 'transcription_units': <obj_model.core.LocalAttribute object>, 'up_35_end': <obj_model.core.LocalAttribute object>, 'up_35_start': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'transcription_units': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Promoter locus'[source]
verbose_name_plural = 'Promoter loci'[source]
objects = <obj_model.core.Manager object>[source]
pribnow_end = <obj_model.core.IntegerAttribute object>[source]
pribnow_start = <obj_model.core.IntegerAttribute object>[source]
up_35_end = <obj_model.core.IntegerAttribute object>[source]
up_35_start = <obj_model.core.IntegerAttribute object>[source]
class wc_kb.prokaryote_schema.ProteinSpeciesType(**kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a protein monomer

gene[source]

gene

Type:GeneLocus
rna[source]

rna

Type:RnaSpeciesType
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'gene', 'rna', 'circular', 'double_stranded', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'gene': <obj_model.core.ManyToOneAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'rna': <obj_model.core.ManyToOneAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote_schema.ProteinSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'gene': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'rna': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Protein species type'[source]
verbose_name_plural = 'Protein species types'[source]
gene = <obj_model.core.ManyToOneAttribute object>[source]
get_charge(cds=True)[source]

Get the charge at physiological pH

Returns:charge
Return type:int
get_empirical_formula(cds=True)[source]

Get the empirical formula

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt(cds=True)[source]

Get the molecular weight

Returns:molecular weight
Return type:float
get_seq(cds=True)[source]

Get the sequence

Returns:sequence
Return type:Bio.Seq.Seq
objects = <obj_model.core.Manager object>[source]
rna = <obj_model.core.ManyToOneAttribute object>[source]
class wc_kb.prokaryote_schema.RnaSpeciesType(**kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of an RNA species

transcription_units[source]

transcription units

Type:list
type[source]

type

Type:RnaType
Related attributes:
proteins (list of ProteinSpeciesType): protein(s)
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'type', 'transcription_units', 'circular', 'double_stranded', 'half_life', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'circular': <obj_model.core.BooleanAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'double_stranded': <obj_model.core.BooleanAttribute object>, 'half_life': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'transcription_units': <obj_model.core.ManyToManyAttribute object>, 'type': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote_schema.RnaSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'circular': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'double_stranded': <obj_model.core.LocalAttribute object>, 'half_life': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'loci': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'proteins': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_type_coefficients': <obj_model.core.LocalAttribute object>, 'transcription_units': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_model.core.ManyToOneAttribute object>, 'proteins': <obj_model.core.ManyToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Rna species type'[source]
verbose_name_plural = 'Rna species types'[source]
get_charge()[source]

Get the charge for a transcript with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens

\(-L - 1\)

Returns:charge
Return type:int
get_empirical_formula()[source]

Get the empirical formula for an RNA transcript with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens

\(N_A * AMP + N_C * CMP + N_G * GMP + N_U * UMP - (L-1) * OH\)

Returns:empirical formula
Return type:chem.EmpiricalFormula
get_mol_wt()[source]

Get the molecular weight for a transcript with

  • 5’ monophosphate
  • Deprotonated phosphate oxygens
Returns:molecular weight (Da)
Return type:float
get_seq()[source]

Get the sequence

Returns:sequence
Return type:Bio.Seq.Seq
objects = <obj_model.core.Manager object>[source]
transcription_units = <obj_model.core.ManyToManyAttribute object>[source]
type = <obj_model.core.EnumAttribute object>[source]
class wc_kb.prokaryote_schema.TranscriptionUnitLocus(**kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge about an open reading frame

promoter[source]

promoter controlling the TU

Type:PromoterLocus
genes[source]

genes

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'polymer', 'name', 'strand', 'promoter', 'start', 'end', 'genes', 'comments', 'references', 'database_references')[source]
attributes = {'cell': <obj_model.core.ManyToOneAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'database_references': <wc_kb.core.DatabaseReferenceAttribute object>, 'end': <obj_model.core.IntegerAttribute object>, 'genes': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'polymer': <obj_model.core.ManyToOneAttribute object>, 'promoter': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'start': <obj_model.core.IntegerAttribute object>, 'strand': <obj_model.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote_schema.TranscriptionUnitLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'database_references': <obj_model.core.LocalAttribute object>, 'end': <obj_model.core.LocalAttribute object>, 'genes': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'polymer': <obj_model.core.LocalAttribute object>, 'promoter': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'rna': <obj_model.core.LocalAttribute object>, 'start': <obj_model.core.LocalAttribute object>, 'strand': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'rna': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Transcription unit locus'[source]
verbose_name_plural = 'Transcription unit loci'[source]
genes = <obj_model.core.ManyToManyAttribute object>[source]
get_3_prime()[source]

Get the 3’ coordinate

Returns:3’ coordinate
Return type:int
get_5_prime()[source]

Get the 5’ coordinate

Returns:5’ coordinate
Return type:int
objects = <obj_model.core.Manager object>[source]
promoter = <obj_model.core.ManyToOneAttribute object>[source]

2.1.7. wc_kb.util module

Utilities

Author:Jonathan Karr <karr@mssm.edu>
Date:2018-02-12
Copyright:2018, Karr Lab
License:MIT
wc_kb.util.get_models(inline=True)[source]

Get list of models

Parameters:inline (bool, optional) – if true, return inline models
Returns:list of models
Return type:list of class
wc_kb.util.set_git_repo_metadata_from_path(kb, path='.')[source]

Use Git to set the Git repository URL, branch, and revision metadata for a knowledge base

Parameters:
  • kb (core.KnowledgeBase) – knowledge base
  • path (str, optional) – path to the Git repository for the knowledge base

2.1.8. Module contents