bio-isoelectric_point 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,14 +1,9 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use the gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
2
 
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
3
+ #development dependencies
8
4
  group :development do
9
- gem "shoulda", ">= 0"
10
- gem "bundler", "~> 1.0.0"
11
- gem "jeweler", "~> 1.5.1"
12
- gem "rcov", ">= 0"
13
- gem "bio", ">= 1.4.1"
5
+ gem "shoulda", "~> 2.11.3"
6
+ gem "bundler", "~> 1.1.rc.7"
7
+ gem "jeweler","~> 1.8.3"
8
+ gem "bio", ">= 1.4.2"
14
9
  end
data/README.rdoc CHANGED
@@ -2,17 +2,15 @@
2
2
 
3
3
  The isoelectric point (pI), sometimes abbreviated to iep, is the pH at which a particular molecule or surface carries no net electrical charge.
4
4
 
5
- This library is a ruby implementation for estimating the isoelectric point of a protein, based on the bioperl’s approach. It can be installed as a bioruby-plugin.
6
-
7
- Support for the following Pka sets is available
5
+ This library is a Ruby implementation for estimating the isoelectric point of a protein.
8
6
 
7
+ The following Pka sets are supported
9
8
  * dtaselect
10
9
  * emboss
11
10
  * rodwell
12
11
  * wikipedia
13
12
  * sillero
14
-
15
- You can also create a custom Pka set as shown in the example
13
+ *Custom Pka sets are also supported
16
14
 
17
15
  == Installation
18
16
 
@@ -23,43 +21,40 @@ You can also create a custom Pka set as shown in the example
23
21
  gem uninstall bio-isoelectric_point
24
22
 
25
23
  == Usage
26
-
27
- require 'bio-isoelectric_point'
28
-
29
- protein_seq = Bio::Sequence::AA.new("KKGFTCGELA")
30
-
31
- #what is the protein charge at ph 14?
32
- charge = protein_seq.charge_at(14) #=>-2.999795857467562
33
-
34
- #calculate the pH using dtaselect pka set and round off to 3 decimal places
35
- isoelectric_point = protein_seq.isoelectric_point('dtaselect', 3) #=>8.219
36
-
37
- # calculate the iep ph with a custom set
38
- custom_pka_set = { "N_TERMINUS" => 8.1,
39
- "K" => 10.1,
40
- "R" => 12.1,
41
- "H" => 6.4,
42
- "C_TERMINUS" => 3.15,
43
- "D" => 4.34,
44
- "E" => 4.33,
45
- "C" => 8.33,
46
- "Y" => 9.5
47
- }
48
- iep_ph = protein_seq.isoelectric_point(custom_pka_set, 3) #=> 8.193
49
-
24
+ require 'bio-isoelectric_point'
25
+
26
+ #create a protein sequence amino acid object
27
+ protein_seq = Bio::Sequence::AA.new("KKGFTCGELA")
28
+
29
+ #what is the protein charge at ph 14?
30
+ charge = protein_seq.charge_at(14) #=>-2.999795857467562
31
+
32
+ #calculate the pH using dtaselect pka set and round off to 3 decimal places
33
+ isoelectric_point = protein_seq.isoelectric_point('dtaselect', 3) #=>8.219
34
+
35
+ #calculate the iep ph with a custom set
36
+ custom_pka_set = { "N_TERMINUS" => 8.1,
37
+ "C_TERMINUS" => 3.15,
38
+ "K" => 10.1,
39
+ "R" => 12.1,
40
+ "H" => 6.4,
41
+ "D" => 4.34,
42
+ "E" => 4.33,
43
+ "C" => 8.33,
44
+ "Y" => 9.5
45
+ }
46
+ iep_ph = protein_seq.isoelectric_point(custom_pka_set, 3) #=> 8.193
50
47
 
51
48
  == Contributing to bio-isoelectric_point
52
49
 
53
50
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
54
51
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
55
- * Fork the project
56
52
  * Start a feature/bugfix branch
57
53
  * Commit and push until you are happy
58
54
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
59
55
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
60
56
 
61
57
  == Copyright
62
-
63
- Copyright (c)2011 George Githinji. See LICENSE.txt for
64
- further details.
58
+ Copyright (c)2011 George Githinji.
59
+ See LICENSE.txt for more details.
65
60
 
