4.1.1.4. datanator.core package

4.1.1.4.2. Submodules

4.1.1.4.3. datanator.core.common_schema module

This code is a common schema for all the datanator modules

Author:Saahith Pochiraju <saahith116@gmail.com>
Date:2017-07-31
Copyright:2017, Karr Lab
License:MIT
class datanator.core.common_schema.CommonSchema(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, load_entire_small_dbs=False, test=False)[source]

Bases: datanator.core.data_source.PostgresDataSource

A Local Postgres copy of the aggregation of data_source modules

load_entire_small_dbs[source]

Loads all entire databases that fall under 50 MB

Type:bool
load_small_db_switch[source]
Type:bool
test[source]

Designates whether tests are being completed for brevity of tests

Type:bool
base_model = <SQLAlchemy engine=postgresql://postgres@postgres_service/CommonSchema>[source]
build_array_express(**kw)[source]
build_corum(**kw)[source]
build_ecmdb(**kw)[source]
build_intact_complexes(**kw)[source]
build_intact_interactions(**kw)[source]
build_jaspar(**kw)[source]
build_ncbi(**kw)[source]
build_pax(**kw)[source]
build_sabio(**kw)[source]
build_uniprot(**kw)[source]
load_content(**kw)[source]

4.1.1.4.4. 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(**kwargs)[source]

Bases: datanator.core.data_model.EntityInteractionOrProperty

