isoelectric_point 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,32 +1,39 @@
1
1
  = isoelectric_point
2
- A ruby class for calculating the isoelectric point of a protein. It's based on bioperl.
3
- It's currently beeing refactored to fit into bioruby.
2
+ The isoelectric point (pI), sometimes abbreviated to iep, is the pH at which a particular molecule or surface carries no net electrical charge.
4
3
 
5
- == PKA Sets
6
- The available pka sets are:
4
+ This library is a ruby implementation for calculating the iep of a protein, based on bioperl's approach.
5
+ It can be installed as a gem. It is currently been refactored to fit as a bioruby plugin.
6
+
7
+
8
+ == Supported PKA sets
9
+ Support for the following Pka sets is available
7
10
  * dta_select
8
11
  * emboss
9
12
  * rodwell
10
13
  * wikipedia
11
14
  * sillero
12
15
 
16
+ You can also create a custom Pka set as shown in the example
17
+
13
18
  == Installation
14
- gem install isoelectric_point
19
+ gem install 'bio'
20
+ gem install 'isoelectric_point'
15
21
 
16
22
  == Usage
23
+ require 'bio'
17
24
  require 'isoelectric_point'
18
- # Either prefix or include namespace
19
- include Bio::Sequence
20
- aa = AA.new("KKGFTCGELA")
25
+
26
+ protein_seq = Bio::Sequence::AA.new("KKGFTCGELA")
21
27
 
22
28
  #what is the protein charge at ph 14?
23
- charge = aa.calculate_charge_at(14)
29
+ charge = protein_seq.calculate_charge_at(14) #=>-2.999795857467562
30
+
31
+ #calculate the ph using dtaselect pka set and round off to 3 decimal places
24
32
 
25
- #calculate the ph using dtaselect and round off to 3 decimal places
26
- ph = aa.calculate_iep('dtaselect', 3)
33
+ isoelectric_point = protein_seq.calculate_iep('dtaselect', 3) #=>8.219
27
34
 
28
- # calculate the ph with a custom set
29
- custom = { "N_TERMINUS" => 8.1,
35
+ # calculate the iep ph with a custom set
36
+ custom_pka_set = { "N_TERMINUS" => 8.1,
30
37
  "K" => 10.1,
31
38
  "R" => 12.1,
32
39
  "H" => 6.4,
@@ -36,4 +43,11 @@ The available pka sets are:
36
43
  "C" => 8.33,
37
44
  "Y" => 9.5
38
45
  }
39
- ph = aa.calculate_iep(custom, 3)
46
+ iep_ph = protein_seq.calculate_iep(custom, 3) #=> 8.193
47
+
48
+
49
+ == Authors
50
+ George Githinji -- KEMRI-Wellcome Trust Research program (georgkam@gmail.com)
51
+ Pascal Betz -- Simplificator GmbH
52
+
53
+ Copyright (C) 2010 George Githinji
@@ -1,3 +1,5 @@
1
+ require 'bio'
2
+
1
3
  ['pka_data', 'extensions', 'aa'].each do |name|
2
4
  require File.join(File.dirname(__FILE__), 'isoelectric_point', name)
3
5
  end
@@ -1,6 +1,6 @@
1
1
  module Bio
2
- module Sequence
3
- class AA < String
2
+ class Sequence
3
+ class AA
4
4
  CHARGED_GROUPS = ['K', 'R', 'H', 'D', 'E', 'C', 'Y']
5
5
 
6
6
  def initialize(sequence)
@@ -74,11 +74,11 @@ module Bio
74
74
  if pka_name_or_set.is_a?(Hash)
75
75
  pka_name_or_set
76
76
  else
77
- set = PkaData::PKAS[pka_name_or_set]
77
+ set = Bio::Sequence::PkaData::PKAS[pka_name_or_set]
78
78
  raise ArgumentError.new("Set '#{pka_name_or_set}' is unknown. Please specify one of #{PkaData::PKAS.keys.join(', ')} or pass a custom set") unless set
79
79
  set
80
- end
81
- end
82
- end
83
- end
84
- end
80
+ end #if
81
+ end #select_pka
82
+ end #class AA
83
+ end #class Sequence
84
+ end #module Bio
@@ -1,6 +1,6 @@
1
1
  module Bio
2
- module Sequence
3
- module PkaData
2
+ class Sequence
3
+ class PkaData
4
4
  PKAS = {
5
5
  'dtaselect' => { 'N_TERMINUS' => 8.0,
6
6
  'K' => 10.0,
@@ -1,5 +1,6 @@
1
1
  require 'test_helper'
2
- include Bio::Sequence
2
+
3
+ # include Bio::Sequence
3
4
  class AATest < Test::Unit::TestCase
4
5
 
5
6
  context 'some known sequences' do
@@ -26,7 +27,7 @@ class AATest < Test::Unit::TestCase
26
27
  should 'calculate iep' do
27
28
  places = 2
28
29
  @known.each do |sequence, expected|
29
- actual = AA.new(sequence).calculate_iep('dtaselect', places)
30
+ actual = Bio::Sequence::AA.new(sequence).calculate_iep('dtaselect', places)
30
31
  assert_equal expected.round_to_places(places), actual, "Expected the iep to be #{expected} but was #{actual} for #{sequence}"
31
32
  end
32
33
  end
@@ -34,26 +35,26 @@ class AATest < Test::Unit::TestCase
34
35
 
35
36
  should "Raise if not sequence given" do
36
37
  assert_raise ArgumentError do
37
- AA.new(nil)
38
+ Bio::Sequence::AA.new(nil)
38
39
  end
39
40
  end
40
41
 
41
42
  should "Raise if empty sequence given" do
42
43
  assert_raise ArgumentError do
43
- AA.new(' ')
44
+ Bio::Sequence::AA.new(' ')
44
45
  end
45
46
  end
46
47
 
47
48
 
48
49
  should "Raise if unknown pks used" do
49
50
  assert_raise ArgumentError do
50
- AA.new('PG', 'youdontknowme')
51
+ Bio::Sequence::AA.new('PG', 'youdontknowme')
51
52
  end
52
53
  end
53
54
 
54
55
  context "a Sequence" do
55
56
  setup do
56
- @sequence = AA.new("PGAKAAAKKPKKAAG")
57
+ @sequence = Bio::Sequence::AA.new("PGAKAAAKKPKKAAG")
57
58
  end
58
59
 
59
60
  should "calculates the isolectric point to 0 places" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isoelectric_point
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - GeorgeG
@@ -48,7 +48,9 @@ dependencies:
48
48
  type: :development
49
49
  version_requirements: *id002
50
50
  description: Calculate the Isoelectric point
51
- email: info@simplificator.com
51
+ email:
52
+ - info@simplificator.com
53
+ - georgkam@gmail.com
52
54
  executables: []
53
55
 
54
56
  extensions: []
@@ -99,7 +101,7 @@ rubyforge_project:
99
101
  rubygems_version: 1.3.7
100
102
  signing_key:
101
103
  specification_version: 3
102
- summary: Calculate isoelectric point.
104
+ summary: Calculate the iso-electric point of a protein sequence.
103
105
  test_files:
104
106
  - test/aa_test.rb
105
107
  - test/extensions_test.rb