2.1. wc_kb package¶
2.1.1. Subpackages¶
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
-
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]¶
-
-
class
-
class
wc_kb.__main__.
BaseController
(*args, **kw)[source]¶ Bases:
cement.ext.ext_argparse.ArgparseController
Base controller for command line application
-
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]¶
-
-
class
-
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]¶
-
-
class
-
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]¶
-
-
class
-
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]¶
-
-
class
-
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]¶
-
-
class
-
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]¶
-
-
class
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
- Related attributes:
references (
list
ofReference
): references compartments (list
ofCompartment
): compartments species_types (list
ofSpeciesType
): species types concentrations (list
ofConcentration
): concentrations observables (list
orObservable
) : observables loci (list
ofPolymerLocus
): locus reactions (list
ofReaction
): reactions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
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]¶
-
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]¶
-
-
knowledge_base
= <obj_tables.core.OneToOneAttribute 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
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
- 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]¶
-
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]¶
-
-
get_direction
()[source]¶ Returns the direction of chromosome feature
- Returns
direction (in [‘forward’, ‘reverse’])
- Return type
-
identifiers
= <wc_kb.core.IdentifierAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_kb.core.
Compartment
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.KnowledgeBaseObject
Knowledge of a subcellular compartment
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
- Related attributes:
reaction_participants (
list
ofReactionParticipant
): 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]¶
-
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]¶
-
-
cell
= <obj_tables.core.ManyToOneAttribute object>[source]
-
identifiers
= <wc_kb.core.IdentifierAttribute 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
-
subunits
[source]¶ subunits
- Type
list
ofSpeciesTypeCoefficient
-
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]¶
-
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]¶
-
-
formation_process
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
get_empirical_formula
()[source]¶ Get the empirical formula
- Returns
empirical formula
- Return type
chem.EmpiricalFormula
-
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
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
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]¶
-
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]¶
-
-
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]
-
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
-
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]¶
-
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]¶
-
-
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 sequenceend (
int
, optional) – end coordinate of the queried subsequence, default is the end of the full sequence
- Returns
structure
- Return type
Bio.Seq.Seq
-
ploidy
= <obj_tables.core.IntegerAttribute object>[source]
-
class
-
class
wc_kb.core.
Evidence
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.KnowledgeBaseObject
Represents the measurement / observation of a property
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
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]¶
-
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]¶
-
-
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]
-
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
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
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]¶
-
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]¶
-
-
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]
-
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
- Related attributes:
compartments (
list
ofCompartment
): compartments species_types (list
ofSpeciesType
): species_types concentrations (list
ofConcentration
): concentrations loci (list
ofPolymerLocus
): loci properties (list
ofSpeciesTypeProperty
): species type properties reactions (list
ofReaction
): reactions rate_laws (list
ofRateLaw
): rate_laws observables (list
ofObservable
): observables
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'id': <obj_tables.core.RegexAttribute object>, 'namespace': <obj_tables.core.RegexAttribute object>}[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]¶
-
-
id
= <obj_tables.core.RegexAttribute object>[source]
-
namespace
= <obj_tables.core.RegexAttribute object>[source]
-
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 valueand cleaning error
- Return type
tuple
oflist
ofIdentifier
,InvalidAttribute
orNone
-
serialize
(identifiers, encoded=None)[source]¶ Serialize related object :param identifiers: a list of instances of Identifier Python representation :type identifiers:
list
ofModel
: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 of the 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]¶
-
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]¶
-
-
branch
= <obj_tables.core.StringAttribute 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
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
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]¶
-
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]¶
-
-
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
ofReference
)
-
id
= <obj_tables.core.StringAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
synonyms
= <obj_tables.core.StringAttribute object>[source]
-
class
-
class
wc_kb.core.
MetaboliteSpeciesType
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.SpeciesType
Knowledge of a metabolite
-
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]¶
-
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]¶
-
-
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.4major_tautomer (
bool
, optional) – ifTrue
, use the major tautomeric in the calculationkeep_hydrogens (
bool
, optional) – ifTrue
, keep explicity defined hydrogensdearomatize (
bool
, optional) – ifTrue
, dearomatize molecule
- Returns
InChI-encoded structure
- Return type
str
-
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
-
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
-
class
wc_kb.core.
Observable
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.KnowledgeBaseObject
Observable: a linear function of other Observables and Species
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
- Related attributes:
observable_expressions (
list
ofObservableExpression
): observable expressions rate_law_expressions (list
ofRateLawExpression
): 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
-
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]¶
-
-
cell
= <obj_tables.core.ManyToOneAttribute object>[source]
-
deserialize
(value, objects, decoded=None)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by modeldecoded (
dict
, optional) – dictionary of objects that have already been decoded
- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofObservableExpression
, InvalidAttribute or None
-
expression
= <obj_tables.math.expression.ManyToOneExpressionAttribute object>[source]
-
identifiers
= <wc_kb.core.IdentifierAttribute 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.
-
observables
[source]¶ other Observables used by this Observable expression
- Type
list
ofObservable
- Related attributes:
observable (
Observable
): observable
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
attributes
= {'expression': <obj_tables.core.LongStringAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[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]¶
-
-
classmethod
deserialize
(value, objects)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by model
- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofObservableExpression
, InvalidAttribute or None
-
expression
= <obj_tables.core.LongStringAttribute object>[source]
-
observables
= <obj_tables.core.ManyToManyAttribute object>[source]
-
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 representationobjects (
dict
) – dictionary of objects, grouped by modeldecoded (
dict
, optional) – dictionary of objects that have already been decoded
- Returns
tuple
of cleaned valueand cleaning error
- Return type
tuple
oflist
ofSpecies
,InvalidAttribute
orNone
-
-
class
wc_kb.core.
Parameter
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.KnowledgeBaseObject
Knowledge of parameters
- Related attributes:
rate_law_expressions (
list
ofRateLawExpression
): 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]¶
-
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]¶
-
-
cell
= <obj_tables.core.ManyToOneAttribute object>[source]
-
error
= <obj_tables.core.FloatAttribute object>[source]
-
evidence
= <obj_tables.core.OneToManyAttribute 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.
PolymerLocus
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.KnowledgeBaseObject
Knowledge about a locus of a polymer
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
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]¶
-
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]¶
-
-
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
- Raises
ValueError – start and end coordinate of chromosome feature can not be the same
Exception – strand is not member of PolymerStrand
-
identifiers
= <wc_kb.core.IdentifierAttribute 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
- Related attributes:
loci (
list
ofPolymerLocus
): 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]¶
-
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]¶
-
-
circular
= <obj_tables.core.BooleanAttribute object>[source]
-
double_stranded
= <obj_tables.core.BooleanAttribute object>[source]
-
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
-
class
wc_kb.core.
RateLaw
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.KnowledgeBaseObject
Rate law
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
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
-
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]¶
-
-
deserialize
(value, objects, decoded=None)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by modeldecoded (
dict
, optional) – dictionary of objects that have already been decoded
- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofObservableExpression
, InvalidAttribute or None
-
direction
= <obj_tables.core.EnumAttribute object>[source]
-
expression
= <obj_tables.math.expression.ManyToOneExpressionAttribute object>[source]
-
identifiers
= <wc_kb.core.IdentifierAttribute 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
-
class
wc_kb.core.
RateLawExpression
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,obj_tables.math.expression.Expression
Rate law expression
-
observables
[source]¶ observables whose values are used in the rate law
- Type
list
ofObservable
- Related attributes:
rate_law (
RateLaw
): the RateLaw which uses this RateLawExpression
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
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]¶
-
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]¶
-
-
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
ofRateLawExpression
, InvalidAttribute or None
-
expression
= <obj_tables.core.LongStringAttribute 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
-
participants
[source]¶ participants
- Type
list
ofSpeciesCoefficient
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
enzymes
[source]¶ enzymes
- Type
list
ofSpeciesType
-
coenzymes
[source]¶ coenzymes
- Type
list
ofSpeciesType
- Related attributes:
- rate_laws (
list
ofRateLaw
): rate laws; if present, rate_laws[0] is the forward rate law, and rate_laws[1] is the backward rate law
- rate_laws (
-
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]¶
-
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]¶
-
-
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]
-
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 representationobjects (
dict
) – dictionary of objects, grouped by modeldecoded (
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
ofSpeciesCoefficient
: list of species coefficientslist
ofException
: list of errors
- Return type
tuple
-
serialize
(participants, encoded=None)[source]¶ Serialize related object
- Parameters
participants (
list
ofSpeciesCoefficient
) – Python representation of reaction participantsencoded (
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
authors
- Type
str
-
pages (
obj:``str): pages
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
- Related attributes:
compartments (
list
ofCompartment
): compartments species_types (list
ofSpeciesType
): species_types concentrations (list
ofConcentration
): concentrations loci (list
ofPolymerLocus
): loci properties (list
ofSpeciesTypeProperty
): species type properties reactions (list
ofReaction
): reactions rate_laws (list
ofRateLaw
): rate_laws observables (list
ofObservable
): 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]¶
-
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]¶
-
-
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]
-
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
- Related attributes:
concentration (
Concentration
): concentration species_coefficients (list
ofSpeciesCoefficient
): participations in reactions rate_law_expressions (list
ofRateLawExpression
): participations in the evaluation of rates observable_expressions (list
ofObservableExpression
): participations in observables
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'compartment': <obj_tables.core.ManyToOneAttribute object>, 'species_type': <obj_tables.core.ManyToOneAttribute object>}[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]¶
-
-
compartment
= <obj_tables.core.ManyToOneAttribute object>[source]
-
classmethod
deserialize
(attribute, value, objects)[source]¶ Deserialize value
- Parameters
attribute (
Attribute
) – attributevalue (
str
) – String representationobjects (
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 idcompartment (
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
-
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
- Related attributes:
reaction (
Reaction
): reaction
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'coefficient': <obj_tables.core.FloatAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>}[source]¶
-
local_attributes
= {'coefficient': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
coefficient
= <obj_tables.core.FloatAttribute object>[source]
-
classmethod
deserialize
(attribute, value, objects, compartment=None)[source]¶ Deserialize value
- Parameters
attribute (
Attribute
) – attributevalue (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by modelcompartment (
Compartment
, optional) – compartment
- Returns
- tuple of cleaned value
and cleaning error
- Return type
tuple
of list of SpeciesCoefficient, InvalidAttribute or None
-
serialize
(show_compartment=True, show_coefficient_sign=True)[source]¶ Serialize related object
- Parameters
show_compartment (
bool
, optional) – if true, show compartmentshow_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
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
- Related attributes:
reaction_participants (
list
ofReactionParticipant
): reaction participants
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
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]¶
-
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]¶
-
-
cell
= <obj_tables.core.ManyToOneAttribute object>[source]
-
abstract
get_empirical_formula
()[source]¶ Get the empirical formula
- Returns
empirical formula
- Return type
chem.EmpiricalFormula
-
identifiers
= <wc_kb.core.IdentifierAttribute 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
- Related attributes:
complex (
ComplexSpeciesType
): complex
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'coefficient': <obj_tables.core.FloatAttribute object>, 'species_type': <obj_tables.core.ManyToOneAttribute object>}[source]¶
-
local_attributes
= {'coefficient': <obj_tables.core.LocalAttribute object>, 'complexes': <obj_tables.core.LocalAttribute object>, 'species_type': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
coefficient
= <obj_tables.core.FloatAttribute object>[source]
-
classmethod
deserialize
(attribute, value, objects)[source]¶ Deserialize value
- Parameters
attribute (
Attribute
) – attributevalue (
str
) – String representationobjects (
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
-
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
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
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]¶
-
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]¶
-
-
evidence
= <obj_tables.core.OneToManyAttribute object>[source]
-
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]
-
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 representationobjects (
dict
) – dictionary of objects, grouped by modeldecoded (
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
ofSpeciesTypeCoefficient
) – Python representation of subunitsencoded (
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 baseget_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.
GeneLocus
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.PolymerLocus
Knowledge of a gene
- Related attributes:
transcripts (
list
ofTranscriptSpeciesType
): 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]¶
-
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]¶
-
-
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
- Related attributes:
transcripts (
list
ofTranscriptSpeciesType
): transcripts proteins (list
ofProteinSpeciesType
): proteins
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'end': <obj_tables.core.PositiveIntegerAttribute object>, 'start': <obj_tables.core.PositiveIntegerAttribute object>}[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]¶
-
-
end
= <obj_tables.core.PositiveIntegerAttribute 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 valueand cleaning error
- Return type
tuple
oflist
ofGenericLocus
,InvalidAttribute
orNone
-
serialize
(coordinates, encoded=None)[source]¶ Serialize related object :param coordinates: a list of instances of GenericLocus Python representation :type coordinates:
list
ofModel
: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
-
coding_regions
[source]¶ CDS coordinates
- Type
list
ofLocusAttribute
- 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]¶
-
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]¶
-
-
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 CDSseq_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 CDSseq_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 CDSseq_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 sequenceBio.Seq.Seq
: start codon- Return type
Bio.Seq.Seq
-
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
-
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]¶
-
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]¶
-
-
fractional_abundance
= <obj_tables.core.FloatAttribute object>[source]
-
modified_protein
= <obj_tables.core.ManyToOneAttribute object>[source]
-
modified_residue
= <obj_tables.core.StringAttribute object>[source]
-
type
= <obj_tables.core.StringAttribute object>[source]
-
class
-
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 valueand cleaning error
- Return type
tuple
oflist
ofRegDirection
,InvalidAttribute
orNone
-
serialize
(directions, encoded=None)[source]¶ Serialize related object :param directions: a list of instances of TFdirection Python representation :type directions:
list
ofModel
: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
-
class
wc_kb.eukaryote.
RegulatoryDirection
[source]¶ Bases:
int
,enum.Enum
The direction of regulation
-
class
wc_kb.eukaryote.
RegulatoryModule
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
Knowledge about regulatory modules
-
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]¶
-
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]¶
-
-
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]
-
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
-
class
wc_kb.eukaryote.
TranscriptSpeciesType
(_comments=None, **kwargs)[source]¶ Bases:
wc_kb.core.PolymerSpeciesType
Knowledge of a transcript (spliced RNA) species
-
exons
[source]¶ exon coordinates
- Type
list
ofLocusAttribute
- 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]¶
-
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]¶
-
-
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
-
type
= <obj_tables.core.EnumAttribute object>[source]
-
-
class
wc_kb.eukaryote.
TranscriptionFactorRegulation
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
Transcription factor and the direction of transcriptional regulation
- Related attributes:
regulatory_modules (
list
of RegulatoryModule): regulatory modules
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'direction': <obj_tables.core.EnumAttribute object>, 'transcription_factor': <obj_tables.core.ManyToOneAttribute object>}[source]¶
-
local_attributes
= {'direction': <obj_tables.core.LocalAttribute object>, 'regulatory_modules': <obj_tables.core.LocalAttribute object>, 'transcription_factor': <obj_tables.core.LocalAttribute object>}[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]
-
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 baseseq_path (
str
) – path to genome sequencerewrite_seq_path (
bool
, optional) – ifTrue
, the path to genome sequence in the knowledge base will be updated to the provided seq_pathtaxon (
str
, optional) – type of model order to usemodels (
types.TypeType
orlist
oftypes.TypeType
, optional) – type of object to read or list of types of objects to readignore_missing_models (
bool
, optional) – ifFalse
, report an error if a worksheet/ file is missing for one or more modelsignore_extra_models (
bool
, optional) – ifTrue
and all models are found, ignore other worksheets or filesignore_sheet_order (
bool
, optional) – ifTrue
, do not require the sheets to be provided in the canonical orderinclude_all_attributes (
bool
, optional) – ifTrue
, export all attributes including those not explictly included in Model.Meta.attribute_orderignore_missing_attributes (
bool
, optional) – ifFalse
, report an error if a worksheet/file doesn’t contain all of attributes in a model in modelsignore_extra_attributes (
bool
, optional) – ifTrue
, do not report errors if attributes in the data are not in the modelignore_attribute_order (
bool
) – ifTrue
, do not require the attributes to be provided in the canonical ordergroup_objects_by_model (
bool
, optional) – ifTrue
, group decoded objects by their typesvalidate (
bool
, optional) – ifTrue
, validate the dataread_metadata (
bool
, optional) – ifTrue
, 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 basecore_path (
str
) – path to save core knowledge baseseq_path (
str
, optional) – path to save genome sequencerewrite_seq_path (
bool
, optional) – ifTrue
, the path to genome sequence in the saved knowledge base will be updated to the newly saved seq_pathtaxon (
str
, optional) – type of model order to usemodels (
list
ofModel
, optional) – models in the order that they should appear as worksheets; all models which are not in models will follow in alphabetical orderget_related (
bool
, optional) – ifTrue
, write object and all related objectsinclude_all_attributes (
bool
, optional) – ifTrue
, export all attributes including those not explictly included in Model.Meta.attribute_ordervalidate (
bool
, optional) – ifTrue
, validate the datatitle (
str
, optional) – titledescription (
str
, optional) – descriptionkeywords (
str
, optional) – keywordsversion (
str
, optional) – versionlanguage (
str
, optional) – languagecreator (
str
, optional) – creatorwrite_schema (
bool
, optional) – ifTrue
, include additional worksheet with schemawrite_toc (
bool
, optional) – ifTrue
, include additional worksheet with table of contentsextra_entries (
int
, optional) – additional entries to displaydata_repo_metadata (
bool
, optional) – ifTrue
, try to write metadata information about the file’s Git repo; the repo must be current with origin, except for the fileschema_package (
str
, optional) – the package which defines the obj_tables schema used by the file; if notNone
, try to write metadata information about the the schema’s Git repository: the repo must be current with originprotected (
bool
, optional) – ifTrue
, 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
andcore.Cell
do not need to be explicitly written to workbooks because they can be inferred byReader.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 <= 1Cell
and that each relationship toKnowledgeBase
andCell
is set. This is necessary to enable theKnowledgeBase
andCell
relationships to be implicit in the Excel output and added byReader.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 basesource_seq (
str
) – path to the genome sequence of the source knowledge basedest_core (
str
) – path to save the converted core of the knowledge basedest_seq (
str
) – path to save the converted genome sequence of the knowledge basetaxon (
str
) – taxonrewrite_seq_path (
bool
, optional) – ifTrue
, the path to genome sequence in the converted core of the knowledge base will be updated to the path of the converted genome sequenceprotected (
bool
, optional) – ifTrue
, 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 baseseq_path (
str
) – path to save genome sequencetaxon (
str
, optional) – taxonwrite_schema (
bool
, optional) – ifTrue
, include additional worksheet with schemawrite_toc (
bool
, optional) – ifTrue
, include additional worksheet with table of contentsextra_entries (
int
, optional) – additional entries to displaydata_repo_metadata (
bool
, optional) – ifTrue
, try to write metadata information about the file’s Git repoprotected (
bool
, optional) – ifTrue
, 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
- Related attributes:
proteins (
list
ofProteinSpeciesType
): 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]¶
-
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]¶
-
-
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
-
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]¶
-
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]¶
-
-
class
-
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
ofTranscriptionUnitLocus
- Related attributes:
proteins (
list
ofProteinSpeciesType
): 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]¶
-
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]¶
-
-
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
-
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
-
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]¶
-
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]¶
-
-
genes
= <obj_tables.core.OneToManyAttribute object>[source]
-
class
2.1.9. wc_kb.util module¶
Utilities
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2018-02-12
- Copyright
2018, Karr Lab
- License
MIT