data/Rakefile CHANGED
@@ -29,20 +29,20 @@ Jeweler::RubygemsDotOrgTasks.new
29
29
  require 'rake/testtask'
30
30
  Rake::TestTask.new(:test) do |test|
31
31
  test.libs << 'lib' << 'test'
32
- test.pattern = 'test/**/test_*.rb'
32
+ test.pattern = 'test/**/*_test.rb'
33
33
  test.verbose = true
34
34
  end
35
35
 
36
- require 'rcov/rcovtask'
37
- Rcov::RcovTask.new do |test|
38
- test.libs << 'test'
39
- test.pattern = 'test/**/test_*.rb'
40
- test.verbose = true
41
- end
36
+ #require 'rcov/rcovtask'
37
+ #Rcov::RcovTask.new do |test|
38
+ #test.libs << 'test'
39
+ #test.pattern = 'test/**/test_*.rb'
40
+ #test.verbose = true
41
+ #end
42
42
 
43
43
  task :default => :test
44
44
 
45
- require 'rake/rdoctask'
45
+ require 'rdoc/task'
46
46
  Rake::RDocTask.new do |rdoc|
47
47
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
48
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{bio-isoelectric_point}
8
- s.version = "0.1.1"
7
+ s.name = "bio-isoelectric_point"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["George Githinji", "Pascal Betz"]
12
- s.date = %q{2011-01-30}
13
- s.description = %q{A bioruby plugin for calculating the isoelectric point of a protein }
14
- s.email = %q{georgkam@gmail.com}
12
+ s.date = "2012-02-25"
13
+ s.description = "A bioruby plugin for calculating the isoelectric point of a protein "
14
+ s.email = "georgkam@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
@@ -32,41 +32,31 @@ Gem::Specification.new do |s|
32
32
  "test/helper.rb",
33
33
  "test/test_bio-isoelectric_point.rb"
34
34
  ]
