4.1.1.4. datanator.core package¶
4.1.1.4.1. Subpackages¶
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
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
-
attributes
= {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>}[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]¶
-
-
class
-
class
datanator.core.data_model.
ComputationalMethod
(**kwargs)[source]¶ Bases:
datanator.core.data_model.Method
Represents a computational method used to generate an observation
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
arguments
= <obj_model.core.LongStringAttribute object>[source]
-
version
= <obj_model.core.StringAttribute object>[source]
-
class
-
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
-
method
[source]¶ method used to calculate the consensus value and error
Type: ConsensusMethod
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
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]
-
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
-
class
datanator.core.data_model.
DnaSpecie
(**kwargs)[source]¶ Bases:
datanator.core.data_model.PolymerSpecie
Represents a DNA polymer
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
binding_matrix
= <obj_model.bio.FrequencyPositionMatrixAttribute object>[source]
-
class
-
class
datanator.core.data_model.
EntityInteractionOrProperty
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents an observable of a biological system
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
attributes
= {'cross_references': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'name': <obj_model.core.StringAttribute object>}[source]¶
-
local_attributes
= {'cross_references': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>}[source]¶
-
-
cross_references
= <obj_model.core.ManyToManyAttribute object>[source]
-
id
= <obj_model.core.StringAttribute object>[source]
-
name
= <obj_model.core.StringAttribute object>[source]
-
class
-
class
datanator.core.data_model.
Environment
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents the environment (temperature, pH, media chemical composition) of an observation
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
media
= <obj_model.core.LongStringAttribute object>[source]
-
ph
= <obj_model.core.FloatAttribute object>[source]
-
temperature
= <obj_model.core.FloatAttribute object>[source]
-
class
-
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
-
attributes
= {'relevance': <obj_model.core.FloatAttribute object>, 'value': <obj_model.core.ManyToOneAttribute object>}[source]¶
-
local_attributes
= {'consensus': <obj_model.core.LocalAttribute object>, 'relevance': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute 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
-
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]¶
-
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]¶
-
-
class
-
class
datanator.core.data_model.
Genetics
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents a taxon
-
taxon (obj
str): taxon name
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
attributes
= {'taxon': <obj_model.core.StringAttribute object>, 'variation': <obj_model.core.StringAttribute object>}[source]¶
-
local_attributes
= {'observations': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>, 'variation': <obj_model.core.LocalAttribute object>}[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
-
variation
= <obj_model.core.StringAttribute object>[source]
-
-
class
datanator.core.data_model.
Interaction
(**kwargs)[source]¶ Bases:
datanator.core.data_model.EntityInteractionOrProperty
Represents an interaction
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
position
= <obj_model.core.IntegerAttribute object>[source]
-
score
= <obj_model.core.FloatAttribute object>[source]
-
class
-
class
datanator.core.data_model.
Method
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents a method used to generate an observation
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
description
= <obj_model.core.LongStringAttribute object>[source]
-
name
= <obj_model.core.StringAttribute object>[source]
-
class
-
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
-
compartment
[source]¶ compartment that the spcies/interaction was observed in
Type: Compartment
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
compartment
= <obj_model.core.ManyToOneAttribute object>[source]
-
interaction
= <obj_model.core.ManyToOneAttribute 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
-
attributes
= {'interaction': <obj_model.core.ManyToOneAttribute object>, 'metadata': <obj_model.core.ManyToOneAttribute object>}[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]¶
-
-
interaction
= <obj_model.core.ManyToOneAttribute object>[source]
-
-
class
datanator.core.data_model.
ObservedResult
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents a base dataset for a queried response
-
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
ofObservedValue
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
environment
= <obj_model.core.ManyToOneAttribute object>[source]
-
genetics
= <obj_model.core.ManyToOneAttribute object>[source]
-
-
class
datanator.core.data_model.
ObservedSpecie
(**kwargs)[source]¶ Bases:
datanator.core.data_model.ObservedResult
Represents an observed interaction of a biological system
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
attributes
= {'metadata': <obj_model.core.ManyToOneAttribute object>, 'specie': <obj_model.core.ManyToOneAttribute object>}[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]¶
-
-
specie
= <obj_model.core.ManyToOneAttribute object>[source]
-
class
-
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
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
error
= <obj_model.core.FloatAttribute 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
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
sequence
= <obj_model.core.LongStringAttribute object>[source]
-
class
-
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
-
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]¶
-
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]¶
-
-
class
-
class
datanator.core.data_model.
ProteinSpecie
(**kwargs)[source]¶ Bases:
datanator.core.data_model.PolymerSpecie
Represents a protein polymer
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
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]
-
uniprot_id
= <obj_model.core.StringAttribute object>[source]
-
class
-
class
datanator.core.data_model.
Reaction
(**kwargs)[source]¶ Bases:
datanator.core.data_model.Interaction
Represents a reaction
-
participants
[source]¶ list of participants
Type: list
ofReactionParticipant
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
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
ofstr
-
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
ofstr
-
get_modifiers
()[source]¶ Get the modifiers
Returns: list of modifiers Return type: list
ofReactionParticipant
-
get_ordered_participants
(collapse_repeated=True)[source]¶ Get an ordered list of the participants
Parameters: collapse_repeated ( bool
) – ifTrue
, collapse any repeated participantsReturns: ordered list of reaction participants Return type: list
ofReactionParticipant
-
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
ofstr
-
get_products
()[source]¶ Get the products
Returns: list of products Return type: list
ofReactionParticipant
-
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 productsReturn type: list
oftuple
of obj
-
get_reactants
()[source]¶ Get the reactants
Returns: list of reactants Return type: list
ofReactionParticipant
-
participants
= <obj_model.core.ManyToManyAttribute object>[source]
-
reversible
= <obj_model.core.BooleanAttribute object>[source]
-
-
class
datanator.core.data_model.
ReactionParticipant
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents a participant in a reaction
-
compartment
[source]¶ compartment
Type: Compartment
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
coefficient
= <obj_model.core.FloatAttribute object>[source]
-
compartment
= <obj_model.core.ManyToOneAttribute 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
author
Type: str
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
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]
-
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
-
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
-
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]¶
-
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]¶
-
-
assignment_method
= <obj_model.core.EnumAttribute object>[source]
-
id
= <obj_model.core.StringAttribute object>[source]
-
namespace
= <obj_model.core.StringAttribute 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
-
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
-
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]¶
-
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]¶
-
-
class
-
class
datanator.core.data_model.
Specie
(**kwargs)[source]¶ Bases:
datanator.core.data_model.EntityInteractionOrProperty
Represents a molecular species in a biological system
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
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
- other (
-
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
) – ifTrue
, return only the formula and connectivity layersReturns: - structure in InChi format or just the formula and connectivity layers
- if
only_formula_and_connectivity
isTrue
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
-
class
-
class
datanator.core.data_model.
SpecieInteraction
(**kwargs)[source]¶ Bases:
datanator.core.data_model.Interaction
Represents a protein interaction
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
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]¶
-
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]¶
-
-
loc_a
= <obj_model.core.StringAttribute object>[source]
-
loc_b
= <obj_model.core.StringAttribute 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]
-
class
-
class
datanator.core.data_model.
Synonym
(**kwargs)[source]¶ Bases:
obj_model.core.Model
Represents a synonym of a given physical entity or property
-
class
Meta
[source]¶ Bases:
obj_model.core.Meta
-
local_attributes
= {'name': <obj_model.core.LocalAttribute object>, 'observations': <obj_model.core.LocalAttribute object>}[source]¶
-
-
name
= <obj_model.core.StringAttribute object>[source]
-
class
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
offloat
) – list of normalized values - weights (
list
offloat
, optional) – weights ofvalues
- method (
str
, optional) – mean, median, or mode; the desired average ofvalues
Returns: tuple of the average value, its uncertainty, and the method used to calculate the average value
Return type: tuple
offloat
,float
,data_model.ConsensusMethod
- values (
-
group_observed_results_by_properties
(observed_results)[source]¶ Group observed values by their observed properties
Parameters: observed_results ( list
ofdata_model.ObservedValue
) – list of observed valuesReturns: list of observed values, grouped by the observed property Return type: list
oftuple
of (str
,list
ofdata_model.ObservedValue
)
-
normalize_observed_results
(observed_results)[source]¶ Normalize one or more observed values to SI units
Parameters: observed_results ( list
ofdata_model.ObservedValue
) – list of observed valuesReturns: list
offloat
: normalized observed valueslist
offloat
: normalized errors of the observed valueslist
offloat
: weights of the observed valuesstr
: units of the normalized observed values
Return type: tuple
-
run
(observed_results, method, weighted=True)[source]¶ Parameters: - observed_results (
list
ofdata_model.ObservedValue
) – list of observed values - method (
str
) – mean, median, or mode; desired average statistic - weighted (
bool
, optional) – ifTrue
, calculate the weighted average value
Returns: - list of consensus values of
the observed properties
Return type: list
ofdata_model.Consensus
Raises: ValueError
– ifmethod
is not one of mean, median, or mode- observed_results (
-
-
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
Find observed values for the exact or similar model components
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
Calculate a statistical representation of the relevant observed values
-
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
ofdata_model.ObservedValue
) – list of observed values
Returns: filter result
Return type: - component (
-
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
ofdata_model.Consensus
- component (
-
get_observed_result
(component)[source]¶ Find the observed result relevant to
component
Parameters: component ( model.PhysicalEntity
) or (model.PhysicalProperty
) – model component to find data forReturns: list of relevant observed values list
ofdata_model.ObservedValue
: list of relevant observed valuesReturn type: list
ofdata_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 forReturns: data model metadata object Return type: list
ofdata_model.ObservedResultMetadata
-
run
(component)[source]¶ - Find observed values for the exact or similar model components and genetic and environmental conditions
- Rank the results by their similarity to the model component and the genetic and environmental conditions
- Calculate a consensus statistical representation of the relevant observed values
Parameters: component ( data_model.EntityInteractionOrProperty
) – model component to find data forReturns: - statistical consensus of the relevant observed values of
component
and the observed values it was based on
Return type: list
ofdata_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
-
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
- target_component (
-
-
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.-
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
- target_component (
-
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 valueReturns: 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
- target_component (
-
-
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
-
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
-
-
class
datanator.core.data_query.
FilterRunner
(filters)[source]¶ Bases:
object
Filter and order a list of observed values according to a list of filters.
-
filter
(observed_results, scores)[source]¶ Filter out observed values that must be discarded (observed values with score = -1)
Parameters: - observed_results (
list
ofdata_model.ObservedValue
) – list of experimental and/or computational observed values - scores (
list
offloat
) – list of scores
Returns: list
ofdata_model.ObservedValue
: list of acceptable observed values (observed values without scores = -1)list
offloat
: list of scores of the acceptable observed valueslist
ofint
: list of indices of the ordered observed values within the original list of observed values
Return type: tuple
- observed_results (
-
order
(observed_results, scores, i_observations=None)[source]¶ Order observed values by their mean score
Parameters: - observed_results (
list
ofdata_model.ObservedValue
) – list of observed values - scores (
list
offloat
) – list of scores - i_observations (
list
ofint
, optional) – list of indices within the original list of observed values
Returns: list
ofdata_model.ObservedValue
: ordered list of observed valueslist
offloat
: list of scores of the ordered observed valueslist
ofint
: list of indices of the ordered observed values within the original list of observed values
Return type: tuple
- observed_results (
-
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.
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
Discard any observed value which has at least one score equal to -1
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
ofdata_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
ofdata_model.ObservedValue
orFilterResult
-
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
ofdata_model.ObservedValue
) – list of experimental and/or computational observed values
Returns: list of scores
Return type: list
offloat
- target_component (
-
-
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.
-
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
- target_component (
-
-
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.
-
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
- target_component (
-
-
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.
-
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
- target_component (
-
-
class
datanator.core.data_query.
ReactionParticipantFilter
(min_similarity=0.5)[source]¶ Bases:
datanator.core.data_query.Filter
-
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
- target_component (
-
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
- target_component (
-
-
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
-
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
- target_component (
-
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
- target_component (
-
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
- target_component (
-
-
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
-
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
- target_component (
-
-
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
- target_component (
-
-
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
-
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
- target_component (
-
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
- target_component (
-
-
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
-
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
-
clear_content
()[source]¶ Clear the content of the sqlite database (i.e. drop and recreate all tables).
-
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 ofbase_model
- **kwargs (
dict
, optional) – attribute-value pairs of desired SQLAlchemy object of typecls
Returns: SQLAlchemy object of type
cls
Return type: - cls (
-
get_paths_to_backup
(download=False)[source]¶ Get a list of the files to backup/unpack
Parameters: download ( bool
, optional) – ifTrue
, prepare the files for uploadingReturns: list of paths to backup Return type: list
ofstr
-
get_session
()[source]¶ Get a session for the sqlite database
Returns: database session Return type: sqlalchemy.orm.session.Session
-
quilt_package
= None[source] Create SQLAlchemy session and load content if necessary
-
-
class
datanator.core.data_source.
DataSource
(name=None, verbose=False)[source]¶ Bases:
object
Represents an external data 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]
-
-
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
-
ENDPOINT_DOMAINS
= {}[source]
-
MAX_HTTP_RETRIES
= 5[source]
-
download_request_backup
= None[source]¶ Call superclass constructor which will optionally load content
-
-
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
-
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 ofbase_model
- **kwargs (
dict
, optional) – attribute-value pairs of desired SQLAlchemy object of typecls
Returns: SQLAlchemy object of type
cls
Return type: - cls (
-
get_session
()[source]¶ Get a session for the database
Returns: database session Return type: sqlalchemy.orm.session.Session
-
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) – IfTrue
, restore data - restore_schema (
bool
, optional) – IfTrue
, clear and restore schema - exit_on_error (
bool
, optional) – IfTrue
, exit on errors
- restore_data (
-
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) – IfTrue
, restore data - restore_schema (
bool
, optional) – IfTrue
, clear and restore schema - exit_on_error (
bool
, optional) – IfTrue
, exit on errors
- restore_data (
-
-
class
datanator.core.data_source.
WebserviceDataSource
[source]¶ Bases:
datanator.core.data_source.DataSource
A data source that is a webservice
-
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]
-
dataset_id
[source]
-
subunit_id
[source]
-
-
class
datanator.core.models.
AbundanceDataSet
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalProperty
Represents a dataset for protein abundance
-
coverage
[source]
-
file_name
[source]
-
score
[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]
-
query_class
[source]¶ alias of
FullTextQuery
-
-
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]
-
query_class
[source]¶ alias of
FullTextQuery
-
-
class
datanator.core.models.
Characteristic
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
Represents the method of collection for a given entity or Property
-
class
datanator.core.models.
Concentration
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalProperty
Represents the concentration of an entity
-
error
[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]
-
growth_system
[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
-
dataset_id
[source]
-
frequency_a
[source]
-
frequency_c
[source]
-
frequency_g
[source]
-
frequency_t
[source]
-
jaspar_id
[source]
-
position
[source]
-
-
class
datanator.core.models.
DNABindingDataset
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalProperty
Represents a dataset for Transcription Factor Binding
-
complex_id
[source]
-
subunit_id
[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
-
bio_assay_data_cubes
[source]
-
name
[source]
-
-
class
datanator.core.models.
Experiment
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
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]
-
-
class
datanator.core.models.
ExperimentMetadata
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
db.Table representing Metadata identifiers for entities and properties
-
name
[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]
-
-
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 kineticsType: int
-
enzyme_id
[source]
-
-
class
datanator.core.models.
Metabolite
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalEntity
Represents a Metabolite - An instance of Physical Entity
-
comment = db.Column
Type: db.Unicode
-
_is_name_ambiguous = db.Column
Type: db.Boolean
-
description
[source]
-
metabolite_id
[source]
-
metabolite_name
[source]
-
query_class
[source]¶ alias of
FullTextQuery
-
-
class
datanator.core.models.
Metadata
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
db.Table representing Metadata identifiers for entities and properties
-
name
[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
-
comments
[source]
-
name
[source]
-
query_class
[source]¶ alias of
FullTextQuery
-
-
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]
-
-
class
datanator.core.models.
Parameter
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
Represents a parameter for a given kinetic law and metabolite
-
error
[source]
-
kinetic_law_id
[source]
-
metabolite_id
[source]
-
observed_error
[source]
-
observed_name
[source]
-
observed_sabio_type
[source]
-
observed_units
[source]
-
observed_value
[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
-
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
-
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]
-
-
class
datanator.core.models.
ProteinComplex
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalEntity
Represents a Protein Complex - An instance of Physical Entity
-
class_name
[source]
-
complex_cmt
[source]
-
complex_id
[source]
-
complex_name
[source]
-
disease_cmt
[source]
-
family_name
[source]
-
funcat_dsc
[source]
-
funcat_id
[source]
-
go_dsc
[source]
-
go_id
[source]
-
molecular_weight
[source]
-
query_class
[source]¶ alias of
FullTextQuery
-
su_cmt
[source]
-
-
class
datanator.core.models.
ProteinInteraction
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalProperty
Represents a protein-protein interaction
-
query_class
[source]¶ alias of
FullTextQuery
-
stoich_a
[source]
-
stoich_b
[source]
-
-
class
datanator.core.models.
ProteinSubunit
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalEntity
Represents a Protein Subunit - An instance of Physical Entity
-
class_name
[source]
-
coefficient
[source]
-
entrez_id
[source]
-
family_name
[source]
-
gene_name
[source]
-
gene_syn
[source]
-
molecular_weight
[source]
-
query_class
[source]¶ alias of
FullTextQuery
-
subunit_id
[source]
-
subunit_name
[source]
-
uniprot_id
[source]
-
-
class
datanator.core.models.
Reaction
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
Represents a reaction
-
coefficient
[source]
-
metabolite_id
[source]
-
rxn_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]
-
release_date
[source]
-
-
class
datanator.core.models.
Structure
(**kwargs)[source]¶ Bases:
datanator.core.models.PhysicalProperty
Represents a structure of a metabolite
-
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]
-
query_class
[source]¶ alias of
FullTextQuery
-
-
class
datanator.core.models.
Taxon
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
Represents the species of a given physical entity or property
-
name
[source]
-
ncbi_id
[source]
-
query_class
[source]¶ alias of
FullTextQuery
-
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
-
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.
-
-
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 nameReturns: 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
-
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_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 ofcls
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 objectReturns: instance of cls
hat has the property-values pairs described by kwargsReturn type: Base
-