lh3 / seqtk

Toolkit for processing sequences in FASTA/Q formats
MIT License
1.38k stars 308 forks source link

seqtk sample can't properly output fastq.gz #194

Closed soappp9527 closed 2 years ago

soappp9527 commented 2 years ago

I am trying to ramdomly extract 1000 reads from a fastq.gz

seqtk sample -s 999 all.fastq.gz 1000 > sub.fq.gz

but sub.fq.gz become readable just like a fastq text file which without gzip although with .gz suffix

$ gzip -l sub.fq.gz

gzip: sub.fq.gz: not in gzip format

seqtk sample seems can't gzip automatically

lh3 commented 2 years ago

If you want gzip'd output, use pipe

seqtk sample -s 999 all.fastq.gz 1000 | gzip > sub.fq.gz