sub parse_results
{ my ($self) = @_;
my $filehandle;
my $resfile = $self->resultsfile();
my @fps;
if (-e $resfile) {
if (-z $resfile) {
print STDERR "PrositeProfile 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";
my $score = 0;
my $hstart = 1;
my $hend = -1;
my ($id, $hid, $start, $end, $evalue ) = /\s*(\S+)\s+\S+\s+(\S+)\s+(\d+)\s+(\d+)\s+([\d\.\-\e]+)\s+\S+\s+\S+/;
$hend = $end - $start + 1;
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." ".$self->analysis->parameters ." against ".$self->database."\n";
print STDERR "FILENAME: ".$self->queryfile."\n";
my $cmd = $self->program .' '.
$self->analysis->parameters .' '.
$self->queryfile.' '.
'> ' . $self->resultsfile;
print STDERR "$cmd\n";
$self->throw ("Error running PrositeProfile_wormbase ".$self->program." on ".$self->queryfile)
unless ((system ($cmd)) == 0); } |