Bio::Tools::BPlite::Iteration - object for parsing single iteration of a PSIBLAST report
use Bio::Tools::BPpsilite;
open my $FH, "t/psiblastreport.out";$report = Bio::Tools::BPpsilite->new(-fh=>\*FH);
# determine number of iterations executed by psiblast$total_iterations = $report->number_of_iterations;$last_iteration = $report->round($total_iterations);
# Process only hits found in last iteration ...$oldhitarray_ref = $last_iteration->oldhits;HIT: while($sbjct = $last_iteration->nextSbjct) {$id = $sbjct->name;$is_old = grep /\Q$id\E/, @$oldhitarray_ref;if ($is_old ){next HIT;}# do something with new hit...}
ALIGNMENTS
# This assumed that you have $db pointing to a database, $out to an output file# $slxdir to a directory and $psiout# note the alignments can only be obtained if the flag "-m 6" is run.# It might also be necessary to use the flag -v to get all alignments#my @psiparams = ('database' => $db , 'output' => $out, 'j' => 3, 'm' => 6,'h' => 1.e-3 , 'F' => 'T' , 'Q' => $psiout );my $factory = Bio::Tools::Run::StandAloneBlast->new(@psiparams);my $report = $factory->blastpgp($seq);my $total_iterations = $report->number_of_iterations();my $last_iteration = $report->round($total_iterations);my $align=$last_iteration->Align;my $slxfile=$slxdir.$id.".slx";my $slx = Bio::AlignIO->new('-format' => 'selex','-file' => ">".$slxfile );$slx->write_aln($align);
See the documentation for BPpsilite.pm for a description of the Iteration.pm module. Email: [email protected] Jason Stajich, [email protected] Based on work of: Ian Korf ([email protected], http://sapiens.wustl.edu/~ikorf), Lorenz Pollak ([email protected], bioperl port) BPlite.pm is copyright (C) 1999 by Ian Korf. This software is provided "as is" without warranty of any kind.
query
Title : queryUsage : $query = $obj->query();Function : returns the query objectExample :Returns : query objectArgs :
qlength
Title : qlengthUsage : $len = $obj->qlength();Returns : length of queryArgs : none
newhits
Title : newhitsUsage : $newhits = $obj->newhits();Returns : reference to an array listing all the hitsfrom the current iteration which were not identifiedin the previous iterationArgs : none
oldhits
Title : oldhitsUsage : $oldhits = $obj->oldhits();Returns : reference to an array listing all the hits fromthe current iteration which were identified andabove threshold in the previous iterationArgs : none
nextSbjct
Title : nextSbjctUsage : $sbjct = $obj->nextSbjct();Function : Method of iterating through all the Sbjct retrievedfrom parsing the report#Example : while ( my $sbjct = $obj->nextSbjct ) {}Returns : next Sbjct object or undef if finishedArgs :
Align
Title : AlignUsage : $SimpleAlign = $obj->Align();Function : Method to obtain a simpleAlign object from psiblastExample : $SimpleAlign = $obj->Align();Returns : SimpleAlign object or undef if not found.BUG : Only works if psiblast has been run with m 6 flagArgs :
_readline
Title : _readlineUsage : $obj->_readlineFunction: Reads a line of input.
Note that this method implicitely uses the value of $/ that isin effect when called.
Note also that the current implementation does not handle pushedback input correctly unless the pushed back input ends with thevalue of $/.Example :Returns :
_pushback
Title : _pushbackUsage : $obj->_pushback($newvalue)Function: puts a line previously read with _readline back into a bufferExample :Returns :Args : newvalue