[Bioperl-l] getting blast orientation in BPlite

Jean-Jack Riethoven pow@ebi.ac.uk
Sat, 27 Jul 2002 12:45:18 +0100 (BST)


> I was just wondering if there is a way to retrieve the orientation of the
> blast output from BPlite?  I can't seem to find anything about it in the
> documentation.
> 
> I need to know if the alignment is plus/plus or plus/minus...


open IN, ($blast_file =~ /\.gz$/) ? 
	"gunzip -c $blast_file |" : "<$blast_file";

my $report = new Bio::Tools::BPlite(-fh=>\*IN);

while (my $sbjct = $report->nextSbjct) {

  while (my $hsp = $sbjct->nextHSP) {

    print "Query strand: " . (($hsp->query->strand == 1) ? "+" : "-");

    print ", Sbjct strand: " . (($hsp->subject->strand == 1) ? "+" : "-") . "\n"; 

  } # while $hsp
} # while $sbjct

Orientation cannot be queried in one go AFAIK, so you have to get query
and subject strands separately. All combinations are possible (++, +-, -+,
--) if you're using wu-blast; ncbi-blast keeps it fortunately simple and
only reverse/complements the subject where necessary.


With kind regards,

Jean-Jack Riethoven

EMBL Outstation - Hinxton           pow@ebi.ac.uk     ICQ#: 3433929
European Bioinformatics Institute   Phone: (+44) 1223 494635      
Wellcome Trust Genome Campus        Fax  : (+44) 1223 494468
Hinxton, Cambridge CB10 1SD         URL  : http://industry.ebi.ac.uk/
UNITED KINGDOM