Grepping samples out of vcf and writing them to a new file

0

I am trying to select samples from a bigger vcf file and write the subset into a new vcf.gz file.
The first part works well, meaning getting the samples out of the initial file.
( bcftools view initial_vcf.vcf.gz --force-samples -s samp1,samp2 )

When I try to write the new file though, I end up with a 0 bytes fcf.gz file ("unexpected end of file").
I've tried formats like this:

bcftools view initial_vcf.vcf.gz --force-samples -S selected_samples.txt | bgzip -c >  new_vcf.vcf.gz

and versions of

bcftools view initial_vcf.vcf.gz --force-samples -S selected_samples.txt -Oz -o new_vcf.vcf.gz

Any help/suggestion greatly appreciated.


VCF


grep


bgzip


bcftools

• 120 views



Source link