2.1. wc_kb package

2.1.2. Submodules

2.1.3. 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]
help = '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'}), (['--taxon'], {'type': <class 'str'>, 'help': 'Taxon ("eukaryote", "prokaryote"', 'default': 'prokaryote'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]
description = 'Convert knowledge base among .csv, .json, .tsv, .xlsx, .yaml, and .yml formats'[source]
help = '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': 'data_repo_metadata', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the Git repo containing `path-core`'}), (['--taxon'], {'type': <class 'str'>, 'help': 'Taxon ("eukaryote", "prokaryote"', 'default': 'prokaryote'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]
description = 'Create file with knowledge base template: blank file(s) with row and column labels'[source]
help = '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'}), (['--taxon'], {'type': <class 'str'>, 'help': 'Taxon ("eukaryote", "prokaryote"', 'default': 'prokaryote'}), (['--compare-files'], {'dest': 'compare_files', 'default': False, 'action': 'store_true', 'help': 'If true, compare knowledge bases; otherwise compare files directly'}), (['--compare-metadata-in-files'], {'dest': 'compare_metadata_in_files', 'default': False, 'action': 'store_true', 'help': 'If true, compare metadata (tables of contents, header rows)'})][source]
description = 'Get difference between two knowledge bases'[source]
help = 'Get difference between two knowledge bases'[source]
label = 'difference'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
static remove_metadata(kb)[source]

Remove metadata from Knowledge base

Parameters

kb (wc_utils.workbook.Workbook) – knowledge base

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'}), (['--taxon'], {'type': <class 'str'>, 'help': 'Taxon ("eukaryote", "prokaryote"', 'default': 'prokaryote'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]
description = 'Normalize knowledge base'[source]
help = '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'}), (['--taxon'], {'type': <class 'str'>, 'help': 'Taxon ("eukaryote", "prokaryote"', 'default': 'prokaryote'}), (['--ignore-repo-metadata'], {'dest': 'data_repo_metadata', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the Git repo containing `path-core`'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]
description = 'Update version metadata of a knowledge base (URL, branch, revision, wc_kb version)'[source]
help = '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'}), (['--taxon'], {'type': <class 'str'>, 'help': 'Taxon ("eukaryote", "prokaryote"', 'default': 'prokaryote'})][source]
description = 'Validate knowledge base and display errors'[source]
help = '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.4. wc_kb._version module

2.1.5. wc_kb.core module

Core schema to represent a knowledge base to build models

Author

Balazs Szigeti <balazs.szigeti@mssm.edu>

Author

