[Bioperl-l] How put tmp file in the tmp directory when using Bio::Tools::Run::StandAloneBlastPlus?

Peng Yu pengyu.ut at gmail.com
Mon Jun 7 00:33:59 UTC 2010


Sorry if I ask some question that is documented. I'm trying to read as
much relevant document as I can, but I can't guarantee read everything
that is relevant.

I don't understand why "registered" files and databases are relevant
for my use case. (BTW, what are "registered" files and what they are
for?).  I don't specify any database option when I call
StandAloneBlastPlus in my example. If I call blast directly, I'll not
get any tempfiles. Therefore, it is reasonable to expect not seeing
any tempfiles with bioperl module as I understand StandAloneBlastPlus
is a wrapper for blast+. What is the purpose of leaving temp files in
the current directory? Is it better not to leave any tempfiles in the
current directory by default?

On Sun, Jun 6, 2010 at 6:37 PM, Chris Fields <cjfields at illinois.edu> wrote:
> Peng,
> You really need to read all relevant documentation prior to firing off emails to the list.  This is answered in the StandAloneBlastPlus installed documentation ('perldoc Bio::Tools::Run::StandAloneBlastPlus'):
>  Cleaning up temp files
>       Temporary analysis files produced under a single factory instances can
>       be unlinked by running
>        $fac->cleanup;
>       Tempfiles are generally not removed unless this method is explicitly
>       called. "cleanup()" only unlinks "registered" files and databases. All
>       temporary files are automatically registered; in particular,
>       "anonymous" databases (such as
>        $fac->Bio::Tools::Run::StandAloneBlastPlus->new(
>          -db_data => 'myseqs.fas',
>          -create => 1
>        );
>       without a "-db_name" specification) are registered for cleanup. Any
>       file or database can be registered with an internal method:
>        $fac->_register_temp_for_cleanup('testdb');
> chris
> On Jun 6, 2010, at 5:52 PM, Peng Yu wrote:
>> The following perl program generate tmp files at the current
>> directory, which is annoying. Is there a way to put the tmp files in a
>> tmp directory say /tmp?
>> #!/usr/bin/env perl
>> use strict;
>> use warnings;
>> use Bio::Tools::Run::StandAloneBlastPlus;
>> use Bio::Perl;
>> my $factory = Bio::Tools::Run::StandAloneBlastPlus->new();
>> my $seq1 = Bio::Perl::read_sequence('first.fa');
>> my $seq2 = Bio::Perl::read_sequence('second.fa');
>> print $seq1->seq, "\n";
>> print $seq2->seq, "\n";
>> my $blast_result=$factory->bl2seq(-method=>'blastn',
>>  -query=> $seq1,
>>  -subject=> $seq2
>> );
>> --
>> Regards,
>> Peng
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l


More information about the Bioperl-l mailing list