NCATS-Tangerine/greent

Name: greent

Owner: NCATS Data Translator Project - Tangerine Team

Description: null

Created: 2017-06-26 19:20:11.0

Updated: 2017-11-06 16:20:14.0

Pushed: 2018-01-11 19:34:36.0

Homepage: null

Size: 456

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

GreenT

Autobuild

GreenT is a library of interfaces to biomedical and environmental data services.

Services

The data sources GreenT provides access to are highly heterogeneous in terms of technologies and data types. We have multiple kinds of graph databases, tabuar data, spatio-temporal environmental data, and machine learning models.

At the same time, we value presenting a coherent, usable interface to users.

So all of the services described below are available via

GreenT currently presents some data from the following services:

| API            | Technology | Provider |  Description                                             | | ——————-|————|————–|—————————————————————–| | ChemBio   | SPARQL | U-Indiana/RENCI| Chemical and biological data via chem2bio2rdf | | Exposures | OpenAPI | UNC-IE-RENCI | Environmental exposures modeled by CMAQ | | Clinical | OpenAPI | UNC-CDW | De-identified clinical data | | Endotype | OpenAPI | UNC-CDW-RENCI| Data driven disease classification / machine learning model | | Chemotext      | Neo4J     | UNC-ESHELMAN | Chemical and biological data via chem2bio2rdf   | | Pharos | OpenAPI | NIH | Drug / Gene / Disease information from the NIH | | OXO | REST API | EMBL-EBI | Identifier XRef service | | DiseaseOntology|OBO Ontology| UofM / IGS | Ontology of disease |

Developed at the University of North Carolina at Chapel Hill, the API provides a Python package, Python interface, and a GraphQL service.

