class Bio::Sequence::AA

Public Instance Methods

grand_average_of_hydropathy() click to toggle source

Sum of hydropathy values for each amino acid, divided by the length of the protein

# File lib/bio/sequence/aa/hydropathy.rb, line 16
def grand_average_of_hydropathy
  hydrophopathy_profile.inject{|sum,x| sum + x }.to_f/seq.length
end
Also aliased as: gravy
gravy()
hydrophopathy_profile() click to toggle source

Return an array of hydrophobicities, as defined by Kyte and Doolittle

# File lib/bio/sequence/aa/hydropathy.rb, line 7
def hydrophopathy_profile
  profile = []
  seq.each_char do |letter|
    profile.push Bio::AminoAcid::Data::KYTE_DOOLITTLE_HYDROPATHY_SCALE[letter]
  end
  profile
end