[Bioperl-l] StandAloneBlast : 2 newbie questions

Jason Stajich jason@chg.mc.duke.edu
Mon, 18 Jun 2001 17:08:40 -0400 (EDT)


On Sat, 16 Jun 2001, Alexandre Irrthum wrote:

> Hello,
> 
> Two naive questions about the StandAloneBlast module. If it helps,
> I am using Bioperl 0.7.0. with Perl 5.005_03.
> 
> Question 1.
> 
> In the following script, the call to blastall doesn't seem to work
> because I modify the input record separator variable $/. The fields of
> the BPlite object $blast_report are undef. No problem if let $/="\n". 
> Is there a way to use StandAloneBlast while still changing $/ ?  

I think you should be using the local directive - 
set it in the loop see below.

> 
> TEST SCRIPT :
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use Bio::Seq;
> use Bio::Tools::Run::StandAloneBlast;
> 
> my @params = (program => 'blastx', database => 'SPEns');
> my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
  my $savedval = $/;
> $/ = "..";
> open(SEQS, 'seqs') || die "Can't open : $!\n";
> while(<SEQS>) {
   local $/ = $savedval;
>   chomp;
>   if (/([acgtn]{40,})/) {
>     my $seq = Bio::Seq->new(-id => "test", -seq => $1);
>     print "Sequence: ", $seq->seq(), "\n";
>     my $blast_report = $factory->blastall($seq);
>     print $blast_report->query, "\n";
>   }
> }
> close(SEQS);
> 
> TEST INPUT FILE (seqs) :
> 
> ..
> catcagctaaacttgctggaggcaacccaatgaatgttccagcagccaagaagaggagggg
> ..
> catcagcttcacttgctgtttgcaacccaatgagggttccagcagccaagtagaggagtgg
> ..
> catcagcttcacttgctggagacaacccaatccgcagttccagcagccaagaagagggggg
> 
> Question 2.
> 
> I have to perform a large number a blast iterations and would like
> to avoid accumulation of temporary input sequence files in /tmp.
> Can I get the name of these files after each iteration to unlink them,
> or is there another way ?
> 
> 
> Thank you for your help.
> 
> 
> Alexandre Irrthum 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 

Jason Stajich
jason@chg.mc.duke.edu
Center for Human Genetics
Duke University Medical Center 
http://www.chg.duke.edu/