Installation
tualenv)$ pip install greent
Running the GraphQL Server:
tualenv)$ python -m greent.app
Usage Example
THONPATH=$PWD/.. python rosetta.py
rs/scox/dev/venv/trans/lib/python3.6/site-packages/cachier/mongo_core.py:24: UserWarning: Cachier warning: pymongo was not found. MongoDB cores will not work.
achier warning: pymongo was not found. MongoDB cores will not work.")
nitializing async pharos
-10-23 11:00:42,627 rosetta.py get_translations DEBUG: Mapped types: ['NAME', 'mesh_disease_id', 'mesh_disease_name', 'pharos_disease_id', 'DOID'] : ['hetio_anatomy']
-10-23 11:00:42,627 rosetta.py get_translations DEBUG: Translation(obj: KNode(id=NAME:diabetes,type=D) type_a: NAME type_b: hetio_anatomy desc:  then:  response: '')
-10-23 11:00:42,627 rosetta.py get_translations DEBUG: Translation(obj: KNode(id=NAME:diabetes,type=D) type_a: mesh_disease_id type_b: hetio_anatomy desc:  then:  response: '')
-10-23 11:00:42,627 rosetta.py get_translations DEBUG: Translation(obj: KNode(id=NAME:diabetes,type=D) type_a: mesh_disease_name type_b: hetio_anatomy desc:  then:  response: '')
-10-23 11:00:42,627 rosetta.py get_translations DEBUG: Translation(obj: KNode(id=NAME:diabetes,type=D) type_a: pharos_disease_id type_b: hetio_anatomy desc:  then:  response: '')
-10-23 11:00:42,628 rosetta.py get_translations DEBUG: Translation(obj: KNode(id=NAME:diabetes,type=D) type_a: DOID type_b: hetio_anatomy desc:  then:  response: '')
-10-23 11:00:42,628 rosetta.py get_transitions DEBUG:   path: ['http://identifiers.org/string', 'http://identifiers.org/doid', 'http://identifiers.org/mesh/disease/id', 'http://identifiers.org/uniprot', 'http://identifier.org/hetio/anatomy']
-10-23 11:00:42,628 rosetta.py get_transitions DEBUG:   steps: [('http://identifiers.org/string', 'http://identifiers.org/doid'), ('http://identifiers.org/doid', 'http://identifiers.org/mesh/disease/id'), ('http://identifiers.org/mesh/disease/id', 'http://identifiers.org/uniprot'), ('http://identifiers.org/uniprot', 'http://identifier.org/hetio/anatomy')]
-10-23 11:00:42,628 rosetta.py get_transitions DEBUG:     trans: ('http://identifiers.org/string', 'http://identifiers.org/doid', {'data': {'op': 'tkba.name_to_doid'}})
-10-23 11:00:42,628 rosetta.py get_transitions DEBUG:     trans: ('http://identifiers.org/doid', 'http://identifiers.org/mesh/disease/id', {'data': {'op': 'disease_ontology.graph_doid_to_mesh'}})
-10-23 11:00:42,628 rosetta.py get_transitions DEBUG:     trans: ('http://identifiers.org/mesh/disease/id', 'http://identifiers.org/uniprot', {'data': {'op': 'chembio.graph_get_genes_by_disease'}})
-10-23 11:00:42,628 rosetta.py get_transitions DEBUG:     trans: ('http://identifiers.org/uniprot', 'http://identifier.org/hetio/anatomy', {'data': {'op': 'hetio.gene_to_anatomy'}})
-10-23 11:00:42,628 rosetta.py translate DEBUG:             invoke(cyc:1): tkba.name_to_doid(KNode(id=NAME:diabetes,type=D)) => 
-10-23 11:00:44,965 rosetta.py translate DEBUG:               response>: [(KEdge(edge_source=tkba,edge_type=queried), KNode(id=DOID:9744,type=D))]
-10-23 11:00:44,965 rosetta.py translate DEBUG:             invoke(cyc:1): disease_ontology.graph_doid_to_mesh(KNode(id=DOID:9744,type=D)) => 
-10-23 11:00:45,661 rosetta.py translate DEBUG:               response>: [(KEdge(edge_source=doid->mesh,edge_type=queried), KNode(id=MESH:D003922,type=D))]
-10-23 11:00:45,661 rosetta.py translate DEBUG:             invoke(cyc:1): chembio.graph_get_genes_by_disease(KNode(id=MESH:D003922,type=D)) => 
-10-23 11:00:46,846 rosetta.py translate DEBUG:               response>: [(KEdge(edge_source=c2b2r,edge_type=diseaseToGene), KNode(id=UNIPROT:AKR1B1,type=G)), (KEdge(edge_source=c2b2r...
-10-23 11:00:46,847 rosetta.py translate DEBUG:             invoke(cyc:1): hetio.gene_to_anatomy(KNode(id=UNIPROT:AKR1B1,type=G)) => 
-10-23 11:00:47,051 rosetta.py translate DEBUG:               response>: [(KEdge(edge_source=gene-anat,edge_type=queried), KNode(id=UBERON:0002390,type=A)), (KEdge(edge_source=gene-an...
-10-23 11:00:47,051 rosetta.py translate DEBUG:             invoke(cyc:2): hetio.gene_to_anatomy(KNode(id=UNIPROT:GMDS,type=G)) => 
-10-23 11:00:47,394 rosetta.py translate DEBUG:               response>: [(KEdge(edge_source=gene-anat,edge_type=queried), KNode(id=UBERON:0002048,type=A)), (KEdge(edge_source=gene-an...

By default, the constructor above will use the public GraphQL API instance hosted at RENCI:

s://stars-app.renci.org/greent/graphql

To use a development server instead, you can install the module and run:

on -m greent.app

Then use http://localhost:5000 as the URL for the GraphQL client.

Also, note that you can send arbitrary GraphQL queries to the client with syntax like this:

slator.query ({
query" : "<query_text>"
)

Constants for referring to vocabulary terms can be found in the greent.translator.Vocab module.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.