s-andrews / FastQC

A quality control analysis tool for high throughput sequencing data
GNU General Public License v3.0
440 stars 85 forks source link

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

Open rzelle-lallemand opened 1 day ago

rzelle-lallemand commented 1 day ago

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

s-andrews commented 1 day ago

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.