Representes a compartment in a biological system

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Compartment'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Compartment'[source]
verbose_name_plural = 'Compartments'[source]
objects = <obj_model.core.Manager object>[source]
class datanator.core.data_model.ComputationalMethod(**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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

attribute_order = ()[source]
attributes = {'date': <obj_model.core.DateTimeAttribute object>, 'error': <obj_model.core.FloatAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'method': <obj_model.core.EnumAttribute object>, 'observable': <obj_model.core.ManyToOneAttribute object>, 'units': <obj_model.core.StringAttribute object>, 'user': <obj_model.core.StringAttribute object>, 'value': <obj_model.core.FloatAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Consensus'>,)[source]
local_attributes = {'date': <obj_model.core.LocalAttribute object>, 'error': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'method': <obj_model.core.LocalAttribute object>, 'observable': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'user': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Consensus'[source]
verbose_name_plural = 'Consensuses'[source]
date = <obj_model.core.DateTimeAttribute object>[source]
error = <obj_model.core.FloatAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
method = <obj_model.core.EnumAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
observable = <obj_model.core.ManyToOneAttribute object>[source]
units = <obj_model.core.StringAttribute object>[source]
user = <obj_model.core.StringAttribute object>[source]
value = <obj_model.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(**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_model.core.Meta

attribute_order = ()[source]
attributes = {'binding_matrix': <obj_model.bio.FrequencyPositionMatrixAttribute object>, 'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'sequence': <obj_model.core.LongStringAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'cross_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_specie': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>, 'sequence': <obj_model.core.LocalAttribute object>, 'specie_interaction': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>, 'specie_interaction': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Dna specie'[source]
verbose_name_plural = 'Dna species'[source]
binding_matrix = <obj_model.bio.FrequencyPositionMatrixAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
class datanator.core.data_model.EntityInteractionOrProperty(**kwargs)[source]

Bases: obj_model.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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

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

Bases: datanator.core.data_model.Method

Represents a experimental method used to generate an observation

class Meta[source]

Bases: obj_model.core.Meta

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

Bases: obj_model.core.Model

Represents a taxon

taxon (obj

str): taxon name

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

attribute_order = ()[source]
attributes = {'taxon': <obj_model.core.StringAttribute object>, 'variation': <obj_model.core.StringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Genetics'>,)[source]
local_attributes = {'observations': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>, 'variation': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observations': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 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_model.core.Manager object>[source]
taxon = <obj_model.core.StringAttribute object>[source]
variation = <obj_model.core.StringAttribute object>[source]
class datanator.core.data_model.Interaction(**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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

attribute_order = ()[source]
attributes = {'compartment': <obj_model.core.ManyToOneAttribute object>, 'interaction': <obj_model.core.ManyToOneAttribute object>, 'property': <obj_model.core.StringAttribute object>, 'specie': <obj_model.core.ManyToOneAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Observable'>,)[source]
local_attributes = {'compartment': <obj_model.core.LocalAttribute object>, 'consensus': <obj_model.core.LocalAttribute object>, 'interaction': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'property': <obj_model.core.LocalAttribute object>, 'specie': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'consensus': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Observable'[source]
verbose_name_plural = 'Observables'[source]
compartment = <obj_model.core.ManyToOneAttribute object>[source]
interaction = <obj_model.core.ManyToOneAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
property = <obj_model.core.StringAttribute object>[source]
specie = <obj_model.core.ManyToOneAttribute object>[source]
class datanator.core.data_model.ObservedInteraction(**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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'environment': <obj_model.core.ManyToOneAttribute object>, 'genetics': <obj_model.core.ManyToOneAttribute object>, 'method': <obj_model.core.ManyToOneAttribute object>, 'synonym': <obj_model.core.ManyToManyAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedResultMetadata'>,)[source]
local_attributes = {'cross_references': <obj_model.core.LocalAttribute object>, 'environment': <obj_model.core.LocalAttribute object>, 'genetics': <obj_model.core.LocalAttribute object>, 'method': <obj_model.core.LocalAttribute object>, 'observed_result': <obj_model.core.LocalAttribute object>, 'synonym': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_result': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Observed result metadata'[source]
verbose_name_plural = 'Observed result metadatas'[source]
cross_references = <obj_model.core.ManyToManyAttribute object>[source]
environment = <obj_model.core.ManyToOneAttribute object>[source]
genetics = <obj_model.core.ManyToOneAttribute object>[source]
method = <obj_model.core.ManyToOneAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
synonym = <obj_model.core.ManyToManyAttribute object>[source]
class datanator.core.data_model.ObservedSpecie(**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_model.core.Meta

attribute_order = ()[source]
attributes = {'metadata': <obj_model.core.ManyToOneAttribute object>, 'specie': <obj_model.core.ManyToOneAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.ObservedSpecie'>, <class 'datanator.core.data_model.ObservedResult'>)[source]
local_attributes = {'metadata': <obj_model.core.LocalAttribute object>, 'specie': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Observed specie'[source]
verbose_name_plural = 'Observed species'[source]
objects = <obj_model.core.Manager object>[source]
specie = <obj_model.core.ManyToOneAttribute object>[source]
class datanator.core.data_model.ObservedValue(**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_model.core.Meta

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

Bases: datanator.core.data_model.Specie

Represents a polymer

sequence[source]

sequence

Type:str
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'sequence': <obj_model.core.LongStringAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_specie': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>, 'sequence': <obj_model.core.LocalAttribute object>, 'specie_interaction': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>, 'specie_interaction': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Polymer specie'[source]
verbose_name_plural = 'Polymer species'[source]
objects = <obj_model.core.Manager object>[source]
sequence = <obj_model.core.LongStringAttribute object>[source]
class datanator.core.data_model.ProteinComplexSpecie(**kwargs)[source]

Bases: datanator.core.data_model.ProteinSpecie

Represents a protein interaction

Attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ()[source]
attributes = {'class_name': <obj_model.core.StringAttribute object>, 'complex_cmt': <obj_model.core.StringAttribute object>, 'cross_references': <obj_model.core.ManyToManyAttribute object>, 'disease_cmt': <obj_model.core.StringAttribute object>, 'entrez_id': <obj_model.core.IntegerAttribute object>, 'family_name': <obj_model.core.StringAttribute object>, 'funcat_dsc': <obj_model.core.StringAttribute object>, 'funcat_id': <obj_model.core.StringAttribute object>, 'gene_name': <obj_model.core.StringAttribute object>, 'go_dsc': <obj_model.core.StringAttribute object>, 'go_id': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'length': <obj_model.core.IntegerAttribute object>, 'mass': <obj_model.core.IntegerAttribute object>, 'molecular_weight': <obj_model.core.FloatAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'sequence': <obj_model.core.LongStringAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>, 'su_cmt': <obj_model.core.StringAttribute object>, 'uniprot_id': <obj_model.core.StringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'complex_cmt': <obj_model.core.LocalAttribute object>, 'cross_references': <obj_model.core.LocalAttribute object>, 'disease_cmt': <obj_model.core.LocalAttribute object>, 'entrez_id': <obj_model.core.LocalAttribute object>, 'family_name': <obj_model.core.LocalAttribute object>, 'funcat_dsc': <obj_model.core.LocalAttribute object>, 'funcat_id': <obj_model.core.LocalAttribute object>, 'gene_name': <obj_model.core.LocalAttribute object>, 'go_dsc': <obj_model.core.LocalAttribute object>, 'go_id': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'length': <obj_model.core.LocalAttribute object>, 'mass': <obj_model.core.LocalAttribute object>, 'molecular_weight': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_specie': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>, 'sequence': <obj_model.core.LocalAttribute object>, 'specie_interaction': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>, 'su_cmt': <obj_model.core.LocalAttribute object>, 'uniprot_id': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>, 'specie_interaction': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Protein complex specie'[source]
verbose_name_plural = 'Protein complex species'[source]
class_name = <obj_model.core.StringAttribute object>[source]
complex_cmt = <obj_model.core.StringAttribute object>[source]
disease_cmt = <obj_model.core.StringAttribute object>[source]
family_name = <obj_model.core.StringAttribute object>[source]
funcat_dsc = <obj_model.core.StringAttribute object>[source]
funcat_id = <obj_model.core.StringAttribute object>[source]
go_dsc = <obj_model.core.StringAttribute object>[source]
go_id = <obj_model.core.StringAttribute object>[source]
molecular_weight = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
su_cmt = <obj_model.core.StringAttribute object>[source]
class datanator.core.data_model.ProteinSpecie(**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_model.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'entrez_id': <obj_model.core.IntegerAttribute object>, 'gene_name': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'length': <obj_model.core.IntegerAttribute object>, 'mass': <obj_model.core.IntegerAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'sequence': <obj_model.core.LongStringAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>, 'uniprot_id': <obj_model.core.StringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'entrez_id': <obj_model.core.LocalAttribute object>, 'gene_name': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'length': <obj_model.core.LocalAttribute object>, 'mass': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_specie': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>, 'sequence': <obj_model.core.LocalAttribute object>, 'specie_interaction': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>, 'uniprot_id': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>, 'specie_interaction': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Protein specie'[source]
verbose_name_plural = 'Protein species'[source]
entrez_id = <obj_model.core.IntegerAttribute object>[source]
gene_name = <obj_model.core.StringAttribute object>[source]
length = <obj_model.core.IntegerAttribute object>[source]
mass = <obj_model.core.IntegerAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
uniprot_id = <obj_model.core.StringAttribute object>[source]
class datanator.core.data_model.Reaction(**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_model.core.Meta

attribute_order = ()[source]
attributes = {'confidence': <obj_model.core.StringAttribute object>, 'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'kinetic_law_id': <obj_model.core.IntegerAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'participants': <obj_model.core.ManyToManyAttribute object>, 'position': <obj_model.core.IntegerAttribute object>, 'reversible': <obj_model.core.BooleanAttribute object>, 'score': <obj_model.core.FloatAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'cross_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'kinetic_law_id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_interaction': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'participants': <obj_model.core.LocalAttribute object>, 'position': <obj_model.core.LocalAttribute object>, 'reversible': <obj_model.core.LocalAttribute object>, 'score': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_interaction': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 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 Tanitomo 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_model.core.IntegerAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
participants = <obj_model.core.ManyToManyAttribute object>[source]
reversible = <obj_model.core.BooleanAttribute object>[source]
stringify()[source]
class datanator.core.data_model.ReactionParticipant(**kwargs)[source]

Bases: obj_model.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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

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

Bases: obj_model.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_model.core.Meta

attribute_order = ()[source]
attributes = {'assignment_method': <obj_model.core.EnumAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'namespace': <obj_model.core.StringAttribute object>, 'relevance': <obj_model.core.FloatAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Resource'>,)[source]
local_attributes = {'assignment_method': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'namespace': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'observations': <obj_model.core.LocalAttribute object>, 'relevance': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observables': <obj_model.core.ManyToManyAttribute object>, 'observations': <obj_model.core.ManyToManyAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Resource'[source]
verbose_name_plural = 'Resources'[source]
assignment_method = <obj_model.core.EnumAttribute object>[source]
id = <obj_model.core.StringAttribute object>[source]
namespace = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
relevance = <obj_model.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(**kwargs)[source]

Bases: datanator.core.data_model.PolymerSpecie

Represents a RNA polymer

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'sequence': <obj_model.core.LongStringAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_specie': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>, 'sequence': <obj_model.core.LocalAttribute object>, 'specie_interaction': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>, 'specie_interaction': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Rna specie'[source]
verbose_name_plural = 'Rna species'[source]
objects = <obj_model.core.Manager object>[source]
class datanator.core.data_model.Specie(**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_model.core.Meta

attribute_order = ()[source]
attributes = {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'datanator.core.data_model.Specie'>, <class 'datanator.core.data_model.EntityInteractionOrProperty'>)[source]
local_attributes = {'cross_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_specie': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'reaction_participants': <obj_model.core.LocalAttribute object>, 'specie_interaction': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_specie': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>, 'reaction_participants': <obj_model.core.ManyToOneAttribute object>, 'specie_interaction': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 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_model.core.Manager object>[source]
structure = <obj_model.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(**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_model.core.Meta

attribute_order = ()[source]
attributes = {'confidence': <obj_model.core.StringAttribute object>, 'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'interaction_type': <obj_model.core.StringAttribute object>, 'loc_a': <obj_model.core.StringAttribute object>, 'loc_b': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'position': <obj_model.core.IntegerAttribute object>, 'score': <obj_model.core.FloatAttribute object>, 'specie_a': <obj_model.core.OneToOneAttribute object>, 'specie_b': <obj_model.core.OneToOneAttribute object>, 'stoichiometry_a': <obj_model.core.IntegerAttribute object>, 'stoichiometry_b': <obj_model.core.IntegerAttribute object>, 'type_a': <obj_model.core.StringAttribute object>, 'type_b': <obj_model.core.StringAttribute object>}[source]
children = {}[source]
frozen_columns = 1[source]
help = ''[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_model.core.LocalAttribute object>, 'cross_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interaction_type': <obj_model.core.LocalAttribute object>, 'loc_a': <obj_model.core.LocalAttribute object>, 'loc_b': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observed_interaction': <obj_model.core.LocalAttribute object>, 'observed_values': <obj_model.core.LocalAttribute object>, 'position': <obj_model.core.LocalAttribute object>, 'score': <obj_model.core.LocalAttribute object>, 'specie_a': <obj_model.core.LocalAttribute object>, 'specie_b': <obj_model.core.LocalAttribute object>, 'stoichiometry_a': <obj_model.core.LocalAttribute object>, 'stoichiometry_b': <obj_model.core.LocalAttribute object>, 'type_a': <obj_model.core.LocalAttribute object>, 'type_b': <obj_model.core.LocalAttribute object>}[source]
merge = 1[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'observed_interaction': <obj_model.core.ManyToOneAttribute object>, 'observed_values': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 1[source]
unique_together = ()[source]
verbose_name = 'Specie interaction'[source]
verbose_name_plural = 'Specie interactions'[source]
interaction_type = <obj_model.core.StringAttribute object>[source]
loc_a = <obj_model.core.StringAttribute object>[source]
loc_b = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
specie_a = <obj_model.core.OneToOneAttribute object>[source]
specie_b = <obj_model.core.OneToOneAttribute object>[source]
stoichiometry_a = <obj_model.core.IntegerAttribute object>[source]
stoichiometry_b = <obj_model.core.IntegerAttribute object>[source]
type_a = <obj_model.core.StringAttribute object>[source]
type_b = <obj_model.core.StringAttribute object>[source]
class datanator.core.data_model.Synonym(**kwargs)[source]

Bases: obj_model.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_model.core.Meta

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

4.1.1.4.5. datanator.core.data_query module

Author:Jonathan Karr <jonrkarr@gmail.com>
Author:Yosef Roth <yosefdroth@gmail.com>
Date:2017-05-16
Copyright:2017, Karr Lab
License:MIT
class datanator.core.data_query.CachedDataSourceQueryGenerator(taxon=None, max_taxon_dist=None, taxon_dist_scale=None, include_variants=False, temperature=37.0, temperature_std=1.0, ph=7.5, ph_std=0.3, data_source=None)[source]

Bases: datanator.core.data_query.DataQueryGenerator

Represents a query of a cached data source

data_source[source]

cached data source

Type:datanator.core.data_source.CachedDataSource
class datanator.core.data_query.ConsensusGenerator[source]

Bases: object

calc_average(values, weights=None, method='mean')[source]

Calculate the weighted or unweighted average of one of more values

Parameters:
  • values (list of float) – list of normalized values
  • weights (list of float, optional) – weights of values
  • method (str, optional) – mean, median, or mode; the desired average of values
Returns:

tuple of the average value, its uncertainty, and the method used to calculate the average value

Return type:

tuple of float, float, data_model.ConsensusMethod

group_observed_results_by_properties(observed_results)[source]

Group observed values by their observed properties

Parameters:observed_results (list of data_model.ObservedValue) – list of observed values
Returns:list of observed values, grouped by the observed property
Return type:list of tuple of (str, list of data_model.ObservedValue)
normalize_observed_results(observed_results)[source]

Normalize one or more observed values to SI units

Parameters:observed_results (list of data_model.ObservedValue) – list of observed values
Returns:
  • list of float: normalized observed values
  • list of float: normalized errors of the observed values
  • list of float: weights of the observed values
  • str: units of the normalized observed values
Return type:tuple
run(observed_results, method, weighted=True)[source]
Parameters:
  • observed_results (list of data_model.ObservedValue) – list of observed values
  • method (str) – mean, median, or mode; desired average statistic
  • weighted (bool, optional) – if True, calculate the weighted average value
Returns:

list of consensus values of

the observed properties

Return type:

list of data_model.Consensus

Raises:

ValueError – if method is not one of mean, median, or mode

class datanator.core.data_query.DataQueryGenerator(taxon=None, max_taxon_dist=None, taxon_dist_scale=None, include_variants=False, temperature=37.0, temperature_std=1.0, ph=7.5, ph_std=0.3)[source]

Bases: object

Represents a query of a data source

  1. Find observed values for the exact or similar model components

  2. Filter out observed values from disimilar genetic and environmental conditions and rank the remaing observed values by their similarity to the desired genetic and environmental conditions

    • Taxonomy
    • Genetic variation (wildtype/mutant)
    • Temperature
    • pH
  3. Calculate a statistical representation of the relevant observed values

filters[source]

list of filters

Type:list of Filter
filter_observed_results(component, observed_results)[source]

Filter out observed values from dissimilar genetic and environmental conditions and order the remaining observed values by their similarity to specified genetic and environmental conditions.

Parameters:
  • component (data_model.EntityInteractionOrProperty) – model component to find data for
  • observed_results (list of data_model.ObservedValue) – list of observed values
Returns:

filter result

Return type:

FilterResult

get_consensus(component, filter_result)[source]

Calculate a consensus statistical representation of the one or more observed values

Parameters:
  • component (data_model.EntityInteractionOrProperty) – model component to find data for
  • filter_result (FilterResult) – filter result
Returns:

statistical consensus of the relevant observed values of

component and the observed values it was based on

Return type:

list of data_model.Consensus

get_observed_result(component)[source]

Find the observed result relevant to component

Parameters:component (model.PhysicalEntity) or (model.PhysicalProperty) – model component to find data for
Returns:list of relevant observed values list of data_model.ObservedValue: list of relevant observed values
Return type:list of data_model.ObservedValue
metadata_dump(component)[source]

Calculate a consensus statistical representation of the one or more observed values

Parameters:component (models.Observation) – model component dump data for
Returns:data model metadata object
Return type:list of data_model.ObservedResultMetadata
run(component)[source]
  1. Find observed values for the exact or similar model components and genetic and environmental conditions
  2. Rank the results by their similarity to the model component and the genetic and environmental conditions
  3. Calculate a consensus statistical representation of the relevant observed values
Parameters:component (data_model.EntityInteractionOrProperty) – model component to find data for
Returns:
statistical consensus of the relevant observed values of
component and the observed values it was based on
Return type:list of data_model.Consensus
class datanator.core.data_query.ExponentialFilter(attribute, center=0.0, scale=1.0)[source]

Bases: datanator.core.data_query.Filter

Prioritizes observed values based on an exponential scale

attribute[source]

Name of an attribute to score

Type:str
center[source]

The center of the distribution. This indicates the value at which the score will be 1.

Type:float
scale[source]

The scale of the distribution. This determines how quickly the score falls to zero away from the center.

Type:float
score(target_component, observed_value)[source]

Calculate a numeric score which indicates how well the attribute of the observed value matches the specified distribution (center, scale).

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed value matches the distribution (center, scale)

Return type:

float

class datanator.core.data_query.Filter(attribute)[source]

Bases: object

Calculate a numeric score which indicates how well an observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

attribute[source]

list of nested attribute names to score on

Type:tuple
compare_observed_value_with_target_component(target_component, observed_value)[source]

Compare the observed biological component with the target component

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

transformed value

Return type:

object

get_attribute_of_observed_value(observed_value)[source]

Get the value of the attribute of observed value observed_value

Parameters:observed_value (data_model.ObservedValue) – observed value
Returns:value of the attribute of the observed value
Return type:object
score(target_component, observed_value)[source]

Calculate a scaled numeric score betwen 0 and 1 which indicates how well the observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed value matches the criteria

Return type:

float

class datanator.core.data_query.FilterResult(observed_results, scores, observed_value_indices, all_observed_results, all_scores)[source]

Bases: object

Represents the results of applying a list of filters to a dataset

observed_results[source]

prioritized list of observed values

Type:list of data_model.ObservedValue
scores[source]

matrix of scores (rows: observed values in same order as in ordered_observed_results; columns: filters, in same orders as in filters)

Type:numpy.ndarray
observed_value_indices[source]

indices of the ordered observed values in the input list of observed values

Type:list of int
all_observed_results[source]

input list of observed values

Type:list of data_model.ObservedValue
all_scores[source]

matrix of scores (rows: observed values in same order as in observed_results; columns: filters, in same orders as in filters)

Type:numpy.ndarray
class datanator.core.data_query.FilterRunner(filters)[source]

Bases: object

Filter and order a list of observed values according to a list of filters.

filters[source]

list of filters

Type:list of Filter
filter(observed_results, scores)[source]

Filter out observed values that must be discarded (observed values with score = -1)

Parameters:
  • observed_results (list of data_model.ObservedValue) – list of experimental and/or computational observed values
  • scores (list of float) – list of scores
Returns:

  • list of data_model.ObservedValue: list of acceptable observed values (observed values without scores = -1)
  • list of float: list of scores of the acceptable observed values
  • list of int: list of indices of the ordered observed values within the original list of observed values

Return type:

tuple

order(observed_results, scores, i_observations=None)[source]

Order observed values by their mean score

Parameters:
  • observed_results (list of data_model.ObservedValue) – list of observed values
  • scores (list of float) – list of scores
  • i_observations (list of int, optional) – list of indices within the original list of observed values
Returns:

  • list of data_model.ObservedValue: ordered list of observed values
  • list of float: list of scores of the ordered observed values
  • list of int: list of indices of the ordered observed values within the original list of observed values

Return type:

tuple

run(target_component, observed_results, return_info=False)[source]

Filter and order a list of observed values according to a list of filters. Optionally, return additional information about the filtering including the scores of the observed values and the indices of the prioritized observed values in the input list of observed values.

  1. Calculate the score of each observed value for each filter

    • Scores equal to -1, indicate that the observed value should be discarded
    • Scores between 0 and 1, indicate how much the observed value should be prioritized
  2. Discard any observed value which has at least one score equal to -1

  3. Order the observed values by their mean score

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_results (list of data_model.ObservedValue) – list of experimental and/or computational observed values
  • return_info (bool, optional) – if True, also return the scores and indices of the ordered observed values in the input list
Returns:

  • If return_info is False: return a list of the observed values which matches the filters, ordered by their mean score
  • If return_info is True: return a list of the observed values which matches the filters, ordered by their mean score plus additional diagnostic information

Return type:

list of data_model.ObservedValue or FilterResult

score(target_component, observed_results)[source]

Score observed values against the filters

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_results (list of data_model.ObservedValue) – list of experimental and/or computational observed values
Returns:

list of scores

Return type:

list of float

class datanator.core.data_query.NormalFilter(attribute, mean=0.0, std=1.0)[source]

Bases: datanator.core.data_query.Filter

Prioritizes observed values whose attributes have values that are closed to mean.

attribute[source]

Name of an attribute to score

Type:str
mean[source]

The mean of the distribution. This indicates the value at which the score will be 1.

Type:float
std[source]

The standard deviation of the distribution. This determines how quickly the score falls to zero away from the mean.

Type:float
score(target_component, observed_value)[source]

Calculate a numeric score which indicates how well the attribute of the observed value matches the specified normal distribution (mean, std).

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed value matches the normal distribution (mean, std)

Return type:

float

class datanator.core.data_query.OptionsFilter(attribute, options)[source]

Bases: datanator.core.data_query.Filter

Filters out observed values whose attributes have values that are not in a list of acceptable options.

attribute[source]

name of attribute to score

Type:str
options[source]

list of acceptable values

Type:list of object
score(target_component, observed_value)[source]

Calculate a numeric score which indicates how well the observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed value matches the criteria

Return type:

float

class datanator.core.data_query.PhNormalFilter(mean, std)[source]

Bases: datanator.core.data_query.NormalFilter

Prioritizes observed values with pHs that are close to mean.

class datanator.core.data_query.PhRangeFilter(min=nan, max=nan)[source]

Bases: datanator.core.data_query.RangeFilter

Filters out observed values with pHs that fall outside a specified range.

class datanator.core.data_query.RangeFilter(attribute, min=nan, max=nan)[source]

Bases: datanator.core.data_query.Filter

Filters out observed values whose attributes have values that fall outside a specified range.

attribute[source]

name of attribute to score

Type:str
min[source]

minimum value

Type:float
max[source]

maximum value

Type:float
score(target_component, observed_value)[source]

Calculate a scaled numeric score betwen 0 and 1 which indicates how well the observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed value matches the criteria

Return type:

float

class datanator.core.data_query.ReactionParticipantFilter(min_similarity=0.5)[source]

Bases: datanator.core.data_query.Filter

min_similarity[source]

mini

Type:float
compare_observed_value_with_target_component(target_component, observed_value)[source]

Compare the observed biological component with the target component

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

transformed value

Return type:

int

score(target_component, observed_value)[source]

Calculate a scaled numeric score betwen 0 and 1 which indicates how well the observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed_value matches the criteria

Return type:

float

class datanator.core.data_query.ReactionSimilarityFilter(min_ec_level=3, scale=0.4)[source]

Bases: datanator.core.data_query.Filter

Prioritize reactions by their chemical similarity, as judged by (a) having the same participants and (b) belonging to the same EC class (or superclass).

  • 1: Reactions have the same participants
  • <0, 1>: Reactions belong to the same EC class (or superclass), but don’t have different participants
  • Score=-1: Reactions belong to different EC classes
reaction[source]

reaction

Type:data_model.Reaction
min_ec_level[source]

minimum EC level that must be common to the observed and target reaction

Type:int
scale[source]

How to exponentially scale of the scores. This determines how quickly the score falls to zero.

Type:float
compare_observed_value_with_target_component(target_component, observed_value)[source]

Compare the observed biological component with the target component

Parameters:
  • target_component (data_model.Reaction) – reaction to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

transformed value

Return type:

int

score(target_component, observed_value)[source]

Calculate a scaled numeric score betwen 0 and 1 which indicates how well the observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed_value matches the criteria

Return type:

float

class datanator.core.data_query.SpecieSequenceSimilarityFilter(min_similarity=0.5)[source]

Bases: datanator.core.data_query.SpecieSimilarityFilter

Proritize observed species based on the Levenshtein distance of their sequences to that of target species

compare_observed_value_with_target_component(target_component, observed_value)[source]

Compare the observed biological component with the target component

Parameters:
  • target_component (data_model.Specie) – species to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

similarity between the observed and target sequences

Return type:

float

class datanator.core.data_query.SpecieSimilarityFilter(filters, min_similarity=0.5)[source]

Bases: datanator.core.data_query.Filter

Proritize observed species based on their similarity to target species

min_similarity[source]

minimum acceptable similarity

Type:float
score(target_component, observed_value)[source]

Calculate a scaled numeric score betwen 0 and 1 which indicates how well the sequence of the observed species match that of the target species.

Parameters:
  • target_component (data_model.Specie) – species to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

similarity between the observed and target structures

Return type:

float

class datanator.core.data_query.SpecieStructuralSimilarityFilter(min_similarity=0.5)[source]

Bases: datanator.core.data_query.SpecieSimilarityFilter

Proritize observed species based on their structural similarity with target species

compare_observed_value_with_target_component(target_component, observed_value)[source]

Compare the observed biological component with the target component

Parameters:
  • target_component (data_model.Specie) – species to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

similarity between the observed and target structures

Return type:

float

class datanator.core.data_query.TaxonomicDistanceFilter(taxon, max=None, scale=None)[source]

Bases: datanator.core.data_query.Filter

Prioritizes observed values that are from taxonomically close taxa

taxon[source]

name of the taxon to find data for

Type:str
compare_observed_value_with_target_component(target_component, observed_value)[source]

Compare the observed biological component with the target component

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – target component
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

distance to latest common ancestor with the observed taxon

Return type:

int

score(target_component, observed_value)[source]

Calculate a scaled numeric score betwen 0 and 1 which indicates how well the observed value matches one or more criteria. Please see FilterRunner to see how these scores are used to filter and order observed values.

Parameters:
  • target_component (data_model.EntityInteractionOrProperty) – interaction, species, or property to find data about
  • observed_value (data_model.ObservedValue) – experimentally or computationally observed value
Returns:

score which indicates how well the observed value matches the criteria

Return type:

float

class datanator.core.data_query.TemperatureNormalFilter(mean, std)[source]

Bases: datanator.core.data_query.NormalFilter

Prioritizes observed values with temperatures that are close to mean.

class datanator.core.data_query.TemperatureRangeFilter(min=nan, max=nan)[source]

Bases: datanator.core.data_query.RangeFilter

Filters out observed values with temperatures that fall outside a specified range.

class datanator.core.data_query.WildtypeFilter[source]

Bases: datanator.core.data_query.OptionsFilter

Filter out observed values which were observed for taxa with genetic perturbations

4.1.1.4.6. 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
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
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.4.7. datanator.core.json_schema module

4.1.1.4.8. datanator.core.models module

class datanator.core.models.AbundanceData(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents protein abundance data from the Pax DB database

abundance[source]

Represents protein abundance from given observation in ppm

Type:float
dataset_id[source]

Represents the dataset from which the abundance stems from

Type:int
subunit_id[source]

Represents the protein frmo which the abundance stems from

Type:int
abundance[source]
abundance_id[source]
dataset[source]
dataset_id[source]
pax_load[source]
subunit[source]
subunit_id[source]
uniprot_id[source]
class datanator.core.models.AbundanceDataSet(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

Represents a dataset for protein abundance

file_name[source]

Name of data set which data stems from

Type:str
score[source]

Quality of the experimental analysis (PAXdb Measure)

Type:float
weight[source]
Type:int
coverage[source]

Percentage of genome coverage

Type:int
abundance_data[source]
coverage[source]
dataset_id[source]
file_name[source]
id[source]
name[source]
observation_id[source]
score[source]
type[source]
weight[source]
class datanator.core.models.CellCompartment(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a cell compartment of a given physical entity or property

Ties especially to the reacitons because this is where the reactions occur

name[source]

Name of the Cell Compartment

Type:str
id[source]
name[source]
query_class[source]

alias of FullTextQuery

reaction[source]
search_vector[source]
class datanator.core.models.CellLine(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a cell line of a given physical entity or property

name[source]

Name of the Cell Line

Type:str
id[source]
name[source]
query_class[source]

alias of FullTextQuery

search_vector[source]
class datanator.core.models.Characteristic(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents the method of collection for a given entity or Property

name[source]

Name of the Method

Type:str
comments[source]

Comments on the method

Type:str
category[source]
id[source]
value[source]
class datanator.core.models.Concentration(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

Represents the concentration of an entity

value[source]

concentration of a tagged metabolite

Type:float
error[source]

uncertainty of corresponding concentration value

Type:float
concentration_id[source]
error[source]
id[source]
metabolite[source]
metabolite_id[source]
name[source]
observation_id[source]
type[source]
units[source]
value[source]
class datanator.core.models.Conditions(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents the conditions of a given physical entity or property

growth_status[source]

Type of growth status

Type:str
media[source]

Media composition

Type:str
temperature[source]

Temperature of the sample (C)

Type:float
ph[source]

pH of the sample

Type:float
growth_system[source]

Type of growth system

Type:str
growth_status[source]
growth_system[source]
id[source]
media[source]
ph[source]
temperature[source]
class datanator.core.models.DNABindingData(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents Matrix binding profile for a protein transcription factor

position[source]

Position in the sequence

Type:int
frequency_a[source]

Frequency of A

Type:int
frequency_c[source]

Frequency of C

Type:int
frequency_g[source]

Frequency of G

Type:int
frequency_t[source]

Frequency of T

Type:int
jaspar_id[source]

ID of Jaspar Matrix (used for bulk insert mapping)

Type:int
dataset_id[source]

Represents the dataset from which the data stems from

Type:int
dataset[source]
dataset_id[source]
frequency_a[source]
frequency_c[source]
frequency_g[source]
frequency_t[source]
jaspar_id[source]
position[source]
position_id[source]
class datanator.core.models.DNABindingDataset(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

Represents a dataset for Transcription Factor Binding

version[source]

Represents the version of binding matrix

Type:int
complex_id[source]

Relation ID for transcription factor complex

Type:int
subunit_id[source]

Relation ID for transcription factor subunit

Type:int
complex_id[source]
dataset_id[source]
dna_binding_data[source]
id[source]
name[source]
observation_id[source]
subunit[source]
subunit_id[source]
tf[source]
type[source]
version[source]
class datanator.core.models.DataFormat(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a data format .. attribute:: _id

unique id

type:int
name[source]

name

Type:str
bio_assay_data_cubes[source]

number of dimensions to the data

Type:int
bio_assay_data_cubes[source]
name[source]
class datanator.core.models.Experiment(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

id[source]
class datanator.core.models.ExperimentDesign(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents and experimental design .. attribute:: _id

unique id

type:int
name[source]

name

Type:str
id[source]
name[source]
class datanator.core.models.ExperimentMetadata(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

db.Table representing Metadata identifiers for entities and properties

name[source]

Name of the entity or property

Type:str
description[source]
experiment[source]
experiment_design[source]
experiment_type[source]
id[source]
method[source]
name[source]
resource[source]
taxon[source]
class datanator.core.models.ExperimentType(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a type of experiment .. attribute:: _id

unique id

type:int
name[source]

name

Type:str
id[source]
name[source]
class datanator.core.models.FullTextQuery(entities, session=None)[source]

Bases: flask_sqlalchemy.BaseQuery, sqlalchemy_searchable.SearchQueryMixin

class datanator.core.models.KineticLaw(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

Represents the concentration of an entity

enzyme_id[source]

ID of enzyme driving the kinetic law enzyme_type (str): Enzyme classification (Ex. Modifier-Catalyst) tissue (str): Tissue from which kinetic law stems from mechanism (str): Rate kinetics of Kinetic Law equation (str): Equation of the rate kinetics

Type:int
enzyme[source]
enzyme_id[source]
enzyme_type[source]
equation[source]
id[source]
kinetic_law_id[source]
mechanism[source]
name[source]
observation_id[source]
parameter[source]
reaction[source]
tissue[source]
type[source]
class datanator.core.models.Metabolite(**kwargs)[source]

Bases: datanator.core.models.PhysicalEntity

Represents a Metabolite - An instance of Physical Entity

metabolite_id[source]

Common Schema Observation Identifier

Type:int
metabolite_name[source]

Name of the Metabolite

Type:str
description[source]
Type:str
comment = db.Column
Type:db.Unicode
_is_name_ambiguous = db.Column
Type:db.Boolean
comment[source]
complex_search_vector[source]
concentration[source]
description[source]
id[source]
metabolite_id[source]
metabolite_name[source]
name[source]
observation_id[source]
parameter[source]
query_class[source]

alias of FullTextQuery

reaction[source]
simple_search_vector[source]
structure[source]
structure_id[source]
type[source]
class datanator.core.models.Metadata(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

db.Table representing Metadata identifiers for entities and properties

name[source]

Name of the entity or property

Type:str
cell_compartment[source]
cell_line[source]
characteristic[source]
conditions[source]
id[source]
method[source]
name[source]
resource[source]
synonym[source]
taxon[source]
variable[source]
class datanator.core.models.Method(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents the method of collection for a given entity or Property

name[source]

Name of the Method

Type:str
comments[source]

Comments on the method

Type:str
comments[source]
hardware[source]
id[source]
name[source]
performer[source]
query_class[source]

alias of FullTextQuery

software[source]
class datanator.core.models.Observation(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents an Observation of a Physical Entity or Property in the Common Schema

id[source]

Common Schema Observation Identifier

Type:int
_metadata_id[source]

Related Metadata ID

Type:int of Metadata
id[source]
class datanator.core.models.Parameter(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a parameter for a given kinetic law and metabolite

kinetic_law_id[source]

corresponding kinetic law to the parameter

Type:int
sabio_type[source]

sabio identifier for type of parameter

Type:int
metabolite_id[source]

corresponding metabolite for the parameter

Type:int
value[source]

Value of parameter

Type:float
error[source]

Uncertainty of the value

Type:float
units[source]

units of the parameter

Type:str
observed_name[source]

observed name of parameter

Type:str
observed_sabio_type[source]

observed sabio type

Type:int
observed_value[source]

observed value of parameter

Type:float
observed_error[source]

observed error of parameter

Type:float
observed_units[source]

observed units of parameter

Type:str
error[source]
kinetic_law[source]
kinetic_law_id[source]
metabolite[source]
metabolite_id[source]
observed_error[source]
observed_name[source]
observed_sabio_type[source]
observed_units[source]
observed_value[source]
parameter_id[source]
sabio_type[source]
units[source]
value[source]
class datanator.core.models.PhysicalEntity(**kwargs)[source]

Bases: datanator.core.models.Observation

Represents a Physical Entity in the Common Schema

observation_id[source]

Common Schema Observation Identifier

Type:int
type[source]

Type of Physical Entity (Ex. Metabolite)

Type:str
name[source]

Name of the Physical Entity (Ex. Water )

Type:str
id[source]
name[source]
observation_id[source]
type[source]
class datanator.core.models.PhysicalProperty(**kwargs)[source]

Bases: datanator.core.models.Observation

Represents a Physical Property in the Common Schema

observation_id[source]

Common Schema Observation Identifier

Type:int
type[source]

Type of Physical Property (Ex. Concentration)

Type:str
name[source]

Name of the Physical Property

Type:str
id[source]
name[source]
observation_id[source]
type[source]
class datanator.core.models.Progress(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents amount loaded of large DBs (Ex. Pax and Sabio) .. attribute:: database_name

Name of observed databse

type:str
amount_loaded[source]

Amount of entries loaded in Common Schema

Type:int
amount_loaded[source]
database_name[source]
class datanator.core.models.ProteinComplex(**kwargs)[source]

Bases: datanator.core.models.PhysicalEntity

Represents a Protein Complex - An instance of Physical Entity

complex_id[source]

Common Schema Observation Identifier

Type:int
complex_name[source]

Name of the Protein Complex

Type:str
go_id[source]

GO functional annotation

Type:str
go_dsc[source]

Description of the annotation

Type:str
funcat_id[source]

FUNCAT functional annotation

Type:str
funcat_dsc[source]

Description of the annotation

Type:str
su_cmt[source]

Subunit comments

Type:str
complex_cmt[source]

Compex comments

Type:str
disease_cmt[source]

Disease comments

Type:str
class_name[source]

Class Name of Subunit

Type:str
family_name[source]

Family Name of Subunit

Type:str
molecular_weight[source]

Molecular weight of subunit

Type:float
class_name[source]
complex_cmt[source]
complex_id[source]
complex_name[source]
disease_cmt[source]
dna_binding_dataset[source]
family_name[source]
funcat_dsc[source]
funcat_id[source]
go_dsc[source]
go_id[source]
id[source]
kinetic_law[source]
molecular_weight[source]
name[source]
observation_id[source]
protein_subunit[source]
query_class[source]

alias of FullTextQuery

simple_search_vector[source]
su_cmt[source]
type[source]
class datanator.core.models.ProteinInteraction(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

Represents a protein-protein interaction

participant_a[source]

Participant A in the interaction

Type:str
participant_b[source]

Participant B in the interaction

Type:str
interaction[source]

Interaction ID

Type:str
site_a[source]

Binding Site of Participant A

Type:str
site_b[source]

Binding Site of Participant B

Type:str
stoich_a[source]

Stoichiometry of Participant A

Type:str
stoich_b[source]

Stoichiometry of Participant B

Type:str
confidence[source]
gene_a[source]
gene_b[source]
id[source]
interaction_id[source]
interaction_type[source]
loc_a[source]
loc_b[source]
name[source]
observation_id[source]
protein_a[source]
protein_b[source]
query_class[source]

alias of FullTextQuery

role_a[source]
role_b[source]
stoich_a[source]
stoich_b[source]
type[source]
type_a[source]
type_b[source]
class datanator.core.models.ProteinSubunit(**kwargs)[source]

Bases: datanator.core.models.PhysicalEntity

Represents a Protein Subunit - An instance of Physical Entity

subunit_id[source]

Common Schema Observation Identifier

Type:int
subunit_name[source]

Name of the Protein Subunit

Type:str
uniprot_id[source]

Uniprot ID for the Subunit

Type:str
entrez_id[source]

Entrez ID for the Subunit

Type:int
gene_name[source]

Name of Gene which subunit is derived

Type:str
gene_syn[source]

Synonym of Gene

Type:str
class_name[source]

Class Name of Subunit

Type:str
family_name[source]

Family Name of Subunit

Type:str
coefficient[source]

Number of units required for complex

Type:str
sequence[source]

Sequence of Subunit

Type:str
molecular_weight[source]

Molecular weight of subunit

Type:float
canonical_sequence[source]
class_name[source]
coefficient[source]
complex_search_vector[source]
dna_binding_dataset[source]
ec_number[source]
entrez_id[source]
family_name[source]
gene_name[source]
gene_syn[source]
id[source]
length[source]
mass[source]
molecular_weight[source]
name[source]
observation_id[source]
pax_load[source]
proteincomplex[source]
proteincomplex_id[source]
query_class[source]

alias of FullTextQuery

simple_search_vector[source]
subunit_id[source]
subunit_name[source]
type[source]
uniprot_checked[source]
uniprot_id[source]
class datanator.core.models.RNASeqDataSet(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

assay[source]
ensembl_organism_strain[source]
experiment[source]
experiment_accession_number[source]
full_strain_specificity[source]
id[source]
name[source]
observation_id[source]
read_type[source]
reference_genome[source]
sample_id[source]
sample_name[source]
type[source]
class datanator.core.models.RNASeqExperiment(**kwargs)[source]

Bases: datanator.core.models.Experiment

accession_number[source]
exp_name[source]
experiment_id[source]
has_fastq_files[source]
id[source]
samples[source]
class datanator.core.models.Reaction(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a reaction

metabolite_id[source]

ID of the corresponding metabolite

Type:int
coefficient[source]

Stoichiometric coefficient

Type:float
_is_reactant[source]

Indicates of corresponding metabolite is a reactant

Type:bool
_is_product[source]

Indicates of corresponding metabolite is a product

Type:bool
_is_modifier[source]

Indicates of corresponding metabolite is a modifier

Type:bool
rxn_type[source]

Classifer of reaction

Type:str
coefficient[source]
compartment[source]
compartment_id[source]
kinetic_law[source]
kinetic_law_id[source]
metabolite[source]
metabolite_id[source]
reaction_id[source]
rxn_type[source]
class datanator.core.models.ReferenceGenome(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

download_url[source]
id[source]
name[source]
namespace[source]
observation_id[source]
organism_strain[source]
reference_genome_id[source]
sample[source]
type[source]
class datanator.core.models.Resource(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a resource of a given physical entity or property

namespace[source]

Name of the classifier of the resource (Ex. Pubmed)

Type:str
_id[source]

Identifier of the resource

Type:str
release_date[source]

The date that resource released the data

Type:str
id[source]
namespace[source]
release_date[source]
class datanator.core.models.Structure(**kwargs)[source]

Bases: datanator.core.models.PhysicalProperty

Represents a structure of a metabolite

_value_smiles[source]

Smiles format for metabolite representation

Type:str
_value_inchi[source]

Inchi format for metabolite representation

Type:str
_structure_formula_connectivity[source]

Connectivity of metabolite

Type:str
id[source]
metabolite[source]
name[source]
observation_id[source]
struct_id[source]
type[source]
class datanator.core.models.Synonym(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents a synonym of a given physical entity or property

name[source]

Name of the Synonym

Type:str
id[source]
name[source]
query_class[source]

alias of FullTextQuery

search_vector[source]
class datanator.core.models.Taxon(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents the species of a given physical entity or property

ncbi_id[source]

NCBI id of the species

Type:int
name[source]

Name of the species

Type:str
name[source]
ncbi_id[source]
query_class[source]

alias of FullTextQuery

search_vector[source]
class datanator.core.models.Variable(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

Represents the method of collection for a given entity or Property

name[source]

Name of the variable

Type:str
comments[source]

Comments on the method

Type:str
category[source]
id[source]
units[source]
value[source]

4.1.1.4.9. datanator.core.query_nosql module

class datanator.core.query_nosql.DataQuery(cache_dirname=None, MongoDB=None, replicaSet=None, db=None, verbose=False, max_entries=inf, username=None, password=None, authSource='admin')[source]

Bases: datanator.util.mongo_util.MongoUtil

Collection agnostic queries

ask(prompt, options='YN')[source]

Prompt Yes or No,return the upper case ‘Y’ or ‘N’.

doc_feeder(collection_str=None, sym_link=False, step=1000, s=None, e=None, inbatch=False, query=None, batch_callback=None, projection=None, verbose=False)[source]

An iterator for returning docs in a collection, with batch query. additional filter query can be passed via “query”, e.g., doc_feeder(collection_str, query={‘taxid’: {‘$in’: [9606, 10090, 10116]}}) batch_callback is a callback function as fn(cnt, t), called after every batch fields is optional parameter passed to find to restrict fields to return.

find_text(v, collection=None)[source]

Find documents containing string v v cannot be part of a word (e.g. ‘wor’ of ‘word’) v needs to be in a previously indexed field :param v: value to be matched

timesofar(t0, clock=0, t1=None)[source]

return the string(eg.‘4m5.32s’) for the passed real time/CPU time so far from given t0 (clock 0 for cpu time 1 for realtime).

class datanator.core.query_nosql.QueryMetabolitesMeta(cache_dirname=None, MongoDB=None, replicaSet=None, db=None, collection_str='metabolites_meta', verbose=False, max_entries=inf, username=None, password=None, authSource='admin')[source]

Bases: datanator.core.query_nosql.DataQuery

Queries specific to metabolites_meta collection

get_ids_from_hash(hashed_inchi)[source]

Given a hashed inchi string, find its corresponding m2m_id and/or ymdb_id :param hashed_inchi: string of hashed inchi

Returns:
dictionary of ids and their keys
{‘m2m_id’: …, ‘ymdb_id’: …}
Return type:result
get_metabolite_hashed_inchi(compounds)[source]

Given a list of compound name(s) Return the corresponding hashed inchi string :param compounds: [‘ATP’, ‘2-Ketobutanoate’]

Returns:[‘3e23df….’, ‘7666ffa….’]
Return type:hashed_inchi
get_metabolite_inchi(compounds)[source]

Given a list of compound name(s) Return the corrensponding inchi string :param compounds: list of compounds :param [‘ATP’, ‘2-Ketobutanoate’]:

Returns:[‘….’, ‘InChI=1S/C4H6O3/c1-2-3(5)4(6)7/…’]
get_metabolite_name_by_hash(compounds)[source]

Given a list of hashed inchi, return a list of name (one of the synonyms) for each compound :param compounds: list of compounds in hashed_inchi format

Returns:
list of names
[name, name, name]
Return type:result
get_metabolite_similar_compounds(compounds, num=0, threshold=0)[source]

Given a list of compound names Return the top num number of similar compounds with tanimoto score above threshold values :param compounds: list of compound names :param num: number of similar compounds to return :param threshold: threshold tanimoto coefficient value :param return_format: return dictionary key format, either

hashed inchi or name
Returns:list of similar compounds and their tanimoto score [ {‘compound1’: score, ‘compound2’: score, … ‘compound_num’: score},
{‘compound1’: score, ‘compound2’: score, … ‘compound_num’: score}, …]
compound(1-n) will be in name format

raw: list of similar compounds and their tanimoto score [ {‘compound1’: score, ‘compound2’: score, … ‘compound_num’: score},

{‘compound1’: score, ‘compound2’: score, … ‘compound_num’: score}, …]
compound(1-n) will be in hashed_inchi format
Return type:result
get_metabolite_synonyms(compounds)[source]

Find synonyms of a compound :param compound: name(s) of the compound e.g. “ATP”, [“ATP”, “Oxygen”, …]

Returns:
dictionary of synonyms of the compounds
{‘ATP’: [], ‘Oxygen’: [], …}
rxns: dictionary of rxns in which each compound is found
{‘ATP’: [12345,45678,…], ‘Oxygen’: […], …}
Return type:synonyms
class datanator.core.query_nosql.QuerySabio(cache_dirname=None, MongoDB=None, replicaSet=None, db=None, collection_str='sabio_rk', verbose=False, max_entries=inf, username=None, password=None, authSource='admin')[source]

Bases: datanator.core.query_nosql.DataQuery

Queries specific to sabio_rk collection

find_reaction_participants(kinlaw_id)[source]

Find the reaction participants defined in sabio_rk using kinetic law id :param kinlaw_id: list of kinlaw_id to search for

Returns:list of dictionaries containing names of reaction participants [{‘substrates’: [], ‘products’: [] }, … {} ]
Return type:rxns
get_kinlawid_by_inchi(inchi)[source]

Find the kinlaw_id defined in sabio_rk using rxn participants’ inchi string :param inchi: list of inchi, all in one rxn

Returns:list of kinlaw_ids that satisfy the condition [id0, id1, id2,…, ]
Return type:rxns
get_kinlawid_by_inchi_slow(inchi)[source]

Find the kinlaw_id defined in sabio_rk using rxn participants’ inchi string :param inchi: list of inchi, all in one rxn

Returns:list of kinlaw_ids that satisfy the condition [id0, id1, id2,…, ]
Return type:rxns
get_kinlawid_by_rxn(substrates, products)[source]

Find the kinlaw_id defined in sabio_rk using rxn participants’ inchi string :param substrates: list of substrates’ inchi :param products: list of products’ inchi

Returns:list of kinlaw_ids that satisfy the condition [id0, id1, id2,…, ]
Return type:rxns
class datanator.core.query_nosql.QueryTaxonTree(cache_dirname=None, MongoDB=None, replicaSet=None, db=None, collection_str='taxon_tree', verbose=False, max_entries=inf, username=None, password=None, authSource='admin')[source]

Bases: datanator.core.query_nosql.DataQuery

Queries specific to taxon_tree collection

get_anc_by_id(ids)[source]

Get organism’s ancestor ids by using organism’s ids :param ids: list of organism’s ids e.g. Candidatus Diapherotrites

Returns:list of ancestors in order of the farthest to the closest
Return type:result
get_anc_by_name(names)[source]

Get organism’s ancestor ids by using organism’s names :param names: list of organism’s names e.g. Candidatus Diapherotrites

Returns:list of ancestors ids in order of the farthest to the closest result_name: list of ancestors’ names in order of the farthest to the closest
Return type:result_id
get_common_ancestor(org1, org2, org_format='name')[source]

Get the closest common ancestor between two organisms and their distances to the said ancestor :param org1: organism 1 :param org2: organism 2 :param org_format: the format of organism eg tax_id or tax_name

Returns:closest common ancestor’s name distance: each organism’s distance to the ancestor
Return type:ancestor
get_name_by_id(ids)[source]

Get organisms’ names given their tax_ids :param ids: organisms’ tax_ids

Returns:organisms’ names
Return type:names
get_rank(ids)[source]

Given a list of taxon ids, return the list of ranks. no rank = ‘+’ :param ids: list of taxon ids [1234,2453,431]

Returns:list of ranks [‘kingdom’, ‘+’, ‘phylum’]
Return type:ranks

4.1.1.4.10. datanator.core.upload_data module

class datanator.core.upload_data.UploadData(cache_dirname='/root/.wc/data/datanator')[source]

Bases: object

get_dict_of_new_objects(object)[source]
get_or_create_object_upload(session, cls, kwargs)[source]

Get the first instance of cls that has the property-values pairs described by kwargs, or create an instance of cls if there is no instance with the property-values pairs described by kwargs :param cls: type of object to find or create :type cls: class :param **kwargs: values of the properties of the object

Returns:instance of cls hat has the property-values pairs described by kwargs
Return type:Base
get_primitive_fields(object, object_type)[source]
upload_from_json(objects, first_data_type)[source]
upload_reference_genome(path_to_annotation_file)[source]
upload_rna_rseq_experiment(path_to_template_directory)[source]
class datanator.core.upload_data.Uploader(parent_node, dict_of_new_objects)[source]

Bases: object

4.1.1.4.11. Module contents