Skip to content

Commit

Permalink
changed aa methods calculate_iep to isoelectric_point and calculate_c…
Browse files Browse the repository at this point in the history
…harge to charge for clarity.
  • Loading branch information
ggklf committed Jan 13, 2011
1 parent 26779ad commit c4da28b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/isoelectric_point/aa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 -
Expand Down

0 comments on commit c4da28b

Please sign in to comment.