1 # Parser module for Signalp Bio::Tools::Signalp
4 # Based on the EnsEMBL module
5 # Bio::EnsEMBL::Pipeline::Runnable::Protein::Signalp originally
6 # written by Marc Sohrmann (ms2@sanger.ac.uk) Written in BioPipe by
7 # Please direct questions and support issues to <bioperl-l@bioperl.org>
9 # Balamurugan Kumarasamy <savikalpa@fugu-sg.org> Cared for by the Fugu
10 # Informatics team (fuguteam@fugu-sg.org)
12 # You may distribute this module under the same terms as perl itself
14 # POD documentation - main docs before the code
18 Bio::Tools::Signalp - parser for Signalp output
22 use Bio::Tools::Signalp;
24 my $parser = Bio::Tools::Signalp->new(-fh =>$filehandle );
26 while( my $sp_feat = $parser->next_result ) {
27 if ($sp_feat->score > 0.9) {
28 push @likely_sigpep, $sp_feat;
34 C<SignalP> predicts the presence and location of signal peptide
35 cleavage sites in amino acid sequences.
37 L<Bio::Tools::Signalp> parses the output of C<SignalP> to provide a
38 L<Bio::SeqFeature::Generic> object describing the signal peptide
39 found, if any. It returns a variety of tags extracted from the NN and HMM
40 analysis. Most importantly, the C<score()> attribute contains the
41 NN probability of this being a true signal peptide.
48 User feedback is an integral part of the evolution of this and other
49 Bioperl modules. Send your comments and suggestions preferably to
50 the Bioperl mailing list. Your participation is much appreciated.
52 bioperl-l@bioperl.org - General discussion
53 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
57 Please direct usage questions or support issues to the mailing list:
59 I<bioperl-l@bioperl.org>
61 rather than to the module maintainer directly. Many experienced and
62 reponsive experts will be able look at the problem and quickly
63 address it. Please include a thorough description of the problem
64 with code and data examples if at all possible.
68 Report bugs to the Bioperl bug tracking system to help us keep track
69 of the bugs and their resolution. Bug reports can be submitted va the
72 https://github.com/bioperl/bioperl-live/issues
76 # Please direct questions and support issues to I<bioperl-l@bioperl.org>
78 Based on the EnsEMBL module Bio::EnsEMBL::Pipeline::Runnable::Protein::Signalp
79 originally written by Marc Sohrmann (ms2_AT_sanger.ac.uk). Written in BioPipe by
80 Balamurugan Kumarasamy savikalpa_AT_fugu-sg.org. Cared for by the Fugu
81 Informatics team (fuguteam_AT_fugu-sg.org)
85 Torsten Seemann - torsten.seemann AT infotech.monash.edu.au
89 The rest of the documentation details each of the object methods.
90 Internal methods are usually preceded with a _
94 package Bio
::Tools
::Signalp
;
98 use Bio
::SeqFeature
::Generic
;
99 use base
qw(Bio::Root::Root Bio::Root::IO);
106 Usage : my $obj = Bio::Tools::Signalp->new();
107 Function: Builds a new Bio::Tools::Signalp object
108 Returns : Bio::Tools::Signalp
109 Args : -fh/-file => $val, # for initing input, see Bio::Root::IO
114 my($class,@args) = @_;
116 my $self = $class->SUPER::new
(@args);
117 $self->_initialize_io(@args);
125 Usage : my $feat = $signalp->next_result
126 Function: Get the next result set from parser data
127 Returns : Bio::SeqFeature::Generic
135 while (my $line=$self->_readline()) {
138 if ($line=~/^\>(\S+)/) {
141 elsif ($line=~/max\.\s+Y\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) {
144 elsif ($line=~/mean\s+S\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) {
147 if ($fact2 eq 'YES' and $self->_fact1 eq 'YES') {
149 my $line = $self->_readline();
151 ###########################################
152 # modification to suit new SignalP output
153 ###########################################
155 #print STDERR "********** <$line>\n";
156 if ($line =~ /\s+D\s+.*/) {
157 $line = $self->_readline();
159 #print STDERR "********** <$line>\n";
161 ###########################################
164 if ($line =~ /Most likely cleavage site between pos\.\s+(\d+)/) {
167 $feature{seq_id
} = $self->_seqname;
169 $feature{end
} = $end;
170 $feature{source_tag
} = 'Signalp';
171 $feature{primary
}= 'signal_peptide';
172 $self->_parse_hmm_result(\
%feature);
173 my $new_feat = $self->_create_feature (\
%feature);
177 $self->throw ("parsing problem in signalp");
186 =head2 _parse_hmm_result
188 Title : _parse_hmm_result
189 Usage : $self->_parse_hmm_result(\%feature)
190 Function: Internal (not to be used directly)
191 Returns : hash of feature values
192 Args : hash of more feature values
196 sub _parse_hmm_result
{
197 my ($self, $feature_hash) = @_;
198 while(my $line = $self->_readline){
200 if($line =~ /Prediction: (.+)$/){
201 $feature_hash->{hmmProdiction
} = $1;
202 }elsif($line =~ /Signal peptide probability: ([0-9\.]+)/){
203 $feature_hash->{peptideProb
} = $1;
204 }elsif($line =~ /Signal anchor probability: ([0-9\.]+)/){
205 $feature_hash->{anchorProb
} = $1;
211 =head2 _create_feature
213 Title : _create_feature
214 Usage : $self->create_feature(\%feature)
215 Function: Internal (not to be used directly)
216 Returns : hash of feature values
217 Args : hash of more feature values
221 sub _create_feature
{
222 my ($self, $feat) = @_;
224 # create feature object
225 my $feature = Bio
::SeqFeature
::Generic
->new(
226 -seq_id
=> $feat->{name
},
227 -start
=> $feat->{start
},
228 -end
=> $feat->{end
},
229 -score
=> $feat->{score
},
230 -source
=> $feat->{source
},
231 -primary
=> $feat->{primary
},
232 -logic_name
=> $feat->{logic_name
},
235 $feature->score($feat->{peptideProb
});
236 $feature->add_tag_value('peptideProb', $feat->{peptideProb
});
237 $feature->add_tag_value('anchorProb', $feat->{anchorProb
});
238 $feature->add_tag_value('evalue',$feat->{anchorProb
});
239 $feature->add_tag_value('percent_id','NULL');
240 $feature->add_tag_value("hid",$feat->{primary
});
241 $feature->add_tag_value('SignalpPrediction', $feat->{hmmProdiction
});
249 Usage : $self->_seqname($name)
250 Function: Internal (not to be used directly)
257 my ($self,$seqname)=@_;
259 if (defined$seqname){
260 $self->{'seqname'}=$seqname;
262 return $self->{'seqname'};
268 Usage : $self->fact1($fact1)
269 Function: Internal (not to be used directly)
276 my ($self, $fact1)=@_;
279 $self->{'fact1'}=$fact1;
281 return $self->{'fact1'};