fastp icon indicating copy to clipboard operation
fastp copied to clipboard

Multiple R1 and R2 fastq input

Open rebeelouise opened this issue 1 year ago • 0 comments

Hello!

I just wanted to check whether you can input multiple R1 and R2 reads from the same sample over multiple lanes into fastp and output into one concatenated fastq.gz...

Here is a basic script I used:

`#script to trim illumina paired end reads with fastp

ipath=$1 #list of directories from illumina run
opath=$2 #output path
unique=$3 

#make sure opath exists without overwriting

mkdir -p $opath

#loop through directories for fastp 

cd $ipath 

for i in $(ls)
do
	mkdir -p ${opath}/${i}
	fastp -i ${i}/*R1.fastq.gz -I ${i}/*R2.fastq.gz -o ${opath}/${i}/trimmed-${i}-${unique}-R1.fastq.gz -O ${opath}/${i}/trimmed-${i}-${unique}-R2.fastq.gz -j ${opath}/${i}/${i}-${unique}-fastp.json -h ${opath}/${i}/${i}-${unique}-fastp.html --thread 16 
done	

`

in "i" I had multiple R1 and R2 files for one sample. However the output file size resembled the size of one fastq as opposed to 4.

It printed the command back to me as I expected:

fastp -i Sample_102/102_220713_L001_R1.fastq.gz Sample_102/102_220713_L002_R1.fastq.gz Sample_102/102_220713_L003_R1.fastq.gz Sample_102/10z Sample_102/102_220729_L002_R1.fastq.gz Sample_102/102_220729_L003_R1.fastq.gz Sample_102/102_220729_L004_R1.fastq.gz -I Sample_102/102_220713_L001_R2.fastq.gz Sample_102/102_220713_L002_R2.fastq.gz Sample_102/102_220713_L003_R2.fastq.gz Sample_102/102_220713_L004_R2.fastq.gz Sample_102/102_220729_L001_R2.fastq.gz Sample_102/102_220729_L002_R2.fastq.gz Sample_102/102_220729_L003_R2.fastq.gz Sample_102/102_220729_L004_R2.fastq.gz -o /home/rebee/projects/DRAGON/data/Trimmed/Sample_102/trimmed-Sample_102-P2-R1.fastq.gz -O /home/rebee/projects/DRAGON/data/Trimmed/Sample_102/trimmed-Sample_102-P2-R2.fastq.gz -j /home/rebee/projects/DRAGON/data/Trimmed/Sample_102/Sample_102-P2-fastp.json -h /home/rebee/projects/DRAGON/data/Trimmed/Sample_102/Sample_102-P2-fastp.html --thread 16

Is there a way for fastp to recognise multiple input for one sample? Or is it better practice to concatenate them first?

Any thoughts welcome!

:)

rebeelouise avatar Aug 12 '22 09:08 rebeelouise