fastp icon indicating copy to clipboard operation
fastp copied to clipboard

fastp needs a directory to write output sequences

Open crcardenas opened this issue 2 years ago • 0 comments

Minor thing that I've found through trial and error for fastp-v0.19.5 & fastp-v0.20.1 I cannot install the latest version of fastp; different issue: https://github.com/OpenGene/fastp/issues/383#issuecomment-1088442268

Regardless, here is the behavior I've noticed: fastp requires a directory to exist before you can write the output file in a different directory.

For example, given a directory of samples where the directory "fastq" is the parent directory, and each sample directory contains paired reads, and lastly the intended target directory is currently empty output directory (trimmed/)

data/
    |__ fastq/
    |   |
    |   |__ sample_SRS111/
    |   |          SRR119read1.fq.gz
    |   |          SRR119read2.fq.gz
    |   |
    |   |__ sample_SRS112/
    |             SRS219read1.fq.gz
    |             SRS219read2.fq.gz
    |
    |__ trimmed/
    |
    |__ bash-scripts/
              fastp_trim.sh

and given the basic fastp command:

fastp 
-i data/fastq/sample_SRS111/SRR119read1.fq.gz 
-o data/trimmed/sample_SRR111/SRR119_r1.fq.gz 
-I data/fastq/sample_SRS111/SRR119read2.fq.gz 
-O data/trimmed/sample_SRR111/SRR119_r2.fq.gz

fastp will not write the file unless there is a directory available for the output of fastp. It expects the directory to look like this:

data/
    |
    |__ fastq/
    |   |
    |   |__ sample_SRS111/
    |   |          SRR119read1.fq.gz
    |   |          SRR119read2.fq.gz
    |   |
    |   |__ sample_SRS112/
    |             SRS219read1.fq.gz
    |             SRS219read2.fq.gz
    |
    |__ trimmed/
    |   |__ sample_SRS111/
    |   |
    |   |__ sample_SRS112/
    | 
    |__ bash-scripts/
               fastp_trim.sh

This behavior may be intended, but I did not see it documented.

crcardenas avatar Apr 05 '22 09:04 crcardenas