Friday, December 27, 2013

FragBuilder: Installation

With the FragBuilder library out as a preprint from PeerJ and the library available at https://github.com/jensengroup/fragbuilder, I am going to make a couple of blog posts to get you started using FragBuilder. You can access the manual via the GitHub page linked above.

This post will guide you through the installation of the FragBuilder library.

Figure 1: Example of peptide model made using the Fragbuilder library



FragBuilder will run about every Linux distribution with a recent Python 2.x interpreter.

You need to havethree things installed before FragBuilder can run. Install of these can be found in the 2nd half of this post.
  1. NumPy
  2. Open Babel with Python bindings
  3. git (in order to get FragBuilder from GitHub)
To actually download FragBuilder you need to use git, as FragBuilder is stored and maintained through GitHub. To clone the latest version do this: 
$ git clone git://github.com/jensengroup/fragbuilder
This will download (clone) FragBuilder to a folder named "fragbuilder". There is nothing that needs to be compiled, so in principle, FragBuilder is now installed and works.

To actually be able to use FragBuilder from a Python script, you need to export the path to the FragBuilder library to your $PYTHONPATH. For instance, on my laptop, I do the export like this: 
\$ export PYTHONPATH=/home/andersx/dev/fragbuilder:\$PYTHONPATH 
Now you should be able to import FragBuilder from Python. You can copy this line into your ~/.bashrc file if you want don't want to export this every time you log in.

To test your installation fire up Python and import FragBuilder: 
$ python  

Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import fragbuilder
>>> print fragbuilder.__version__
1.0

>>> 
If you don't get any errors FragBuilder now works.



Installation of dependencies:

1) NumPy:


In most Linux distributions, NumPy is can be obtained through a package manager. The commands are usually.

For Ubuntu/Debian distributions:
sudo apt-get install python-numpy 
For Fedora/Red Hat distributions: 
su
yum install python-numpy
See this link, if you still have troubles installing NumPy: http://www.scipy.org/install.html


2) Open Babel with Python bindings:

In most Linux distributions, Open Babel is can be obtained through a package manager. The commands are usually.

For Ubuntu/Debian distributions: 
sudo apt-get install python-openbabel 
For Fedora/Red Hat distributions: 
su
yum install python-openbabel 
Optionally, you can compile and install Open Babel yourself. This may be required if you get a certain problem with setting dihedral angles to 180 degrees.
In older versions of Open Babel you are only allowed to set the dihedral angle to 179.96 degrees. I recently submitted a patch to fix this, but I don't know when the changes will go "live" onto repositories, etc.

I made a short guide here:
http://combichem.blogspot.dk/2013/12/compiling-open-babel-with-python.html

There is some extra stuff here from the Open Babel manual:
 http://openbabel.org/docs/dev/Installation/install.html


 3) Git:

Git is pretty much the program you use to download FragBuilder from GitHub. You can also use Git to submit patches back to the repository. Git also does a million other things, but you don't need to know more at this point.

In most Linux distributions, git is can be obtained through a package manager. The commands are usually.

For Ubuntu/Debian distributions:
sudo apt-get install git 
For Fedora/Red Hat distributions: 
su
yum install git

 I think that is all. If not, feel free to leave a message!


Saturday, December 21, 2013

Putting preprints on arXiv increases your h-index

... but it's not the only reason why you should do so. Let me explain!

My upcoming paper on amide proton chemical shifts in proteins was accepted on November 11 by PLOS ONE. The tentative publication date is December 31. Pretty goddamn, horribly slow if you you ask me.
Their only job at this point is to apply fancy formatting to a LaTeX document. This  apparently takes 7 flippin' weeks?

However, this is no problem (and enough rage). I have had a preprint available on arXiv since I submitted the first draft. Since then it has been peer reviewed and accepted, and I have uploaded the same version to arXiv as the one we have accepted in PLOS ONE

Today I was even cited by a paper in a "real" journal (Journal of  Chemical Theory and Computation) by the Ochsenfeld group in Munich. See here:

This might eventually increase my h-index, give me an edge when applying for money, etc. I am even waiting for a review on another of my papers in PeerJ which cites this very same paper on arXiv once more. My h-index might increase by TWO one because of this.

But the most important thing here is: The information I had freely available on arXiv before the entire cycle of waiting, peer review, waiting, acceptance, waiting, publishing was over had found it leverage another study.

This proves, that preprints are indeed useful. And of don't deposit preprints your are not only holding back everyone else, but also yourself. If a publisher doesn't allow preprints, tell them to change their policies or, alternatively, to continue their cooperating with the Devil.

In conclusion, be this Good Guy Greg:


Tuesday, December 10, 2013

Beautiful rendereing of small molecules in Pymol


Getting ready to submit a publication of my FragBuilder paper to PeerJ, I had to make several pictures of peptides and pictures to illustrate dihedral angles in the proteins. 

Personally, a little bit of me dies whenever I see a screenshot from GaussView in a publication. I used Pymol to make the ray-traced 3D models. One example is shown below, and I think it came out pretty great. Note that I added the torsion angles in LibreOffice Draw manually.





 The Pymol commands to  make the above figure are:

load my_molecule.xyz
color grey05, elem c
bg_color white
preset.ball_and_stick(selection='all', mode=1)
set ray_trace_mode, 4

Once you have oritented the molecule to the position you want in your picture, type in the console:

ray

Then export the resulting image to a .png file.

Happy Pymol'ing