Question: Sequence Evolution Library In Java
gravatar for Rob
9.2 years ago by
United States
Rob3.7k wrote:


I'm writing a biological evolution simulator. Currently, all of my code is written in Python. For the most part, this is great and everything works sufficiently well. However, there are two steps in the process which take a long time and which I'd like to rewrite in Scala.

The first problem area is sequence evolution. Imagine you're given a phylogenetic tree which relates a large set of proteins. The length of each branch represents the evolutionary distance between the parent and child. The root of the tree is seeded with a single sequence, and then an evolutionary model (e.g. is used to evolve the sequence along the tree structure; taking into account the branch lengths. PyCogent takes a long time to perform this step, and I believe that a reasonable Java/Scala implementation would be significantly faster. Do you know of any libraries that implement this type of functionality. I want to write the application in Scala, so, due to interoperability, any Java library will suffice.

The second problem area is the comparison of the generated sequences. The problem is, given a set of sequences for the proteins in a number of different extant species, attempt to use the sequence to reconstruct the phylogenetic tree which relates the species. This problem is inherently computationally demanding, because one must basically do a pairwise comparison between all sequences in the extant species. Here again, however, I feel like a Java/Scala implementation would perform significantly faster than a Python one, if for nothing else than the unfortunately slow speed of looping in Python. This part I could write from scratch more easily than the sequence evolution part, but I'd be willing to use a library for it as well if a good one exists.

Thanks, Rob

model python java evolution • 2.7k views
ADD COMMENTlink written 9.2 years ago by Rob3.7k

For your second problem area, I wouldn't recommend trying to re-implement phylogenetic inference in java. It is so computationally intensive that generally this is done in C. I only know of one tool that does part of this in java, and that's treefinder (

ADD REPLYlink written 9.2 years ago by Rvosa570

I have never heard that loops are slow in python. Aren't you confusing it with R?

ADD REPLYlink written 9.1 years ago by Giovanni M Dall'Olio27k
gravatar for Botond Sipos
9.2 years ago by
Botond Sipos1.7k
United Kingdom
Botond Sipos1.7k wrote:

Check out the Phylogenetic Analysis Library.

ADD COMMENTlink written 9.2 years ago by Botond Sipos1.7k

Excellent! This library doesn't look like it has been updated in a while, but it seems to contain all of the functionality I need. I'll probably give it a try.

ADD REPLYlink written 9.2 years ago by Rob3.7k

My friend is using pal. He is very satisfied with that.

ADD REPLYlink written 8.2 years ago by lh332k
gravatar for Rvosa
9.2 years ago by
Leiden, the Netherlands
Rvosa570 wrote:

Check out JEBL:, which can roughly be seen as the successor to PAL, at least to the extent that some of the same people are involved (who seem to have abandoned PAL).

ADD COMMENTlink written 9.2 years ago by Rvosa570
gravatar for Jeremy Leipzig
9.2 years ago by
Philadelphia, PA
Jeremy Leipzig19k wrote:

I wouldn't be surprised to see improvements if the slowest elements of Pycogent were moved to c - seems like that group already has people like Daniel McDonald who know how to wrap c, since it looks like some of it is already in c:

find . | grep "\.c$"
ADD COMMENTlink modified 7 months ago by RamRS26k • written 9.2 years ago by Jeremy Leipzig19k

Yea, some parts of what I'm doing are clearly already in C, but others aren't quite there yet. I'll be sure to keep an eye out for library updates.

ADD REPLYlink written 9.2 years ago by Rob3.7k
gravatar for Audriusa
8.2 years ago by
Audriusa10 wrote:

There is an interesting Java - based package designed to model evolution of all kinds (JGap). It provides the good framework (chromosomes, selection, inheritance, evolution) and is normally used as a tool to solve various difficult problems by the method of simulated evolution. JGap also offers some interesting visualization tools. It is old, mature project with hundreds of downloads per week. I think I can surely recommend it.

ADD COMMENTlink written 8.2 years ago by Audriusa10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 832 users visited in the last hour