-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloops.sh
More file actions
119 lines (87 loc) · 4.1 KB
/
cloops.sh
File metadata and controls
119 lines (87 loc) · 4.1 KB
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
#!/bin/bash
exec > cloops.log 2>&1
#===================================================
#=======================Primary=====================
#===================================================
start=$(date +%s)
cLoops -f /storage/store/mohit/data/GM12878_primary_30.bedpe -o hic_chr1 -w -j -eps 5000,7500,10000 -minPts 20,30,40,50 -s -hic -m 3 -c chr1
end=$(date +%s)
echo "primary chr 1, elapsed time: $(($end-$start)) seconds"
start=$(date +%s)
cLoops -f /storage/store/mohit/data/GM12878_primary_30.bedpe -o hic_chr6 -w -j -eps 5000,7500,10000 -minPts 20,30,40,50 -s -hic -m 3 -c chr6
end=$(date +%s)
echo "primary chr 6, elapsed time: $(($end-$start)) seconds"
#===================================================
#====================Normalized=====================
#===================================================
#!/bin/bash
exec > cloops_normKR.log 2>&1
start=$(date +%s)
cLoops -f /storage/store/mohit/data/kr_norm/GM12878_primary_KR_chr1_5k.bedpe -o hic -w -j -eps 5000,7500,10000 -minPts 20,30 -s -hic -c 1
end=$(date +%s)
echo "primary_normKR chr 1 @5k eps, elapsed time: $(($end-$start)) seconds"
start=$(date +%s)
cLoops -f /storage/store/mohit/data/kr_norm/GM12878_primary_KR_chr1_10k.bedpe -o hic -w -j -eps 5000,7500,10000 -minPts 20,30 -s -hic -c 1
end=$(date +%s)
echo "primary_normKR chr 1 @10k eps, elapsed time: $(($end-$start)) seconds"
start=$(date +%s)
cLoops -f /storage/store/mohit/data/kr_norm/GM12878_primary_KR_chr6_5k.bedpe -o hic -w -j -eps 5000,7500,10000 -minPts 20,30 -s -hic -c 6
end=$(date +%s)
echo "primary_normKR chr 6 @5k eps, elapsed time: $(($end-$start)) seconds"
start=$(date +%s)
cLoops -f /storage/store/mohit/data/kr_norm/GM12878_primary_KR_chr6_10k.bedpe -o hic -w -j -eps 5000,7500,10000 -minPts 20,30 -s -hic -c 6
end=$(date +%s)
echo "primary_normKR chr 6 @10k eps, elapsed time: $(($end-$start)) seconds"
#===================================================
#====================Replicate=====================
#===================================================
#!/bin/bash
exec > cloops_replicate.log 2>&1
start=$(date +%s)
cLoops -f /storage/store/mohit/data/replicate/GM12878_replicate.bedpe -o hic_chr1 -w -j -eps 5000,7500,10000 -minPts 20,30,40,50 -s -hic -m 3 -c chr1
end=$(date +%s)
echo "replicate chr 1, elapsed time: $(($end-$start)) seconds"
start=$(date +%s)
cLoops -f /storage/store/mohit/data/replicate/GM12878_replicate.bedpe -o hic_chr6 -w -j -eps 5000,7500,10000 -minPts 20,30,40,50 -s -hic -m 3 -c chr6
end=$(date +%s)
echo "replicate chr 6, elapsed time: $(($end-$start)) seconds"
my_log <- file("cooler2bedpe.log", open = 'a')
sink(my_log, append = TRUE, type = "output")
sink(my_log, append = TRUE, type = "message")
library(HiCcompare)
v_input <- cooler2bedpe('GM12878_primary_KR_chr6_10000.cool')
v_input <- as.data.frame(v_input$cis)
v_output <- file('GM12878_primary_KR_chr6_10000.bedpe', open = 'a')
v_count <- 0
for (row in 1:nrow(v_input)) {
v_data <- v_input[row,]
if(length(v_data) < 7) {
print(v_data)
v_count++
continue
}
writeLines(v_data, v_output)
}
close(v_input)
close(v_output)
print(v_count)
my_log <- file("cooler2bedpe.log", open = 'a')
sink(my_log, append = TRUE, type = "output")
sink(my_log, append = TRUE, type = "message")
library(HiCcompare)
v_input <- cooler2bedpe('GM12878_replicate_chr1_10000.cool')
v_input <- as.data.frame(v_input$cis)
v_output <- file('GM12878_replicate_chr1_10000.bedpe', open = 'a')
write.table(v_input, v_output)
v_input <- cooler2bedpe('GM12878_replicate_chr1_5000.cool')
v_input <- as.data.frame(v_input$cis)
v_output <- file('GM12878_replicate_chr1_5000.bedpe', open = 'a')
write.table(v_input, v_output)
v_input <- cooler2bedpe('GM12878_replicate_chr6_10000.cool')
v_input <- as.data.frame(v_input$cis)
v_output <- file('GM12878_replicate_chr6_10000.bedpe', open = 'a')
write.table(v_input, v_output)
v_input <- cooler2bedpe('GM12878_replicate_chr6_5000.cool')
v_input <- as.data.frame(v_input$cis)
v_output <- file('GM12878_replicate_chr6_5000.bedpe', open = 'a')
write.table(v_input, v_output)