Running bcftools on vcf files
0
0
Entering edit mode
9.2 years ago

Hello

I am trying to run bcftools view -p to filter only the SNPs that have phased genotypes, but I keep getting either empty files or the following error message:

[bcf_sync] incorrect number of fields (0 != 5) at 0:0

Immediately following the VCF file header. Do I need to convert the vcf back to bcf?

Please help, the command I'm running is:

bcftools view input.vcf -p

Thanks,

  • Stefano
sequencing SNP • 3.4k views
ADD COMMENT
2
Entering edit mode

Which version of bcftools are you using?

Edit: BTW, that error normally only happens when it attempts to read BCF in from a pipe and that's in an older format.

ADD REPLY
0
Entering edit mode

Version 0.1.19-44428cd

ADD REPLY
0
Entering edit mode

You are correct, after updating to the latest version it works!

ADD REPLY
0
Entering edit mode

Could you give us the output of:

egrep -C 10 "^#CHROM" input.vcf
ADD REPLY
0
Entering edit mode

I'm showing the first two variants for brevity. This is a non-human organism so disregard unusual chrom names. The first is a phased SNP the second is unphased

LmjF.07    1021    .    T    TC    1261.05    .    AC=1;AF=0.333333;LEN=1;TYPE=ins    GT    0|0|1
LmjF.07    1048    .    T    G    1218.11    .    AB=0.228426;ABP=129.209;AC=1;AF=0.333333;AN=3;AO=45;CIGAR=1X;DP=197;DPB=197;DPRA=0;EPP=4.21667;EPPR=4.4389;GTI=0;LEN=1;MEANALT=1;MQM=28.7556;MQMR=46.9276;NS=1;NUMALT=1;ODDS=148.333;PAIRED=0.111111;PAIREDR=0.605263;PAO=0;PQA=0;PQR=0;PRO=0;QA=1493;QR=5425;RO=152;RPL=27;RPP=6.91895;RPPR=5.06748;RPR=18;RUN=1;SAF=14;SAP=16.956;SAR=31;SRF=83;SRP=5.81036;SRR=69;TYPE=snp;technology.ILLUMINA=1    GT:DP:RO:QR:AO:QA    0/0/1:197:152:5425:45:1493
ADD REPLY

Login before adding your answer.

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