-
Notifications
You must be signed in to change notification settings - Fork 1
/
mergebed_Si_YS.txt
138 lines (114 loc) · 4.84 KB
/
mergebed_Si_YS.txt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Sp data only
# 03.30.2020- goal is to combine files together (DAP-Seq)
# by Ying Sun
Bedtools: Keep if it occurs in 2 or more files-- save peaks
Venn diagram to check: checked and the more files, the more peaks you can find
# Si-Shoot_ABF1
module load bedtools/2.26.0
# This will chop each peak to 8bp
# Then also sorting
for f in *.narrowPeak; do
awk -v OFS='\t' '{$2=$2+97} {$3=$3-97} {print $0}' $f | awk -v OFS="\t" '{ if ($2<0) {$2=0}} {print $0}' | sort -k1,1 -k2,2n > ${f}_7bp
done
for f in *.narrowPeak_7bp; do
wc -l "$f"
done
########################
2502 sorted_Si-SiABF1a-Sishoot-Q-11-30-2018-GCCAAT_S1_out_GEM_events.narrowPeak
2021 sorted_Si-SiABF1b-Sishoot-Q-11-30-2018-TCAGAC_S1_out_GEM_events.narrowPeak
1899 sorted_Si-SiABF1c-Sishoot-Q-11-30-2018-TTGAGC_S1_out_GEM_events.narrowPeak
########################
cat *.narrowPeak_7bp | sort -k1,1 -k2,2n > ${PWD##*/}.bed
bedtools merge -c 1 -o count -i ${PWD##*/}.bed > ${PWD##*/}.merged.bed
awk -v OFS="\t" -v t=$t '$4>=2 {print $0}' ${PWD##*/}.merged.bed > ${PWD##*/}.mergedfiltered.bed
for f in *.bed; do
wc -l "$f"
done
# All peaks, merged peaks, final peaks
########################
6422 Si_Shoot_SiABF1.bed
3890 Si_Shoot_SiABF1.merged.bed
1602 Si_Shoot_SiABF1.mergedfiltered.bed
########################
# Si-Shoot_ABF2
module load bedtools/2.26.0
# This will chop each peak to 8bp
# Then also sorting
for f in *.narrowPeak; do
awk -v OFS='\t' '{$2=$2+97} {$3=$3-97} {print $0}' $f | awk -v OFS="\t" '{ if ($2<0) {$2=0}} {print $0}' | sort -k1,1 -k2,2n > ${f}_7bp
done
for f in *.narrowPeak_7bp; do
wc -l "$f"
done
########################
6953 sorted_Si-SiABF2a-Sishoot-Q-11-30-2018-CAGATC_S1_out_GEM_events.narrowPeak
9227 sorted_Si-SiABF2b-Sishoot-Q-11-30-2018-ATGACC_S1_out_GEM_events.narrowPeak
11726 sorted_Si-SiABF2c-Sishoot-Q-11-30-2018-CTACGA_S1_out_GEM_events.narrowPeak
########################
cat *.narrowPeak_7bp | sort -k1,1 -k2,2n > ${PWD##*/}.bed
bedtools merge -c 1 -o count -i ${PWD##*/}.bed > ${PWD##*/}.merged.bed
awk -v OFS="\t" -v t=$t '$4>=2 {print $0}' ${PWD##*/}.merged.bed > ${PWD##*/}.mergedfiltered.bed
for f in *.bed; do
wc -l "$f"
done
# All peaks, merged peaks, final peaks
########################
27906 Si_Shoot_SiABF2.bed
15088 Si_Shoot_SiABF2.merged.bed
7971 Si_Shoot_SiABF2.mergedfiltered.bed
########################
# Si-Shoot_ABF3
module load bedtools/2.26.0
# This will chop each peak to 8bp
# Then also sorting
for f in *.narrowPeak; do
awk -v OFS='\t' '{$2=$2+97} {$3=$3-97} {print $0}' $f | awk -v OFS="\t" '{ if ($2<0) {$2=0}} {print $0}' | sort -k1,1 -k2,2n > ${f}_7bp
done
for f in *.narrowPeak_7bp; do
wc -l "$f"
done
########################
5844 sorted_Si-SiABF3a-Sishoot-Q-11-30-2018-ACTTGA_S1_out_GEM_events.narrowPeak_7bp
9103 sorted_Si-SiABF3b-Sishoot-Q-11-30-2018-GTACGT_S1_out_GEM_events.narrowPeak_7bp
14573 sorted_Si-SiABF3c-Sishoot-Q-11-30-2018-AGTCTG_S1_out_GEM_events.narrowPeak_7bp
########################
cat *.narrowPeak_7bp | sort -k1,1 -k2,2n > ${PWD##*/}.bed
bedtools merge -c 1 -o count -i ${PWD##*/}.bed > ${PWD##*/}.merged.bed
awk -v OFS="\t" -v t=$t '$4>=2 {print $0}' ${PWD##*/}.merged.bed > ${PWD##*/}.mergedfiltered.bed
for f in *.bed; do
wc -l "$f"
done
# All peaks, merged peaks, final peaks
########################
29520 Si_Shoot_SiABF3.bed
17528 Si_Shoot_SiABF3.merged.bed
8005 Si_Shoot_SiABF3.mergedfiltered.bed
########################
# Si-Shoot_ABF4
module load bedtools/2.26.0
# This will chop each peak to 8bp
# Then also sorting
for f in *.narrowPeak; do
awk -v OFS='\t' '{$2=$2+97} {$3=$3-97} {print $0}' $f | awk -v OFS="\t" '{ if ($2<0) {$2=0}} {print $0}' | sort -k1,1 -k2,2n > ${f}_7bp
done
for f in *.narrowPeak_7bp; do
wc -l "$f"
done
########################
7618 sorted_Si-SiABF4a-Sishoot-Q-11-30-2018-GATCAG_S1_out_GEM_events.narrowPeak
6817 sorted_Si-SiABF4b-Sishoot-Q-11-30-2018-GATGCT_S1_out_GEM_events.narrowPeak
11488 sorted_Si-SiABF4c-Sishoot-Q-11-30-2018-GAACCT_S1_out_GEM_events.narrowPeak
5790 sorted_Si-SiABF4-Sishoot-Q-11-30-2018-ACAGTG_S1_out_GEM_events.narrowPeak
########################
cat *.narrowPeak_7bp | sort -k1,1 -k2,2n > ${PWD##*/}.bed
bedtools merge -c 1 -o count -i ${PWD##*/}.bed > ${PWD##*/}.merged.bed
awk -v OFS="\t" -v t=$t '$4>=2 {print $0}' ${PWD##*/}.merged.bed > ${PWD##*/}.mergedfiltered.bed
for f in *.bed; do
wc -l "$f"
done
# All peaks, merged peaks, final peaks
########################
31713 Si_Shoot_SiABF4.bed
15177 Si_Shoot_SiABF4.merged.bed
7744 Si_Shoot_SiABF4.mergedfiltered.bed
########################