Installing and using a neo4j server on a CentOS server

First of all, if you have weird errors while trying to install neo4j server on a machine running under CentOS, it looks like you are trying to perform installation from a folder within your $HOME directory. Which the newly created neo4j user (if you do a default installation) won’t be able to access. In order to avoid it, unpack the neo4j-community-x.x.x package to the /opt/ directory and

You will also need to install the Oracle Java to support the neo4j installation. A good explanation of how to do it can be found on the ubuntu stack overflow. To sum up:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Only install oracle java as default if you don’t have other programs relying on the

If you meet the “java heap out of space error”, what you have to do is to go to the $NEO4J_HOME directorty (where you’ve installed the neo4j files), then to config and then in the neo4j-wrapper.conf file edit the following lines:

wrapper.java.initmemory = 64
wrapper.java.maxmemory = 512 (increase to 1-4 Gb if you have >4Gb of RAM)

Installing 2.7 parallel python stack + a couple of modules under CentOS 6

On CentOS 5 and 6 you unfortunately cannot install a newer version of python instead of the default one, because the package controller “yum” depends on it. The only way to go is to make an altinstall. The following article describes it really well:

http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/

in order to make python2.7 command available to the root now (typically for the module installation), add python2.7 to root’s path:

PATH=$PATH:/usr/local/bin
export PATH

Now you can safely install all the fancy python modules you want. Well, almost all.

Building Scipy with alternative install of Python isn’t really a piece of cake neither, since it requires to first install LAPACK, ATLAS and BLAS packages, which is not completely direct for complete newcomers. This tutorial explains well how to do it exactly:

http://www.shocksolution.com/2011/08/how-to-build-scippy-with-python-2-7-2-on-centos5/

Btw, once you’ve installed all the modules listed in the link above, you can just do

sudo pip install scipy

and wait until it finishes compiling.

Enjoy!

Mastering Groovy

So, since I want to work with neo4j through bulbs, it seems that I have no other option but to use Groovy Gremlin.

Installation of groovy on Eclipse: through marketplace. Quite easy.

First attempt to use: install gremlin from Tinkerpop and access it from Groovy programming shell in eclipse. After about an hour of furious googling, it seems that a couple of libraries need to be included in the groovy shell to launch the gremlin from within groovy:

gremlin$ groovysh -cp $GREMLIN_HOME/lib/gremlin-groovy-2.3.0.jar:$GREMLIN_HOME/lib/gremlin-java-2.3.0.jar:$GREMLIN_HOME/lib/pipes-2.3.0.jar:$GREMLIN_HOME/lib/common-1.7.jar:$GREMLIN_HOME/lib/groovy-1.8.9.jar

To do the same thing from Eclipse, Project>Properties>JavaBuild Path>Add External Jars and then add:

  • $GREMLIN_HOME/lib/gremlin-groovy-2.3.0.jar
  • $GREMLIN_HOME/lib/gremlin-java-2.3.0.jar
  • $GREMLIN_HOME/lib/pipes-2.3.0.jar
  • $GREMLIN_HOME/lib/common-1.7.jar
  • $GREMLIN_HOME/lib/groovy-1.8.9.jar
  • A couple of concepts of efficient programming

    As I am trying to use python to build a rather large software solution for use in bioinformatics, I am slowly realizing that there are lots of concepts I really need, that were never taught in my CS courses. Among them:

    Python – D3.js integration

    Python provides a pretty coomon framework for biological data analysis. And D3.js is one of the most coomon plateforms for the visualisation of large massifs of data. So I have been looking for a way to make them work together. This post gives a pretty decent introduction to the d3.js visualisation for people totally unfamiliar with javascript. It also suggests a possible interfacting of d3.js with pyhton via a javascript pseudo-library for that is to be wrtitten to the root folder containing the html page in JSON format.

    An alternative approach is to is to send the JSON directly to a webpage javascript via the python build-in server, but this requires a little bit more work. In any case I will be looking more in depth at it shortly

    http://blog.nextgenetics.net/?e=7

    Update1: I tried to follow the path suggested in the link, it didn’t quite work for me

    Update2: And as usual, the problem was not with the tutorial but with chair-keyboard interface on the users side: I put d3.min.js library in a folder my server had no permission to go, so it didn’t  get loaded and the script didn’t get executed. Using instead the following snippet to import the d3.min.js library works perfectly fine:

    <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>r