Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation Signalp
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
 Bio::EnsEMBL::Analysis::Runnable::Protein::Signalp
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Bio::SeqIO
Inherit
Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation
Synopsis
 my $signalp = Bio::EnsEMBL::Analysis::Runnable::Protein::Signalp->new(
-query => $seq,
-analysis => $ana,
);
$signalp->run;
my @results = @{$signalp->output};
Description
Methods
multiprotein
No description
Code
parse_results
No description
Code
run_analysis
No description
Code
write_seq_file
No description
Code
Methods description
None available.
Methods code
multiproteindescriptionprevnextTop
sub multiprotein {
  my ($self) = @_;
  return 0;
}


#
# we over-ride write_seq_file because Signalp works best
# if only the first 50 a.a. of the protein is supplied
}
parse_resultsdescriptionprevnextTop
sub parse_results {
  my ($self) = @_;

  my ($fh);

  my $resfile = $self->resultsfile;
  
  if (-e $resfile) {
    # it's a filename
if (-z $resfile) { # no hits
return; }else { open ($fh, "<$resfile") or throw ("Error opening $resfile"); } }else { # it'a a filehandle
$fh = $resfile; } # parse
my (@fps, $id, $fact1, $fact2, $end); while (<$fh>) { chomp; if (/^\>(\S+)/) { $id = $1; } elsif (/max\.\s+Y\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) { $fact1 = $2; } elsif (/mean\s+S\s+(\S+)\s+\S+\s+\S+\s+(\S+)/) { $fact2 = $2; if ($fact1 eq "YES" && $fact2 eq "YES") { my $line = <$fh>; if ($line =~ /Most likely cleavage site between pos\.\s+(\d+)/) { $end = $1; } else { $self->throw ("parsing problem in ".$self->program); } my $fp = $self->create_protein_feature(1, $end, 0, $id, 0, 0, 'Sigp', $self->analysis, 0, 0); push @fps, $fp; } } } close($fh); $self->output(\@fps); } 1;
}
run_analysisdescriptionprevnextTop
sub run_analysis {
  my ($self) = @_;
  
  throw("Error running ".$self->program." on ".$self->queryfile) 
      unless ((system($self->program . " -t euk "
                      .$self->queryfile 
                      . " > ".$self->resultsfile)) == 0);
}
write_seq_filedescriptionprevnextTop
sub write_seq_file {
  my ($self, $seq, $filename) = @_;
  if(!$seq){
    $seq = $self->query;
  }
  if(!$filename){
    $filename = $self->queryfile;
  }
  my $seqout = Bio::SeqIO->new(
                               -file => ">".$filename,
                               -format => 'Fasta',
                              );
  eval{
    my $init_seq = substr($seq->seq, 0, 50);
    my $newseqobj = Bio::Seq->new(-id => $seq->display_id,
                                  -seq => $init_seq);
    $seqout->write_seq($newseqobj);
  };
  if($@){
    throw("FAILED to write $seq to $filename Runnable:write_seq_file");
  }
  return $filename;
}
General documentation
No general documentation available.