Search code examples
bashpipesamtools

How to pipe samtools mileup with varscan trio caller?


I have seen piping samtools with varscan as follows

samtools mpileup -f reference.fasta sample1.bam sample2.bam | java -jar VarScan.jar mpileup2snp

But how to pipe the following pipeline for varscan trio

#Generate a three-sample mpileup
samtools mpileup -B -q 1 \
     -f ref.fasta \
     dad.bam mom.bam child.bam > trio.mpileup

#Run VarScan trio
varscan trio \
     trio.mpileup \ #this is input
     trio.mpileup.output \ #this is output
     --min-coverage 10 --min-var-freq 0.20 --p-value 0.05 \ 
     -adj-var-freq 0.05 -adj-p-value 0.15

Solution

  • No idea if varscan supports this (or even what it is), but try

    #Generate a three-sample mpileup
    samtools mpileup -B -q 1 \
         -f ref.fasta \
         dad.bam mom.bam child.bam |
    
    varscan trio \
         - \
         trio.mpileup.output \
         --min-coverage 10 --min-var-freq 0.20 --p-value 0.05 \ 
         -adj-var-freq 0.05 -adj-p-value 0.15
    

    If you use Bash, you can replace - with /dev/stdin which should look to varscan like just a file name like any other.