| 1 | # Parser module for Signalp Bio::Tools::Signalp | ||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 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> | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # Balamurugan Kumarasamy <savikalpa@fugu-sg.org> Cared for by the Fugu | ||||||||||||||||||||||||||||
| 10 | # Informatics team (fuguteam@fugu-sg.org) | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # You may distribute this module under the same terms as perl itself | ||||||||||||||||||||||||||||
| 13 | # | ||||||||||||||||||||||||||||
| 14 | # POD documentation - main docs before the code | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =head1 NAME | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | Bio::Tools::Signalp - parser for Signalp output | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | use Bio::Tools::Signalp; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | my $parser = Bio::Tools::Signalp->new(-fh =>$filehandle ); | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | while( my $sp_feat = $parser->next_result ) { | ||||||||||||||||||||||||||||
| 27 | if ($sp_feat->score > 0.9) { | ||||||||||||||||||||||||||||
| 28 | push @likely_sigpep, $sp_feat; | ||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | C<SignalP> predicts the presence and location of signal peptide | ||||||||||||||||||||||||||||
| 35 | cleavage sites in amino acid sequences. | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =head1 FEEDBACK | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | =head2 Mailing Lists | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||||||||||
| 53 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =head2 Support | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | =head2 Reporting Bugs | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
| 70 | web: | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | https://github.com/bioperl/bioperl-live/issues | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | # Please direct questions and support issues to I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 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) | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | =head1 CONTRIBUTORS | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | Torsten Seemann - torsten.seemann AT infotech.monash.edu.au | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | =head1 APPENDIX | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | The rest of the documentation details each of the object methods. | ||||||||||||||||||||||||||||
| 90 | Internal methods are usually preceded with a _ | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | =cut | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | package Bio::Tools::Signalp; | ||||||||||||||||||||||||||||
| 95 | 4 | $Bio::Tools::Signalp::VERSION = '1.7.8'; | |||||||||||||||||||||||||||
| 96 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 4 | ▶ | use Bio::SeqFeature::Generic; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 99 | 4 | ▶ | use base qw(Bio::Root::Root Bio::Root::IO); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | =head2 new | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | Title : new | ||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | =cut | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 12 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 114 | 12 | my($class,@args) = @_; | |||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | 12 | my $self = $class->SUPER::new(@args); | |||||||||||||||||||||||||||
| 117 | 12 | $self->_initialize_io(@args); | |||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 12 | return $self; | |||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | =head2 next_result | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | Title : next_result | ||||||||||||||||||||||||||||
| 125 | Usage : my $feat = $signalp->next_result | ||||||||||||||||||||||||||||
| 126 | Function: Get the next result set from parser data | ||||||||||||||||||||||||||||
| 127 | Returns : Bio::SeqFeature::Generic | ||||||||||||||||||||||||||||
| 128 | Args : none | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | =cut | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | 3 | ▶ | sub next_result { | ||||||||||||||||||||||||||
|
Subroutine
next_result: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||
| 133 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | 3 | ▶ | while (my $line=$self->_readline()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 136 | 278 | chomp $line; | |||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | 278 | ▶ | if ($line=~/^\>(\S+)/) { | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 139 | 8 | $self->_seqname($1); | |||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||
| 141 | elsif ($line=~/max\.\s+Y\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) { | ||||||||||||||||||||||||||||
| 142 | 2 | $self->_fact1($2); | |||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||
| 144 | elsif ($line=~/mean\s+S\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) { | ||||||||||||||||||||||||||||
| 145 | 2 | my $fact2 = $2; | |||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | 2 | ▶ | if ($fact2 eq 'YES' and $self->_fact1 eq 'YES') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$fact2 eq "YES" and $self->_fact1 eq "YES"
MC/DC50%1/2
$fact2 eq "YES" and $self->_fact1 eq "YES"
$fact2 eq "YES"
$self->_fact1 eq "YES"
Truth table66%2/3
A and B
A= $fact2 eq "YES"B= $self->_fact1 eq "YES"
| |||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | 1 | my $line = $self->_readline(); | |||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | ########################################### | ||||||||||||||||||||||||||||
| 152 | # modification to suit new SignalP output | ||||||||||||||||||||||||||||
| 153 | ########################################### | ||||||||||||||||||||||||||||
| 154 | 1 | chomp $line; | |||||||||||||||||||||||||||
| 155 | #print STDERR "********** <$line>\n"; | ||||||||||||||||||||||||||||
| 156 | 1 | ▶ | if ($line =~ /\s+D\s+.*/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 157 | 1 | $line = $self->_readline(); | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | #print STDERR "********** <$line>\n"; | ||||||||||||||||||||||||||||
| 160 | 1 | my $end; | |||||||||||||||||||||||||||
| 161 | ########################################### | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | 1 | ▶ | if ($line =~ /Most likely cleavage site between pos\.\s+(\d+)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 165 | 1 | my $end = $1; | |||||||||||||||||||||||||||
| 166 | 1 | my (%feature); | |||||||||||||||||||||||||||
| 167 | 1 | $feature{seq_id} = $self->_seqname; | |||||||||||||||||||||||||||
| 168 | 1 | $feature{start} = 1; | |||||||||||||||||||||||||||
| 169 | 1 | $feature{end} = $end; | |||||||||||||||||||||||||||
| 170 | 1 | $feature{source_tag} = 'Signalp'; | |||||||||||||||||||||||||||
| 171 | 1 | $feature{primary}= 'signal_peptide'; | |||||||||||||||||||||||||||
| 172 | 1 | $self->_parse_hmm_result(\%feature); | |||||||||||||||||||||||||||
| 173 | 1 | my $new_feat = $self->_create_feature (\%feature); | |||||||||||||||||||||||||||
| 174 | 1 | return $new_feat; | |||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||
| 176 | else { | ||||||||||||||||||||||||||||
| 177 | 0 | $self->throw ("parsing problem in signalp"); | |||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | =head2 _parse_hmm_result | ||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | =cut | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | 1 | ▶ | sub _parse_hmm_result { | ||||||||||||||||||||||||||
|
Subroutine
_parse_hmm_result: called CC=5 SCAR=16.4
| |||||||||||||||||||||||||||||
| 197 | 1 | my ($self, $feature_hash) = @_; | |||||||||||||||||||||||||||
| 198 | 1 | ▶ | while(my $line = $self->_readline){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 199 | 86 | chomp $line; | |||||||||||||||||||||||||||
| 200 | 86 | ▶ | if($line =~ /Prediction: (.+)$/){ | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 201 | 1 | $feature_hash->{hmmProdiction} = $1; | |||||||||||||||||||||||||||
| 202 | }elsif($line =~ /Signal peptide probability: ([0-9\.]+)/){ | ||||||||||||||||||||||||||||
| 203 | 1 | $feature_hash->{peptideProb} = $1; | |||||||||||||||||||||||||||
| 204 | }elsif($line =~ /Signal anchor probability: ([0-9\.]+)/){ | ||||||||||||||||||||||||||||
| 205 | 0 | $feature_hash->{anchorProb} = $1; | |||||||||||||||||||||||||||
| 206 | 0 | last; | |||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | =head2 _create_feature | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | =cut | ||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | 1 | ▶ | sub _create_feature { | ||||||||||||||||||||||||||
|
Subroutine
_create_feature: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 222 | 1 | my ($self, $feat) = @_; | |||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 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}, | ||||||||||||||||||||||||||||
| 233 | 1 | ); | |||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | 1 | $feature->score($feat->{peptideProb}); | |||||||||||||||||||||||||||
| 236 | 1 | $feature->add_tag_value('peptideProb', $feat->{peptideProb}); | |||||||||||||||||||||||||||
| 237 | 1 | $feature->add_tag_value('anchorProb', $feat->{anchorProb}); | |||||||||||||||||||||||||||
| 238 | 1 | $feature->add_tag_value('evalue',$feat->{anchorProb}); | |||||||||||||||||||||||||||
| 239 | 1 | $feature->add_tag_value('percent_id','NULL'); | |||||||||||||||||||||||||||
| 240 | 1 | $feature->add_tag_value("hid",$feat->{primary}); | |||||||||||||||||||||||||||
| 241 | 1 | $feature->add_tag_value('SignalpPrediction', $feat->{hmmProdiction}); | |||||||||||||||||||||||||||
| 242 | 1 | return $feature; | |||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||
| 246 | =head2 _seqname | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | Title : _seqname | ||||||||||||||||||||||||||||
| 249 | Usage : $self->_seqname($name) | ||||||||||||||||||||||||||||
| 250 | Function: Internal (not to be used directly) | ||||||||||||||||||||||||||||
| 251 | Returns : | ||||||||||||||||||||||||||||
| 252 | Args : | ||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||
| 254 | =cut | ||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||
| 256 | 11 | ▶ | sub _seqname{ | ||||||||||||||||||||||||||
|
Subroutine
_seqname: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 257 | 11 | my ($self,$seqname)=@_; | |||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||
| 259 | 11 | ▶ | if (defined$seqname){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 260 | 8 | $self->{'seqname'}=$seqname; | |||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||
| 262 | 11 | return $self->{'seqname'}; | |||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||
| 265 | =head2 _fact1 | ||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||
| 267 | Title : _fact1 | ||||||||||||||||||||||||||||
| 268 | Usage : $self->fact1($fact1) | ||||||||||||||||||||||||||||
| 269 | Function: Internal (not to be used directly) | ||||||||||||||||||||||||||||
| 270 | Returns : | ||||||||||||||||||||||||||||
| 271 | Args : | ||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||
| 273 | =cut | ||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||
| 275 | 5 | ▶ | sub _fact1{ | ||||||||||||||||||||||||||
|
Subroutine
_fact1: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 276 | 5 | my ($self, $fact1)=@_; | |||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||
| 278 | 5 | ▶ | if (defined $fact1){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 279 | 2 | $self->{'fact1'}=$fact1; | |||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||
| 281 | 5 | return $self->{'fact1'}; | |||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||
| 286 | 4 | 1; | |||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||