#!/bin/sh
#$ -S /bin/sh

#$ -pe smp 24
#$ -cwd
#$ -V

#### Jobname
#$ -N STSO2

#### Error Outputfile
#$ -e STSO2.log
#$ -o STSO2.err

#### Resubmit
#$ -r y


for files in /data/projects/2018/IBD/ATAC_BCG/03_BOWTIE/*_sorted_rmChrM_rmdupl_rmmulti_rmunpl.bam ;
do

samtools sort -@ 24 $files -O bam -o ${files%_sorted_rmChrM_rmdupl_rmmulti_rmunpl.bam}_sorted_rmChrM_rmdupl_rmmulti_rmunpl_sorted.bam
done
