This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem with read counts after concatenating FASTQ files

Hello ! I downloaded multiple run accession files (RNAseq-FASTQ) from ENA and tried to concatenate them using cat.

cat *_1.fastq.gz > merged_R1.fastq.gz

The output file is bigger in size, however, when I look at the read counts it is the same as the first of all the files that were concatenated. I am a beginner in NGS data analysis. Can someone please advise what am I doing wrong/missing.

Thank you

rna-seq fastq

What is ${i}? Please show the entire code including how you determined the read number.

I used the readlength.sh script in bbmap

What is ${i}? Please show the entire code

for i in $(ls -d */)
do
    cd $i
    cat *_1.fastq.gz > ${i%?}_R1.fastq.gz
    cat *_2.fastq.gz > ${i%?}_R2.fastq.gz
    cd ..
done

I had the files for different samples in individual folders.

Looks fine, did checking read counts with the suggestion from RamRS help? I guess everything is fine and simply the counting went wrong.

Yes, RamRS's suggestion did help. Thank you

1 answer

It could be a problem with gzip streaming library. Can you try a simple zcat merged_R1.fastq | wc -l? That should give you 4 * number_of_reads (=number of lines)

Yes, this works. Thank you so much!

Log in to answer this question.