Question: samtools mpileup and bcftools error HELP~
0
gravatar for linzhang
3.0 years ago by
linzhang0
linzhang0 wrote:

Hi I have used the below command line to call SNPs: samtools-1.2/samtools mpileup -q 25 -Iu -f reference.fasta .*.sorted.bam | bcftools view -Nv - | vcfutils.pl varFilter -Q 20 - >multicall.vcf

but it gives the following error:

[mpileup] 20 samples in 20 input files [bcf_sync] incorrect number of fields (0 != 5) at 0:0 [afs] 0:0.000

and the vcf file it generated only has the headers

Please give any suggestions which will help a lot!! I have been stuck on this for so long...

snp • 1.8k views
ADD COMMENTlink modified 3.0 years ago by Devon Ryan88k • written 3.0 years ago by linzhang0
0
gravatar for Devon Ryan
3.0 years ago by
Devon Ryan88k
Freiburg, Germany
Devon Ryan88k wrote:

99% of the time this is due to using different versions of bcftools and samtools. If you're using samtools-1.2 then you MUST also be using bcftools-1.2.

ADD COMMENTlink written 3.0 years ago by Devon Ryan88k

Thank you so much!! I tried it, it works!! but the generated .vcf file has some problems (all "<x>" in "ALT" column, all "0" in "QUAL" column, all "." in "Filter" column). Besides, it also says "[mpileup] 1 samples in 1 input files", of which I do not know whether it is an error or not.

ADD REPLYlink written 3.0 years ago by linzhang0

The "[mpileup]..." thing is just informational. You'll need to use bcftools call in addition to bcftools view.

ADD REPLYlink written 3.0 years ago by Devon Ryan88k

Thanks a lot! (the commands were given by a senior who no longer works in our lab, I didn't know bcftools call should be used in newer version for samtools mpileup output). I generated a better .vcf file using bcftools call instead of bcftools view, however the "ID" and "FILTER" column is still "."

The command I am using now is: samtools-1.2/samtools mpileup -d 8000 -q 25 -Iu -f reference.fasta *.sorted.bam | bcftools-1.2/bcftools call -m | bcftools-1.2/vcfutils.pl varFilter -Q 20 - > multivariantcall.vcf &

ADD REPLYlink written 3.0 years ago by linzhang0
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: 1055 users visited in the last hour