gzip: merged.fastq.gz not in gzip format
1
0
Entering edit mode
3.0 years ago
Kai_Qi ▴ 130

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

RNAseq • 2.5k views
ADD COMMENT
6
Entering edit mode
3.0 years ago
ATpoint 82k

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
ADD COMMENT
0
Entering edit mode

Thanks, In this case, does it mean that I could directly use the zcat generated files as fastq instead of doing it again?

ADD REPLY
2
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

You are very right. Thanks a lot.

I followed a package to analyze the dataset. They recommended to use fastq.

ADD REPLY

Login before adding your answer.

Traffic: 1874 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6