2 # BioPerl module for Bio::Tools::Prints
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Balamurugan Kumarasamy
8 # You may distribute this module under the same terms as perl itself
9 # POD documentation - main docs before the code
14 Bio::Tools::Prints - Parser for FingerPRINTScanII program
18 use Bio::Tools::Prints;
19 my $prints_parser = Bio::Tools::Prints->new(-fh =>$filehandle );
20 while( my $prints_feat = $prints_parser->next_result ) {
21 push @prints_feat, $prints_feat;
26 PRINTScan II is a PRINTS fingerprint identification algorithm.
27 Copyright (C) 1998,1999 Phil Scordis
33 User feedback is an integral part of the evolution of this and other
34 Bioperl modules. Send your comments and suggestions preferably to
35 the Bioperl mailing list. Your participation is much appreciated.
37 bioperl-l@bioperl.org - General discussion
38 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
42 Please direct usage questions or support issues to the mailing list:
44 I<bioperl-l@bioperl.org>
46 rather than to the module maintainer directly. Many experienced and
47 reponsive experts will be able look at the problem and quickly
48 address it. Please include a thorough description of the problem
49 with code and data examples if at all possible.
53 Report bugs to the Bioperl bug tracking system to help us keep track
54 of the bugs and their resolution. Bug reports can be submitted via
57 https://github.com/bioperl/bioperl-live/issues
59 =head1 AUTHOR - Balamurugan Kumarasamy
66 The rest of the documentation details each of the object methods.
67 Internal methods are usually preceded with a _
72 package Bio
::Tools
::Prints
;
76 use Bio
::SeqFeature
::FeaturePair
;
77 use Bio
::SeqFeature
::Generic
;
78 use base
qw(Bio::Root::Root Bio::Root::IO);
84 Usage : my $obj = Bio::Tools::Prints->new(-fh=>$filehandle);
85 Function: Builds a new Bio::Tools::Prints object
86 Returns : Bio::Tools::Prints
93 my($class,@args) = @_;
95 my $self = $class->SUPER::new
(@args);
96 $self->_initialize_io(@args);
105 Usage : my $feat = $prints_parser->next_result
106 Function: Get the next result set from parser data
107 Returns : L<Bio::SeqFeature::Generic>
119 while ($_=$self->_readline()) {
124 if ($line =~ s/^Sn;//) { # We have identified a Sn; line so there should be the following:
126 ($sequenceId) = $line =~ /^\s*(\w+)/;
127 $self->seqname($sequenceId);
131 if ($line =~ s/^1TBH//) {
132 my ($id) = $line =~ /^\s*(\w+)/;
133 my ($ac) = $line =~ /(PR\w+)\s*$/;
134 $printsac{$id} = $ac;
135 $self->print_sac(\
%printsac);
139 if ($line =~ s/^3TB//) {
141 if ($line =~ s/^[HN]//) {
145 my @elements = split /\s+/, $line;
147 my ($fingerprintName,$motifNumber,$temp,$tot,$percentageIdentity,$profileScore,$pvalue,$subsequence,$motifLength,$lowestMotifPosition,$matchPosition,$highestMotifPosition) = @elements;
149 my $start = $matchPosition;
150 my $end = $matchPosition + $motifLength - 1;
151 my $print_sac = $self->print_sac;
153 my %printsac = %{$print_sac};
154 my $print = $printsac{$fingerprintName};
155 my $seqname=$self->seqname;
156 my $feat = "$print,$start,$end,$percentageIdentity,$profileScore,$pvalue";
157 my $new_feat = $self->create_feature($feat,$seqname);
160 if ($line =~ s/^F//) {
171 =head2 create_feature
173 Title : create_feature
174 Usage : my $feat=$prints_parser->create_feature($feature,$seqname)
175 Function: creates a SeqFeature Generic object
176 Returns : L<Bio::SeqFeature::FeaturePair>
183 my ($self, $feat,$sequenceId) = @_;
185 my @f = split (/,/,$feat);
186 # create feature object
187 my $feature= Bio
::SeqFeature
::Generic
->new(
188 -seq_id
=>$sequenceId,
194 -logic_name
=> "PRINTS",
196 $feature->add_tag_value('evalue',$f[5]);
197 $feature->add_tag_value('percent_id',$f[3]);
199 my $feature2 = Bio
::SeqFeature
::Generic
->new(
204 my $fp = Bio
::SeqFeature
::FeaturePair
->new(
205 -feature1
=> $feature,
206 -feature2
=> $feature2
214 Usage : $prints_parser->print_sac($print_sac)
215 Function: get/set for print_sac
224 return $self->{'print_sac'} = shift if @_;
225 return $self->{'print_sac'};
231 Usage : $prints_parser->seqname($seqname)
232 Function: get/set for seqname
240 my($self,$seqname)=@_;
241 return $self->{'seqname'}=$seqname if(defined($seqname));
242 return $self->{'seqname'};