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

adding options for tbed file

parent 58c7a125
No related merge requests found
...@@ -66,14 +66,14 @@ else ...@@ -66,14 +66,14 @@ else
ponopt=''; ponopt='';
fi fi
fbsplit="${index_path}/genomefile.5M.txt"
cat ${reffa}.fai |cut -f 1 |grep -v decoy |grep -v 'HLA' |grep -v alt |grep -v 'chrUn' |grep -v 'random' > intervals.txt
interval=`cat intervals.txt | perl -pe 's/\n/ -L /g' |perl -pe 's/-L $//'`
if [[ -n $tbed ]] if [[ -n $tbed ]]
then then
awk '{print $1":"$2"-"$3}' $tbed > intervals.txt
interval=$tbed interval=$tbed
awk '{print $1":"$2"-"$3}' $tbed > fbsplit.genomefile.txt
fbsplit=fbsplit.genomefile.txt
else
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 $//'`
fbsplit="${index_path}/genomefile.5M.txt"
fi fi
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
...@@ -130,12 +130,13 @@ then ...@@ -130,12 +130,13 @@ then
elif [ $algo == 'mutect' ] elif [ $algo == 'mutect' ]
then then
gatk4_dbsnp=${index_path}/clinseq_prj/dbSnp.gatk4.vcf.gz gatk4_dbsnp=${index_path}/clinseq_prj/dbSnp.gatk4.vcf.gz
module load gatk/4.1.4.0 module load gatk/4.1.4.0 parallel/20150122
threads=`expr $NPROC / 2`
bamlist='' bamlist=''
for i in *.bam; do for i in *.bam; do
bamlist+="-I ${i} " bamlist+="-I ${i} "
done done
gatk --java-options "-Xmx20g" Mutect2 $ponopt -R ${reffa} ${bamlist} --output ${pair_id}.mutect.vcf -RF AllowAllReadsReadFilter --independent-mates --tmp-dir `pwd` -L $interval cut -f 1 intervals.txt | parallel --delay 1 --jobs $threads "gatk --java-options \"-Xmx20g\" Mutect2 $ponopt -R ${reffa} ${bamlist} -RF AllowAllReadsReadFilter --independent-mates --tmp-dir `pwd` --output ${pair_id}.mutect.{}.vcf -L {}"
vcf-sort ${pair_id}.mutect.vcf | vcf-annotate -n --fill-type | java -jar $SNPEFF_HOME/SnpSift.jar filter -p '(GEN[*].DP >= 10)' | bgzip > ${pair_id}.mutect.vcf.gz vcf-sort ${pair_id}.mutect.vcf | vcf-annotate -n --fill-type | java -jar $SNPEFF_HOME/SnpSift.jar filter -p '(GEN[*].DP >= 10)' | bgzip > ${pair_id}.mutect.vcf.gz
elif [[ $algo == 'strelka2' ]] elif [[ $algo == 'strelka2' ]]
then then
......
...@@ -34,6 +34,10 @@ do ...@@ -34,6 +34,10 @@ do
esac esac
done done
source /etc/profile.d/modules.sh
module load htslib/gcc/1.8 samtools/gcc/1.8 snpeff/4.3q vcftools/0.1.14
export PATH=/project/shared/bicf_workflow_ref/seqprg/bin:$PATH
shift $(($OPTIND -1)) shift $(($OPTIND -1))
#Check for mandatory options #Check for mandatory options
...@@ -78,11 +82,10 @@ else ...@@ -78,11 +82,10 @@ else
fi fi
baseDir="`dirname \"$0\"`" baseDir="`dirname \"$0\"`"
cat ${reffa}.fai |cut -f 1 |grep -v decoy |grep -v 'HLA' |grep -v alt |grep -v 'chrUn' |grep -v 'random' > intervals.txt
if [[ -n $tbed ]] if [[ -n $tbed ]]
then then
interval=$tbed awk '{print $1":"$2"-"$3}' $tbed > intervals.txt
else
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 $//'`
fi fi
if [[ -z $tid ]] if [[ -z $tid ]]
then then
...@@ -94,10 +97,6 @@ then ...@@ -94,10 +97,6 @@ then
fi fi
source /etc/profile.d/modules.sh
module load htslib/gcc/1.8 samtools/gcc/1.8 snpeff/4.3q vcftools/0.1.14
export PATH=/project/shared/bicf_workflow_ref/seqprg/bin:$PATH
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
...@@ -125,7 +124,6 @@ then ...@@ -125,7 +124,6 @@ then
configureStrelkaSomaticWorkflow.py --normalBam ${normal} --tumorBam ${tumor} --referenceFasta ${reffa} --targeted --runDir strelka $mantaopt configureStrelkaSomaticWorkflow.py --normalBam ${normal} --tumorBam ${tumor} --referenceFasta ${reffa} --targeted --runDir strelka $mantaopt
strelka/runWorkflow.py -m local -j 8 strelka/runWorkflow.py -m local -j 8
vcf-concat strelka/results/variants/*.vcf.gz | vcf-annotate -n --fill-type -n |vcf-sort |java -jar $SNPEFF_HOME/SnpSift.jar filter "(GEN[*].DP >= 10)" | perl -pe "s/TUMOR/${tid}/g" | perl -pe "s/NORMAL/${nid}/g" |bgzip > ${pair_id}.strelka2.vcf.gz vcf-concat strelka/results/variants/*.vcf.gz | vcf-annotate -n --fill-type -n |vcf-sort |java -jar $SNPEFF_HOME/SnpSift.jar filter "(GEN[*].DP >= 10)" | perl -pe "s/TUMOR/${tid}/g" | perl -pe "s/NORMAL/${nid}/g" |bgzip > ${pair_id}.strelka2.vcf.gz
fi
elif [ $algo == 'virmid' ] elif [ $algo == 'virmid' ]
then then
module load virmid/1.2 module load virmid/1.2
...@@ -138,9 +136,10 @@ then ...@@ -138,9 +136,10 @@ then
elif [ $algo == 'mutect' ] elif [ $algo == 'mutect' ]
then then
gatk4_dbsnp=${index_path}/clinseq_prj/dbSnp.gatk4.vcf.gz gatk4_dbsnp=${index_path}/clinseq_prj/dbSnp.gatk4.vcf.gz
module load gatk/4.1.4.0 picard/2.10.3 module load gatk/4.1.4.0 parallel/20150122
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 threads=`expr $NPROC / 2`
vcf-sort ${tid}.mutect.vcf | vcf-annotate -n --fill-type | java -jar $SNPEFF_HOME/SnpSift.jar filter -p '(GEN[*].DP >= 10)' | bgzip > ${pair_id}.mutect.vcf.gz cut -f 1 intervals.txt | parallel --delay 1 --jobs $threads "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 {}"
vcf-concat ${tid}.mutect.*vcf | vcf-sort | vcf-annotate -n --fill-type | java -jar $SNPEFF_HOME/SnpSift.jar filter -p '(GEN[*].DP >= 10)' | bgzip > ${pair_id}.mutect.vcf.gz
elif [ $algo == 'varscan' ] elif [ $algo == 'varscan' ]
then then
module load bcftools/gcc/1.8 VarScan/2.4.2 module load bcftools/gcc/1.8 VarScan/2.4.2
......
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