I cannot extract all of the contents of a gzipped vcf file. The file is part of an encrypted tarball I downloaded from dbGaP. After decryption, I was able to extract a directory of files with this command:
tar -xvf phg001.tar
When I used Plink to convert one of the extracted vcf files to a bed file, I got an error message: Error: Line 20 of .vcf file has fewer tokens than expected.
I counted the number of lines in the files with the help of zcat.
zcat chr22-filtered.dose.vcf.gz | wc -l
Output:
gzip: chr22-filtered.dose.vcf.gz: decompression OK, trailing garbage ignored
19
And if I try to unzip the file, I get a similar message about trailing garbage.
gzip: test22.vcf.gz: decompression OK, trailing garbage ignored
The file is too large to have only 20 lines, and if I count the number of lines without using zcat, there is indeed more to the file.
wc -l chr22-filtered.dose.vcf.gz
3632730 chr22-filtered.dose.vcf.gz
How can I extract all of the contents of the zipped file.
All advice is appreciated.
Paul
Updated: Here are the results from pigz:
pigz -ltv chr22-filtered.dose.vcf.gz
method check timestamp compressed original reduced name
gzip 8 3388a535 ------ ----- 17965 65280 72.5% chr22-filtere...
gzip 8 50734e24 ------ ----- 1356 39654 96.6% <...>
pigz: warning: chr22-filtered.dose.vcf.gz: trailing junk was ignored
ls-vcf.c1$ pigz -ltv chr13-filtered.dose.vcf.gz
method check timestamp compressed original reduced name
gzip 8 15c3d4c1 ------ ----- 18431 65280 71.8% chr13-filtere...
gzip 8 e17a4674 ------ ----- 3221 39654 91.9% <...>
pigz: warning: chr13-filtered.dose.vcf.gz: trailing junk was ignored
pigz -ltv chr2-filtered.dose.vcf.gz
method check timestamp compressed original reduced name
gzip 8 f4cfe9f0 ------ ----- 18245 65280 72.1% chr2-filtered...
gzip 8 e8370ff3 ------ ----- 2345 39654 94.1% <...>
pigz: warning: chr2-filtered.dose.vcf.gz: trailing junk was ignored
pigz -ltv chr21-filtered.dose.vcf.gz
method check timestamp compressed original reduced name
gzip 8 967d168f ------ ----- 19756 65280 69.7% chr21-filtere...
gzip 8 9e27cda1 ------ ----- 8588 39654 78.3% <...>
pigz: warning: chr21-filtered.dose.vcf.gz: trailing junk was ignored
The output for all the files is similar. And all the files have the same error when I try to extract with gunzip.
-ltv
. Try that on your examples, and add the results to your question.