9 our @EXPORT_OK = qw(hydrophobic_moment);
13 HPM - module to calculate hydrophobic moments of a peptide sequence
15 =head1 $moment = hydrophobic_moment($angle, @sequence)
17 Calculate the hydrophobic moment (Eisenberg et al.) of a series of amino acids in @sequence for angle $angle in degrees. This is 100 for alpha helices and between 160 and 180.
19 An example helix is: RIIRRIIRRIRRIIRRII which has a maximum at 100 degrees.
20 An example sheet is: ALALALALAL, with a maximum at between 160-180 degrees.
22 See Eisenberg et al., PNAS, 1984, v81, p140-144 for more details.
26 # Hydrophobic moments from Eisenberg et al., PNAS, 1984, v81, p140.
50 # Hydrophobic moments from EMBOSS 2.9.0 hmoment program. Gives similar graphs
51 # to the above moments.
81 sub deg2rad { $_[0] and return $_[0] * (3.141593 / 180) }
83 sub hydrophobic_moment {
84 my ($angle, @seq) = @_;
87 my ($sum_sin, $sum_cos) = (0, 0);
89 $sum_sin += ($moments{ $_ } * sin(deg2rad $tangle));
90 $sum_cos += ($moments{ $_ } * cos(deg2rad $tangle));
91 $tangle = ($tangle + $angle) % 360;
93 return sqrt($sum_sin * $sum_sin + $sum_cos * $sum_cos) / @seq;