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
;
97 use Bio
::SeqFeature
::Generic
;
98 use base
qw(Bio::Root::Root Bio::Root::IO);
105 Usage : my $obj = Bio::Tools::Signalp->new();
106 Function: Builds a new Bio::Tools::Signalp object
107 Returns : Bio::Tools::Signalp
108 Args : -fh/-file => $val, # for initing input, see Bio::Root::IO
113 my($class,@args) = @_;
115 my $self = $class->SUPER::new
(@args);
116 $self->_initialize_io(@args);
124 Usage : my $feat = $signalp->next_result
125 Function: Get the next result set from parser data
126 Returns : Bio::SeqFeature::Generic
134 while (my $line=$self->_readline()) {
137 if ($line=~/^\>(\S+)/) {
140 elsif ($line=~/max\.\s+Y\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) {
143 elsif ($line=~/mean\s+S\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) {
146 if ($fact2 eq 'YES' and $self->_fact1 eq 'YES') {
148 my $line = $self->_readline();
150 ###########################################
151 # modification to suit new SignalP output
152 ###########################################
154 #print STDERR "********** <$line>\n";
155 if ($line =~ /\s+D\s+.*/) {
156 $line = $self->_readline();
158 #print STDERR "********** <$line>\n";
160 ###########################################
163 if ($line =~ /Most likely cleavage site between pos\.\s+(\d+)/) {
166 $feature{seq_id
} = $self->_seqname;
168 $feature{end
} = $end;
169 $feature{source_tag
} = 'Signalp';
170 $feature{primary
}= 'signal_peptide';
171 $self->_parse_hmm_result(\
%feature);
172 my $new_feat = $self->_create_feature (\
%feature);
176 $self->throw ("parsing problem in signalp");
185 =head2 _parse_hmm_result
187 Title : _parse_hmm_result
188 Usage : $self->_parse_hmm_result(\%feature)
189 Function: Internal (not to be used directly)
190 Returns : hash of feature values
191 Args : hash of more feature values
195 sub _parse_hmm_result
{
196 my ($self, $feature_hash) = @_;
197 while(my $line = $self->_readline){
199 if($line =~ /Prediction: (.+)$/){
200 $feature_hash->{hmmProdiction
} = $1;
201 }elsif($line =~ /Signal peptide probability: ([0-9\.]+)/){
202 $feature_hash->{peptideProb
} = $1;
203 }elsif($line =~ /Signal anchor probability: ([0-9\.]+)/){
204 $feature_hash->{anchorProb
} = $1;
210 =head2 _create_feature
212 Title : _create_feature
213 Usage : $self->create_feature(\%feature)
214 Function: Internal (not to be used directly)
215 Returns : hash of feature values
216 Args : hash of more feature values
220 sub _create_feature
{
221 my ($self, $feat) = @_;
223 # create feature object
224 my $feature = Bio
::SeqFeature
::Generic
->new(
225 -seq_id
=> $feat->{name
},
226 -start
=> $feat->{start
},
227 -end
=> $feat->{end
},
228 -score
=> $feat->{score
},
229 -source
=> $feat->{source
},
230 -primary
=> $feat->{primary
},
231 -logic_name
=> $feat->{logic_name
},
234 $feature->score($feat->{peptideProb
});
235 $feature->add_tag_value('peptideProb', $feat->{peptideProb
});
236 $feature->add_tag_value('anchorProb', $feat->{anchorProb
});
237 $feature->add_tag_value('evalue',$feat->{anchorProb
});
238 $feature->add_tag_value('percent_id','NULL');
239 $feature->add_tag_value("hid",$feat->{primary
});
240 $feature->add_tag_value('SignalpPrediction', $feat->{hmmProdiction
});
248 Usage : $self->_seqname($name)
249 Function: Internal (not to be used directly)
256 my ($self,$seqname)=@_;
258 if (defined$seqname){
259 $self->{'seqname'}=$seqname;
261 return $self->{'seqname'};
267 Usage : $self->fact1($fact1)
268 Function: Internal (not to be used directly)
275 my ($self, $fact1)=@_;
278 $self->{'fact1'}=$fact1;
280 return $self->{'fact1'};