1 package HMMER::Profile;
6 use base qw(Root Read Write);
13 my ($flag, @data) = 0;
14 while (my $line = <$fh>) {
15 $flag = 1, next if $line =~ /^Cons/;
17 next if $line =~ /^! \d+/;
18 last if $line =~ /^ \*/;
22 #$self->seq($self->seq, [ (split / +/, $line)[1..24] ]);
24 $self->add_line((split /\s+/, $line)[1..24]);
30 for ($self->get_line) {
31 print join(" ", @{ $_}) , "\n";
33 #print join(" ", map { @{ $_ }), "\n";
34 print $fh join(" ", map { sprintf "%.5f", $_ } @{ $_ }), "\n";
40 @_ or croak "No data passed to HMMER::Profile::add_line";
41 push @{ $self->{__PACKAGE__."lines"} }, pack "d*", @_;
45 my ($self, $line) = @_;
47 if (defined $line) { return [ unpack "d*", ${$self->{__PACKAGE__."lines"}}[$line] ] }
49 return map { [ unpack "d*", $_ ] } @{$self->{__PACKAGE__."lines"}}
58 HMMER::Profile - Convert the output of hmmconvert to a profile for Jnet
62 system("hmmconvert -p hmmer.model hmmer.prf");
64 my $prof = HMMER::Profile->new;
65 $prof->read_file("hmmer.prf");
67 my @data = $prof->jnet
68 print join(" ", @{$_}), "\n" for @data;
72 Takes the output of the HMMER program hmmconvert with the -p option and calculates the profile used by Jpred to calculate secondary structure.
76 =head2 my $prof = HMMER::Profile->new;
80 =head2 $prof->read_file("path_to_hmmer_model_converted_to_prf");
82 Read a HMMER model that's been converted to PRF format via the HMMER hmmconvert program with the -p option.
84 =head2 my @data = $prof->seq
86 Returns an array of array refs of the HMMER numbers.
88 =head2 my @data = $prof->jnet
90 Returns an array of array refs of frequences for use in Jnet.
94 Packages Root, Read and Sequence.
98 The whole set of profile modules is a bit of an abortion now, as there is no standard interface and the methods do different things for different objects. Converting the different representations is a nightmare because of this.
102 Jonathan Barber <jon@compbio.dundee.ac.uk>