Been struggling with a new error that has popped up with calling variants with samtools, using mpileup
Current command:
samtools mpileup -C50 -Q 20 -q 20 -B -I -S -f ../Pila.88.seeds.fasta pila.s1.sort.nodup.bam pila.s2.sort.nodup.bam pila.s5.sort.nodup.bam | bcftools view -bvcg - > pila.var.raw.bcf
Output:
[mpileup] 3 samples in 3 input files
<mpileup> Set max per-file depth to 2666
[bcf_sync] incorrect number of fields (0 != 5) at 0:0
[afs] 0:0.000
I have tried stripping everything down to one bam file, no specific parameters but it's always the same error. The bam files themselves are fine, not corrupted as I was able to sort, index, etc without issue. I did perform a conversion from sam to bam following a bwa mapping step and perhaps that could be a problem. The conversion was performed in samtools with view however and this was repeated again to ensure no errors come from there.
I just pulled the latest code as posts indicate issues similar to this have been resolved...
1 answer
Found the error in my ways. Missed a very critical -u flag in the mpileup line to produce the uncompressed bcf.
Log in to answer this question.
Could you run Picard ValidateSamFile on your bam-alignment and post what that says?