Browse files

changed aa methods calculate_iep to isoelectric_point and calculate_c…

…harge to charge for clarity.
  • Loading branch information...
1 parent 26779ad commit c4da28bf5f233434ea3c429bf5cf6b20e67be2cf @georgeG committed Jan 13, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/isoelectric_point/aa.rb
View
8 lib/isoelectric_point/aa.rb
@@ -13,12 +13,12 @@ def initialize(sequence)
# places: specify the number of decimal places the value should be rounded to.
# loop_limit: how many iterations should be made to find the point. You should not need to tweak this.
#TODO to be renamed to isoelectric_point to preserve clarity
- def calculate_iep(pka_name_or_set = 'dtaselect', places = 2, loop_limit = 100)
+ def isoelectric_point(pka_name_or_set = 'dtaselect', places = 2, loop_limit = 100)
loops = 0
ph = 7.5
step = 3.5
begin
- current_charge = calculate_charge_at(ph, pka_name_or_set)
+ current_charge = charge_at(ph, pka_name_or_set)
if current_charge > 0
ph += step
else
@@ -33,8 +33,8 @@ def calculate_iep(pka_name_or_set = 'dtaselect', places = 2, loop_limit = 100)
# Calculate the charge of the sequence at a given ph
# As a second argument you can pass the name of the PKA set or a custom PKA set
- #To be renamed to charge at to preserve clarity
- def calculate_charge_at(ph, pka_name_or_set = 'dtaselect')
+
+ def charge_at(ph, pka_name_or_set = 'dtaselect')
['K', 'R', 'H'].inject(partial_charge(select_pka(pka_name_or_set)['N_TERMINUS'], ph)) do |memo, item|
memo += partial_charge(select_pka(pka_name_or_set)[item], ph) * charged_residue_frequencies[item]
end -

0 comments on commit c4da28b

Please sign in to comment.