34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/ms/isoelectric_calc.rb', line 34
def identify_potential_charges(str)
string = str.upcase
first = string[0]; last = string[-1]
puts string if first.nil? or last.nil?
begin
out = PepCharges.new(string, ResidueTable[first.to_sym][0], ResidueTable[last.to_sym][1], 0, 0, 0 ,0 ,0 ,0, 0, 0, 0, 0, 0)
rescue NoMethodError
abort string
end
string.chars.each do |letter|
case letter
when "Y"
out.y_num += 1
when "C"
out.c_num += 1
when "K"
out.k_num += 1
when "H"
out.h_num += 1
when "R"
out.r_num += 1
when "D"
out.d_num += 1
when "E"
out.e_num += 1
when "U"
out.u_num += 1
when "S", "T", "N", "Q"
out.polar_num += 1
when "A", "V", "I", "L", "M", "F", "W", "G", "P"
out.hydrophobic_num += 1
end
end
out
end
|