Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation Hmmpfam
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Analysis::Runnable::Protein::Hmmpfam
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Inherit
Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation
Synopsis
  # something like this
my $query = new Bio::Seq(-file => $queryfile,
-format => 'Fasta');
my $hmm = Bio::EnsEMBL::Pipeline::Runnable::Protein::Hmmpfam->new ('-query' => $query, '-program' => 'hmmpfam' or '/usr/local/pubseq/bin/hmmpfam', '-database' => '/data/Pfam_ls'); $hmm->run; my @results = @{$hmm->output};
Description
Methods
multiprotein
No description
Code
parse_resultsDescriptionCode
run_analysis
No description
Code
Methods description
parse_resultscode    nextTop
 Title    :  parse_results
Usage : $self->parse_results ($filename)
Function : parses program output to give a set of features
Example :
Returns :
Args : filename (optional, can be filename, filehandle or pipe, not implemented)
Throws :
Methods code
multiproteindescriptionprevnextTop
sub multiprotein {
  my ($self) = @_;
  return 1;
}
parse_resultsdescriptionprevnextTop
sub parse_results {
  my ($self) = @_;

  my (@hits, $id);

  my $f = $self->resultsfile;

  if (-e $f and not -z $f) {
    my $fh;
    open ($fh, "<$f") or throw ("Error opening $f");
    
    while (<$fh>) {
      chomp;
      #last if /^Alignments of top-scoring domains/;
#next if (/^Model/ || /^\-/ || /^$/);
if (/^Query sequence:\s+(\S+)/) { $id = $1; next; } if (my ($hid, $start, $end, $hstart, $hend, $score, $evalue) = /^(\S+)\s+\d+\/\d+\s+(\d+)\s+(\d+)\s+\S+\s+(\d+)\s+(\d+)\s+\S+\s+(\S+)\s+(\S+)/) { $evalue = sprintf ("%.3e", $evalue); my $fp = $self->create_protein_feature($start, $end, $score, $id, $hstart, $hend, $hid, $self->analysis, $evalue, 0); push @hits, $fp; } } } $self->output(\@hits); } 1;
}
run_analysisdescriptionprevnextTop
sub run_analysis {
  my ($self) = @_;
  
  my $options = "";
  if (defined($self->options)) {
    $options .= $self->options;
  }
  if ($options !~ /\-\-acc/) {
    $options .= ' --acc';
  }
  if ($options !~ /\-\-cpu/) {
    $options .= ' --cpu 1';
  }

  my $cmd = $self->program 
      . ' ' . $options
      . ' ' . $self->database 
      . ' ' . $self->queryfile 
      .' > '. $self->resultsfile;

  print STDERR "Running:$cmd\n";
  
  throw ("Error running ".$self->program." on ".
         $self->queryfile." against ".$self->database)unless 
         ((system ($cmd)) == 0);
}
General documentation
APPENDIXTop