FastQC icon indicating copy to clipboard operation
FastQC copied to clipboard

Different behavior for "-d" and "--dir"

Open rzelle-lallemand opened this issue 1 year ago • 1 comments

With FastQC v0.12.1 (bioconda hdfd78af_0) on RHEL 9.4, we're seeing a discrepancy when using the "-d" and "--dir" flags to specify a non-standard directory for temporary files

$ fastqc -d "/test/temp" file.fastq.gz 
Option d is ambiguous (delete, dir, dup_length)
null
Failed to process /test/temp
java.io.FileNotFoundException: /test/temp (Is a directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
	at uk.ac.babraham.FastQC.Sequence.FastQFile.<init>(FastQFile.java:77)
	at uk.ac.babraham.FastQC.Sequence.SequenceFactory.getSequenceFile(SequenceFactory.java:106)
	at uk.ac.babraham.FastQC.Sequence.SequenceFactory.getSequenceFile(SequenceFactory.java:62)
	at uk.ac.babraham.FastQC.Analysis.OfflineRunner.processFile(OfflineRunner.java:163)
	at uk.ac.babraham.FastQC.Analysis.OfflineRunner.<init>(OfflineRunner.java:125)
	at uk.ac.babraham.FastQC.FastQCApplication.main(FastQCApplication.java:316)
application/gzip
Started analysis of file.fastq.gz
...

and

$ fastqc --dir "/test/temp" file.fastq.gz 
application/gzip
Started analysis of file.fastq.gz
...

$ fastqc -h meanwhile reports:

-d --dir Selects a directory to be used for temporary files written when generating report images. Defaults to system temp directory if not specified.

Also discussed here: https://github.com/sunbeam-labs/sunbeam/issues/424#issuecomment-1802832761 and https://github.com/bcbio/bcbio-nextgen/issues/3702#issuecomment-1477664839

rzelle-lallemand avatar Oct 17 '24 18:10 rzelle-lallemand

Yeah, that's just a flat out bug. I'll either need to explicitly assign -d to the directory option, or just remove it from the docs. The --dir will work and should be the option to use until this is fixed.

s-andrews avatar Oct 18 '24 06:10 s-andrews