1 # BioPerl module for Bio::Tools::Profile
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
12 Bio::Tools::Profile - parse Profile output
16 use Bio::Tools::Profile;
17 my $profile_parser = Bio::Tools::Profile->new(-fh =>$filehandle );
18 while( my $profile_feat = $profile_parser->next_result ) {
19 push @profile_feat, $profile_feat;
24 Parser for Profile output
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to
32 the Bioperl mailing list. Your participation is much appreciated.
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 Please direct usage questions or support issues to the mailing list:
41 I<bioperl-l@bioperl.org>
43 rather than to the module maintainer directly. Many experienced and
44 reponsive experts will be able look at the problem and quickly
45 address it. Please include a thorough description of the problem
46 with code and data examples if at all possible.
50 Report bugs to the Bioperl bug tracking system to help us keep track
51 of the bugs and their resolution. Bug reports can be submitted via the
54 https://github.com/bioperl/bioperl-live/issues
56 =head1 AUTHOR - Balamurugan Kumarasamy
58 Email: fugui@worf.fugu-sg.org
62 The rest of the documentation details each of the object methods.
63 Internal methods are usually preceded with a _
69 package Bio
::Tools
::Profile
;
73 use Bio
::SeqFeature
::FeaturePair
;
74 use Bio
::SeqFeature
::Generic
;
76 use base
qw(Bio::Root::Root Bio::Root::IO);
83 Usage : my $obj = Bio::Tools::Profile->new();
84 Function: Builds a new Bio::Tools::Profile object
85 Returns : Bio::Tools::Profile
92 my($class,@args) = @_;
94 my $self = $class->SUPER::new
(@args);
95 $self->_initialize_io(@args);
103 Usage : my $feat = $profile_parser->next_result
104 Function: Get the next result set from parser data
105 Returns : L<Bio::SeqFeature::FeaturePair>
117 while ($_=$self->_readline()) {
120 my ($nscore,$rawscore,$from,$to,$hfrom,$hto,$ac) = $line =~ /(\S+)\s+(\d+)\s*pos.\s+(\d*)\s*-\s+(\d*)\s*\[\s+(\d*),\s+(\S*)\]\s*(\w+)/;
121 #for example in this output line
122 #38.435 2559 pos. 19958 - 20212 [ 1, -1] PS50011|PROTEIN_KINASE_DOM Protein kinase domain profile.
130 my $feat = "$ac,$from,$to,$hfrom,$hto,$nscore";
131 my $new_feat= $self->create_feature($feat);
138 =head2 create_feature
140 Title : create_feature
141 Usage : my $feat= $profile_parser->create_feature($feature)
142 Function: creates a Bio::SeqFeature::FeaturePair object
143 Returns : L<Bio::SeqFeature::FeaturePair>
150 my ($self, $feat) = @_;
152 my @f = split (/,/,$feat);
159 $hto = $f[2] - $f[1] + 1;
164 my $feat1 = Bio
::SeqFeature
::Generic
->new( -start
=> $f[1],
170 my $feat2 = Bio
::SeqFeature
::Generic
->new(-start
=> $f[3],
174 my $feature = Bio
::SeqFeature
::FeaturePair
->new(-feature1
=> $feat1,
175 -feature2
=> $feat2);