samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
640 stars 241 forks source link

fail to call indels using command "bcftools call" #2110

Closed Amatatsu15 closed 4 months ago

Amatatsu15 commented 4 months ago

Hi, While using command bcftools call, I find that the output vcf file only includes snps, and indels are strangely missing. For input file, I use two fasta files (ref.fa and reads.fa) , each of them includes one contig whose length is about 900bp. After running command bcftools mpileup, indel information still seem to be detected.

Here is detail information: 1.cigar code in .sam file: 5^TTA82C265C67C263A15G14C38C102 (indicating that there is a deletion starting from the 6th base)

  1. .vcf file after running mpileup: vcf
  2. .vcf file after running call: image
  3. commands that I've used: bwa index ref.fa bwa mem ref.fa reads.fa > aln.sam samtools view -@ 16 -b -S aln.sam -o aln.bam samtools faidx ref.fa bcftools mpileup aln.bam --fasta-ref ref.fa > aln.vcf bcftools call aln.vcf --ploidy 1 -c -v -o aln-snp.vcf

I've tried several different input files, but the problem remains the same. Longer deletions(40bp) can't be detected either.

jkbonfield commented 4 months ago

A BAM or SAM file demonstrating the problem would help.

Also how many records have this deletion? Bcftools requires a minimum of 2 reads to consider an indel (unless reduced with mpileup -m 1).

Amatatsu15 commented 4 months ago

Thank you for your answer, now I understand what's going on. The solution of adding parameter -m 1 for mpileup works. Again, thanks a lot.