1 # BioPerl module for Bio::Tools::Hmmpfam
3 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 # Cared for by Balamurugan Kumarasamy
7 # You may distribute this module under the same terms as perl itself
8 # POD documentation - main docs before the code
13 Bio::Tools::Hmmpfam - Parser for Hmmpfam program
17 use Bio::Tools::Hmmpfam;
19 my $hmmpfam_parser = Bio::Tools::Hmmpfam->new(-fh =>$filehandle );
20 while( my $hmmpfam_feat = $hmmpfam_parser->next_result ) {
21 push @hmmpfam_feat, $hmmpfam_feat;
26 Parser for Hmmpfam program. See also L<Bio::SearchIO::hmmer>.
32 User feedback is an integral part of the evolution of this and other
33 Bioperl modules. Send your comments and suggestions preferably to
34 the Bioperl mailing list. Your participation is much appreciated.
36 bioperl-l@bioperl.org - General discussion
37 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
41 Please direct usage questions or support issues to the mailing list:
43 I<bioperl-l@bioperl.org>
45 rather than to the module maintainer directly. Many experienced and
46 reponsive experts will be able look at the problem and quickly
47 address it. Please include a thorough description of the problem
48 with code and data examples if at all possible.
52 Report bugs to the Bioperl bug tracking system to help us keep track
53 of the bugs and their resolution. Bug reports can be submitted via the
56 https://github.com/bioperl/bioperl-live/issues
58 =head1 AUTHOR - Balamurugan Kumarasamy
60 Email: fugui@worf.fugu-sg.org
64 The rest of the documentation details each of the object methods.
65 Internal methods are usually preceded with a _
70 package Bio
::Tools
::Hmmpfam
;
73 use Bio
::SeqFeature
::FeaturePair
;
74 use Bio
::SeqFeature
::Generic
;
75 use base
qw(Bio::Root::Root Bio::Root::IO);
82 Usage : my $obj = Bio::Tools::Hmmpfam->new(-fh=>$filehandle);
83 Function: Builds a new Bio::Tools::Hmmpfam object
84 Returns : Bio::Tools::Hmmpfam
91 my($class,@args) = @_;
93 my $self = $class->SUPER::new
(@args);
94 $self->_initialize_io(@args);
103 Usage : my $feat = $hmmpfam_parser->next_result
104 Function: Get the next result set from parser data
105 Returns : L<Bio::SeqFeature::Generic>
117 while ($_=$self->_readline()) {
121 if ( $line=~m/^Alignments of top-scoring domains/ ) {
122 while( my $rest = $self->_readline() ) { last if $rest =~ m!^//! }
125 next if ($line=~m/^Model/ || /^\-/ || /^$/);
127 if ($line=~m/^Query sequence:\s+(\S+)/) {
132 if (my ($hid, $start, $end, $hstart, $hend, $score, $evalue) = $line=~m/^(\S+)\s+\S+\s+(\d+)\s+(\d+)\s+\S+\s+(\d+)\s+(\d+)\s+\S+\s+(\S+)\s+(\S+)/) {
135 ($feature{name
}) = $self->seqname;
136 $feature{raw_score
} = $score;
137 $feature{p_value
} = sprintf ("%.3e", $evalue);
138 $feature{score
} = $feature{p_value
};
139 $feature{start
} = $start;
140 $feature{end
} = $end;
141 $feature{hname
} = $hid;
142 $feature{hstart
} = $hstart;
143 $feature{hend
} = $hend;
144 ($feature{source
}) = 'pfam';
145 $feature{primary
} = $hid;
146 ($feature{program
}) = 'pfam';
147 ($feature{db
}) = 'db1';
148 ($feature{logic_name
}) = 'hmmpfam';
149 my $new_feat = $self->create_feature (\
%feature);
159 =head2 create_feature
161 Title : create_feature
162 Usage : my $feat=$hmmpfam_parser->create_feature($feature,$seqname)
163 Function: creates a SeqFeature Generic object
164 Returns : L<Bio::SeqFeature::Generic>
171 my ($self, $feat) = @_;
175 my $feature1= Bio
::SeqFeature
::Generic
->new( -seq_id
=>$feat->{name
},
176 -start
=>$feat->{start
},
178 -score
=>$feat->{score
},
179 -source
=>$feat->{source
},
180 -primary
=>$feat->{primary
},
185 my $feature2= Bio
::SeqFeature
::Generic
->new(
186 -start
=>$feat->{hstart
},
187 -end
=>$feat->{hend
},
193 my $featurepair = Bio
::SeqFeature
::FeaturePair
->new;
194 $featurepair->feature1 ($feature1);
195 $featurepair->feature2 ($feature2);
197 $featurepair->add_tag_value('evalue',$feat->{p_value
});
198 $featurepair->add_tag_value('percent_id','NULL');
199 $featurepair->add_tag_value("hid",$feat->{primary
});
207 Usage : obj->seqname($seqname)
208 Function: Internal(not to be used directly)
215 my($self,$seqname)=@_;
217 if(defined($seqname))
219 $self->{'seqname'}=$seqname;
222 return $self->{'seqname'};