# something like this
my $query = new Bio::Seq(-file => $queryfile,
-format => 'Fasta');
my $hmm = Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation::Panther->new
('-query' => $query,
'-program' => 'Panther' or '/usr/local/pubseq/bin/Panther',
'-database' => 'sf_hmm');
$hmm->workdir ($workdir);
$hmm->run;
my @results = $hmm->output;
sub parse_results
{ my ($self) = @_;
my $filehandle;
my $resfile = $self->resultsfile();
my @fps;
if (-e $resfile) {
if (-z $self->resultsfile) {
print STDERR "Panther didn't find any hits\n";
return; }
else {
open (CPGOUT, "<$resfile") or $self->throw("Error opening ", $resfile, "\n "); }
}
while (<CPGOUT>) {
chomp;
next if (/^\/\//);
print "$_\n";
if (my ($id, $hid,$description,$evalue, $score, $start, $end) = /^(\S+)\s+(\S+)\s+(.+)?\s+(\S+)\s+(\S+)\s+(\S+)-(\S+)/) {
print "matched ($id, $hid,$description,$evalue, $score, $start, $end)\n";
$hid =~ s/:SF\d+//;
my $fp= $self->create_protein_feature($start,$end,$score,$id,0,0,$hid,$self->analysis, sprintf("%.3e", $evalue),0);
push @fps,$fp;
}
}
close (CPGOUT);
$self->output(\@fps);
}
1; } |
sub run_analysis
{ my ($self) = @_;
print STDERR "running ".$self->program." against ".$self->database."\n";
my @dbfiles = split(/;/,$self->analysis->db_file);
print STDERR "FILENAME: ".$self->queryfile."\n";
my $cmd = $self->program .' '.
$self->options .' '.
'-n '.
'-l ' . $dbfiles[0] . ' '.
'-i ' . $self->queryfile . ' '.
'-H /software/worm/iprscan/bin/binaries/hmmsearch ' .
'-B /software/worm/iprscan/bin/binaries/blast/blastall ' .
'-T /tmp ' .
'-D I -z -E 1e-3 ' .
'-o ' . $self->resultsfile;
print STDERR "$cmd\n";
$self->throw ("Error running ".$self->program." on ".$self->filename." against ".$dbfiles[0])
unless ((system ($cmd)) == 0); } |