-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMACS_Broad.sh
More file actions
26 lines (21 loc) · 881 Bytes
/
MACS_Broad.sh
File metadata and controls
26 lines (21 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#SBATCH --job-name=macs_broad
#SBATCH --ntasks=1
#SBATCH --mem=16G
#SBATCH -N 1
#SBATCH -n 12
#SBATCH --time=01:00:00
#SBATCH -e macs_broad.%job.err
#re-run end of ChIP-seq script to call broad peaks, need to have intermediate ChIP script files still there
DIR=/path/to/fastq/files/*fastq.gz
RepeatSequence='/path/to/repeatsequences/RepeatSequence.bed'
for f in ${DIR}
do
module load macs
macs2 callpeak -g mm -q 0.01 --broad -f BED -n ${f}-broad -t ${f}-fixall.bed
awk '{print $1, $2-50, $3+50, $4, $5
}' ${f}-broad_summits.bed > ${f}-broad-summits-exp50.bed
bedtools intersect -a ${f}-broad-summits-exp50.bed -b ${RepeatSequence} -v -wa > ${f}-broad-summits-exp50-noreps.bed
awk '{print $1, $2+50, $3-50, $4, $5
}' ${f}-broad-summits-exp50-noreps.bed > ${f}-broad-summits-exp50-noreps-shrink.bed
done