[Bioperl-l] question temp files in blast
dimitark at bii.a-star.edu.sg
dimitark at bii.a-star.edu.sg
Wed Dec 11 01:53:52 UTC 2013
Hi guys,
i have a question about StandAloneBlastPlus and File::Temp.
I encountered a problem which arises from File::Temp in my particular
script. In previous email i said i forced StandAloneBLastPLus to
accept a TEMP_DIR which i give through modifying BlastMethods.pm and
StandAloneBlastPlus.pm. This works but not always and that is because
File::Temp is using the built in perl function rand() which uses
srand().
Now in brief: my script is splitting a large FASTA into smaller ones
and for each of the smaller ones is starting a new thread of BLAST
with as many threads as desired. Also is creating a special TEMP_DIR
for each thread in which the temp blast files are stored: file.fas and
the blast_result. However because of the rand() some clashing of file
names occurs because there is not enough randomness and some of my
threads die, not always but very often.
So my question is the following. Should i try to modify
BlastMethods.pm and StandAloneBlastPlus.pm further so that i can
manually specify the file names of the temp files or to use another
module like Math::Random::Secure in order to produce a really random
number which i can then pass to srand() after i create my threads so
that there is no temp file names clashing?
The easiest is to just use additional module but then more
dependencies just for one random number. On the other hand if i modify
the current modules i will be sure that there wont be a chance to have
temp file name clashing at all and no further dependencies.
I am sorry if my email seems too messy but i tried to put it really brief.
Any advice is welcomed!
Thank you for your time
Cheers
Dimitar
More information about the Bioperl-l
mailing list