Class: Bio::Sequence::AA
- Inherits:
-
Object
- Object
- Bio::Sequence::AA
- Defined in:
- lib/bio/sequence/aa/hydropathy.rb
Instance Method Summary collapse
-
#grand_average_of_hydropathy ⇒ Object
(also: #gravy)
Sum of hydropathy values for each amino acid, divided by the length of the protein.
-
#hydrophopathy_profile ⇒ Object
Return an array of hydrophobicities, as defined by Kyte and Doolittle.
Instance Method Details
#grand_average_of_hydropathy ⇒ Object 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_profile ⇒ Object
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 |