Bio4j 0.7 Release Gains Cypher and Gremlin Support
Join the DZone community and get the full member experience.Join For Free
learn about the newest release of bio4j, which now includes aws instances from any region, a basic rest server, and support for cypher and gremlin.
i’m happy to announce that the version 0.7 of bio4j has been released. check out the wide set of new features, tools and improvements:
expasy enzyme database integration
from now on you have the whole enzyme db included in bio4j. for that, both a new node type and relationship type have been created:
(this relationship connects a protein and the respective enzyme nodes associated to it)
all properties found have been incorporated to the enzyme node including:
- official name
- alternate names
- catalytic activity
node type indexing
from now on, every node present in the database has a property nodetype including its type which has been indexed. that way you can now access all nodes belonging to an specific type really easily.
availability in all regions
the aws region you are based in won’t be a problem for using bio4j anymore. ebs snapshots have been created in all regions as well as cloudformation templates have been updated so that they can now be used regardless the region where you want to create the stack.
only asia pacific (singapore) ap-southeast-1 region is not ready due to ongoing issues from aws side regarding extremely slow s3 object downloading. hope we can find a work around for this soon!
new cloudformation templates
basic bio4j instance (updated)
the basic bio4j instance template has been updated so that now you
can use it from all zones. check out more info about this in the
updated blog post
basic bio4j rest server
a new template has been developed so that you can easily deploy your neo4j-bio4j rest server in less than a minute.
this template is available in the following address:
the steps you should follow to create the stack are really simple. actually, you can follow as a guide
this blog post
about the template i created for deploying a general neo4j server, –
only one or two parameters vary
bio4j rest server
once you get your server running thanks to the useful template i just mentioned before, using neo4j webadmin with bio4j as source you will be able to:
explore you database with the data browser
using the data browser tab of the web administration tool you can explore in real-time the contents of bio4j!
in order to get visualizations like the one shown above, you should make use of
there you can specify different styles associated to customizable rules
which can be expressed in terms of the node properties. here’s a
screenshot showing how the visualization profile i used for the
visualization above looks like:
just beware of one thing, the behavior of the tool is such that it does not distinguish between highly connected nodes and more isolated ones. because of this, clicking nodes such as trembl dataset node is not advisable unless you want to see it freeze forever - this node has more than 15 million relationships linking it to proteins .
run queries with cypher
cypher is a declarative language which allows for expressive and efficient querying of the graph store without having to write traversers in code. it focuses on the clarity of expressing what to retrieve from a graph, not how to do it , in contrast to imperative languages like java, and scripting languages like gremlin.
a query to retrieve protein interaction circuits of length 3 with proteins belonging to swiss-prot dataset (limited to 5 results) would look like this in cypher:
start d=node:dataset_name_index(dataset_name_index = "swiss-prot") match d <-[r:protein_dataset]- p, circuit = (p) -[:protein_protein_interaction]-> (p2) -[:protein_protein_interaction]-> (p3) -[:protein_protein_interaction]-> (p) return p.accession, p2.accession, p3.accession, p.accession limit 5
if you want to check out more examples of bio4j + cypher, check our bio4j cypher cheat sheet that we will be updating from time to time.
querying bio4j with gremlin
gremlins? what do they have to do with bio4j !?
gremlin is a graph traversal language that can be natively used in various jvm languages – it currently provides native support for java, groovy, and scala. however, it can express in a few lines of code what it would take many, many lines of code in java to express.
querying proteins associated to the interpro motif with id ‘ipr023306′ in bio4j with gremlin would look like this: (limited to 5 results)
gremlin> g.idx('interpro_id_index')[['interpro_id_index':'ipr023306']].ine('protein_interpro').outv.accession[0..4] ==> e2gk26 ==> g3pms4 ==> g3q865 ==> g3pil8 ==> g3nna4 gremlin>
if you want to check out more examples of bio4j + gremlin, check our bio4j gremlin cheat sheet that we will be updating from time to time.
- dataset nodes there was a bug in the importing process which resulted in the creation of a new dataset node everytime a new uniprot entry was stored. now everything’s fine!
so that’s all for now!
hope you enjoy all this changes and new features i’ve been working on in the last couple of months.
as always, feel free to give any feedback you may have, i’m looking forward to it
Opinions expressed by DZone contributors are their own.