35
- s.homepage = %q{http://github.com/GeorgeG/bioruby-isoelectric_point}
35
+ s.homepage = "http://github.com/GeorgeG/bioruby-isoelectric_point"
36
36
  s.licenses = ["Ruby"]
37
37
  s.require_paths = ["lib"]
38
- s.rubygems_version = %q{1.3.7}
39
- s.summary = %q{A bioruby plugin for calculating the isoelectric point and the charge of a protein sequence.}
40
- s.test_files = [
41
- "test/aa_test.rb",
42
- "test/extensions_test.rb",
43
- "test/helper.rb",
44
- "test/test_bio-isoelectric_point.rb"
45
- ]
38
+ s.rubygems_version = "1.8.17"
39
+ s.summary = "A bioruby plugin for calculating the isoelectric point and the charge of a protein sequence."
46
40
 
47
41
  if s.respond_to? :specification_version then
48
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
42
  s.specification_version = 3
50
43
 
51
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
- s.add_development_dependency(%q<shoulda>, [">= 0"])
53
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
54
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
55
- s.add_development_dependency(%q<rcov>, [">= 0"])
56
- s.add_development_dependency(%q<bio>, [">= 1.4.1"])
45
+ s.add_development_dependency(%q<shoulda>, ["~> 2.11.3"])
46
+ s.add_development_dependency(%q<bundler>, ["~> 1.1.rc.7"])
47
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
48
+ s.add_development_dependency(%q<bio>, [">= 1.4.2"])
57
49
  else
58
- s.add_dependency(%q<shoulda>, [">= 0"])
59
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
- s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
61
- s.add_dependency(%q<rcov>, [">= 0"])
62
- s.add_dependency(%q<bio>, [">= 1.4.1"])
50
+ s.add_dependency(%q<shoulda>, ["~> 2.11.3"])
51
+ s.add_dependency(%q<bundler>, ["~> 1.1.rc.7"])
52
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
53
+ s.add_dependency(%q<bio>, [">= 1.4.2"])
63
54
  end
64
55
  else
65
- s.add_dependency(%q<shoulda>, [">= 0"])
66
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
67
- s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
68
- s.add_dependency(%q<rcov>, [">= 0"])
69
- s.add_dependency(%q<bio>, [">= 1.4.1"])
56
+ s.add_dependency(%q<shoulda>, ["~> 2.11.3"])
57
+ s.add_dependency(%q<bundler>, ["~> 1.1.rc.7"])
58
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
59
+ s.add_dependency(%q<bio>, [">= 1.4.2"])
70
60
  end
71
61
  end
72
62
 
@@ -1,10 +1,8 @@
1
1
  require 'bio'
2
-
3
2
  ['pka_data', 'extensions', 'aa'].each do |name|
4
3
  require File.join(File.expand_path(File.dirname(__FILE__)), 'isoelectric_point',"#{name}")
5
4
  end
6
5
 
7
-
8
6
  # protein_seq = Bio::Sequence::AA.new("KKGFTCGELA")
9
7
  #
10
8
  # #what is the protein charge at ph 14?
@@ -12,8 +10,6 @@ end
12
10
  #
13
11
  # #calculate the pH using dtaselect pka set and round off to 3 decimal places
14
12
  # isoelectric_point = protein_seq.isoelectric_point('dtaselect', 3) #=>8.219
15
- #
16
- # puts charge
17
- # puts isoelectric_point
18
13
  #
19
- #
14
+ # puts charge
15
+ # puts isoelectric_point:
@@ -12,7 +12,6 @@ module Bio
12
12
  # pka_name_or_set: the name of a PKA set or a custom PKA set
13
13
  # places: specify the number of decimal places the value should be rounded to.
14
14
  # loop_limit: how many iterations should be made to find the point. You should not need to tweak this.
15
- #TODO to be renamed to isoelectric_point to preserve clarity
16
15
  def isoelectric_point(pka_name_or_set = 'dtaselect', places = 2, loop_limit = 100)
17
16
  loops = 0
18
17
  ph = 7.5
@@ -33,7 +32,6 @@ module Bio
33
32
 
34
33
  # Calculate the charge of the sequence at a given ph
35
34
  # As a second argument you can pass the name of the PKA set or a custom PKA set
36
-
37
35
  def charge_at(ph, pka_name_or_set = 'dtaselect')
38
36
  ['K', 'R', 'H'].inject(partial_charge(select_pka(pka_name_or_set)['N_TERMINUS'], ph)) do |memo, item|
39
37
  memo += partial_charge(select_pka(pka_name_or_set)[item], ph) * charged_residue_frequencies[item]
@@ -67,7 +65,6 @@ module Bio
67
65
  end
68
66
  end
69
67
 
70
- #
71
68
  # Select a PKA set according to the name or supply a custom set.
72
69
  # Raises ArgumentError if the name can not be mapped to a Pka set.
73
70
  # If the argument is a String it is used as a key to lookup the set,
@@ -84,5 +81,3 @@ module Bio
84
81
  end #class AA
85
82
  end #class Sequence
86
83
  end #module Bio
87
- #include a new class Bio::AA::Index for Pkas? suggestes by tokiashiki katayama
88
-
@@ -1,6 +1,5 @@
1
1
  module Bio
2
2
  class Sequence
3
-
4
3
  #It would be better to have a class for pKa, compatible with Bio::AAindex indices.Bio::AAindex
5
4
  class PkaData
6
5
  PKAS = {
@@ -58,3 +57,5 @@ module Bio
58
57
  end
59
58
  end
60
59
  end
60
+ #Refactor this to a class Bio::AA::Index for Pkas? suggestion by Toshiaki Katayama
61
+
data/test/aa_test.rb CHANGED
@@ -1,10 +1,6 @@
1
-
2
- #require 'helper'
3
1
  require File.join(File.expand_path(File.dirname(__FILE__)),'helper')
4
2
 
5
- # include Bio::Sequence
6
3
  class AATest < Test::Unit::TestCase
7
-
8
4
  context 'some known sequences' do
9
5
  setup do
10
6
  # Values are taken from http://isoelectric.ovh.org/
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require File.join(File.expand_path(File.dirname(__FILE__)),'helper')
2
2
  class ExtensionsTest < Test::Unit::TestCase
3
3
  context 'float' do
4
4
  setup do
data/test/helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ #require 'rubygems'
2
2
  require 'bundler'
3
3
  begin
4
4
  Bundler.setup(:default, :development)
@@ -13,6 +13,3 @@ require 'shoulda'
13
13
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
14
  $LOAD_PATH.unshift(File.dirname(__FILE__))
15
15
  require 'bio-isoelectric_point'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,4 +1,4 @@
1
- require 'helper'
1
+ require File.join(File.expand_path(File.dirname(__FILE__)),'helper')
2
2
 
3
3
  class TestBioIsoelectricPoint < Test::Unit::TestCase
4
4
 
metadata CHANGED
@@ -1,104 +1,69 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: bio-isoelectric_point
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 1
9
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - George Githinji
13
9
  - Pascal Betz
14
10
  autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
-
18
- date: 2011-01-30 00:00:00 +03:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2012-02-25 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: shoulda
23
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2156641380 !ruby/object:Gem::Requirement
24
18
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 2.11.3
31
23
  type: :development
32
24
  prerelease: false
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *2156641380
26
+ - !ruby/object:Gem::Dependency
35
27
  name: bundler
36
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ requirement: &2156640700 !ruby/object:Gem::Requirement
37
29
  none: false
38
- requirements:
30
+ requirements:
39
31
  - - ~>
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 1
43
- - 0
44
- - 0
45
- version: 1.0.0
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.rc.7
46
34
  type: :development
47
35
  prerelease: false
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *2156640700
37
+ - !ruby/object:Gem::Dependency
50
38
  name: jeweler
51
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ requirement: &2156640180 !ruby/object:Gem::Requirement
52
40
  none: false
53
- requirements:
41
+ requirements:
54
42
  - - ~>
55
- - !ruby/object:Gem::Version
56
- segments:
57
- - 1
58
- - 5
59
- - 1
60
- version: 1.5.1
61
- type: :development
62
- prerelease: false
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: rcov
66
- requirement: &id004 !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- segments:
72
- - 0
73
- version: "0"
43
+ - !ruby/object:Gem::Version
44
+ version: 1.8.3
74
45
  type: :development
75
46
  prerelease: false
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *2156640180
48
+ - !ruby/object:Gem::Dependency
78
49
  name: bio
79
- requirement: &id005 !ruby/object:Gem::Requirement
50
+ requirement: &2156639700 !ruby/object:Gem::Requirement
80
51
  none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- segments:
85
- - 1
86
- - 4
87
- - 1
88
- version: 1.4.1
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 1.4.2
89
56
  type: :development
90
57
  prerelease: false
91
- version_requirements: *id005
92
- description: "A bioruby plugin for calculating the isoelectric point of a protein "
58
+ version_requirements: *2156639700
59
+ description: ! 'A bioruby plugin for calculating the isoelectric point of a protein '
93
60
  email: georgkam@gmail.com
94
61
  executables: []
95
-
96
62
  extensions: []
97
-
98
- extra_rdoc_files:
63
+ extra_rdoc_files:
99
64
  - LICENSE.txt
100
65
  - README.rdoc
101
- files:
66
+ files:
102
67
  - Gemfile
103
68
  - LICENSE.txt
104
69
  - README.rdoc
@@ -113,41 +78,33 @@ files:
113
78
  - test/extensions_test.rb
114
79
  - test/helper.rb
115
80
  - test/test_bio-isoelectric_point.rb
116
- has_rdoc: true
117
81
  homepage: http://github.com/GeorgeG/bioruby-isoelectric_point
118
- licenses:
82
+ licenses:
119
83
  - Ruby
120
84
  post_install_message:
121
85
  rdoc_options: []
122
-
123
- require_paths:
86
+ require_paths:
124
87
  - lib
125
- required_ruby_version: !ruby/object:Gem::Requirement
88
+ required_ruby_version: !ruby/object:Gem::Requirement
126
89
  none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- hash: -1228718005813956698
131
- segments:
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ segments:
132
95
  - 0
133
- version: "0"
134
- required_rubygems_version: !ruby/object:Gem::Requirement
96
+ hash: -602066681349865312
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
98
  none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- segments:
140
- - 0
141
- version: "0"
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
142
103
  requirements: []
143
-
144
104
  rubyforge_project:
145
- rubygems_version: 1.3.7
105
+ rubygems_version: 1.8.17
146
106
  signing_key:
147
107
  specification_version: 3
148
- summary: A bioruby plugin for calculating the isoelectric point and the charge of a protein sequence.
149
- test_files:
150
- - test/aa_test.rb
151
- - test/extensions_test.rb
152
- - test/helper.rb
153
- - test/test_bio-isoelectric_point.rb
108
+ summary: A bioruby plugin for calculating the isoelectric point and the charge of
109
+ a protein sequence.
110
+ test_files: []