4.1. datanator package

4.1.1. Subpackages

4.1.2. Submodules

4.1.3. datanator.__main__ module

Command line utilities

Author:Yosef Roth <yosefdroth@gmail.com>
Author:Jonathan Karr <jonrkarr@gmail.com>
Author:Saahith Pochiraju <saahith116@gmail.com>
Date:2017-04-12
Copyright:2017, Karr Lab
License:MIT
class datanator.__main__.AggregateBuildController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['--path'], {'type': <class 'str'>, 'default': '/root/.wc/data/datanator', 'help': 'path to build the database'}), (['--verbose'], {'type': <class 'bool'>, 'default': False, 'help': 'verbosity'}), (['--max-entries'], {'type': <class 'int'>, 'default': inf, 'help': 'number of normalized entries to add per database. Default: Full Database'}), (['--build-on-existing'], {'type': <class 'bool'>, 'default': False, 'help': 'load from existing database on karr lab server'}), (['--load-full-small-dbs'], {'type': <class 'bool'>, 'default': True, 'help': 'loads entire small database modules'})][source]
description = 'Builds Aggregated Database'[source]
help = 'Builds Aggregated Database'[source]
label = 'aggregate'[source]
stacked_on = 'build'[source]
stacked_type = 'nested'[source]
class datanator.__main__.App(label=None, **kw)[source]

Bases: cement.core.foundation.App

class Meta[source]

Bases: object

