# Processing Histone centric data

bedops --everything  H3K4me1_filtered_peaks.bed H3K27ac_filtered_peaks.bed | bedops -m --range -1 - > Histone_putative_enhancers.bed


# RPKM Filtering
# Get RPKM
./rpkm.py --peaks Histone_putative_enhancers.bed --experiments h3k27ac_list.csv -f Histone_h3k27ac --minimum 1
./rpkm.py --peaks Histone_putative_enhancers.bed --experiments h3k4me1_list.csv -f Histone_h3k4me1 --minimum 1
./rpkm.py --peaks Histone_putative_enhancers.bed --experiments putative_histone_enhancers.csv -f Histone_pe --minimum 0

awk -F\, '{print $0 "\tHE_" NR}' Histone_pe_filtered_peaks.bed > t
mv t Histone_pe_filtered_peaks.bed

grep chrom Histone_pe_filtered_peaks.tsv | awk -F\, '{print $0 "\tname"}' > t
grep -v chrom Histone_pe_filtered_peaks.tsv | awk -F\, '{print $0 "\tHE_" NR}' >> t
mv t Histone_pe_filtered_peaks.tsv

# Acutal Processing
python histone_enhancer_plots.py