Jonathan Karr <karr@mssm.edu>

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(_comments=None, **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_tables.core.Meta

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

Bases: wc_kb.core.PolymerLocus

Knowledge of chromosome features

cell[source]

cell

Type

Cell

value[source]

value

Type

float

error[source]

measurement error

Type

float

units[source]

units of value

Type

unit_registry.Unit

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

Related attributes:

seq_path (str): path to sequence fasta file ploidy (int): ploidy

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'type', 'polymer', 'start', 'end', 'intensity', 'unit', 'evidence', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'coordinate': <obj_tables.core.IntegerAttribute object>, 'end': <obj_tables.core.IntegerAttribute object>, 'evidence': <obj_tables.core.OneToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'intensity': <obj_tables.core.FloatAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'polymer': <obj_tables.core.ManyToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'start': <obj_tables.core.IntegerAttribute object>, 'strand': <obj_tables.core.EnumAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'unit': <obj_tables.sci.units.UnitAttribute object>}[source]
expression_term_token_pattern = (1,)[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.ChromosomeFeature'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'coordinate': <obj_tables.core.LocalAttribute object>, 'end': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'intensity': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'polymer': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'strand': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'unit': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Chromosome feature'[source]
verbose_name_plural = 'Chromosome features'[source]
coordinate = <obj_tables.core.IntegerAttribute object>[source]
end = <obj_tables.core.IntegerAttribute object>[source]
evidence = <obj_tables.core.OneToManyAttribute object>[source]
get_direction()[source]

Returns the direction of chromosome feature

Returns

direction (in [‘forward’, ‘reverse’])

Return type

PolymerDirection

identifiers = <wc_kb.core.IdentifierAttribute object>[source]
intensity = <obj_tables.core.FloatAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
polymer = <obj_tables.core.ManyToOneAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
start = <obj_tables.core.IntegerAttribute object>[source]
type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
unit = <obj_tables.sci.units.UnitAttribute object>[source]
class wc_kb.core.Compartment(_comments=None, **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 of Reference

identifiers[source]

identifiers

Type

list of Identifier

Related attributes:

reaction_participants (list of ReactionParticipant): reaction participants

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'volumetric_fraction', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'volumetric_fraction': <obj_tables.core.FloatAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Compartment'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'volumetric_fraction': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'species': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Compartment'[source]
verbose_name_plural = 'Compartments'[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
id = <obj_tables.core.SlugAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
volumetric_fraction = <obj_tables.core.FloatAttribute object>[source]
class wc_kb.core.ComplexSpeciesType(_comments=None, **kwargs)[source]

Bases: wc_kb.core.SpeciesType

Knowledge of a protein complex

formation_process[source]

type of formation process

Type

pronto

subunits[source]

subunits

Type

list of SpeciesTypeCoefficient

type[source]

type of complex formation

Type

pronto

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'type', 'formation_process', 'subunits', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'formation_process': <obj_tables.sci.onto.OntoTermAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'subunits': <wc_kb.core.SubunitAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute 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 = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'formation_process': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'subunits': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'properties': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Complex'[source]
verbose_name_plural = 'Complexes'[source]
formation_process = <obj_tables.sci.onto.OntoTermAttribute 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_tables.core.Manager object>[source]
subunits = <wc_kb.core.SubunitAttribute object>[source]
type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
class wc_kb.core.Concentration(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Species concentration

cell[source]

cell

Type

Cell

species[source]

species

Type

Species

medium[source]

medium

Type

str

value[source]

value

Type

float

units[source]

units; default units is ‘M’

Type

unit_registry.Unit

evidence[source]

evidence

Type

list of Evidence

comments[source]

comments

Type

str

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'species', 'value', 'units', 'evidence', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'evidence': <obj_tables.core.OneToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'medium': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'species': <wc_kb.core.OneToOneSpeciesAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Concentration'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'medium': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('species',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = (('species',),)[source]
verbose_name = 'Concentration'[source]
verbose_name_plural = 'Concentrations'[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
evidence = <obj_tables.core.OneToManyAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
medium = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
references = <obj_tables.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_tables.sci.units.UnitAttribute object>[source]
value = <obj_tables.core.FloatAttribute object>[source]
class wc_kb.core.DnaSpeciesType(_comments=None, **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_tables.core.Meta

attribute_order = ('id', 'name', 'sequence_path', 'circular', 'double_stranded', 'ploidy', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'circular': <obj_tables.core.BooleanAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'double_stranded': <obj_tables.core.BooleanAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'ploidy': <obj_tables.core.IntegerAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'sequence_path': <obj_tables.core.StringAttribute object>, 'synonyms': <obj_tables.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_tables.core.LocalAttribute object>, 'chromosome_features': <obj_tables.core.LocalAttribute object>, 'circular': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'double_stranded': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'ploidy': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'sequence_path': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'chromosome_features': <obj_tables.core.ManyToOneAttribute object>, 'loci': <obj_tables.core.ManyToOneAttribute object>, 'properties': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Chromosome'[source]
verbose_name_plural = 'Chromosomes'[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\)

N’s in the sequence will be distributed into the four bases by preserving the original ratio

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_tables.core.Manager object>[source]
ploidy = <obj_tables.core.IntegerAttribute object>[source]
sequence_path = <obj_tables.core.StringAttribute object>[source]
class wc_kb.core.Evidence(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Represents the measurement / observation of a property

id[source]

identifier

Type

str

cell[source]

cell

Type

Cell

object[source]

object

Type

str

property[source]

property

Type

str

value[source]

value

Type

float

units[source]

units

Type

Units

identifiers[source]

identifiers

Type

list of Identifier

references[source]

references

Type

list of Reference

experiment[source]

experiment

Type

Experiment

comments[source]

comments

Type

str

Related attributes:

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'cell', 'object', 'property', 'value', 'units', 'experiment', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'experiment': <obj_tables.core.ManyToOneAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'object': <obj_tables.core.StringAttribute object>, 'property': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Evidence'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'chromosome_features': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'concentrations': <obj_tables.core.LocalAttribute object>, 'experiment': <obj_tables.core.LocalAttribute object>, 'genes': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'object': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'property': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'chromosome_features': <obj_tables.core.OneToManyAttribute object>, 'concentrations': <obj_tables.core.OneToManyAttribute object>, 'genes': <obj_tables.core.OneToManyAttribute object>, 'parameters': <obj_tables.core.OneToManyAttribute object>, 'properties': <obj_tables.core.OneToManyAttribute object>, 'reactions': <obj_tables.core.OneToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Evidence'[source]
verbose_name_plural = 'Evidences'[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
comments = <obj_tables.core.LongStringAttribute object>[source]
experiment = <obj_tables.core.ManyToOneAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
object = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
property = <obj_tables.core.StringAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
units = <obj_tables.sci.units.UnitAttribute object>[source]
value = <obj_tables.core.FloatAttribute object>[source]
class wc_kb.core.Experiment(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Represents an experiment in which a property was measured

id[source]

identifier

Type

str

species[source]

species

Type

str

genetic_variant[source]

genetic_variant

Type

str

external_media[source]

external_media

Type

str

temperature[source]

temperature

Type

float

temperature_units[source]

temperature_units

Type

Units

ph[source]

pH

Type

float

experiment_design[source]

experimental design

Type

str

measurement_technology[source]

measurement technology

Type

str

analysis_type[source]

analysis type

Type

str

identifiers[source]

identifiers

Type

list of Identifier

references[source]

references

Type

list of Reference

comments[source]

comments

Type

str

Related attributes:

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'experiment_design', 'measurement_technology', 'analysis_type', 'species', 'genetic_variant', 'external_media', 'temperature', 'temperature_units', 'ph', 'identifiers', 'references', 'comments')[source]
attributes = {'analysis_type': <obj_tables.core.StringAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'experiment_design': <obj_tables.core.StringAttribute object>, 'external_media': <obj_tables.core.StringAttribute object>, 'genetic_variant': <obj_tables.core.StringAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'measurement_technology': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'ph': <obj_tables.core.FloatAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.StringAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'temperature': <obj_tables.core.FloatAttribute object>, 'temperature_units': <obj_tables.sci.units.UnitAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Experiment'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'analysis_type': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'experiment_design': <obj_tables.core.LocalAttribute object>, 'external_media': <obj_tables.core.LocalAttribute object>, 'genetic_variant': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'measurement_technology': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'ph': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'temperature': <obj_tables.core.LocalAttribute object>, 'temperature_units': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'evidence': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Experiment'[source]
verbose_name_plural = 'Experiments'[source]
analysis_type = <obj_tables.core.StringAttribute object>[source]
comments = <obj_tables.core.LongStringAttribute object>[source]
experiment_design = <obj_tables.core.StringAttribute object>[source]
external_media = <obj_tables.core.StringAttribute object>[source]
genetic_variant = <obj_tables.core.StringAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
measurement_technology = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
ph = <obj_tables.core.FloatAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
species = <obj_tables.core.StringAttribute object>[source]
temperature = <obj_tables.core.FloatAttribute object>[source]
temperature_units = <obj_tables.sci.units.UnitAttribute object>[source]
class wc_kb.core.Identifier(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Reference to an entity in an external namespace

namespace[source]

namespace

Type

str

id[source]

identifier within the namespace

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 SpeciesTypeProperty): species type properties reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate_laws observables (list of Observable): observables

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('namespace', 'id')[source]
attributes = {'id': <obj_tables.core.RegexAttribute object>, 'namespace': <obj_tables.core.RegexAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Identifier'>,)[source]
local_attributes = {'chromosome_features': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'concentrations': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'experiments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'namespace': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'regulatory_modules': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('namespace', 'id')[source]
primary_attribute = None[source]
related_attributes = {'chromosome_features': <wc_kb.core.IdentifierAttribute object>, 'compartments': <wc_kb.core.IdentifierAttribute object>, 'concentrations': <wc_kb.core.IdentifierAttribute object>, 'evidence': <wc_kb.core.IdentifierAttribute object>, 'experiments': <wc_kb.core.IdentifierAttribute object>, 'loci': <wc_kb.core.IdentifierAttribute object>, 'observables': <wc_kb.core.IdentifierAttribute object>, 'parameters': <wc_kb.core.IdentifierAttribute object>, 'properties': <wc_kb.core.IdentifierAttribute object>, 'rate_laws': <wc_kb.core.IdentifierAttribute object>, 'reactions': <wc_kb.core.IdentifierAttribute object>, 'references': <wc_kb.core.IdentifierAttribute object>, 'regulatory_modules': <wc_kb.core.IdentifierAttribute object>, 'species_types': <wc_kb.core.IdentifierAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Identifier'[source]
verbose_name_plural = 'Identifiers'[source]
id = <obj_tables.core.RegexAttribute object>[source]
namespace = <obj_tables.core.RegexAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns

value of primary attribute

Return type

str

class wc_kb.core.IdentifierAttribute(related_name='', verbose_name='', verbose_related_name='', description='')[source]

Bases: obj_tables.core.ManyToManyAttribute

Identifier 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 Identifier, InvalidAttribute or None

serialize(identifiers, encoded=None)[source]

Serialize related object :param identifiers: a list of instances of Identifier Python representation :type identifiers: 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.KnowledgeBase(_comments=None, **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_tables.core.Meta

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

Bases: obj_tables.core.Model

Knowledge of a biological entity

id[source]

identifier

Type

str

name[source]

name

Type

str

synonyms[source]

synonyms

Type

str

comments[source]

comments

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'comments': <obj_tables.core.LongStringAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.KnowledgeBaseObject'>,)[source]
local_attributes = {'comments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Knowledge base object'[source]
verbose_name_plural = 'Knowledge base objects'[source]
comments = <obj_tables.core.LongStringAttribute object>[source]
get_nested_metadata()[source]
Returns a list of wc_kb.core.Reference / wc_kb.core.DatabaseReference / wc_kb.core.Comments objects that

appear in the object’s wc_kb.core.Evidence and the associated wc_kb.core.Experiment

Returns

references

Return type

id (list of Reference)

id = <obj_tables.core.StringAttribute object>[source]
name = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
synonyms = <obj_tables.core.StringAttribute object>[source]
class wc_kb.core.MetaboliteSpeciesType(_comments=None, **kwargs)[source]

Bases: wc_kb.core.SpeciesType

Knowledge of a metabolite

synonyms[source]

synonyms

Type

str

type[source]

type

Type

pronto

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'type', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.LongStringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute 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_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'properties': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Metabolite'[source]
verbose_name_plural = 'Metabolites'[source]
calc_charge()[source]

Calculate the charge

Returns

charge

Return type

int

calc_empirical_formula()[source]

Calculate the empirical formula

Returns

empirical formula

Return type

chem.EmpiricalFormula

calc_structure(ph=7.4, major_tautomer=False, keep_hydrogens=False, dearomatize=False)[source]

Get the major microspecies

Parameters
  • pH (float, optional) – pH, default is 7.4

  • major_tautomer (bool, optional) – if True, use the major tautomeric in the calculation

  • keep_hydrogens (bool, optional) – if True, keep explicity defined hydrogens

  • dearomatize (bool, optional) – if True, dearomatize molecule

Returns

InChI-encoded structure

Return type

str

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

Raises

ValueError – if there is not enough information to calculate molecular weight

get_structure()[source]

Get the structure

Returns

InChI or SMILES structure

Return type

str

Raises

ValueError – if structure has not been provided

objects = <obj_tables.core.Manager object>[source]
synonyms = <obj_tables.core.LongStringAttribute object>[source]
to_openbabel_mol()[source]

Convert species type to an Open Babel molecule

Returns

Open Babel molecule

Return type

openbabel.OBMol

type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
class wc_kb.core.Observable(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Observable: a linear function of other Observables and Species

cell[source]

cell

Type

Cell

expression[source]

mathematical expression for an Observable

Type

ObservableExpression

units[source]

units of expression

Type

unit_registry.Unit

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

Related attributes:

observable_expressions (list of ObservableExpression): observable expressions rate_law_expressions (list of RateLawExpression): rate law expressions

class Meta[source]

Bases: obj_tables.core.Meta, obj_tables.math.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'name', 'expression', 'units', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'expression': <obj_tables.math.expression.ManyToOneExpressionAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]
expression_term_model[source]

alias of ObservableExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Observable'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observable_expressions': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'observable_expressions': <obj_tables.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_tables.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Observable'[source]
verbose_name_plural = 'Observables'[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
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 ObservableExpression, InvalidAttribute or None

expression = <obj_tables.math.expression.ManyToOneExpressionAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
units = <obj_tables.sci.units.UnitAttribute object>[source]
class wc_kb.core.ObservableExpression(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model, obj_tables.math.expression.Expression

A mathematical expression of Observables and Species

The expression used by a Observable.

expression[source]

mathematical expression for an Observable

Type

str

species[source]

Species used by this Observable expression

Type

list of Species

observables[source]

other Observables used by this Observable expression

Type

list of Observable

Related attributes:

observable (Observable): observable

class Meta[source]

Bases: obj_tables.core.Meta, obj_tables.math.expression.Meta

attribute_order = ()[source]
attributes = {'expression': <obj_tables.core.LongStringAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[source]
expression_is_linear = True[source]
expression_term_models = ('Species', 'Observable')[source]
expression_unit_registry = <pint.registry.UnitRegistry object>[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.ObservableExpression'>,)[source]
local_attributes = {'expression': <obj_tables.core.LocalAttribute object>, 'observable': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('expression',)[source]
primary_attribute = <obj_tables.core.LongStringAttribute object>[source]
related_attributes = {'observable': <obj_tables.math.expression.ManyToOneExpressionAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Observable expression'[source]
verbose_name_plural = 'Observable expressions'[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters
  • value (str) – String representation

  • objects (dict) – dictionary of objects, grouped by model

Returns

tuple of cleaned value and cleaning error

Return type

tuple of ObservableExpression, InvalidAttribute or None

expression = <obj_tables.core.LongStringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
observables = <obj_tables.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns

string representation

Return type

str

species = <obj_tables.core.ManyToManyAttribute object>[source]
class wc_kb.core.OneToOneSpeciesAttribute(related_name='', verbose_name='', verbose_related_name='', description='')[source]

Bases: obj_tables.core.OneToOneAttribute

Species attribute

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 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(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of parameters

cell[source]

cell

Type

Cell

value[source]

value

Type

float

error[source]

measurement error

Type

float

units[source]

units of value

Type

unit_registry.Unit

evidence[source]

evidence

Type

list of Evidence

references[source]

references

Type

list of Reference

identifierss[source]

reference in external namespaces

Type

list of DatabaseReference

Related attributes:

rate_law_expressions (list of RateLawExpression): rate law expressions that use a Parameter

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'value', 'units', 'evidence', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'error': <obj_tables.core.FloatAttribute object>, 'evidence': <obj_tables.core.OneToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]
expression_term_token_pattern = (1,)[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Parameter'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'error': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'rate_law_expressions': <obj_tables.core.ManyToManyAttribute object>, 'reactions': <obj_tables.core.OneToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Parameter'[source]
verbose_name_plural = 'Parameters'[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
error = <obj_tables.core.FloatAttribute object>[source]
evidence = <obj_tables.core.OneToManyAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
units = <obj_tables.sci.units.UnitAttribute object>[source]
value = <obj_tables.core.FloatAttribute object>[source]
class wc_kb.core.PolymerDirection[source]

Bases: enum.Enum

An enumeration.

forward = 1[source]
reverse = -1[source]
class wc_kb.core.PolymerLocus(_comments=None, **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 of Reference

identifiers[source]

identifiers

Type

list of Identifier

class Meta[source]

Bases: obj_tables.core.Meta

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

Returns the direction of the polymer feature defind by its strand and start/end coordinate

Returns

direction (in [‘forward’, ‘reverse’])

Return type

PolymerDirection

Raises
  • ValueError – start and end coordinate of chromosome feature can not be the same

  • Exception – strand is not member of PolymerStrand

get_len()[source]

Get the length

Returns

length

Return type

int

get_seq()[source]

Get the sequence

Returns

sequence

Return type

Bio.Seq.Seq

identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
polymer = <obj_tables.core.ManyToOneAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
start = <obj_tables.core.IntegerAttribute object>[source]
strand = <obj_tables.core.EnumAttribute object>[source]
class wc_kb.core.PolymerSpeciesType(_comments=None, **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_tables.core.Meta

attribute_order = ('id', 'name', 'circular', 'double_stranded', 'comments', 'references', 'identifiers')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'circular': <obj_tables.core.BooleanAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'double_stranded': <obj_tables.core.BooleanAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute 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_tables.core.LocalAttribute object>, 'circular': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'double_stranded': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_tables.core.ManyToOneAttribute object>, 'properties': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Polymer species type'[source]
verbose_name_plural = 'Polymer species types'[source]
circular = <obj_tables.core.BooleanAttribute object>[source]
double_stranded = <obj_tables.core.BooleanAttribute object>[source]
get_len()[source]

Get the polymer length

Returns

length

Return type

int

abstract 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_tables.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.RateLaw(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Rate law

reaction[source]

reaction

Type

Reaction

direction[source]

direction

Type

RateLawDirection

expression[source]

expression

Type

RateLawExpression

units[source]

units

Type

unit_registry.Unit

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

class Meta[source]

Bases: obj_tables.core.Meta, obj_tables.math.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'reaction', 'direction', 'expression', 'units', 'identifiers', 'references', 'comments')[source]
attributes = {'comments': <obj_tables.core.LongStringAttribute object>, 'direction': <obj_tables.core.EnumAttribute object>, 'expression': <obj_tables.math.expression.ManyToOneExpressionAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'reaction': <obj_tables.core.ManyToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]
expression_term_model[source]

alias of RateLawExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.RateLaw'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'comments': <obj_tables.core.LocalAttribute object>, 'direction': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'reaction': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Rate law'[source]
verbose_name_plural = 'Rate laws'[source]
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 ObservableExpression, InvalidAttribute or None

direction = <obj_tables.core.EnumAttribute object>[source]
expression = <obj_tables.math.expression.ManyToOneExpressionAttribute object>[source]
gen_id()[source]

Generate identifier :returns: identifier :rtype: str

identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
reaction = <obj_tables.core.ManyToOneAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
units = <obj_tables.sci.units.UnitAttribute object>[source]
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.RateLawExpression(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model, obj_tables.math.expression.Expression

Rate law expression

expression[source]

mathematical expression of the rate law

Type

str

parameters[source]

parameters whose values are used in the rate law

Type

list of Parameter

species[source]

species whose dynamic concentrations are used in the rate law

Type

list of Species

observables[source]

observables whose values are used in the rate law

Type

list of Observable

Related attributes:

rate_law (RateLaw): the RateLaw which uses this RateLawExpression

class Meta[source]

Bases: obj_tables.core.Meta, obj_tables.math.expression.Meta

attribute_order = ('expression', 'parameters', 'species', 'observables')[source]
attributes = {'expression': <obj_tables.core.LongStringAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'parameters': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[source]
expression_term_models = ('Parameter', 'Species', 'Observable')[source]
expression_unit_registry = <pint.registry.UnitRegistry object>[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.RateLawExpression'>,)[source]
local_attributes = {'expression': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('expression',)[source]
primary_attribute = <obj_tables.core.LongStringAttribute object>[source]
related_attributes = {'rate_laws': <obj_tables.math.expression.ManyToOneExpressionAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Rate law expression'[source]
verbose_name_plural = 'Rate law expressions'[source]
classmethod deserialize(value, objects)[source]

Deserialize value :param value: String representation :type value: str :param objects: dictionary of objects, grouped by model :type objects: dict

Returns

tuple of cleaned value

and cleaning error

Return type

tuple of RateLawExpression, InvalidAttribute or None

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

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

species = <obj_tables.core.ManyToManyAttribute object>[source]
class wc_kb.core.Reaction(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of reactions

cell[source]

cell

Type

Cell

participants[source]

participants

Type

list of SpeciesCoefficient

reversible[source]

denotes whether reaction is reversible

Type

boolean

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

evidence[source]

evidence

Type

list of Evidence

enzymes[source]

enzymes

Type

list of SpeciesType

coenzymes[source]

coenzymes

Type

list of SpeciesType

spontaneous[source]

spontaneity

Type

bool

parameters[source]

parameters

Type

Parameter

type[source]

type

Type

pronto

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_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'type', 'participants', 'enzymes', 'coenzymes', 'reversible', 'spontaneous', 'parameters', 'evidence', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'coenzymes': <obj_tables.core.ManyToManyAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'enzymes': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <obj_tables.core.OneToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'parameters': <obj_tables.core.OneToManyAttribute object>, 'participants': <wc_kb.core.ReactionParticipantAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'reversible': <obj_tables.core.BooleanAttribute object>, 'spontaneous': <obj_tables.core.BooleanAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Reaction'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'coenzymes': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'enzymes': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'participants': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'reversible': <obj_tables.core.LocalAttribute object>, 'spontaneous': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'rate_laws': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Reaction'[source]
verbose_name_plural = 'Reactions'[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
coenzymes = <obj_tables.core.ManyToManyAttribute object>[source]
enzymes = <obj_tables.core.ManyToManyAttribute object>[source]
evidence = <obj_tables.core.OneToManyAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
parameters = <obj_tables.core.OneToManyAttribute object>[source]
participants = <wc_kb.core.ReactionParticipantAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
reversible = <obj_tables.core.BooleanAttribute object>[source]
spontaneous = <obj_tables.core.BooleanAttribute object>[source]
type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
class wc_kb.core.ReactionParticipantAttribute(related_name='', verbose_name='', verbose_related_name='', description='')[source]

Bases: obj_tables.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(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Reference to the literature

id[source]

identifier

Type

str

name[source]

name

Type

str

authors[source]

authors

Type

str

title[source]

title

Type

str

volume[source]

volume

Type

str

issue[source]

issue

Type

str

journal[source]

journal

Type

str

pages (

obj:``str): pages

year[source]

year

Type

int

cell[source]

cell

Type

Cell

identifiers[source]

identifiers

Type

list of Identifier

comments[source]

comments

Type

str

type[source]

type of reference

Type

pronto

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 SpeciesTypeProperty): species type properties reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate_laws observables (list of Observable): observables

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'type', 'title', 'authors', 'journal', 'volume', 'issue', 'pages', 'year', 'identifiers', 'comments')[source]
attributes = {'authors': <obj_tables.core.LongStringAttribute object>, 'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'issue': <obj_tables.core.StringAttribute object>, 'journal': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'pages': <obj_tables.core.StringAttribute object>, 'title': <obj_tables.core.LongStringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'volume': <obj_tables.core.StringAttribute object>, 'year': <obj_tables.core.IntegerAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Reference'>,)[source]
local_attributes = {'authors': <obj_tables.core.LocalAttribute object>, 'cell': <obj_tables.core.LocalAttribute object>, 'chromosome_features': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'concentrations': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'experiment': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'issue': <obj_tables.core.LocalAttribute object>, 'journal': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'pages': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'regulatory_modules': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'title': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'volume': <obj_tables.core.LocalAttribute object>, 'year': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'chromosome_features': <obj_tables.core.ManyToManyAttribute object>, 'compartments': <obj_tables.core.ManyToManyAttribute object>, 'concentrations': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <obj_tables.core.ManyToManyAttribute object>, 'experiment': <obj_tables.core.ManyToManyAttribute object>, 'loci': <obj_tables.core.ManyToManyAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'parameters': <obj_tables.core.ManyToManyAttribute object>, 'properties': <obj_tables.core.ManyToManyAttribute object>, 'rate_laws': <obj_tables.core.ManyToManyAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'regulatory_modules': <obj_tables.core.ManyToManyAttribute object>, 'species_types': <obj_tables.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Reference'[source]
verbose_name_plural = 'References'[source]
authors = <obj_tables.core.LongStringAttribute object>[source]
cell = <obj_tables.core.ManyToOneAttribute object>[source]
comments = <obj_tables.core.LongStringAttribute object>[source]
id = <obj_tables.core.SlugAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
issue = <obj_tables.core.StringAttribute object>[source]
journal = <obj_tables.core.StringAttribute object>[source]
name = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
pages = <obj_tables.core.StringAttribute object>[source]
title = <obj_tables.core.LongStringAttribute object>[source]
type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
volume = <obj_tables.core.StringAttribute object>[source]
year = <obj_tables.core.IntegerAttribute object>[source]
class wc_kb.core.Species(tuple of species type, compartment)[source]

Bases: obj_tables.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 rate_law_expressions (list of RateLawExpression): participations in the evaluation of rates observable_expressions (list of ObservableExpression): participations in observables

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'species_type', 'compartment')[source]
attributes = {'compartment': <obj_tables.core.ManyToOneAttribute object>, 'species_type': <obj_tables.core.ManyToOneAttribute object>}[source]
expression_term_token_pattern = (1, 9, 1, 10)[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.Species'>,)[source]
local_attributes = {'compartment': <obj_tables.core.LocalAttribute object>, 'concentration': <obj_tables.core.LocalAttribute object>, 'observable_expressions': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'species_coefficients': <obj_tables.core.LocalAttribute object>, 'species_type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('species_type', 'compartment')[source]
primary_attribute = None[source]
related_attributes = {'concentration': <wc_kb.core.OneToOneSpeciesAttribute object>, 'observable_expressions': <obj_tables.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_tables.core.ManyToManyAttribute object>, 'species_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 3[source]
unique_together = (('compartment', 'species_type'),)[source]
verbose_name = 'Species'[source]
verbose_name_plural = 'Species'[source]
compartment = <obj_tables.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_tables.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_tables.core.ManyToOneAttribute object>[source]
class wc_kb.core.SpeciesCoefficient(_comments=None, **kwargs)[source]

Bases: obj_tables.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_tables.core.Meta

attribute_order = ('species', 'coefficient')[source]
attributes = {'coefficient': <obj_tables.core.FloatAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.SpeciesCoefficient'>,)[source]
local_attributes = {'coefficient': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('species',)[source]
primary_attribute = None[source]
related_attributes = {'reactions': <wc_kb.core.ReactionParticipantAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Species coefficient'[source]
verbose_name_plural = 'Species coefficients'[source]
coefficient = <obj_tables.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_tables.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_tables.core.ManyToOneAttribute object>[source]
class wc_kb.core.SpeciesType(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of a molecular species

cell[source]

cell

Type

Cell

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

Related attributes:

reaction_participants (list of ReactionParticipant): reaction participants

class Meta[source]

Bases: obj_tables.core.Meta

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

Get the charge

Returns

charge

Return type

int

abstract get_empirical_formula()[source]

Get the empirical formula

Returns

empirical formula

Return type

chem.EmpiricalFormula

abstract get_mol_wt()[source]

Get the molecular weight

Returns

molecular weight

Return type

float

id = <obj_tables.core.SlugAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
class wc_kb.core.SpeciesTypeCoefficient(_comments=None, **kwargs)[source]

Bases: obj_tables.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_tables.core.Meta

attribute_order = ('species_type', 'coefficient')[source]
attributes = {'coefficient': <obj_tables.core.FloatAttribute object>, 'species_type': <obj_tables.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.SpeciesTypeCoefficient'>,)[source]
local_attributes = {'coefficient': <obj_tables.core.LocalAttribute object>, 'complexes': <obj_tables.core.LocalAttribute object>, 'species_type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('species_type',)[source]
primary_attribute = None[source]
related_attributes = {'complexes': <wc_kb.core.SubunitAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Species type coefficient'[source]
verbose_name_plural = 'Species type coefficients'[source]
coefficient = <obj_tables.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_tables.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_tables.core.ManyToOneAttribute object>[source]
class wc_kb.core.SpeciesTypeProperty(_comments=None, **kwargs)[source]

Bases: wc_kb.core.KnowledgeBaseObject

Knowledge of the properties of species types

species_type[source]

species type

Type

SpeciesType

property[source]

name of property

Type

str

units[source]

units

Type

unit_registry

value[source]

value

Type

str

identifiers[source]

identifiers

Type

list of Identifier

references[source]

references

Type

list of Reference

evidence[source]

evidence

Type

list of Evidence

value_type[source]

value type

Type

pronto

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'species_type', 'property', 'value', 'value_type', 'units', 'evidence', 'identifiers', 'references', 'comments')[source]
attributes = {'comments': <obj_tables.core.LongStringAttribute object>, 'evidence': <obj_tables.core.OneToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'property': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'species_type': <obj_tables.core.ManyToOneAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.LongStringAttribute object>, 'value_type': <obj_tables.sci.onto.OntoTermAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.core.SpeciesTypeProperty'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'comments': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'property': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species_type': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>, 'value_type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = (('property', 'species_type'),)[source]
verbose_name = 'Species type property'[source]
verbose_name_plural = 'Species type properties'[source]
evidence = <obj_tables.core.OneToManyAttribute object>[source]
gen_id()[source]

Generate id :returns: identifier :rtype: str

get_value()[source]

SpeciesType property values are stored as strings, this function returns the value as the correct type.

identifiers = <wc_kb.core.IdentifierAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
property = <obj_tables.core.StringAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
species_type = <obj_tables.core.ManyToOneAttribute object>[source]
units = <obj_tables.sci.units.UnitAttribute object>[source]
value = <obj_tables.core.LongStringAttribute object>[source]
value_type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
class wc_kb.core.SubunitAttribute(related_name='', verbose_name='', verbose_related_name='', description='')[source]

Bases: obj_tables.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

class wc_kb.core.Validator[source]

Bases: obj_tables.core.Validator

run(knowledge_base, get_related=True)[source]

Validate a knowledge_base and return its errors

Parameters
  • knowledge_base (KnowledgeBase) – knowledge base

  • get_related (bool, optional) – if true, get all related objects

Returns

list of invalid objects/models and their errors

Return type

InvalidObjectSet or None

2.1.6. wc_kb.eukaryote 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.ActivityLevel[source]

Bases: enum.Enum

Activity level of regulatory element

active = 1[source]
inactive = 4[source]
na = 5[source]
poised = 2[source]
repressed = 3[source]
class wc_kb.eukaryote.GeneLocus(_comments=None, **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:

transcripts (list of TranscriptSpeciesType): transcripts regulatory_modules (list of RegulatoryModule): regulatory_modules

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'symbol', 'homologs', 'polymer', 'strand', 'start', 'end', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'end': <obj_tables.core.IntegerAttribute object>, 'homologs': <obj_tables.core.LongStringAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'polymer': <obj_tables.core.ManyToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'start': <obj_tables.core.IntegerAttribute object>, 'strand': <obj_tables.core.EnumAttribute object>, 'symbol': <obj_tables.core.StringAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.GeneLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'end': <obj_tables.core.LocalAttribute object>, 'homologs': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'polymer': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'regulatory_modules': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'strand': <obj_tables.core.LocalAttribute object>, 'symbol': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'transcripts': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'regulatory_modules': <obj_tables.core.ManyToOneAttribute object>, 'transcripts': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Gene'[source]
verbose_name_plural = 'Genes'[source]
homologs = <obj_tables.core.LongStringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
symbol = <obj_tables.core.StringAttribute object>[source]
class wc_kb.eukaryote.GenericLocus(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Start and end coordinates of exons and CDSs

start[source]

start coordinate

Type

int

end[source]

end coordinate

Type

int

Related attributes:

transcripts (list of TranscriptSpeciesType): transcripts proteins (list of ProteinSpeciesType): proteins

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('start', 'end')[source]
attributes = {'end': <obj_tables.core.PositiveIntegerAttribute object>, 'start': <obj_tables.core.PositiveIntegerAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.GenericLocus'>,)[source]
local_attributes = {'end': <obj_tables.core.LocalAttribute object>, 'proteins': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'transcripts': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('start', 'end')[source]
primary_attribute = None[source]
related_attributes = {'proteins': <wc_kb.eukaryote.LocusAttribute object>, 'transcripts': <wc_kb.eukaryote.LocusAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Generic locus'[source]
verbose_name_plural = 'Generic loci'[source]
end = <obj_tables.core.PositiveIntegerAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns

value of primary attribute

Return type

str

start = <obj_tables.core.PositiveIntegerAttribute object>[source]
class wc_kb.eukaryote.LocusAttribute(related_name='', verbose_name='', verbose_related_name='', description='')[source]

Bases: obj_tables.core.ManyToManyAttribute

Start and end coordinates 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 GenericLocus, InvalidAttribute or None

serialize(coordinates, encoded=None)[source]

Serialize related object :param coordinates: a list of instances of GenericLocus Python representation :type coordinates: 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.eukaryote.ProteinSpeciesType(_comments=None, **kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a protein monomer

uniprot[source]

uniprot id

Type

str

transcript[source]

transcript

Type

TranscriptSpeciesType

coding_regions[source]

CDS coordinates

Type

list of LocusAttribute

Related attributes:

transcription_factor_regulation (list of TranscriptionFactorRegulation): transcription factor regulation ptm_sites (:obj:list` of PtmSite): protein modification sites

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'uniprot', 'transcript', 'coding_regions', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'circular': <obj_tables.core.BooleanAttribute object>, 'coding_regions': <wc_kb.eukaryote.LocusAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'double_stranded': <obj_tables.core.BooleanAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'transcript': <obj_tables.core.OneToOneAttribute object>, 'uniprot': <obj_tables.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.ProteinSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'circular': <obj_tables.core.LocalAttribute object>, 'coding_regions': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'double_stranded': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'ptm_sites': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'transcript': <obj_tables.core.LocalAttribute object>, 'transcription_factor_regulation': <obj_tables.core.LocalAttribute object>, 'uniprot': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_tables.core.ManyToOneAttribute object>, 'properties': <obj_tables.core.ManyToOneAttribute object>, 'ptm_sites': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>, 'transcription_factor_regulation': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Protein'[source]
verbose_name_plural = 'Proteins'[source]
coding_regions = <wc_kb.eukaryote.LocusAttribute object>[source]
get_charge(table=1, cds=True, seq_input=None)[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

  • seq_input (Bio.Seq.Seq, optional) – if provided, the method will use it instead of reading from fasta file to reduce IO operation

Returns

charge

Return type

int

get_empirical_formula(table=1, cds=True, seq_input=None)[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

  • seq_input (Bio.Seq.Seq, optional) – if provided, the method will use it instead of reading from fasta file to reduce IO operation

Returns

empirical formula

Return type

chem.EmpiricalFormula

get_mol_wt(table=1, cds=True, seq_input=None)[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

  • seq_input (Bio.Seq.Seq, optional) – if provided, the method will use it instead of reading from fasta file to reduce IO operation

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

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

Get the 5’ to 3’ amino acid sequence and the start codon

Parameters
  • table (int, optional) – NCBI identifier for translation table (default = standard table)

  • cds (bool, optional) – True indicates the sequence is a complete CDS

Returns

coding RNA sequence that will be translated Bio.Seq.Seq: amino acid sequence Bio.Seq.Seq: start codon

Return type

Bio.Seq.Seq

objects = <obj_tables.core.Manager object>[source]
transcript = <obj_tables.core.OneToOneAttribute object>[source]
uniprot = <obj_tables.core.StringAttribute object>[source]
class wc_kb.eukaryote.PtmSite(_comments=None, **kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge of protein modification sites

modified_protein[source]

modified protein

Type

ProteinSpeciesType

type[source]

type of modification (phosphorylation, methylation, etc…)

Type

str

modified_residue[source]

residue name and position in protein sequence

Type

str

fractional_abundance[source]

ratio of modified protein abundance

Type

int

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'modified_protein', 'type', 'modified_residue', 'fractional_abundance', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'end': <obj_tables.core.IntegerAttribute object>, 'fractional_abundance': <obj_tables.core.FloatAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'modified_protein': <obj_tables.core.ManyToOneAttribute object>, 'modified_residue': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'polymer': <obj_tables.core.ManyToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'start': <obj_tables.core.IntegerAttribute object>, 'strand': <obj_tables.core.EnumAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.PtmSite'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'end': <obj_tables.core.LocalAttribute object>, 'fractional_abundance': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'modified_protein': <obj_tables.core.LocalAttribute object>, 'modified_residue': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'polymer': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'strand': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Ptm site'[source]
verbose_name_plural = 'Ptm sites'[source]
fractional_abundance = <obj_tables.core.FloatAttribute object>[source]
modified_protein = <obj_tables.core.ManyToOneAttribute object>[source]
modified_residue = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
type = <obj_tables.core.StringAttribute object>[source]
class wc_kb.eukaryote.RegDirectionAttribute(related_name='', verbose_name='', verbose_related_name='', description='')[source]

Bases: obj_tables.core.ManyToManyAttribute

Regulatory direction 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 RegDirection, InvalidAttribute or None

serialize(directions, encoded=None)[source]

Serialize related object :param directions: a list of instances of TFdirection Python representation :type directions: 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.eukaryote.RegulationType[source]

Bases: enum.Enum

Type of regulation between a regulatory element and a gene

distal = 2[source]
proximal = 1[source]
class wc_kb.eukaryote.RegulatoryDirection[source]

Bases: int, enum.Enum

The direction of regulation

activation = 1[source]
repression = -1[source]
unknown = 0[source]
class wc_kb.eukaryote.RegulatoryModule(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Knowledge about regulatory modules

id[source]

identifier

Type

str

name[source]

name

Type

str

gene[source]

gene

Type

GeneLocus

promoter[source]

promoter ensembl ID

Type

str

activity[source]

cell-type specific activity level

Type

ActivityLevel

type[source]

type of regulation (proximal or distal)

Type

RegulationType

transcription_factor_regulation[source]

transcription factor and direction of regulation

Type

TranscriptionFactorRegulation

comments[source]

comments

Type

str

references[source]

references

Type

list of Reference

identifiers[source]

identifiers

Type

list of Identifier

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'gene', 'promoter', 'activity', 'type', 'transcription_factor_regulation', 'identifiers', 'references', 'comments')[source]
attributes = {'activity': <obj_tables.core.EnumAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'gene': <obj_tables.core.ManyToOneAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'promoter': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'transcription_factor_regulation': <wc_kb.eukaryote.RegDirectionAttribute object>, 'type': <obj_tables.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.RegulatoryModule'>,)[source]
local_attributes = {'activity': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'gene': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'promoter': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'transcription_factor_regulation': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Regulatory module'[source]
verbose_name_plural = 'Regulatory modules'[source]
activity = <obj_tables.core.EnumAttribute object>[source]
comments = <obj_tables.core.LongStringAttribute object>[source]
gene = <obj_tables.core.ManyToOneAttribute object>[source]
id = <obj_tables.core.SlugAttribute object>[source]
identifiers = <wc_kb.core.IdentifierAttribute object>[source]
name = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
promoter = <obj_tables.core.StringAttribute object>[source]
references = <obj_tables.core.ManyToManyAttribute object>[source]
transcription_factor_regulation = <wc_kb.eukaryote.RegDirectionAttribute object>[source]
type = <obj_tables.core.EnumAttribute object>[source]
class wc_kb.eukaryote.TranscriptSpeciesType(_comments=None, **kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of a transcript (spliced RNA) species

gene[source]

gene

Type

GeneLocus

exons[source]

exon coordinates

Type

list of LocusAttribute

type[source]

type

Type

TranscriptType

Related attributes:

protein (ProteinSpeciesType): protein

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'gene', 'exons', 'type', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'circular': <obj_tables.core.BooleanAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'double_stranded': <obj_tables.core.BooleanAttribute object>, 'exons': <wc_kb.eukaryote.LocusAttribute object>, 'gene': <obj_tables.core.ManyToOneAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.core.EnumAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.TranscriptSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'circular': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'double_stranded': <obj_tables.core.LocalAttribute object>, 'exons': <obj_tables.core.LocalAttribute object>, 'gene': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'protein': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_tables.core.ManyToOneAttribute object>, 'properties': <obj_tables.core.ManyToOneAttribute object>, 'protein': <obj_tables.core.OneToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Transcript'[source]
verbose_name_plural = 'Transcripts'[source]
exons = <wc_kb.eukaryote.LocusAttribute object>[source]
gene = <obj_tables.core.ManyToOneAttribute object>[source]
get_charge(seq_input=None)[source]

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

  • 5’ monophosphate

  • Deprotonated phosphate oxygens

\(-L - 1\)

Parameters

seq_input (Bio.Seq.Seq, optional) – if provided, the method will use it instead of reading from fasta file to reduce IO operation

Returns

charge

Return type

int

get_empirical_formula(seq_input=None)[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\)

Parameters

seq_input (Bio.Seq.Seq, optional) – if provided, the method will use it instead of reading from fasta file to reduce IO operation

Returns

empirical formula

Return type

chem.EmpiricalFormula

get_mol_wt(seq_input=None)[source]

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

  • 5’ monophosphate

  • Deprotonated phosphate oxygens

Parameters

seq_input (Bio.Seq.Seq, optional) – if provided, the method will use it instead of reading from fasta file to reduce IO operation

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_tables.core.Manager object>[source]
type = <obj_tables.core.EnumAttribute object>[source]
class wc_kb.eukaryote.TranscriptType[source]

Bases: enum.Enum

Type of transcript

itRna = 4[source]
mRna = 1[source]
rRna = 2[source]
tRna = 3[source]
class wc_kb.eukaryote.TranscriptionFactorRegulation(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Transcription factor and the direction of transcriptional regulation

transcription_factor[source]

transcription factor

Type

ProteinSpeciesType

direction[source]

regulatory direction

Type

RegulatoryDirection

Related attributes:

regulatory_modules (list of RegulatoryModule): regulatory modules

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('transcription_factor', 'direction')[source]
attributes = {'direction': <obj_tables.core.EnumAttribute object>, 'transcription_factor': <obj_tables.core.ManyToOneAttribute object>}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.eukaryote.TranscriptionFactorRegulation'>,)[source]
local_attributes = {'direction': <obj_tables.core.LocalAttribute object>, 'regulatory_modules': <obj_tables.core.LocalAttribute object>, 'transcription_factor': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('transcription_factor', 'direction')[source]
primary_attribute = None[source]
related_attributes = {'regulatory_modules': <wc_kb.eukaryote.RegDirectionAttribute object>}[source]
table_format = 3[source]
unique_together = ()[source]
verbose_name = 'Transcription factor regulation'[source]
verbose_name_plural = 'Transcription factor regulations'[source]
classmethod deserialize(value, objects)[source]

Deserialize value :param value: String representation :type value: str :param objects: dictionary of objects, grouped by model :type objects: dict

Returns

tuple of cleaned value

and cleaning error

Return type

tuple of list of TranscriptionFactorRegulation, InvalidAttribute or None

direction = <obj_tables.core.EnumAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns

value of primary attribute

Return type

str

transcription_factor = <obj_tables.core.ManyToOneAttribute object>[source]

2.1.7. 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: obj_tables.io.Reader

Read knowledge base from file(s)

run(core_path, seq_path='', rewrite_seq_path=True, taxon='prokaryote', models=None, ignore_missing_models=None, ignore_extra_models=None, ignore_sheet_order=None, include_all_attributes=False, ignore_missing_attributes=None, ignore_extra_attributes=None, ignore_attribute_order=None, group_objects_by_model=True, validate=True, read_metadata=False)[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

  • taxon (str, optional) – type of model order to use

  • models (types.TypeType or list of types.TypeType, optional) – type of object to read or list of types of objects to read

  • ignore_missing_models (bool, optional) – if False, report an error if a worksheet/ file is missing for one or more models

  • ignore_extra_models (bool, optional) – if True and all models are found, ignore other worksheets or files

  • ignore_sheet_order (bool, optional) – if True, do not require the sheets to be provided in the canonical order

  • include_all_attributes (bool, optional) – if True, export all attributes including those not explictly included in Model.Meta.attribute_order

  • ignore_missing_attributes (bool, optional) – if False, report an error if a worksheet/file doesn’t contain all of attributes in a model in models

  • ignore_extra_attributes (bool, optional) – if True, do not report errors if attributes in the data are not in the model

  • ignore_attribute_order (bool) – if True, do not require the attributes to be provided in the canonical order

  • group_objects_by_model (bool, optional) – if True, group decoded objects by their types

  • validate (bool, optional) – if True, validate the data

  • read_metadata (bool, optional) – if True, read metadata models

Returns

model objects grouped by obj_tables.Model class

Return type

dict

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: obj_tables.io.Writer

Write knowledge base to file(s)

run(core_path, knowledge_base, seq_path=None, rewrite_seq_path=True, taxon='prokaryote', models=None, get_related=True, include_all_attributes=False, validate=True, title=None, description=None, keywords=None, version=None, language=None, creator=None, write_schema=False, write_toc=True, extra_entries=0, data_repo_metadata=False, schema_package=None, protected=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

  • taxon (str, optional) – type of model order to use

  • models (list of Model, optional) – models in the order that they should appear as worksheets; all models which are not in models will follow in alphabetical order

  • get_related (bool, optional) – if True, write object and all related objects

  • include_all_attributes (bool, optional) – if True, export all attributes including those not explictly included in Model.Meta.attribute_order

  • validate (bool, optional) – if True, validate the data

  • title (str, optional) – title

  • description (str, optional) – description

  • keywords (str, optional) – keywords

  • version (str, optional) – version

  • language (str, optional) – language

  • creator (str, optional) – creator

  • write_schema (bool, optional) – if True, include additional worksheet with schema

  • write_toc (bool, optional) – if True, include additional worksheet with table of contents

  • extra_entries (int, optional) – additional entries to display

  • data_repo_metadata (bool, optional) – if True, try to write metadata information about the file’s Git repo; the repo must be current with origin, except for the file

  • schema_package (str, optional) – the package which defines the obj_tables schema used by the file; if not None, try to write metadata information about the the schema’s Git repository: the repo must be current with origin

  • protected (bool, optional) – if True, protect the worksheet

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

validate_implicit_relationships_are_set(knowledge_base)[source]

Check that there is only 1 KnowledgeBase and <= 1 Cell and that each relationship to KnowledgeBase and Cell is set. This is necessary to enable the KnowledgeBase and Cell relationships to be implicit in the Excel output and added by Reader.run

Parameters

knowledge_base (core.KnowledgeBase) – knowledge base

Raises

ValueError – if there are multiple instances of core.KnowledgeBase in the object graph

wc_kb.io.convert(source_core, source_seq, dest_core, dest_seq, taxon='prokaryote', rewrite_seq_path=True, protected=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

  • taxon (str) – taxon

  • 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

  • protected (bool, optional) – if True, protect the worksheet

wc_kb.io.create_template(core_path, seq_path, taxon='prokaryote', write_schema=False, write_toc=True, extra_entries=10, data_repo_metadata=True, protected=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

  • taxon (str, optional) – taxon

  • write_schema (bool, optional) – if True, include additional worksheet with schema

  • write_toc (bool, optional) – if True, include additional worksheet with table of contents

  • extra_entries (int, optional) – additional entries to display

  • data_repo_metadata (bool, optional) – if True, try to write metadata information about the file’s Git repo

  • protected (bool, optional) – if True, protect the worksheet

2.1.8. wc_kb.prokaryote 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.GeneLocus(_comments=None, **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_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'symbol', 'polymer', 'start', 'end', 'cog', 'homologs', 'is_essential', 'proteins', 'evidence', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'cog': <obj_tables.sci.onto.OntoTermAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'end': <obj_tables.core.IntegerAttribute object>, 'evidence': <obj_tables.core.OneToManyAttribute object>, 'homologs': <obj_tables.core.LongStringAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'is_essential': <obj_tables.core.BooleanAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'polymer': <obj_tables.core.ManyToOneAttribute object>, 'proteins': <obj_tables.core.OneToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'start': <obj_tables.core.IntegerAttribute object>, 'strand': <obj_tables.core.EnumAttribute object>, 'symbol': <obj_tables.core.StringAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote.GeneLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'cog': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'end': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'homologs': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'is_essential': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'polymer': <obj_tables.core.LocalAttribute object>, 'proteins': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'strand': <obj_tables.core.LocalAttribute object>, 'symbol': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'transcription_units': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {'transcription_units': <obj_tables.core.OneToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Gene'[source]
verbose_name_plural = 'Genes'[source]
cog = <obj_tables.sci.onto.OntoTermAttribute object>[source]
end = <obj_tables.core.IntegerAttribute object>[source]
evidence = <obj_tables.core.OneToManyAttribute object>[source]
homologs = <obj_tables.core.LongStringAttribute object>[source]
is_essential = <obj_tables.core.BooleanAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
proteins = <obj_tables.core.OneToOneAttribute object>[source]
start = <obj_tables.core.IntegerAttribute object>[source]
symbol = <obj_tables.core.StringAttribute object>[source]
class wc_kb.prokaryote.ProteinSpeciesType(_comments=None, **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_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'type', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'circular': <obj_tables.core.BooleanAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'double_stranded': <obj_tables.core.BooleanAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'unit': <obj_tables.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote.ProteinSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'circular': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'double_stranded': <obj_tables.core.LocalAttribute object>, 'gene': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'rnas': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'unit': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'gene': <obj_tables.core.OneToOneAttribute object>, 'loci': <obj_tables.core.ManyToOneAttribute object>, 'properties': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'rnas': <obj_tables.core.OneToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Protein'[source]
verbose_name_plural = 'Proteins'[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_tables.core.Manager object>[source]
type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
unit = <obj_tables.core.StringAttribute object>[source]
class wc_kb.prokaryote.RnaSpeciesType(_comments=None, **kwargs)[source]

Bases: wc_kb.core.PolymerSpeciesType

Knowledge of an RNA species

transcription_units[source]

transcription units

Type

list of TranscriptionUnitLocus

type[source]

type

Type

RnaType

Related attributes:

proteins (list of ProteinSpeciesType): protein(s)

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'synonyms', 'type', 'start', 'end', 'proteins', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'circular': <obj_tables.core.BooleanAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'coordinate': <obj_tables.core.IntegerAttribute object>, 'double_stranded': <obj_tables.core.BooleanAttribute object>, 'end': <obj_tables.core.IntegerAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'length': <obj_tables.core.IntegerAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'proteins': <obj_tables.core.OneToManyAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'start': <obj_tables.core.IntegerAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote.RnaSpeciesType'>, <class 'wc_kb.core.PolymerSpeciesType'>, <class 'wc_kb.core.SpeciesType'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'circular': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'coordinate': <obj_tables.core.LocalAttribute object>, 'double_stranded': <obj_tables.core.LocalAttribute object>, 'end': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'length': <obj_tables.core.LocalAttribute object>, 'loci': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'properties': <obj_tables.core.LocalAttribute object>, 'proteins': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_type_coefficients': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>, 'transcription_units': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.SlugAttribute object>[source]
related_attributes = {'loci': <obj_tables.core.ManyToOneAttribute object>, 'properties': <obj_tables.core.ManyToOneAttribute object>, 'reactions': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'species_type_coefficients': <obj_tables.core.ManyToOneAttribute object>, 'transcription_units': <obj_tables.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'RNA'[source]
verbose_name_plural = 'RNAs'[source]
coordinate = <obj_tables.core.IntegerAttribute object>[source]
end = <obj_tables.core.IntegerAttribute object>[source]
get_charge()[source]

Get the charge for a transcript with

  • 5’ monophosphate

  • Deprotonated phosphate oxygens

\(-L - 1\)

Returns

charge

Return type

int

get_direction()[source]

Returns the direction of the polymer feature defind by its strand and start/end coordinate :returns: direction (in [‘forward’, ‘reverse’]) :rtype: str

Raises
  • ValueError – start and end coordinate of chromosome feature can not be the same

  • Exception – strand is not member of PolymerStrand

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

length = <obj_tables.core.IntegerAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
proteins = <obj_tables.core.OneToManyAttribute object>[source]
start = <obj_tables.core.IntegerAttribute object>[source]
type = <obj_tables.sci.onto.OntoTermAttribute object>[source]
class wc_kb.prokaryote.TranscriptionUnitLocus(_comments=None, **kwargs)[source]

Bases: wc_kb.core.PolymerLocus

Knowledge about an open reading frame

genes[source]

genes

Type

list of GeneLocus

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ('id', 'name', 'polymer', 'strand', 'pribnow_start', 'pribnow_end', 'start', 'end', 'rnas', 'genes', 'identifiers', 'references', 'comments')[source]
attributes = {'cell': <obj_tables.core.ManyToOneAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'end': <obj_tables.core.IntegerAttribute object>, 'genes': <obj_tables.core.OneToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_kb.core.IdentifierAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'polymer': <obj_tables.core.ManyToOneAttribute object>, 'pribnow_end': <obj_tables.core.IntegerAttribute object>, 'pribnow_start': <obj_tables.core.IntegerAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'rnas': <obj_tables.core.ManyToManyAttribute object>, 'start': <obj_tables.core.IntegerAttribute object>, 'strand': <obj_tables.core.EnumAttribute object>, 'synonyms': <obj_tables.core.StringAttribute object>}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_kb.prokaryote.TranscriptionUnitLocus'>, <class 'wc_kb.core.PolymerLocus'>, <class 'wc_kb.core.KnowledgeBaseObject'>)[source]
local_attributes = {'cell': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'end': <obj_tables.core.LocalAttribute object>, 'genes': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'polymer': <obj_tables.core.LocalAttribute object>, 'pribnow_end': <obj_tables.core.LocalAttribute object>, 'pribnow_start': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'rnas': <obj_tables.core.LocalAttribute object>, 'start': <obj_tables.core.LocalAttribute object>, 'strand': <obj_tables.core.LocalAttribute object>, 'synonyms': <obj_tables.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_tables.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Transcription unit'[source]
verbose_name_plural = 'Transcription units'[source]
genes = <obj_tables.core.OneToManyAttribute 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_tables.core.Manager object>[source]
pribnow_end = <obj_tables.core.IntegerAttribute object>[source]
pribnow_start = <obj_tables.core.IntegerAttribute object>[source]
rnas = <obj_tables.core.ManyToManyAttribute object>[source]

2.1.9. 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

2.1.10. Module contents