None available.
sub parse_results
{ my ($self) = @_;
my %seqlengths;
my $seqio = Bio::SeqIO->new(-format => 'fasta',
-file => $self->queryfile);
while (my $seq = $seqio->next_seq) {
$seqlengths{$seq->id} = $seq->length;
}
$seqio->close;
my ($fh);
my $resfile = $self->resultsfile;
if (-e $resfile) {
if (-z $resfile) {
return;
}
else {
open ($fh, "<$resfile") or $self->throw("Error opening ", $resfile, "\n ");
}
}
my (@fps, %printsac, $seq_id);
while (<$fh>) {
my $line = $_;
chomp $line;
if ($line =~ s/^Sn;//) { ($seq_id) = $line =~ /^\s*(\w+)/;
}
if ($line =~ s/^1TBH//) {
my ($id) = $line =~ /^\s*(\w+)/;
my ($ac) = $line =~ /(PR\w+);?\s*$/;
$printsac{$id} = $ac;
}
if ($line =~ s/^3TB//) {
if ($line =~ s/^[HN]//) {
my ($num,$temp1,$tot1);
$line =~ s/^\s+//;
my @elements = split /\s+/, $line;
my ($fingerprintName,
$motifNumber,
$temp,
$tot,
$percentageIdentity,
$profileScore,
$pvalue,
$subsequence,
$motifLength,
$lowestMotifPosition,
$matchPosition,
$highestMotifPosition) = @elements;
if (!defined $highestMotifPosition) {
$highestMotifPosition = $matchPosition;
$matchPosition = substr($highestMotifPosition, 0, 5, '');
}
my $start = $matchPosition;
my $end = $matchPosition + $motifLength - 1;
$lowestMotifPosition = 1 if $lowestMotifPosition == -1;
$highestMotifPosition = $lowestMotifPosition + $motifLength -1
if $highestMotifPosition == -1;
$start = 1 if $start < 1;
$end = $seqlengths{$seq_id} if $end > $seqlengths{$seq_id};
my $fp = $self->create_protein_feature($start, $end,
$profileScore,
$seq_id,
$lowestMotifPosition,
$highestMotifPosition,
$printsac{$fingerprintName},
$self->analysis,
$pvalue,
$percentageIdentity);
push @fps, $fp;
}
}
}
close($fh);
$self->output(\@fps);
}
1; } |