Thanks, In this case, does it mean that I could directly use the zcat generated files as fastq instead of doing it again?
Hi:
I have several fastq.gz files and I have combined them into one using:
zcat file1.fastq.gz file2.fastq.gz file3.fastq.gz > merged.fastq.gz
Now I would like to convert the merged file into a fastq file using:
gunzip merged.fastq.gz
and I got an error:
gzip: merged.fastq.gz: not in gzip format
I have tried gunzip on the individual fastq.gz files and it worked. Can anyone help me understand where is the problem?
Thanks, Kai
1 answer
zcat decompresses the stream, therefore merged.fastq.gz is not compressed but a plain (normal) text file that should be called merged.fastq. Just use cat rather than zcat, as cat can concatenate compressed files.
cat file1.fastq.gz file2.fastq.gz file3.fastq.gz > merged.fastq.gz
The output of your command should be an uncompressed file, you can confirm by running head on it. It should return the first few reads, instead of the gibberish that is printed to screen when heading a compressed file. I see no reason to ever uncompress a fastq file though, it just takes up space.
You are very right. Thanks a lot.
I followed a package to analyze the dataset. They recommended to use fastq.
Log in to answer this question.