Skip to content

Commit

Permalink
calculate charge and calculate_iep will be deplicated in the future t…
Browse files Browse the repository at this point in the history
…o support clarity
  • Loading branch information
ggklf committed Jan 7, 2011
1 parent 97c5a43 commit 26779ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/isoelectric_point/aa.rb
Expand Up @@ -12,6 +12,7 @@ def initialize(sequence)
# pka_name_or_set: the name of a PKA set or a custom PKA set
# 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)
loops = 0
ph = 7.5
Expand All @@ -32,6 +33,7 @@ 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')
['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]
Expand Down Expand Up @@ -81,4 +83,6 @@ def select_pka(pka_name_or_set = 'dtaselect')
end #select_pka
end #class AA
end #class Sequence
end #module Bio
end #module Bio
#include a new class Bio::AA::Index for Pkas? suggestes by tokiashiki katayama

0 comments on commit 26779ad

Please sign in to comment.