sub parse_results
{ my ($self) = @_;
my $filehandle;
my $resfile = $self->resultsfile();
my @fps;
if (-e $resfile) {
if (-z $resfile) {
print STDERR "Pfam didn't find any hits\n";
return;
} else {
open (CPGOUT, "<$resfile") or $self->throw("Error opening ", $resfile, "\n "); }
}
my $id;
while (<CPGOUT>) {
chomp;
print "$_\n";
if (my ($id, $start, $end, $hid, $hstart, $hend, $skipit,$score, $evalue) = /^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(ls)*\s+([\d\.\-\+]+)\s+(\S+)\s+(\S+)/) {
print "matched\n";
my $percentIdentity = 0;
my $fp= $self->create_protein_feature($start, $end, $score, $id, $hstart, $hend, $hid, $self->analysis, $evalue, $percentIdentity);
push @fps, $fp;
}
}
close (CPGOUT);
$self->output(\@fps);
}
1; } |
sub run_analysis
{ my ($self) = @_;
print STDERR "running ".$self->program." against ".$self->database."\n";
print STDERR "FILENAME: ".$self->queryfile."\n";
my $cmd = $self->program .' '.
$self->analysis->parameters .' '.
'-o ' . $self->resultsfile .' '.
$self->queryfile;
print STDERR "$cmd\n";
$PATH = '/software/worm/bin/hmmer/:/software/worm/iprscan/bin/binaries/:'.$PATH; $PATH = '/software/worm/iprscan/bin/binaries/blast/:'.$PATH;
$self->throw ("Error running Pfam_wormbase ".$self->program." on ".$self->queryfile)
unless ((system ($cmd)) == 0); } |