#! /bin/bash
for sample in Merge_TFs-only_IP_Reb1 Merge_ISW2_IP_Reb1 Replicate1_INO80_IP_Reb1 Replicate1_Chd1_IP_Reb1
do
  macs2 callpeak -t ${sample}_.bam -c Merge_control_IP_Reb1 -n ${sample} -m 5 50 -q 0.05
  Rscript ${sample}_model.r
done

cat *_peaks.narrowPeak > merged_narrowpeaks-Reb1.bed
bedtools getfasta -fi /Users/Elisa/Documents/Sequencing/Revision/sacCer3.fasta -bed merged_narrowpeaks-Reb1.bed -fo merged_narrowpeaks-Reb1.fasta

meme merged_narrowpeaks-Reb1.fasta -dna -maxw 8 -nmotifs 2 -o PWM-Reb1
