Class: Bio::Sequence::AA

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/sequence/aa/hydropathy.rb

Instance Method Summary collapse

Instance Method Details

#grand_average_of_hydropathyObject Also known as: gravy

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



16
17
18
# 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

#hydrophopathy_profileObject

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



7
8
9
10
11
12
13
# 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