base_controller = 'base'[source]
handlers = [<class 'datanator.__main__.BaseController'>, <class 'datanator.__main__.UploadDataController'>, <class 'datanator.__main__.UploadReferenceGenome'>, <class 'datanator.__main__.UploadRNASeqExperiment'>, <class 'datanator.__main__.UploadData'>, <class 'datanator.__main__.DownloadController'>, <class 'datanator.__main__.BuildController'>, <class 'datanator.__main__.AggregateBuildController'>, <class 'datanator.__main__.GetDataController'>, <class 'datanator.__main__.GenerateTemplateController'>, <class 'datanator.__main__.GenerateRNASeqTemplate'>, <class 'datanator.__main__.TaxonomyController'>, <class 'datanator.__main__.TaxonomyGetRankController'>, <class 'datanator.__main__.TaxonomyGetParentsController'>, <class 'datanator.__main__.TaxonomyGetCommonAncestorController'>, <class 'datanator.__main__.TaxonomyGetDistanceToCommonAncestorController'>, <class 'datanator.__main__.TaxonomyGetDistanceToRoot'>, <class 'datanator.__main__.MoleculeController'>, <class 'datanator.__main__.MoleculeGetStructureController'>, <class 'datanator.__main__.MoleculeConvertStructureController'>, <class 'datanator.__main__.ReactionController'>, <class 'datanator.__main__.ReactionGetEcNumberController'>, <class 'datanator.__main__.DbController'>, <class 'datanator.__main__.DbRestoreController'>][source]
label = 'datanator'[source]
class datanator.__main__.BaseController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['-v', '--version'], {'action': 'version', 'version': '0.1.20'})][source]
description = 'Utilities for aggregating data for biochemical models'[source]
help = 'Utilities for aggregating data for biochemical models'[source]
label = 'base'[source]
class datanator.__main__.BuildController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['--max-entries'], {'type': <class 'int'>, 'default': inf, 'help': 'number of normalized entries to add per database. Default: Full Database'}), (['--path'], {'type': <class 'str'>, 'default': '/root/.wc/data/datanator', 'help': 'path to build the database'}), (['--clear-existing-content'], {'type': <class 'bool'>, 'default': False, 'help': 'clears existing content of the db if exists'}), (['--verbose'], {'type': <class 'bool'>, 'default': False, 'help': 'verbosity'})][source]
description = 'Build aggregated database'[source]
help = 'Build aggregated database'[source]
label = 'build'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
array_express()[source]
corum()[source]
ecmdb()[source]
intact()[source]
jaspar()[source]
pax()[source]
sabio()[source]
uniprot()[source]
class datanator.__main__.DbController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [][source]
description = 'Database management utilities'[source]
help = 'Database management utilities'[source]
label = 'db'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
create()[source]
drop()[source]
migrate()[source]
class datanator.__main__.DbRestoreController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['--do-not-restore-data'], {'dest': 'restore_data', 'action': 'store_false', 'help': 'If set, do not restore the data'}), (['--restore-schema'], {'dest': 'restore_schema', 'action': 'store_true', 'help': 'If set, restore the schema'}), (['--do-not-exit-on-error'], {'dest': 'exit_on_error', 'action': 'store_false', 'help': 'If set, do not exit on errors'})][source]
description = 'Restore the content of the Datanator database'[source]
help = 'Restore the content of the Datanator database'[source]
label = 'restore'[source]
stacked_on = 'db'[source]
stacked_type = 'nested'[source]
class datanator.__main__.DownloadController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['--path'], {'type': <class 'str'>, 'help': 'path to download the modules', 'default': '/root/.wc/data/datanator'})][source]
description = 'Download existing databases from Karr Lab Server'[source]
help = 'Download existing databases from Karr Lab Server'[source]
label = 'download'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
aggregate()[source]
array_express()[source]
corum()[source]
ecmdb()[source]
intact()[source]
jaspar()[source]
pax()[source]
sabio()[source]
uniprot()[source]
class datanator.__main__.GenerateRNASeqTemplate(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['directory_name'], {'type': <class 'str'>, 'help': 'path to save the directory'})][source]
description = 'Generate a folder with excel tables to upload rna-seq experiments'[source]
help = 'Generate a folder with excel tables to upload rna-seq experiments'[source]
label = 'generate-rna-seq-template'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.GenerateTemplateController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['filename'], {'type': <class 'str'>, 'help': 'path to save the Excel template'})][source]
description = 'Generate an Excel template for specifying which reactions to aggregate kinetic data about'[source]
help = 'Generate an Excel template for specifying which reactions to aggregate kinetic data about'[source]
label = 'generate-template'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.GetDataController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['input_file'], {'type': <class 'str'>, 'help': 'path to the input data spreadsheet (.xlsx)'}), (['output_file'], {'type': <class 'str'>, 'help': 'path to the output data spreadsheet (.xlsx)'}), (['--max-taxon-dist'], {'help': 'Maximum acceptable taxonomic distance', 'type': <class 'int'>, 'default': None}), (['--taxon-dist-scale'], {'help': 'Exponential constant for scoring taxonomic distance', 'type': <class 'float'>, 'default': nan}), (['--include-variants'], {'help': 'If set, include data from genetic variants', 'action': 'store_true', 'default': False}), (['--temperature'], {'help': 'Target temperature', 'type': <class 'float'>, 'default': 37.0}), (['--temperature-std'], {'help': 'Standard deviation for scoring temperatures', 'type': <class 'float'>, 'default': 1.0}), (['--ph'], {'help': 'Target pH', 'type': <class 'float'>, 'default': 7.5}), (['--ph-std'], {'help': 'Standard deviation for scoring pHs', 'type': <class 'float'>, 'default': 0.3})][source]
description = 'Get relevant data for a model of a taxon'[source]
help = 'Get relevant data for a model of a taxon'[source]
label = 'get-data'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.MoleculeController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [][source]
description = 'Molecule utilities'[source]
help = 'Molecule utilities'[source]
label = 'molecule'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.MoleculeConvertStructureController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['structure'], {'type': <class 'str'>, 'help': 'Structure in InChI, MOL, or canonical SMILES format'}), (['format'], {'type': <class 'str'>, 'help': 'Output format: inchi (InChI), mol (MOL), or can (canonical SMILES)'})][source]
description = 'Convert molecule structure'[source]
help = 'Convert molecule structure'[source]
label = 'convert-structure'[source]
stacked_on = 'molecule'[source]
stacked_type = 'nested'[source]
class datanator.__main__.MoleculeGetStructureController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['--by-name'], {'dest': 'by_name', 'action': 'store_true', 'default': True, 'help': 'If set, lookup structure by name'}), (['--by-id'], {'dest': 'by_name', 'action': 'store_false', 'default': True, 'help': 'If set, lookup structure by id'}), (['--namespace'], {'type': <class 'str'>, 'help': 'Namespace of id'}), (['name_or_id'], {'type': <class 'str'>, 'help': 'Name or id of the molecule'})][source]
description = 'Get the structure of a molecule by its name or id'[source]
help = 'Get the structure of a molecule by its name or id'[source]
label = 'get-structure'[source]
stacked_on = 'molecule'[source]
stacked_type = 'nested'[source]
class datanator.__main__.ReactionController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [][source]
description = 'Reaction utilities'[source]
help = 'Reaction utilities'[source]
label = 'reaction'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.ReactionGetEcNumberController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['reaction'], {'type': <class 'str'>, 'help': 'The reaction (e.g. {ATP(4-) + H2O --> ADP(3-) + PI(2-) + proton}, {inchi-atp + inchi-h2o --> inchi-adp + inchi-pi + inchi-h}), or {smiles-atp + smiles-h2o --> smiles-adp + smiles-pi + smiles-h})'})][source]
description = 'Use Ezyme to predict the EC number of a reaction'[source]
help = 'Use Ezyme to predict the EC number of a reaction'[source]
label = 'get-ec-number'[source]
stacked_on = 'reaction'[source]
stacked_type = 'nested'[source]
class datanator.__main__.TaxonomyController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [][source]
description = 'Taxonomy utilities'[source]
help = 'Taxonomy utilities'[source]
label = 'taxonomy'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.TaxonomyGetCommonAncestorController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['taxon_id_or_name_1'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"}), (['taxon_id_or_name_2'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"})][source]
description = 'Get the latest common ancestor between two taxa'[source]
help = 'Get the latest common ancestor between two taxa'[source]
label = 'get-common-ancestor'[source]
stacked_on = 'taxonomy'[source]
stacked_type = 'nested'[source]
class datanator.__main__.TaxonomyGetDistanceToCommonAncestorController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['taxon_id_or_name_1'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"}), (['taxon_id_or_name_2'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"})][source]
description = 'Get the distance to the latest common ancestor between two taxa'[source]
help = 'Get the distance to the latest common ancestor between two taxa'[source]
label = 'get-distance-to-common-ancestor'[source]
stacked_on = 'taxonomy'[source]
stacked_type = 'nested'[source]
class datanator.__main__.TaxonomyGetDistanceToRoot(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['taxon_id_or_name'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"})][source]
description = 'Get the distance to from a taxon to the root of the taxonomic tree'[source]
help = 'Get the distance to from a taxon to the root of the taxonomic tree'[source]
label = 'get-distance-to-root'[source]
stacked_on = 'taxonomy'[source]
stacked_type = 'nested'[source]
class datanator.__main__.TaxonomyGetParentsController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['taxon_id_or_name'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"})][source]
description = 'Get the parents of a taxon'[source]
help = 'Get the parents of a taxon'[source]
label = 'get-parents'[source]
stacked_on = 'taxonomy'[source]
stacked_type = 'nested'[source]
class datanator.__main__.TaxonomyGetRankController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['taxon_id_or_name'], {'type': <class 'str'>, 'help': "Taxon id or name (examples: 9606, 'Homo sapiens')"})][source]
description = 'Get the rank of a taxon'[source]
help = 'Get the rank of a taxon'[source]
label = 'get-rank'[source]
stacked_on = 'taxonomy'[source]
stacked_type = 'nested'[source]
class datanator.__main__.UploadData(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['data_type'], {'type': <class 'str'>, 'help': 'type of data to be uploaded'})][source]
description = 'Upload data from overall schema'[source]
help = 'Upload data from overall schema'[source]
label = 'general-data'[source]
stacked_on = 'upload'[source]
stacked_type = 'nested'[source]
class datanator.__main__.UploadDataController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [][source]
description = 'Upload reference genome into Datanator. The reference genome must be in Genbank or Ensembl format'[source]
help = 'Upload reference genome into Datanator. The reference genome must be in Genbank or Ensembl format'[source]
label = 'upload'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class datanator.__main__.UploadRNASeqExperiment(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['ref-genome-path'], {'type': <class 'str'>, 'help': 'path to reference genome', 'default': '/root/.wc/data/datanator'}), (['--db-path'], {'type': <class 'str'>, 'help': 'path to build the database', 'default': '/root/.wc/data/datanator'})][source]
description = 'Upload an RNA-seq experiment'[source]
help = 'Upload an RNA-seq experiment'[source]
label = 'rna-seq-experiment'[source]
stacked_on = 'upload'[source]
stacked_type = 'nested'[source]
class datanator.__main__.UploadReferenceGenome(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

class Meta[source]

Bases: object

arguments = [(['genome_path'], {'type': <class 'str'>, 'help': 'path to reference genome', 'default': '/root/.wc/data/datanator'}), (['--db-path'], {'type': <class 'str'>, 'help': 'path to build the database', 'default': '/root/.wc/data/datanator'})][source]
description = 'Upload a ref-seq genome'[source]
help = 'Upload a ref-seq genome'[source]
label = 'reference-genome'[source]
stacked_on = 'upload'[source]
stacked_type = 'nested'[source]
datanator.__main__.create_taxon(id_or_name)[source]

Create a taxon with NCBI id=:obj:id_or_name or name=:obj:id_or_name

Parameters:id_or_name (str) – NCBI id or name
Returns:taxon
Return type:taxonomy_util.Taxon
datanator.__main__.main()[source]

4.1.4. datanator.datanator module

Author:Yosef Roth <yosefdroth@gmail.com>
Author:Jonathan Karr <jonrkarr@gmail.com>
Date:2017-04-06
Copyright:2017, Karr Lab
License:MIT
class datanator.datanator.Datanator(max_taxon_dist=None, include_variants=False, min_temp=None, max_temp=None, min_ph=None, max_ph=None)[source]

Bases: object

max_taxon_dist[source]

maximum taxonomic distance from the target taxon to its latest common ancestor with the observed taxon

Type:float, optional
include_variants[source]

if True, include observations from mutants

Type:bool, optional
min_temp[source]

minimum observed temperature

Type:float, optional
max_temp[source]

maximum observed temperature

Type:float, optional
min_ph[source]

minimum observed pH

Type:float, optional
max_ph[source]

maximum observed pH

Type:float, optional
read_model(filename)[source]
Parameters:filename (str) – path to an Excel workbook which contains a list of reactions to find kinetic data for

4.1.5. datanator.io module

Utilities for reading and writing data to/from files

Author:Yosef Roth <yosefdroth@gmail.com>
Author:Jonathan Karr <jonrkarr@gmail.com>
Date:2017-04-14
Copyright:2017, Karr Lab
License:MIT
class datanator.io.InputReader[source]

Bases: object

parse_reaction_equation(equation, compartments, species)[source]

Parse a reaction equation, e.g.

  • [c]: ATP + H2O ==> ADP + PI + H
  • GLC[e] + ATP[c] + H2O[c] ==> GLC[c] + ADP[c] + PI[c] + H[c]
Parameters:
  • equation (str) – reaction equation
  • compartments (list of data_model.Compartment) – list of compartments
  • species (list of data_model.Specie) – list of species
Returns:

reaction

Return type:

data_model.Reaction

read_compartments(ws)[source]

Read compartments from an Excel worksheet

Parameters:ws (openpyxl.Worksheet) – worksheet
Returns:list of compartments
Return type:list of data_model.Compartment
read_genetics(ws)[source]

Read taxon from an Excel worksheet

Parameters:ws (openpyxl.Worksheet) – worksheet
Returns:taxon
Return type:data_model.Genetics
read_reactions(ws, compartments, species)[source]

Read reactions from an Excel worksheet

Parameters:
  • ws (openpyxl.Worksheet) – worksheet
  • compartments (list of data_model.Compartment) – list of compartments
  • species (list of data_model.Specie) – list of species
Returns:

list of reactions

Return type:

list of data_model.Reaction

read_species(ws)[source]

Read species from an Excel worksheet

Parameters:ws (openpyxl.Worksheet) – worksheet
Returns:list of species
Return type:list of data_model.Specie
run(filename)[source]

Read input data from an Excel workbook

Parameters:filename (str) – filename of Excel workbook
Returns:
  • data_model.Genetics: genetics
  • list of data_model.Compartment: list of compartments
  • list of data_model.Specie: list of species
  • list of data_model.Reaction: list of reactions
Return type:tuple
class datanator.io.ResultsWriter[source]

Bases: object

Save reaction kinetic data to an Excel workbook

classmethod run(taxon, reactions, filename)[source]

Save a list of reaction kinetic data to an Excel workbook or set of csv/tsv files

Parameters:
  • taxon (str) – taxon
  • reactions (list of datanator.datanator.SabioResult) – list of reactions and their kinetic data
  • filename (str) – filename to store the list reaction kinetic data
classmethod run2(taxon, reactions, filename)[source]

Save a list of reaction kinetic data to an Excel workbook or set of csv/tsv files

Parameters:
  • taxon (str) – taxon name
  • reactions (list of datanator.datanator.SabioResult) – list of reactions and their kinetic data
  • filename (str) – filename to store the list reaction kinetic data

4.1.6. Module contents

datanator.page_not_found(error)[source]
datanator.register_blueprints(app)[source]
datanator.unauthorized_page(error)[source]