Question: Running bcftools on vcf files
0
gravatar for stefano.iantorno
4.2 years ago by
United Kingdom
stefano.iantorno70 wrote:

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 • 1.9k views
ADD COMMENTlink modified 4.1 years ago by Biostar ♦♦ 20 • written 4.2 years ago by stefano.iantorno70
2

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 REPLYlink modified 4.2 years ago • written 4.2 years ago by Devon Ryan89k

Version 0.1.19-44428cd

ADD REPLYlink written 4.2 years ago by stefano.iantorno70

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

ADD REPLYlink written 4.2 years ago by stefano.iantorno70

Could you give us the output of:

egrep -C 10 "^#CHROM" input.vcf
ADD REPLYlink written 4.2 years ago by RamRS21k

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 REPLYlink written 4.2 years ago by stefano.iantorno70
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 921 users visited in the last hour