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

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

#### Jobname
#$ -N REMD

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

#### Resubmit
#$ -r y


for files in /data/projects/2018/IBD/ATAC_BCG/03_BOWTIE/*_sorted_rmChrM_marked_duplicates.bam ;
do
samtools view -@ 24 -h -b -F 1024 $files > ${files%_sorted_rmChrM_marked_duplicates.bam}_sorted_rmChrM_rmdupl.bam
done
