Created
June 13, 2011 13:17
-
-
Save seandavi/1022747 to your computer and use it in GitHub Desktop.
Call varScan using named pipes (fifos)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Sean Davis <[email protected]> | |
# | |
# Uses named pipes (FIFO) to reduce storage needs | |
# to call varscan somatic | |
# Some details may need to be edited to meet particular needs | |
# call with the following parameters | |
# 1) The FASTA file containing the reference genome | |
# 2) The Normal bam file | |
# 3) The tumor bam file | |
# 4) The output file prefix | |
# Outputs the varscan snp and indel files as well as the somatic-processed files | |
REFFILE=$1 | |
TUMORBAM=$3 | |
NORMALBAM=$2 | |
OUTFILE=$4 | |
mkdir -p /scratch/sedavis | |
mkfifo /scratch/sedavis/${TUMORBAM}.fifo | |
mkfifo /scratch/sedavis/${NORMALBAM}.fifo | |
/usr/local/samtools/samtools mpileup -f $REFFILE -q 5 -L 10000 -d 10000 ${TUMORBAM} > /scratch/sedavis/${TUMORBAM}.fifo & | |
/usr/local/samtools/samtools mpileup -f $REFFILE -q 5 -L 10000 -d 10000 ${NORMALBAM} > /scratch/sedavis/${NORMALBAM}.fifo & | |
java -jar /data/sedavis/usr/local/jars/VarScan.v2.2.5.jar somatic /scratch/sedavis/${NORMALBAM}.fifo /scratch/sedavis/${TUMORBAM}.fifo ${OUTFILE} | |
rm /scratch/sedavis/${TUMORBAM}.fifo | |
rm /scratch/sedavis/${NORMALBAM}.fifo | |
java -jar /data/sedavis/usr/local/jars/VarScan.v2.2.5.jar processSomatic ${OUTFILE}.snp | |
java -jar /data/sedavis/usr/local/jars/VarScan.v2.2.5.jar processSomatic ${OUTFILE}.indel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a really good and neat way of running varscan. very impressive..!