4.1.1.2. datanator.core package

4.1.1.2.1. Submodules

4.1.1.2.2. datanator.core.data_model module

Author

Jonathan Karr <jonrkarr@gmail.com>

Author

Yosef Roth <yosefdroth@gmail.com>

Date

2017-04-10

Copyright

2017, Karr Lab

License

MIT

class datanator.core.data_model.Compartment(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.EntityInteractionOrProperty

Representes a compartment in a biological system

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Compartment'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Compartment'[source]
verbose_name_plural = 'Compartments'[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.ComputationalMethod(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.Method

Represents a computational method used to generate an observation

version[source]

version

Type

str

arguments[source]

string representation of the arguments to the method

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'arguments': <obj_tables.core.LongStringAttribute object>, 'description': <obj_tables.core.LongStringAttribute object>, 'hardware': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'performer': <obj_tables.core.StringAttribute object>, 'software': <obj_tables.core.StringAttribute object>, 'version': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ComputationalMethod'>, <class 'datanator.core.data_model.Method'>)[source]
local_attributes = {'arguments': <obj_tables.core.LocalAttribute object>, 'description': <obj_tables.core.LocalAttribute object>, 'hardware': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'performer': <obj_tables.core.LocalAttribute object>, 'software': <obj_tables.core.LocalAttribute object>, 'version': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Computational method'[source]
verbose_name_plural = 'Computational methods'[source]
arguments = <obj_tables.core.LongStringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
version = <obj_tables.core.StringAttribute object>[source]
class datanator.core.data_model.Consensus(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents a consensus of one or more observed values of an attribute of a component of a model

observable[source]

biological component that was estimated

Type

Observable

value[source]

consensus value of the attribute of the model component

Type

float

error[source]

uncertainty of the value of the attribute of the model component

Type

float

units[source]

units of the value of the attribute of the model component

Type

str

evidence[source]

list of evidence which the consensus value is based on

Type

list of Evidence

method[source]

method used to calculate the consensus value and error

Type

ConsensusMethod

user[source]

user who generated the consensus

Type

str

date[source]

date and time when the consensus was generated

Type

datetime.datetime

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'date': <obj_tables.core.DateTimeAttribute object>, 'error': <obj_tables.core.FloatAttribute object>, 'evidence': <obj_tables.core.ManyToManyAttribute object>, 'method': <obj_tables.core.EnumAttribute object>, 'observable': <obj_tables.core.ManyToOneAttribute object>, 'units': <obj_tables.core.StringAttribute object>, 'user': <obj_tables.core.StringAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Consensus'>,)[source]
local_attributes = {'date': <obj_tables.core.LocalAttribute object>, 'error': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'method': <obj_tables.core.LocalAttribute object>, 'observable': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'user': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Consensus'[source]
verbose_name_plural = 'Consensuses'[source]
date = <obj_tables.core.DateTimeAttribute object>[source]
error = <obj_tables.core.FloatAttribute object>[source]
evidence = <obj_tables.core.ManyToManyAttribute object>[source]
method = <obj_tables.core.EnumAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
observable = <obj_tables.core.ManyToOneAttribute object>[source]
units = <obj_tables.core.StringAttribute object>[source]
user = <obj_tables.core.StringAttribute object>[source]
value = <obj_tables.core.FloatAttribute object>[source]
class datanator.core.data_model.ConsensusMethod[source]

Bases: enum.Enum

Represents the method by which a consensus was chosen

manual = 0[source]
mean = 1[source]
median = 2[source]
mode = 3[source]
weighted_mean = 4[source]
weighted_median = 5[source]
weighted_mode = 6[source]
class datanator.core.data_model.DnaSpecie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.PolymerSpecie

Represents a DNA polymer

binding_matrix[source]

Binding motif

Type

Bio.motifs.matrix.FrequencyPositionMatrix

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'binding_matrix': <obj_tables.bio.seq.FreqPosMatrixAttribute object>, 'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'sequence': <obj_tables.core.LongStringAttribute object>, 'structure': <obj_tables.core.LongStringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.DnaSpecie'>, <class 'datanator.core.data_model.PolymerSpecie'>, <class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'binding_matrix': <obj_tables.core.LocalAttribute object>, 'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_specie': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>, 'sequence': <obj_tables.core.LocalAttribute object>, 'specie_interaction': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>, 'specie_interaction': <obj_tables.core.OneToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Dna specie'[source]
verbose_name_plural = 'Dna species'[source]
binding_matrix = <obj_tables.bio.seq.FreqPosMatrixAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.EntityInteractionOrProperty(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents an observable of a biological system

id[source]

identifier

Type

str

name[source]

name

Type

str

cross_references[source]

list of cross references to external resources

Type

list of Resource

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.EntityInteractionOrProperty'>,)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Entity interaction or property'[source]
verbose_name_plural = 'Entity interaction or propertys'[source]
cross_references = <obj_tables.core.ManyToManyAttribute object>[source]
id = <obj_tables.core.StringAttribute object>[source]
name = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.Environment(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents the environment (temperature, pH, media chemical composition) of an observation

temperature[source]

temperature in Celcius

Type

float

ph[source]

pH

Type

float

media[source]

the chemical composition of the environment

Type

str

observations[source]

list of observations

Type

list of Observation

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'growth_status': <obj_tables.core.LongStringAttribute object>, 'growth_system': <obj_tables.core.LongStringAttribute object>, 'media': <obj_tables.core.LongStringAttribute object>, 'ph': <obj_tables.core.FloatAttribute object>, 'temperature': <obj_tables.core.FloatAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Environment'>,)[source]
local_attributes = {'growth_status': <obj_tables.core.LocalAttribute object>, 'growth_system': <obj_tables.core.LocalAttribute object>, 'media': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'ph': <obj_tables.core.LocalAttribute object>, 'temperature': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Environment'[source]
verbose_name_plural = 'Environments'[source]
growth_status = <obj_tables.core.LongStringAttribute object>[source]
growth_system = <obj_tables.core.LongStringAttribute object>[source]
media = <obj_tables.core.LongStringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
ph = <obj_tables.core.FloatAttribute object>[source]
temperature = <obj_tables.core.FloatAttribute object>[source]
class datanator.core.data_model.Evidence(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents the observed values and their relevance which support a consensus

value[source]

observed value

Type

ObservedValue

relevance[source]

numeric score which indicates the relevance of the observed value to the consensus

Type

float

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'relevance': <obj_tables.core.FloatAttribute object>, 'value': <obj_tables.core.ManyToOneAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Evidence'>,)[source]
local_attributes = {'consensus': <obj_tables.core.LocalAttribute object>, 'relevance': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'consensus': <obj_tables.core.ManyToManyAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Evidence'[source]
verbose_name_plural = 'Evidences'[source]
objects = <obj_tables.core.Manager object>[source]
relevance = <obj_tables.core.FloatAttribute object>[source]
value = <obj_tables.core.ManyToOneAttribute object>[source]
class datanator.core.data_model.ExperimentalMethod(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.Method

Represents a experimental method used to generate an observation

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'description': <obj_tables.core.LongStringAttribute object>, 'hardware': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'performer': <obj_tables.core.StringAttribute object>, 'software': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ExperimentalMethod'>, <class 'datanator.core.data_model.Method'>)[source]
local_attributes = {'description': <obj_tables.core.LocalAttribute object>, 'hardware': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'performer': <obj_tables.core.LocalAttribute object>, 'software': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Experimental method'[source]
verbose_name_plural = 'Experimental methods'[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.Genetics(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents a taxon

taxon[source]

taxon name

Type

str

variation[source]

the genetic variation from the wildtype taxon

Type

str

observations[source]

list of observations

Type

list of Observation

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'taxon': <obj_tables.core.StringAttribute object>, 'variation': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Genetics'>,)[source]
local_attributes = {'observations': <obj_tables.core.LocalAttribute object>, 'taxon': <obj_tables.core.LocalAttribute object>, 'variation': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Genetics'[source]
verbose_name_plural = 'Geneticss'[source]
is_variant()[source]

Determine if the taxon is the wildtype stain

Returns

True if the taxon has at least one genetic perturbation

Return type

bool

is_wildtype()[source]

Determine if the taxon is the wildtype taxon

Returns

bool: True if the taxon doesn’t have any genetic perturbation(s)

Return type

obj

objects = <obj_tables.core.Manager object>[source]
taxon = <obj_tables.core.StringAttribute object>[source]
variation = <obj_tables.core.StringAttribute object>[source]
class datanator.core.data_model.Interaction(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.EntityInteractionOrProperty

Represents an interaction

position[source]

position at which interaction occurs

Type

int

score[source]

ranking of the response of the interaction

Type

float

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'confidence': <obj_tables.core.StringAttribute object>, 'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'position': <obj_tables.core.IntegerAttribute object>, 'score': <obj_tables.core.FloatAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Interaction'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'confidence': <obj_tables.core.LocalAttribute object>, 'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_interaction': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'position': <obj_tables.core.LocalAttribute object>, 'score': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_interaction': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Interaction'[source]
verbose_name_plural = 'Interactions'[source]
confidence = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
position = <obj_tables.core.IntegerAttribute object>[source]
score = <obj_tables.core.FloatAttribute object>[source]
class datanator.core.data_model.Method(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents a method used to generate an observation

name[source]

name

Type

str

description[source]

description

Type

str

observations[source]

list of observations

Type

list of Observation

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'description': <obj_tables.core.LongStringAttribute object>, 'hardware': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'performer': <obj_tables.core.StringAttribute object>, 'software': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Method'>,)[source]
local_attributes = {'description': <obj_tables.core.LocalAttribute object>, 'hardware': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'performer': <obj_tables.core.LocalAttribute object>, 'software': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Method'[source]
verbose_name_plural = 'Methods'[source]
description = <obj_tables.core.LongStringAttribute object>[source]
hardware = <obj_tables.core.StringAttribute object>[source]
name = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
performer = <obj_tables.core.StringAttribute object>[source]
software = <obj_tables.core.StringAttribute object>[source]
class datanator.core.data_model.Observable(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents an observable of a biological system

interaction[source]

observed interaction

Type

Interaction

specie[source]

observed species

Type

Specie

compartment[source]

compartment that the spcies/interaction was observed in

Type

Compartment

property[source]

property that was observed

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'compartment': <obj_tables.core.ManyToOneAttribute object>, 'interaction': <obj_tables.core.ManyToOneAttribute object>, 'property': <obj_tables.core.StringAttribute object>, 'specie': <obj_tables.core.ManyToOneAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Observable'>,)[source]
local_attributes = {'compartment': <obj_tables.core.LocalAttribute object>, 'consensus': <obj_tables.core.LocalAttribute object>, 'interaction': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'property': <obj_tables.core.LocalAttribute object>, 'specie': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'consensus': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Observable'[source]
verbose_name_plural = 'Observables'[source]
compartment = <obj_tables.core.ManyToOneAttribute object>[source]
interaction = <obj_tables.core.ManyToOneAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
property = <obj_tables.core.StringAttribute object>[source]
specie = <obj_tables.core.ManyToOneAttribute object>[source]
class datanator.core.data_model.ObservedInteraction(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.ObservedResult

Represents an observed interaction of a biological system

interaction[source]

observed interaction

Type

Interaction

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'interaction': <obj_tables.core.ManyToOneAttribute object>, 'metadata': <obj_tables.core.ManyToOneAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedInteraction'>, <class 'datanator.core.data_model.ObservedResult'>)[source]
local_attributes = {'interaction': <obj_tables.core.LocalAttribute object>, 'metadata': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Observed interaction'[source]
verbose_name_plural = 'Observed interactions'[source]
interaction = <obj_tables.core.ManyToOneAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.ObservedResult(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents a base dataset for a queried response

observation[source]

the collection of covariate observed values

Type

Observaton

method[source]

method that was used to make the observation

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'metadata': <obj_tables.core.ManyToOneAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedResult'>,)[source]
local_attributes = {'metadata': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Observed result'[source]
verbose_name_plural = 'Observed results'[source]
metadata = <obj_tables.core.ManyToOneAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.ObservedResultMetadata(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents an observation (one or more observed values) about a biological system

genetics[source]

the taxon, and any genetic variation from the wildtype taxon, that the component was observed in

Type

Genetics

environment[source]

environment that the component was observed in

Type

Environment

values[source]

observed values

Type

list of ObservedValue

reference[source]

reference to the reference

Type

Reference

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'environment': <obj_tables.core.ManyToOneAttribute object>, 'genetics': <obj_tables.core.ManyToOneAttribute object>, 'method': <obj_tables.core.ManyToOneAttribute object>, 'synonym': <obj_tables.core.ManyToManyAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedResultMetadata'>,)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'environment': <obj_tables.core.LocalAttribute object>, 'genetics': <obj_tables.core.LocalAttribute object>, 'method': <obj_tables.core.LocalAttribute object>, 'observed_result': <obj_tables.core.LocalAttribute object>, 'synonym': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_result': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Observed result metadata'[source]
verbose_name_plural = 'Observed result metadatas'[source]
cross_references = <obj_tables.core.ManyToManyAttribute object>[source]
environment = <obj_tables.core.ManyToOneAttribute object>[source]
genetics = <obj_tables.core.ManyToOneAttribute object>[source]
method = <obj_tables.core.ManyToOneAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
synonym = <obj_tables.core.ManyToManyAttribute object>[source]
class datanator.core.data_model.ObservedSpecie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.ObservedResult

Represents an observed interaction of a biological system

specie[source]

observed specie

Type

Specie

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'metadata': <obj_tables.core.ManyToOneAttribute object>, 'specie': <obj_tables.core.ManyToOneAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedSpecie'>, <class 'datanator.core.data_model.ObservedResult'>)[source]
local_attributes = {'metadata': <obj_tables.core.LocalAttribute object>, 'specie': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Observed specie'[source]
verbose_name_plural = 'Observed species'[source]
objects = <obj_tables.core.Manager object>[source]
specie = <obj_tables.core.ManyToOneAttribute object>[source]
class datanator.core.data_model.ObservedValue(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.ObservedResult

Represents an observed value of a biological system

observable[source]

the observed interaction or specie for which the value corresponds

Type

Observaton

value[source]

observed value

Type

float

error[source]

uncertainty of the observed value

Type

float

units[source]

SI units of the observed value

Type

units

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'error': <obj_tables.core.FloatAttribute object>, 'metadata': <obj_tables.core.ManyToOneAttribute object>, 'observable': <obj_tables.core.ManyToOneAttribute object>, 'units': <obj_tables.core.StringAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedValue'>, <class 'datanator.core.data_model.ObservedResult'>)[source]
local_attributes = {'error': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'metadata': <obj_tables.core.LocalAttribute object>, 'observable': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'evidence': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Observed value'[source]
verbose_name_plural = 'Observed values'[source]
error = <obj_tables.core.FloatAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
observable = <obj_tables.core.ManyToOneAttribute object>[source]
units = <obj_tables.core.StringAttribute object>[source]
value = <obj_tables.core.FloatAttribute object>[source]
class datanator.core.data_model.PolymerSpecie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.Specie

Represents a polymer

sequence[source]

sequence

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'sequence': <obj_tables.core.LongStringAttribute object>, 'structure': <obj_tables.core.LongStringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.PolymerSpecie'>, <class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_specie': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>, 'sequence': <obj_tables.core.LocalAttribute object>, 'specie_interaction': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>, 'specie_interaction': <obj_tables.core.OneToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Polymer specie'[source]
verbose_name_plural = 'Polymer species'[source]
objects = <obj_tables.core.Manager object>[source]
sequence = <obj_tables.core.LongStringAttribute object>[source]
class datanator.core.data_model.ProteinComplexSpecie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.ProteinSpecie

Represents a protein interaction

Attributes:

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'class_name': <obj_tables.core.StringAttribute object>, 'complex_cmt': <obj_tables.core.StringAttribute object>, 'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'disease_cmt': <obj_tables.core.StringAttribute object>, 'entrez_id': <obj_tables.core.IntegerAttribute object>, 'family_name': <obj_tables.core.StringAttribute object>, 'funcat_dsc': <obj_tables.core.StringAttribute object>, 'funcat_id': <obj_tables.core.StringAttribute object>, 'gene_name': <obj_tables.core.StringAttribute object>, 'go_dsc': <obj_tables.core.StringAttribute object>, 'go_id': <obj_tables.core.StringAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'length': <obj_tables.core.IntegerAttribute object>, 'mass': <obj_tables.core.IntegerAttribute object>, 'molecular_weight': <obj_tables.core.FloatAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'sequence': <obj_tables.core.LongStringAttribute object>, 'structure': <obj_tables.core.LongStringAttribute object>, 'su_cmt': <obj_tables.core.StringAttribute object>, 'uniprot_id': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ProteinComplexSpecie'>, <class 'datanator.core.data_model.ProteinSpecie'>, <class 'datanator.core.data_model.PolymerSpecie'>, <class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'class_name': <obj_tables.core.LocalAttribute object>, 'complex_cmt': <obj_tables.core.LocalAttribute object>, 'cross_references': <obj_tables.core.LocalAttribute object>, 'disease_cmt': <obj_tables.core.LocalAttribute object>, 'entrez_id': <obj_tables.core.LocalAttribute object>, 'family_name': <obj_tables.core.LocalAttribute object>, 'funcat_dsc': <obj_tables.core.LocalAttribute object>, 'funcat_id': <obj_tables.core.LocalAttribute object>, 'gene_name': <obj_tables.core.LocalAttribute object>, 'go_dsc': <obj_tables.core.LocalAttribute object>, 'go_id': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'length': <obj_tables.core.LocalAttribute object>, 'mass': <obj_tables.core.LocalAttribute object>, 'molecular_weight': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_specie': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>, 'sequence': <obj_tables.core.LocalAttribute object>, 'specie_interaction': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>, 'su_cmt': <obj_tables.core.LocalAttribute object>, 'uniprot_id': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>, 'specie_interaction': <obj_tables.core.OneToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Protein complex specie'[source]
verbose_name_plural = 'Protein complex species'[source]
class_name = <obj_tables.core.StringAttribute object>[source]
complex_cmt = <obj_tables.core.StringAttribute object>[source]
disease_cmt = <obj_tables.core.StringAttribute object>[source]
family_name = <obj_tables.core.StringAttribute object>[source]
funcat_dsc = <obj_tables.core.StringAttribute object>[source]
funcat_id = <obj_tables.core.StringAttribute object>[source]
go_dsc = <obj_tables.core.StringAttribute object>[source]
go_id = <obj_tables.core.StringAttribute object>[source]
molecular_weight = <obj_tables.core.FloatAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
su_cmt = <obj_tables.core.StringAttribute object>[source]
class datanator.core.data_model.ProteinSpecie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.PolymerSpecie

Represents a protein polymer

uniprot_id[source]

Uniprot Identifier

Type

str

entrez_id[source]

Entrez Identifier

Type

int

gene_name[source]

gene name from which protein stems

Type

str

length[source]

Length of the amino acid sequence

Type

int

mass[source]

Mass of the protein in KDa

Type

int

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'entrez_id': <obj_tables.core.IntegerAttribute object>, 'gene_name': <obj_tables.core.StringAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'length': <obj_tables.core.IntegerAttribute object>, 'mass': <obj_tables.core.IntegerAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'sequence': <obj_tables.core.LongStringAttribute object>, 'structure': <obj_tables.core.LongStringAttribute object>, 'uniprot_id': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ProteinSpecie'>, <class 'datanator.core.data_model.PolymerSpecie'>, <class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'entrez_id': <obj_tables.core.LocalAttribute object>, 'gene_name': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'length': <obj_tables.core.LocalAttribute object>, 'mass': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_specie': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>, 'sequence': <obj_tables.core.LocalAttribute object>, 'specie_interaction': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>, 'uniprot_id': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>, 'specie_interaction': <obj_tables.core.OneToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Protein specie'[source]
verbose_name_plural = 'Protein species'[source]
entrez_id = <obj_tables.core.IntegerAttribute object>[source]
gene_name = <obj_tables.core.StringAttribute object>[source]
length = <obj_tables.core.IntegerAttribute object>[source]
mass = <obj_tables.core.IntegerAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
uniprot_id = <obj_tables.core.StringAttribute object>[source]
class datanator.core.data_model.Reaction(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.Interaction

Represents a reaction

participants[source]

list of participants

Type

list of ReactionParticipant

reversible[source]

True if the reaction is reversible

Type

bool

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'confidence': <obj_tables.core.StringAttribute object>, 'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'kinetic_law_id': <obj_tables.core.IntegerAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'participants': <obj_tables.core.ManyToManyAttribute object>, 'position': <obj_tables.core.IntegerAttribute object>, 'reversible': <obj_tables.core.BooleanAttribute object>, 'score': <obj_tables.core.FloatAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Reaction'>, <class 'datanator.core.data_model.Interaction'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'confidence': <obj_tables.core.LocalAttribute object>, 'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'kinetic_law_id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_interaction': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'participants': <obj_tables.core.LocalAttribute object>, 'position': <obj_tables.core.LocalAttribute object>, 'reversible': <obj_tables.core.LocalAttribute object>, 'score': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_interaction': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Reaction'[source]
verbose_name_plural = 'Reactions'[source]
get_ec_number()[source]

Get the most relevant EC number from the list of cross references

  • If the reaction has a single manually-assigned EC number, return that

  • If the reaction has multiple manually-assigned EC numbers, return an error

  • Otherwise, return the most relevant predicted EC number

Returns

most relevant EC number

Return type

str

get_ec_numbers()[source]

Get the EC numbers from the list of cross references

Returns

list of EC numbers

Return type

list of str

get_manual_ec_numbers()[source]

Get the manually assigned EC numbers from the list of cross references

Returns

list of EC manually assigned numbers

Return type

list of str

get_modifiers()[source]

Get the modifiers

Returns

list of modifiers

Return type

list of ReactionParticipant

get_ordered_participants(collapse_repeated=True)[source]

Get an ordered list of the participants

Parameters

collapse_repeated (bool) – if True, collapse any repeated participants

Returns

ordered list of reaction participants

Return type

list of ReactionParticipant

get_predicted_ec_numbers()[source]

Get the predicted EC numbers from the list of cross references

Returns

list of predicted EC numbers

Return type

list of str

get_products()[source]

Get the products

Returns

list of products

Return type

list of ReactionParticipant

get_reactant_product_pairs()[source]

Get list of pairs of similar reactants and products

Note: This requires the modeler to have ordered the reactans and products by their similarity. The modeler is required to specify this pairing because it cannot easily be computed. In particular, we have tried to use Tanimoto similarity to predict reactant-product pairings, but this doesn’t adequately capture reaction centers.

Returns

ReactionParticipant, ReactionParticipant: list of pairs of similar reactants and products

Return type

list of tuple of obj

get_reactants()[source]

Get the reactants

Returns

list of reactants

Return type

list of ReactionParticipant

kinetic_law_id = <obj_tables.core.IntegerAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
participants = <obj_tables.core.ManyToManyAttribute object>[source]
reversible = <obj_tables.core.BooleanAttribute object>[source]
stringify()[source]
class datanator.core.data_model.ReactionParticipant(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents a participant in a reaction

specie[source]

molecular species

Type

Specie

compartment[source]

compartment

Type

Compartment

coefficient[source]

coefficient

Type

float

order[source]

order in the list of participants

Type

int

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'coefficient': <obj_tables.core.FloatAttribute object>, 'compartment': <obj_tables.core.ManyToOneAttribute object>, 'order': <obj_tables.core.IntegerAttribute object>, 'specie': <obj_tables.core.ManyToOneAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ReactionParticipant'>,)[source]
local_attributes = {'coefficient': <obj_tables.core.LocalAttribute object>, 'compartment': <obj_tables.core.LocalAttribute object>, 'order': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'specie': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'reactions': <obj_tables.core.ManyToManyAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Reaction participant'[source]
verbose_name_plural = 'Reaction participants'[source]
coefficient = <obj_tables.core.FloatAttribute object>[source]
compartment = <obj_tables.core.ManyToOneAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
order = <obj_tables.core.IntegerAttribute object>[source]
specie = <obj_tables.core.ManyToOneAttribute object>[source]
class datanator.core.data_model.Reference(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represent a reference for an observation

title[source]

title

Type

str

editor[source]

editor

Type

str

author[source]

author

Type

str

year[source]

year

Type

int

publication[source]

publication

Type

str

volume[source]

volume

Type

str

number[source]

number

Type

str

chapter[source]

chapter

Type

str

pages[source]

pages

Type

str

url[source]

url

Type

str

observations[source]

list of observations

Type

list of Observation

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'author': <obj_tables.core.StringAttribute object>, 'chapter': <obj_tables.core.StringAttribute object>, 'editor': <obj_tables.core.StringAttribute object>, 'number': <obj_tables.core.StringAttribute object>, 'pages': <obj_tables.core.StringAttribute object>, 'publication': <obj_tables.core.StringAttribute object>, 'title': <obj_tables.core.StringAttribute object>, 'url': <obj_tables.core.StringAttribute object>, 'volume': <obj_tables.core.StringAttribute object>, 'year': <obj_tables.core.IntegerAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Reference'>,)[source]
local_attributes = {'author': <obj_tables.core.LocalAttribute object>, 'chapter': <obj_tables.core.LocalAttribute object>, 'editor': <obj_tables.core.LocalAttribute object>, 'number': <obj_tables.core.LocalAttribute object>, 'pages': <obj_tables.core.LocalAttribute object>, 'publication': <obj_tables.core.LocalAttribute object>, 'title': <obj_tables.core.LocalAttribute object>, 'url': <obj_tables.core.LocalAttribute object>, 'volume': <obj_tables.core.LocalAttribute object>, 'year': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Reference'[source]
verbose_name_plural = 'References'[source]
author = <obj_tables.core.StringAttribute object>[source]
chapter = <obj_tables.core.StringAttribute object>[source]
editor = <obj_tables.core.StringAttribute object>[source]
number = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
pages = <obj_tables.core.StringAttribute object>[source]
publication = <obj_tables.core.StringAttribute object>[source]
title = <obj_tables.core.StringAttribute object>[source]
url = <obj_tables.core.StringAttribute object>[source]
volume = <obj_tables.core.StringAttribute object>[source]
year = <obj_tables.core.IntegerAttribute object>[source]
class datanator.core.data_model.Resource(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents an object in an external resource

namespace[source]

namespace of the identifier (e.g. pubmed)

Type

str

id[source]

identifier within namespace (e.g. PMID)

Type

str

relevance[source]

numerical indicator relevance of the external resource to the observable

Type

float

assignment_method[source]

method used to assign the cross reference to the observable

Type

ResourceAssignmentMethod

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'assignment_method': <obj_tables.core.EnumAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'namespace': <obj_tables.core.StringAttribute object>, 'relevance': <obj_tables.core.FloatAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Resource'>,)[source]
local_attributes = {'assignment_method': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'namespace': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'relevance': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observables': <obj_tables.core.ManyToManyAttribute object>, 'observations': <obj_tables.core.ManyToManyAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Resource'[source]
verbose_name_plural = 'Resources'[source]
assignment_method = <obj_tables.core.EnumAttribute object>[source]
id = <obj_tables.core.StringAttribute object>[source]
namespace = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
relevance = <obj_tables.core.FloatAttribute object>[source]
class datanator.core.data_model.ResourceAssignmentMethod[source]

Bases: enum.Enum

Represents the method used to assign a cross reference to an observable

manual = 0[source]
predicted = 1[source]
class datanator.core.data_model.RnaSpecie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.PolymerSpecie

Represents a RNA polymer

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'sequence': <obj_tables.core.LongStringAttribute object>, 'structure': <obj_tables.core.LongStringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.RnaSpecie'>, <class 'datanator.core.data_model.PolymerSpecie'>, <class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_specie': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>, 'sequence': <obj_tables.core.LocalAttribute object>, 'specie_interaction': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>, 'specie_interaction': <obj_tables.core.OneToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Rna specie'[source]
verbose_name_plural = 'Rna species'[source]
objects = <obj_tables.core.Manager object>[source]
class datanator.core.data_model.Specie(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.EntityInteractionOrProperty

Represents a molecular species in a biological system

structure[source]

structure

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'structure': <obj_tables.core.LongStringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_specie': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'reaction_participants': <obj_tables.core.LocalAttribute object>, 'specie_interaction': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>, 'reaction_participants': <obj_tables.core.ManyToOneAttribute object>, 'specie_interaction': <obj_tables.core.OneToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Specie'[source]
verbose_name_plural = 'Species'[source]
get_similarity(other, fingerprint_type='fp2')[source]

Calculate the similarity with another species

Parameters
  • other (Specie) – a second species

  • fingerprint_type (str, optional) – fingerprint type to use to calculate similarity

Returns

the similarity with the other molecule

Return type

float

objects = <obj_tables.core.Manager object>[source]
structure = <obj_tables.core.LongStringAttribute object>[source]
to_inchi(only_formula_and_connectivity=False)[source]

Get the structure in InChi format

Parameters

only_formula_and_connectivity (bool) – if True, return only the formula and connectivity layers

Returns

structure in InChi format or just the formula and connectivity layers

if only_formula_and_connectivity is True

Return type

str

to_mol()[source]

Get the structure in .mol format

Returns

structure in .mol format

Return type

str

to_openbabel()[source]

Get the structure as a Open Babel molecule

Returns

structure as a Open Babel molecule

Return type

openbabel.OBMol

to_pybel()[source]

Get the structure as a Pybel molecule

Returns

structure as a Pybel molecule

Return type

pybel.Molecule

to_smiles()[source]

Get the structure in canonical SMILES format

Returns

structure in canonical SMILES format

Return type

str

class datanator.core.data_model.SpecieInteraction(_comments=None, **kwargs)[source]

Bases: datanator.core.data_model.Interaction

Represents a protein interaction

specie_a[source]
Type

str

specie_b[source]
Type

str

stoichiometry_a[source]
Type

int

stoichiometry_b[source]
Type

int

loc_a[source]
Type

str

loc_b[source]
Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'confidence': <obj_tables.core.StringAttribute object>, 'cross_references': <obj_tables.core.ManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'interaction_type': <obj_tables.core.StringAttribute object>, 'loc_a': <obj_tables.core.StringAttribute object>, 'loc_b': <obj_tables.core.StringAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'position': <obj_tables.core.IntegerAttribute object>, 'score': <obj_tables.core.FloatAttribute object>, 'specie_a': <obj_tables.core.OneToOneAttribute object>, 'specie_b': <obj_tables.core.OneToOneAttribute object>, 'stoichiometry_a': <obj_tables.core.IntegerAttribute object>, 'stoichiometry_b': <obj_tables.core.IntegerAttribute object>, 'type_a': <obj_tables.core.StringAttribute object>, 'type_b': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.SpecieInteraction'>, <class 'datanator.core.data_model.Interaction'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'confidence': <obj_tables.core.LocalAttribute object>, 'cross_references': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'interaction_type': <obj_tables.core.LocalAttribute object>, 'loc_a': <obj_tables.core.LocalAttribute object>, 'loc_b': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observed_interaction': <obj_tables.core.LocalAttribute object>, 'observed_values': <obj_tables.core.LocalAttribute object>, 'position': <obj_tables.core.LocalAttribute object>, 'score': <obj_tables.core.LocalAttribute object>, 'specie_a': <obj_tables.core.LocalAttribute object>, 'specie_b': <obj_tables.core.LocalAttribute object>, 'stoichiometry_a': <obj_tables.core.LocalAttribute object>, 'stoichiometry_b': <obj_tables.core.LocalAttribute object>, 'type_a': <obj_tables.core.LocalAttribute object>, 'type_b': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_interaction': <obj_tables.core.ManyToOneAttribute object>, 'observed_values': <obj_tables.core.ManyToOneAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Specie interaction'[source]
verbose_name_plural = 'Specie interactions'[source]
interaction_type = <obj_tables.core.StringAttribute object>[source]
loc_a = <obj_tables.core.StringAttribute object>[source]
loc_b = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]
specie_a = <obj_tables.core.OneToOneAttribute object>[source]
specie_b = <obj_tables.core.OneToOneAttribute object>[source]
stoichiometry_a = <obj_tables.core.IntegerAttribute object>[source]
stoichiometry_b = <obj_tables.core.IntegerAttribute object>[source]
type_a = <obj_tables.core.StringAttribute object>[source]
type_b = <obj_tables.core.StringAttribute object>[source]
class datanator.core.data_model.Synonym(_comments=None, **kwargs)[source]

Bases: obj_tables.core.Model

Represents a synonym of a given physical entity or property

name[source]

Name of the Synonym

Type

str

class Meta[source]

Bases: obj_tables.core.Meta

attribute_order = ()[source]
attributes = {'name': <obj_tables.core.StringAttribute object>}[source]
children = {}[source]
description = ''[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Synonym'>,)[source]
local_attributes = {'name': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_tables.core.ManyToManyAttribute object>}[source]
table_format = 1[source]
unique_together = ()[source]
verbose_name = 'Synonym'[source]
verbose_name_plural = 'Synonyms'[source]
name = <obj_tables.core.StringAttribute object>[source]
objects = <obj_tables.core.Manager object>[source]

4.1.1.2.3. datanator.core.data_source module

Author

Jonathan Karr <jonrkarr@gmail.com>

Date

2017-05-08

Copyright

2017, Karr Lab

License

MIT

class datanator.core.data_source.CachedDataSource(name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=inf, commit_intermediate_results=False, download_backups=True, verbose=False, quilt_owner=None, quilt_package=None)[source]

Bases: datanator.core.data_source.DataSource

Represents an external data source that is cached locally in a sqlite database

filename[source]

path to sqlite copy of the data source

Type

str

cache_dirname[source]

directory to store the local copy of the data source

Type

str

engine[source]

SQLAlchemy engine

Type

sqlalchemy.engine.Engine

session[source]

SQLAlchemy session

Type

sqlalchemy.orm.session.Session

max_entries[source]

maximum number of entries to save locally

Type

float

commit_intermediate_results[source]

if True, commit the changes throughout the loading process. This is particularly helpful for restarting this method when webservices go offline.

Type

bool

verbose[source]

if True, print status information to the standard output

Type

bool

quilt_owner[source]

owner of Quilt package to save data

Type

str

quilt_package[source]

identifier of Quilt package to save data

Type

str

base_model[source]

base ORM model for the sqlite databse

Type

Base

clear_content()[source]

Clear the content of the sqlite database (i.e. drop and recreate all tables).

download_backups()[source]

Download the local sqlite database from Quilt

get_engine()[source]

Get an engine for the sqlite database. If the database doesn’t exist, initialize its structure.

Returns

database engine

Return type

sqlalchemy.engine.Engine

get_or_create_object(cls, **kwargs)[source]

Get the SQLAlchemy object of type cls with attribute/value pairs specified by **kwargs. If an object with these attribute/value pairs does not exist, create an object with these attribute/value pairs and add it to the SQLAlchemy session.

Parameters
  • cls (class) – child class of base_model

  • **kwargs (dict, optional) – attribute-value pairs of desired SQLAlchemy object of type cls

Returns

SQLAlchemy object of type cls

Return type

base_model

get_paths_to_backup(download=False)[source]

Get a list of the files to backup/unpack

Parameters

download (bool, optional) – if True, prepare the files for uploading

Returns

list of paths to backup

Return type

list of str

get_session()[source]

Get a session for the sqlite database

Returns

database session

Return type

sqlalchemy.orm.session.Session

abstract load_content()[source]

Load the content of the local copy of the data source

quilt_package = None[source]

Create SQLAlchemy session and load content if necessary

upload_backups()[source]

Backup the local sqlite database to Quilt

class datanator.core.data_source.DataSource(name=None, verbose=False)[source]

Bases: object

Represents an external data source

name[source]

name

Type

str

vprint(str)[source]
exception datanator.core.data_source.DataSourceWarning[source]

Bases: UserWarning

Data source warning

class datanator.core.data_source.FtpDataSource(name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=inf, commit_intermediate_results=False, download_backups=True, verbose=False, quilt_owner=None, quilt_package=None)[source]

Bases: datanator.core.data_source.CachedDataSource

An external data source which can be obtained via a FTP interface

ENDPOINT_DOMAINS[source]

dictionary of domains to retry

Type

dict of str, str

ENDPOINT_DOMAINS = {}[source]
class datanator.core.data_source.HttpDataSource(name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=inf, commit_intermediate_results=False, download_backups=True, verbose=False, clear_requests_cache=False, download_request_backup=False, quilt_owner=None, quilt_package=None)[source]

Bases: datanator.core.data_source.CachedDataSource

An external data source which can be obtained via a HTTP interface

requests_cache_filename[source]

path to cache HTTP requests

Type

str

requests_session[source]

cache-enabled HTTP request session

Type

requests_cache.core.CachedSession

ENDPOINT_DOMAINS[source]

dictionary of domains to retry

Type

dict of str, str

MAX_HTTP_RETRIES[source]

maximum number of times to retry each HTTP request

Type

int

ENDPOINT_DOMAINS = {}[source]
MAX_HTTP_RETRIES = 5[source]
clear_requests_cache()[source]

Clear the cache-enabled HTTP request session

download_request_backup = None[source]

Call superclass constructor which will optionally load content

get_paths_to_backup(download=False)[source]

Get a list of the files to backup/unpack

Parameters

download (bool, optional) – if True, prepare the files for uploading

Returns

paths to backup

Return type

list of str

get_requests_session()[source]

Setup an cache-enabled HTTP request session

Returns

cached-enable session

Return type

requests_cache.core.CachedSession

class datanator.core.data_source.PostgresDataSource(name=None, clear_content=False, load_content=False, max_entries=inf, restore_backup_data=False, restore_backup_schema=False, restore_backup_exit_on_error=True, quilt_owner=None, quilt_package=None, cache_dirname=None, verbose=False)[source]

Bases: datanator.core.data_source.DataSource

Represents a Postgres database

name[source]

name

Type

str

max_entries[source]

maximum number of entries to save locally

Type

float

quilt_owner[source]

owner of Quilt package to save data

Type

str

quilt_package[source]

identifier of Quilt package to save data

Type

str

cache_dirname[source]

directory to store the local copy of the data source

Type

str

verbose[source]

if True, print status information to the standard output

Type

bool

engine[source]

SQLAlchemy engine

Type

sqlalchemy.engine.Engine

session[source]

SQLAlchemy session

Type

sqlalchemy.orm.session.Session

base_model[source]

base ORM model for the databse

Type

Base

clear_content()[source]

Clear the content of the database (i.e. drop and recreate all tables).

dump_database()[source]

Create a dump file of the Postgres database

get_engine()[source]

Get an engine for the Postgres database. If the database doesn’t exist, initialize its structure.

Returns

database engine

Return type

sqlalchemy.engine.Engine

get_or_create_object(cls, **kwargs)[source]

Get the SQLAlchemy object of type cls with attribute/value pairs specified by **kwargs. If an object with these attribute/value pairs does not exist, create an object with these attribute/value pairs and add it to the SQLAlchemy session.

Parameters
  • cls (class) – child class of base_model

  • **kwargs (dict, optional) – attribute-value pairs of desired SQLAlchemy object of type cls

Returns

SQLAlchemy object of type cls

Return type

base_model

get_session()[source]

Get a session for the database

Returns

database session

Return type

sqlalchemy.orm.session.Session

abstract load_content()[source]

Load the content of the local copy of the data source

restore_backup(restore_data=True, restore_schema=False, exit_on_error=True)[source]

Download and restore the database from Quilt

Parameters
  • restore_data (bool, optional) – If True, restore data

  • restore_schema (bool, optional) – If True, clear and restore schema

  • exit_on_error (bool, optional) – If True, exit on errors

restore_database(restore_data=True, restore_schema=False, exit_on_error=True)[source]

Restore a dump file of the Postgres database

Parameters
  • restore_data (bool, optional) – If True, restore data

  • restore_schema (bool, optional) – If True, clear and restore schema

  • exit_on_error (bool, optional) – If True, exit on errors

upload_backup()[source]

Dump and backup the database to Quilt

class datanator.core.data_source.WebserviceDataSource[source]

Bases: datanator.core.data_source.DataSource

A data source that is a webservice

requests_session[source]

cache-enabled HTTP request session

Type

requests.Session

ENDPOINT_DOMAINS[source]

dictionary of domains to retry

Type

dict of str, str

MAX_HTTP_RETRIES[source]

maximum number of times to retry each HTTP request

Type

int

ENDPOINT_DOMAINS = {}[source]
MAX_HTTP_RETRIES = 5[source]

4.1.1.2.4. Module contents