Grepping samples out of vcf and writing them to a new file
0
1
Entering edit mode
3.0 years ago
Kath__ ▴ 10

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 • 1.2k views
ADD COMMENT
0
Entering edit mode

is there any error message ?

ADD REPLY
0
Entering edit mode

Hi Pierre, no error message, it just never finishes.

ADD REPLY
0
Entering edit mode

what is the filesystem ? what is your OS ? "it just never finishes" is contradictory with " I end up with a 0 bytes fcf.gz file" ? what is the size of the initial_vcf.vcf.gz ?

ADD REPLY
0
Entering edit mode

Sorry for the lack of details, I am running it on our Linux server and the original file sizes are around 70GB. And you are right, the claims are a bit contradictory, I can see a file created but nothing is written into it (thus, 0 bytes); the process never terminates though.

ADD REPLY
0
Entering edit mode

the process never terminates though.

70G is high. how long did you wait ?

ADD REPLY
0
Entering edit mode

Several hours, restarted a few hours ago, ps -u username shows me

02:46:37 bcftools
00:00:03 bgzip
ADD REPLY

Login before adding your answer.

Traffic: 1921 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