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
;
72 use Bio
::SeqFeature
::FeaturePair
;
73 use Bio
::SeqFeature
::Generic
;
75 use base
qw(Bio::Root::Root Bio::Root::IO);
82 Usage : my $obj = Bio::Tools::Profile->new();
83 Function: Builds a new Bio::Tools::Profile object
84 Returns : Bio::Tools::Profile
91 my($class,@args) = @_;
93 my $self = $class->SUPER::new
(@args);
94 $self->_initialize_io(@args);
102 Usage : my $feat = $profile_parser->next_result
103 Function: Get the next result set from parser data
104 Returns : L<Bio::SeqFeature::FeaturePair>
116 while ($_=$self->_readline()) {
119 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+)/;
120 #for example in this output line
121 #38.435 2559 pos. 19958 - 20212 [ 1, -1] PS50011|PROTEIN_KINASE_DOM Protein kinase domain profile.
129 my $feat = "$ac,$from,$to,$hfrom,$hto,$nscore";
130 my $new_feat= $self->create_feature($feat);
137 =head2 create_feature
139 Title : create_feature
140 Usage : my $feat= $profile_parser->create_feature($feature)
141 Function: creates a Bio::SeqFeature::FeaturePair object
142 Returns : L<Bio::SeqFeature::FeaturePair>
149 my ($self, $feat) = @_;
151 my @f = split (/,/,$feat);
158 $hto = $f[2] - $f[1] + 1;
163 my $feat1 = Bio
::SeqFeature
::Generic
->new( -start
=> $f[1],
169 my $feat2 = Bio
::SeqFeature
::Generic
->new(-start
=> $f[3],
173 my $feature = Bio
::SeqFeature
::FeaturePair
->new(-feature1
=> $feat1,
174 -feature2
=> $feat2);