Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation Gene3d
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation::Genes3d
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::Analysis::Runnable::ProteinAnnotation::Genes3d->new ('-query' => $query, '-program' => 'hmmpfam' or '/usr/local/pubseq/bin/hmmpfam', '-database' => 'Pfam'); $hmm->workdir ($workdir); $hmm->run; my @results = $hmm->output;
Description
  Blast takes a Bio::Seq (or Bio::PrimarySeq) object and runs hmmpfam.
The resulting output file is parsed to produce a set of Bio::EnsEMBL::FeaturePairs.
Methods
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
parse_resultsdescriptionprevnextTop
sub parse_results {
    my ($self) = @_;

    my $filehandle;
    my $resfile = $self->resultsfile();
    my @fps;
		

    if (-e $resfile) {
	if (-z $resfile) {  
	    print STDERR "Genes3D didn't find any hits\n";
	    return; }       
	else {
	    open (CPGOUT, "<$resfile") or $self->throw("Error opening ", $resfile, "\n ");#
} } #First parse what comes from the ls mode matches. Every match in that case is taken
my $id; while (<CPGOUT>) { chomp; last if /^Alignments of top-scoring domains/; next if (/^Model/ || /^\-/ || /^$/); if (/^Query sequence:\s+(\S+)/) { $id = $1; } if (my ($hid, $start, $end, $hstart, $hend, $score, $evalue) = /^(\S+)\s+\S+\s+(\d+)\s+(\d+)\s+\S+\s+(\d+)\s+(\d+)\s+\S+\s+(\S+)\s+(\S+)/) { my $fp= $self->create_protein_feature($start,$end,$score,$id,$hstart,$hend,$hid,$self->analysis, sprintf("%.3e", $evalue),0); push @fps,$fp; } } close (CPGOUT); $self->output(\@fps); } 1;
}
run_analysisdescriptionprevnextTop
sub run_analysis {
    my ($self) = @_;

    # run program
print STDERR "running ".$self->program." against ".$self->database."\n"; # some of these options require HMMER 2.2g (August 2001)
my @dbfiles = split(/;/,$self->analysis->db_file); print STDERR "FILENAME: ".$self->queryfile."\n"; my $cmd = $self->program .' '. '--acc -E 59.5 -A 100 '. $self->options .' '. $dbfiles[0] .' '. $self->queryfile.' > '. $self->resultsfile; print STDERR "$cmd\n"; $self->throw ("Error running ".$self->program." on ".$self->filename." against ".$dbfiles[0]) unless ((system ($cmd)) == 0);
}
General documentation
CONTACTTop
   Marc Sohrmann: ms2@sanger.ac.uk
APPENDIXTop
run_programTop
 Title    : run_program
Usage : $self->program
Function : makes the system call to program
Example :
Returns :
Args :
Throws :