Skip to content

Commit

Permalink
Add neo4j nomencalture mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Apr 18, 2016
1 parent f082995 commit 31e6cb3
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
4 changes: 4 additions & 0 deletions hetnet/neo4j/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`hetionet-v1.0.db.tar.bz2` is a bzip2-compressed tarball of a Neo4j database. The database was build under Neo4j 2.3.3 Community Edition.

## Nomenclature

The Neo4j graph uses slightly different names for metanodes (Neo4j labels) and metaedges (Neo4j relationship types). See [`labels.tsv`](labels.tsv) for the node type mapping and [`types.tsv`](types.tsv) for the edge type mapping. We conform to the Neo4j style of CamelCase labels and ALL_CAPS relationship types. In addition, Neo4j relationship types are appended with metaedge standard abbreviations. This adds source/target metanode awareness to relationship types and [enables](https://thinklab.com/discussion/using-the-neo4j-graph-database-for-hetnets/112#6 "Query Optimization · Using the neo4j graph database for hetnets · Thinklab Discussion in Project Rephetio") optimized queries.

## Neo4j setup instructions

Download and extract Neo4j 2.3 Community Edition [from Neo4j](http://neo4j.com/download/other-releases/ "Neo4j Releases"). Navigate to the `data` directory inside the Neo4j directory and run:
Expand Down
12 changes: 12 additions & 0 deletions hetnet/neo4j/labels.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
metanode abbreviation label
Anatomy A Anatomy
Biological Process BP BiologicalProcess
Cellular Component CC CellularComponent
Compound C Compound
Disease D Disease
Gene G Gene
Molecular Function MF MolecularFunction
Pathway PW Pathway
Pharmacologic Class PC PharmacologicClass
Side Effect SE SideEffect
Symptom S Symptom
25 changes: 25 additions & 0 deletions hetnet/neo4j/types.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
metaedge rel_type direction
Anatomy - downregulates - Gene DOWNREGULATES_AdG both
Anatomy - expresses - Gene EXPRESSES_AeG both
Anatomy - upregulates - Gene UPREGULATES_AuG both
Compound - binds - Gene BINDS_CbG both
Compound - causes - Side Effect CAUSES_CcSE both
Compound - downregulates - Gene DOWNREGULATES_CdG both
Compound - palliates - Disease PALLIATES_CpD both
Compound - resembles - Compound RESEMBLES_CrC both
Compound - treats - Disease TREATS_CtD both
Compound - upregulates - Gene UPREGULATES_CuG both
Disease - associates - Gene ASSOCIATES_DaG both
Disease - downregulates - Gene DOWNREGULATES_DdG both
Disease - localizes - Anatomy LOCALIZES_DlA both
Disease - presents - Symptom PRESENTS_DpS both
Disease - resembles - Disease RESEMBLES_DrD both
Disease - upregulates - Gene UPREGULATES_DuG both
Gene - covaries - Gene COVARIES_GcG both
Gene - interacts - Gene INTERACTS_GiG both
Gene - participates - Biological Process PARTICIPATES_GpBP both
Gene - participates - Cellular Component PARTICIPATES_GpCC both
Gene - participates - Molecular Function PARTICIPATES_GpMF both
Gene - participates - Pathway PARTICIPATES_GpPW both
Gene > regulates > Gene REGULATES_GrG forward
Pharmacologic Class - includes - Compound INCLUDES_PCiC both
10 changes: 7 additions & 3 deletions import.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"outputs": [],
"source": [
"# dhimmel/integrate commit\n",
"commit = '470bd40e6ac763f7690f55818ed21afbaf73163b'\n",
"commit = 'ffd1a48b4051c41fc8cef6e8847d0687f1a722bc'\n",
"\n",
"# Name and version for hetionet\n",
"name = 'hetionet-v1.0'"
Expand Down Expand Up @@ -68,6 +68,10 @@
" 'data/summary/metaedge-styles.tsv': 'describe/edges/metaedge-styles.tsv',\n",
" 'data/summary/degrees.xlsx': 'describe/degree/degrees.xlsx',\n",
" 'viz/degrees.pdf': 'describe/degree/degrees.pdf',\n",
"\n",
" # Neo4j nomencalture mappings\n",
" 'neo4j/nomenclature/labels.tsv': 'hetnet/neo4j/labels.tsv',\n",
" 'neo4j/nomenclature/types.tsv': 'hetnet/neo4j/types.tsv',\n",
"}"
]
},
Expand All @@ -81,8 +85,8 @@
"source": [
"for integrate_path, hetionet_path in integrate_to_hetionet.items():\n",
" url = 'https://github.com/dhimmel/integrate/raw/{}/{}'.format(commit, integrate_path)\n",
"# if os.path.exists(hetionet_path):\n",
"# continue\n",
" if os.path.exists(hetionet_path):\n",
" continue\n",
" urllib.request.urlretrieve(url, filename=hetionet_path)"
]
},
Expand Down

0 comments on commit 31e6cb3

Please sign in to comment.