My first Bioruby plugin calculates the isoelectric point of a protein

Late last year,  there was a lot of talk about creating a plugin system for Bioruby. The idea is that more people can start to develop bioinformatics libraries using the Ruby language and the libraries can leverage on the bioruby framework. Bioruby maintainers can then concentrate on yet to be defined “core” parts of the library to ensure compatibility and support for the plugins.Together with Pascal Bentz we have created a library to calculate the Isoelectric point of a protein given a Pka set and an  amino acid sequence of a peptide/protein. The project lay domant for a while at github until now! I am happy to release my first bioruby plugin, bio-isoelectric point! Download it at Fork it and check the usage at github


require 'bio'
require 'bio-isoelectric_point'
protein_seq ="KKGFTCGELA")

#what is the protein charge at ph 14?
charge = protein_seq.charge_at(14) #=>-2.999795857467562

#calculate the ph using dtaselect pka set and round off to 3 decimal places
isoelectric_point = protein_seq.isoelectric_point(‘dtaselect’, 3) #=>8.219

# calculate the isoelectric point pH with a custom set
custom_pka_set = { “N_TERMINUS” => 8.1,
“K” => 10.1,
“R” => 12.1,
“H” => 6.4,
“C_TERMINUS” => 3.15,
“D” => 4.34,
“E” => 4.33,
“C” => 8.33,
“Y” => 9.5
iep_ph = protein_seq.isoelectric_point(custom_pka_set, 3) #=> 8.193

This gem supports the following Pka sets, as well as allowing a user to provide a custom Pka set.

    * dta_select
    * emboss
    * rodwell
    * wikipedia
    * sillero

Happy biology!



  1. Raoul Bonnal

    New soil for our ecosystem :-)

    I would do in this way:
    require Gem.available?(“bioruby”) ? ‘bioruby’ : ‘bio’

  2. Toshiaki Katayama

    Good job!

    1. require ‘bioruby’ –> require ‘bio’

    Gem package name of the BioRuby is ‘bio’, not ‘bioruby’ (also, please fix the indentation of “require” lines).

    2. protein_seq.calculate_charge_at(14) –> protein_seq.charge_at_ph(14)

    For short and clarity (it is obvious that the method will do some calculation, but it is not clear that this method will return the charge at a sequence position or at a pH etc. ;-).

    3. protein_seq.calculate_iep(‘dtaselect’, 3) –> protein_seq. isoelectric_point(‘dta_select’, 3)

    Reversely, the acronym ‘iep’ might be too short. Defined name ‘dtaselect’ should be identical with the document ‘dta_select’. It would be better to have a class for pKa, compatible with Bio::AAindex indices.


  3. George

    The code in this blog post was posted a year ago and I had not updated the post. for more accurate update please follow the github repo README.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s