This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Can you concatenate fastq.gz (zipped) and fastq (non-zipped) files?

Is is possible to concatenate fastq files which are compressed to different degrees (compression using different methods)? Or concatenate a mix of fastq and fastq.gz files?

The following command seems to work (but I cannot tell if the final files are properly compressed or combined)

cat file1.fastq.gz file2.fastq > combined.fastq.gz

fastq gzip

Even if that works you probably don't want to play with fire. Either uncompress the first file and then cat/bgzip or bgzip the second file and then cat. Tools may fail silently if they have trouble with files created the way you are showing above.

1 answer

but I cannot tell if the final files are properly compressed or combined

gunzip -t combined.fastq.gz && echo "OK"

but I can tell you it's not properly compressed

Log in to answer this question.