This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Missing SAM header when piping the samtools mpileup output to a VarScan call

I want to run samtools and pipe the mpileup output into a VarScan call using the following conditions:

  • 30 mapping score
  • 30 phred quality score
  • output-snp format
  • min coverage = 50
  • min tumor coverage = 3
  • p-value = 0.01
  • min variant frequency = 4%

Code:

samtools mpileup -B -q 30 -Q 30 -f hg19.fa normal_sort.bam tumor_sort.bam | java
-jar VarScan.v2.3.9.jar somatic /dev/stdin output --mpileup 1 --strand-filter 1 --output-snp --min-coverage 50 --min-coverage-tumor 3 --p-value 0.01 --min-var-freq 0.04

Traceback:

[E::sam_parse1] missing SAM header
[W::sam_read1] Parse error at line 1
Input file was not ready after 100 5-second cycles!
samtools varscan

it's a problem with samtools mpileup -B -q 30 -Q 30 -f hg19.fa normal_sort.bam tumor_sort.bam not varscan.

check both commands output a header

samtools view -H normal_sort.bam 
samtools view -H tumor_sort.bam 

Seems like the normal_sort.bam is missing the header. What should I do about it?

samtools view -H normal_sort.bam
samtools view -H tumor_sort.bam
@SQ     SN:chr22        LN:51304566

0 answers

No answers yet.

Log in to answer this question.