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

4adapter readgroup bug

parent 636e989b
Branches
Tags
No related merge requests found
...@@ -12,13 +12,14 @@ usage() { ...@@ -12,13 +12,14 @@ usage() {
exit 1 exit 1
} }
OPTIND=1 # Reset OPTIND OPTIND=1 # Reset OPTIND
while getopts :r:x:y:p:uh opt while getopts :r:x:y:g:p:uh opt
do do
case $opt in case $opt in
r) index_path=$OPTARG;; r) index_path=$OPTARG;;
x) fq1=$OPTARG;; x) fq1=$OPTARG;;
y) fq2=$OPTARG;; y) fq2=$OPTARG;;
u) umi='umi';; u) umi='umi';;
g) read_group=$OPTARG;;
p) pair_id=$OPTARG;; p) pair_id=$OPTARG;;
h) usage;; h) usage;;
esac esac
...@@ -36,6 +37,11 @@ then ...@@ -36,6 +37,11 @@ then
SLURM_CPUS_ON_NODE=1 SLURM_CPUS_ON_NODE=1
fi fi
if [[ -z $read_group ]]
then
read_group=$pair_id
fi
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
module load bwakit/0.7.15 bwa/intel/0.7.15 samtools/1.6 picard/2.10.3 module load bwakit/0.7.15 bwa/intel/0.7.15 samtools/1.6 picard/2.10.3
...@@ -45,9 +51,9 @@ diff $fq1 $fq2 > difffile ...@@ -45,9 +51,9 @@ diff $fq1 $fq2 > difffile
if [ -s difffile ] if [ -s difffile ]
then then
bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${pair_id}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${pair_id}" ${index_path}/genome.fa ${fq1} ${fq2} > out.sam bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${read_group}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${read_group}" ${index_path}/genome.fa ${fq1} ${fq2} > out.sam
else else
bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${pair_id}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${pair_id}" ${index_path}/genome.fa ${fq1} > out.sam bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${read_group}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${read_group}" ${index_path}/genome.fa ${fq1} > out.sam
fi fi
if [[ $umi == 'umi' ]] && [[ $index_path == '/project/shared/bicf_workflow_ref/GRCh38' ]] if [[ $umi == 'umi' ]] && [[ $index_path == '/project/shared/bicf_workflow_ref/GRCh38' ]]
......
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