From cacd8bc8b77a5cd38d9008891c01c79872be3a90 Mon Sep 17 00:00:00 2001 From: Brandi Cantarel <brandi.cantarel@utsouthwestern.edu> Date: Sun, 31 May 2020 13:25:12 -0500 Subject: [PATCH] cvc simplify dnaworkflows --- cvc/add_umi_sam.py | 1 + cvc/dna_trim_align.sh | 22 ++++++++++++++++------ cvc/parse_trimreport.pl | 1 + variants/somatic_vc.sh | 13 +++++++++---- 4 files changed, 27 insertions(+), 10 deletions(-) create mode 120000 cvc/add_umi_sam.py create mode 120000 cvc/parse_trimreport.pl diff --git a/cvc/add_umi_sam.py b/cvc/add_umi_sam.py new file mode 120000 index 0000000..2a9843b --- /dev/null +++ b/cvc/add_umi_sam.py @@ -0,0 +1 @@ +../alignment/add_umi_sam.py \ No newline at end of file diff --git a/cvc/dna_trim_align.sh b/cvc/dna_trim_align.sh index a44d414..ceaffa6 100644 --- a/cvc/dna_trim_align.sh +++ b/cvc/dna_trim_align.sh @@ -26,11 +26,20 @@ done shift $(($OPTIND -1)) baseDir="`dirname \"$0\"`" -fqs=("$@") +fqs='' +i=0 numfq=$# +while [[ $i -le $numfq ]] +do + fqs="$fqs $1" + i=$((i + 1)) + shift 1 +done + # Check for mandatory options -if [[ -z $pair_id ]] || [[ -z $fq1 ]]; then +if [[ -z $pair_id ]] +then usage fi NPROC=$SLURM_CPUS_ON_NODE @@ -50,17 +59,18 @@ else fi source /etc/profile.d/modules.sh -module load trimgalore/0.6.4 cutadapt/1.9.1 python/2.7.x-anaconda bwakit/0.7.15 samtools/gcc/1.8 picard/2.10.3 +module load trimgalore/0.6.4 cutadapt/1.9.1 bwakit/0.7.15 samtools/gcc/1.8 picard/2.10.3 threads=`expr $NPROC / 2` -trim_galore --cores $threads --paired -q 25 -o trim --illumina --gzip --length 35 ${fqs} -if [[ $filter == 1 ]] +trim_galore --cores 4 --paired -q 25 --illumina --gzip --length 35 ${fqs} + +if [[ ${filter} == 1 ]] then perl $baseDir/parse_trimreport.pl ${pair_id}.trimreport.txt *trimming_report.txt fi -bwa mem -M -t $threads -R "@RG\tID:${read_group}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${read_group}" ${index_path}/genome.fa trim/*.fq.gz > out.sam +bwa mem -M -t $threads -R "@RG\tID:${read_group}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${read_group}" ${index_path}/genome.fa *.fq.gz > out.sam if [[ $umi == 'umi' ]] && [[ -f "${index_path}/genome.fa.alt" ]] then diff --git a/cvc/parse_trimreport.pl b/cvc/parse_trimreport.pl new file mode 120000 index 0000000..ede2fb3 --- /dev/null +++ b/cvc/parse_trimreport.pl @@ -0,0 +1 @@ +../preproc_fastq/parse_trimreport.pl \ No newline at end of file diff --git a/variants/somatic_vc.sh b/variants/somatic_vc.sh index 36a09b0..a8b0594 100755 --- a/variants/somatic_vc.sh +++ b/variants/somatic_vc.sh @@ -92,10 +92,15 @@ source /etc/profile.d/modules.sh module load htslib/gcc/1.8 if [ $algo == 'strelka2' ] - then - module load strelka/2.9.10 manta/1.3.1 samtools/gcc/1.8 snpeff/4.3q vcftools/0.1.14 - mkdir manta strelka - configManta.py --normalBam ${normal} --tumorBam ${tumor} --referenceFasta ${reffa} --runDir manta +then + opt='' + if [[ -n $tbed ]] + then + opt="--callRegions ${tbed}.gz}" + module load strelka/2.9.10 manta/1.3.1 samtools/gcc/1.8 snpeff/4.3q vcftools/0.1.14 + fi + mkdir manta + configManta.py --normalBam ${normal} --tumorBam ${tumor} --referenceFasta ${reffa} $opt --runDir manta manta/runWorkflow.py -m local -j 8 if [[ -f manta/results/variants/candidateSmallIndels.vcf.gz ]] then -- GitLab