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
;
75 use Bio
::SeqFeature
::FeaturePair
;
76 use Bio
::SeqFeature
::Generic
;
77 use base
qw(Bio::Root::Root Bio::Root::IO);
83 Usage : my $obj = Bio::Tools::Prints->new(-fh=>$filehandle);
84 Function: Builds a new Bio::Tools::Prints object
85 Returns : Bio::Tools::Prints
92 my($class,@args) = @_;
94 my $self = $class->SUPER::new
(@args);
95 $self->_initialize_io(@args);
104 Usage : my $feat = $prints_parser->next_result
105 Function: Get the next result set from parser data
106 Returns : L<Bio::SeqFeature::Generic>
118 while ($_=$self->_readline()) {
123 if ($line =~ s/^Sn;//) { # We have identified a Sn; line so there should be the following:
125 ($sequenceId) = $line =~ /^\s*(\w+)/;
126 $self->seqname($sequenceId);
130 if ($line =~ s/^1TBH//) {
131 my ($id) = $line =~ /^\s*(\w+)/;
132 my ($ac) = $line =~ /(PR\w+)\s*$/;
133 $printsac{$id} = $ac;
134 $self->print_sac(\
%printsac);
138 if ($line =~ s/^3TB//) {
140 if ($line =~ s/^[HN]//) {
144 my @elements = split /\s+/, $line;
146 my ($fingerprintName,$motifNumber,$temp,$tot,$percentageIdentity,$profileScore,$pvalue,$subsequence,$motifLength,$lowestMotifPosition,$matchPosition,$highestMotifPosition) = @elements;
148 my $start = $matchPosition;
149 my $end = $matchPosition + $motifLength - 1;
150 my $print_sac = $self->print_sac;
152 my %printsac = %{$print_sac};
153 my $print = $printsac{$fingerprintName};
154 my $seqname=$self->seqname;
155 my $feat = "$print,$start,$end,$percentageIdentity,$profileScore,$pvalue";
156 my $new_feat = $self->create_feature($feat,$seqname);
159 if ($line =~ s/^F//) {
170 =head2 create_feature
172 Title : create_feature
173 Usage : my $feat=$prints_parser->create_feature($feature,$seqname)
174 Function: creates a SeqFeature Generic object
175 Returns : L<Bio::SeqFeature::FeaturePair>
182 my ($self, $feat,$sequenceId) = @_;
184 my @f = split (/,/,$feat);
185 # create feature object
186 my $feature= Bio
::SeqFeature
::Generic
->new(
187 -seq_id
=>$sequenceId,
193 -logic_name
=> "PRINTS",
195 $feature->add_tag_value('evalue',$f[5]);
196 $feature->add_tag_value('percent_id',$f[3]);
198 my $feature2 = Bio
::SeqFeature
::Generic
->new(
203 my $fp = Bio
::SeqFeature
::FeaturePair
->new(
204 -feature1
=> $feature,
205 -feature2
=> $feature2
213 Usage : $prints_parser->print_sac($print_sac)
214 Function: get/set for print_sac
223 return $self->{'print_sac'} = shift if @_;
224 return $self->{'print_sac'};
230 Usage : $prints_parser->seqname($seqname)
231 Function: get/set for seqname
239 my($self,$seqname)=@_;
240 return $self->{'seqname'}=$seqname if(defined($seqname));
241 return $self->{'seqname'};