rpetit3 / dragonflye

:dragon: :fly: Assemble bacterial isolate genomes from Nanopore reads
GNU General Public License v3.0
117 stars 10 forks source link

Fast temporary directory not used by kmc #35

Open iorga opened 2 months ago

iorga commented 2 months ago

Hello,

When a custom fast temporary directory is selected with the option --tmpdir, this is not used by kmc, which uses the default tmp directory instead.

[dragonflye] You ran: /sys/dragonflye/bin/dragonflye --outdir flye_out --reads file.fastq.gz --tmpdir /home_local/tmp --cpus 20 --assembler flye --racon 4
...
[dragonflye] Using tempdir: /home_local/tmp
...
[dragonflye] Estimating genome size by counting unqiue 21-mers > frequency 10
[dragonflye] Running: kmc -sm -m8 -t20 -k21 -ci10 file\.fastq\.gz /tmp/1081228.1.hpc/WPYrSVwMJu/kmc /tmp/1081228.1.hpc/WPYrSVwMJu 2>&1 | sed 's/^/[kmc] /' | tee -a dragonflye.log

The following modification of line 219 in dragonflye fixes the issue:

- my $tmpout = File::Temp->newdir();
+ my $tmpout = File::Temp->newdir(DIR => $tmpdir, CLEANUP => 1 );

The output is now:

[dragonflye] You ran: /sys/dragonflye/bin/dragonflye --outdir flye_out --reads file.fastq.gz --tmpdir /home_local/tmp --cpus 20 --assembler flye --racon 4
...
[dragonflye] Using tempdir: /home_local/tmp
...
[dragonflye] Estimating genome size by counting unqiue 21-mers > frequency 10
[dragonflye] Running: kmc -sm -m8 -t20 -k21 -ci10 file\.fastq\.gz /home_local/tmp/SACmBvwO_t/kmc /home_local/tmp/SACmBvwO_t 2>&1 | sed 's/^/[kmc] /' | tee -a dragonflye.log

Many thanks, Bogdan