Skip to content
Snippets Groups Projects
Commit ec1a962c authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

update snpeff ref; remove unnecessary ref data checks

parent 04d7650b
No related merge requests found
#!/bin/bash nucleu#!/bin/bash
#germline_vc.sh #germline_vc.sh
usage() { usage() {
...@@ -36,21 +36,7 @@ if [[ -z $NPROC ]] ...@@ -36,21 +36,7 @@ if [[ -z $NPROC ]]
then then
NPROC=`nproc` NPROC=`nproc`
fi fi
if [[ -s "${index_path}/dbSnp.vcf.gz" ]]
then
dbsnp="${index_path}/dbSnp.vcf.gz"
gatk4_dbsnp="${index_path}/dbSnp.gatk4.vcf.gz"
else
echo "Missing dbSNP File: ${index_path}/dbSnp.vcf.gz"
usage
fi
if [[ -s "${index_path}/GoldIndels.vcf.gz" ]]
then
knownindel="${index_path}/GoldIndels.vcf.gz"
else
echo "Missing InDel File: ${index_path}/GoldIndels.vcf.gz"
usage
fi
if [[ -s "${index_path}/genome.fa" ]] if [[ -s "${index_path}/genome.fa" ]]
then then
reffa="${index_path}/genome.fa" reffa="${index_path}/genome.fa"
...@@ -112,6 +98,12 @@ then ...@@ -112,6 +98,12 @@ then
bcftools norm -c s -f ${reffa} -w 10 -O z -o ${pair_id}.platypus.vcf.gz platypus.vcf.gz bcftools norm -c s -f ${reffa} -w 10 -O z -o ${pair_id}.platypus.vcf.gz platypus.vcf.gz
elif [[ $algo == 'gatk' ]] elif [[ $algo == 'gatk' ]]
then then
gatk4_dbsnp="${index_path}/dbSnp.gatk4.vcf.gz"
if [[ ! -f "${index_path}/dbSnp.gatk4.vcf.gz" ]]
then
echo "Missing dbSNP File: ${index_path}/dbSnp.vcf.gz"
usage
fi
user=$USER user=$USER
module load gatk/4.1.4.0 module load gatk/4.1.4.0
gvcflist='' gvcflist=''
...@@ -129,7 +121,6 @@ then ...@@ -129,7 +121,6 @@ then
tabix ${pair_id}.gatk.vcf.gz tabix ${pair_id}.gatk.vcf.gz
elif [ $algo == 'mutect' ] elif [ $algo == 'mutect' ]
then then
gatk4_dbsnp=${index_path}/clinseq_prj/dbSnp.gatk4.vcf.gz
module load gatk/4.1.4.0 parallel/20150122 module load gatk/4.1.4.0 parallel/20150122
threads=`expr $NPROC / 2` threads=`expr $NPROC / 2`
bamlist='' bamlist=''
......
...@@ -56,7 +56,6 @@ if [[ -f $pon ]] ...@@ -56,7 +56,6 @@ if [[ -f $pon ]]
then then
ponopt="--pon $pon" ponopt="--pon $pon"
fi fi
if [[ -a "${index_path}/genome.fa" ]] if [[ -a "${index_path}/genome.fa" ]]
then then
reffa="${index_path}/genome.fa" reffa="${index_path}/genome.fa"
...@@ -65,21 +64,7 @@ else ...@@ -65,21 +64,7 @@ else
echo "Missing Fasta File: ${index_path}/genome.fa" echo "Missing Fasta File: ${index_path}/genome.fa"
usage usage
fi fi
if [[ -a "${index_path}/dbSnp.vcf.gz" ]]
then
dbsnp="${index_path}/dbSnp.vcf.gz"
else
echo "Missing dbSNP File: ${index_path}/dbSnp.vcf.gz"
usage
fi
if [[ -a "${index_path}/cosmic.vcf.gz" ]]
then
cosmic=${index_path}/cosmic.vcf.gz
else
echo "Missing InDel File: ${index_path}/cosmic.vcf.gz"
usage
fi
baseDir="`dirname \"$0\"`" baseDir="`dirname \"$0\"`"
interval=`cat ${reffa}.fai |cut -f 1 |grep -v decoy |grep -v 'HLA' |grep -v alt |grep -v 'chrUn' |grep -v 'random' | perl -pe 's/\n/ -L /g' |perl -pe 's/-L $//'` interval=`cat ${reffa}.fai |cut -f 1 |grep -v decoy |grep -v 'HLA' |grep -v alt |grep -v 'chrUn' |grep -v 'random' | perl -pe 's/\n/ -L /g' |perl -pe 's/-L $//'`
...@@ -96,7 +81,6 @@ then ...@@ -96,7 +81,6 @@ then
nid=`samtools view -H ${normal} |grep '^@RG' |perl -pi -e 's/\t/\n/g' |grep ID |cut -f 2 -d ':'` nid=`samtools view -H ${normal} |grep '^@RG' |perl -pi -e 's/\t/\n/g' |grep ID |cut -f 2 -d ':'`
fi fi
if [ $algo == 'strelka2' ] if [ $algo == 'strelka2' ]
then then
module load strelka/2.9.10 manta/1.3.1 module load strelka/2.9.10 manta/1.3.1
...@@ -127,6 +111,12 @@ then ...@@ -127,6 +111,12 @@ then
elif [ $algo == 'virmid' ] elif [ $algo == 'virmid' ]
then then
module load virmid/1.2 module load virmid/1.2
cosmic=${index_path}/cosmic.vcf.gz
if [[ ! -f "${index_path}/cosmic.vcf.gz" ]]
then
echo "Missing InDel File: ${index_path}/cosmic.vcf.gz"
usage
fi
virmid -R ${reffa} -D ${tumor} -N ${normal} -s ${cosmic} -t $NPROC -M 2000 -c1 10 -c2 10 virmid -R ${reffa} -D ${tumor} -N ${normal} -s ${cosmic} -t $NPROC -M 2000 -c1 10 -c2 10
perl $baseDir/addgt_virmid.pl ${tumor}.virmid.som.passed.vcf perl $baseDir/addgt_virmid.pl ${tumor}.virmid.som.passed.vcf
perl $baseDir/addgt_virmid.pl ${tumor}.virmid.loh.passed.vcf perl $baseDir/addgt_virmid.pl ${tumor}.virmid.loh.passed.vcf
...@@ -135,7 +125,6 @@ then ...@@ -135,7 +125,6 @@ then
vcf-concat *gt.vcf | vcf-sort | vcf-annotate -n --fill-type -n | java -jar $SNPEFF_HOME/SnpSift.jar filter '((NDP >= 10) & (DDP >= 10))' | perl -pe "s/TUMOR/${tid}/g" | perl -pe "s/NORMAL/${nid}/g" | bgzip > ${pair_id}.virmid.vcf.gz vcf-concat *gt.vcf | vcf-sort | vcf-annotate -n --fill-type -n | java -jar $SNPEFF_HOME/SnpSift.jar filter '((NDP >= 10) & (DDP >= 10))' | perl -pe "s/TUMOR/${tid}/g" | perl -pe "s/NORMAL/${nid}/g" | bgzip > ${pair_id}.virmid.vcf.gz
elif [ $algo == 'mutect' ] elif [ $algo == 'mutect' ]
then then
gatk4_dbsnp=${index_path}/clinseq_prj/dbSnp.gatk4.vcf.gz
module load gatk/4.1.4.0 parallel/20150122 module load gatk/4.1.4.0 parallel/20150122
threads=`expr $NPROC / 2` threads=`expr $NPROC / 2`
gatk --java-options "-Xmx20g" Mutect2 $ponopt --independent-mates -RF AllowAllReadsReadFilter -R ${reffa} -I ${tumor} -tumor ${tid} -I ${normal} -normal ${nid} --output ${tid}.mutect.vcf -L $interval gatk --java-options "-Xmx20g" Mutect2 $ponopt --independent-mates -RF AllowAllReadsReadFilter -R ${reffa} -I ${tumor} -tumor ${tid} -I ${normal} -normal ${nid} --output ${tid}.mutect.vcf -L $interval
......
...@@ -11,7 +11,7 @@ usage() { ...@@ -11,7 +11,7 @@ usage() {
exit 1 exit 1
} }
OPTIND=1 # Reset OPTIND OPTIND=1 # Reset OPTIND
while getopts :r:p:b:t:x:c:y:n:l:a:hf opt while getopts :r:p:b:t:x:c:g:y:n:l:a:hf opt
do do
case $opt in case $opt in
r) index_path=$OPTARG;; r) index_path=$OPTARG;;
...@@ -22,6 +22,7 @@ do ...@@ -22,6 +22,7 @@ do
x) tid=$OPTARG;; x) tid=$OPTARG;;
y) nid=$OPTARG;; y) nid=$OPTARG;;
f) filter=1;; f) filter=1;;
g) snpeffgeno=$OPTARG;;
b) sbam=$OPTARG;; b) sbam=$OPTARG;;
c) tbed=$OPTARG;; c) tbed=$OPTARG;;
l) itdbed=$OPTARG;; l) itdbed=$OPTARG;;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment