Quantcast
Channel: Post Feed
Viewing all articles
Browse latest Browse all 41826

Bioperl Standaloneblastplus, Cleaning Up Thousands Of Temp Files

$
0
0
Hi, I'm using StandAloneBlastPlus BioPerl module as NCBI blast+ wrapper. I have to perform sequence alignments against a database of bacteria using multiple processes on a cluster. A temp file (.fas) is created for each call to blast+, so hundreds and thousands may be created. I think StandAloneBlastPlus use File::Temp module for that. I would like to know the best way to control the growth of the number of files to avoid problems in my file system, wait until the program finishes to delete files is inappropriate. Moreover I don't know if there can be name collisions when create temp files with several processes running the same code with different data. The way they are created is transparent thanks to BioPerl. Some code: sub invoke_blast { my $genome = $_[0]; my $query = $_[1]; $genome =~ /.*\/([^\/]*).fna/; my $name1 = $1; my @arr = split (/\|/, $query->display_id() ); my $name2 = "$arr[0].$arr[1]"; my $blastout = "$name1.$name2.blast"; return $blast_factory -> bl2seq (-method => 'blastn', -query => $query, -subject => $genome, -max_target_seqs => 1, -outfile => $blastout ); } my $blast_factory = Bio::Tools::Run::StandAloneBlastPlus -> new (-prog_dir => $BLAST_PATH, -program => 'blastn' ); ... &invoke_blast(...) in a loop $blast_factory->cleanup; ...

Viewing all articles
Browse latest Browse all 41826

Trending Articles