Load data

TAD from Insulation Score

IS - TAD size

##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    65000   185000   265000   374547   400000 24490000




500. PreciseTAD with sliding window of 500 (5KB resolution) and smoothing h = 1100

e = 0.1 and t = 0.1

Arm1

##   left_TAD right_TAD center_TAD averageProb_diff error_symetric overlap
## 1  1020000   2060000    1530000        0.3739284     0.03921569       0
## 2  1020000   2410000    1720000        0.5694892     0.01449275       0
## 3  1785000   1925000    1855000        0.4547684     0.00000000       0
## 4  1925000   2060000    1990000        0.2613912     0.07692308       0
## 5  1645000   1785000    1720000        0.2866044     0.15384615       0
## 6  1925000   2060000    1990000        0.2613912     0.07692308       0
##   actual_size
## 1     1040000
## 2     1390000
## 3      140000
## 4      135000
## 5      140000
## 6      135000
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   55000  140000  170000  540875  820000 2390000
## report error of closest IS boundary and preciseTAD
### Find Distance of closest IS boundaries and preciseTAD boundary 
arm.bound.1a = unique(c(report1a$left_TAD, report1a$right_TAD))
closest_IS.bound <- sapply(arm.bound.1a, function(x) {
  distances = abs(boundaryIS_ch1$Start - x)
  min.d.pos = which(distances == min(distances) )
  closest.bound = boundaryIS_ch1$Start[min.d.pos[1]]
  return(closest.bound)
} )

report.e_bp <- data.frame(preciseTAD_boundary = arm.bound.1a, 
                          closest_IS.bound)
report.e_bp$error_bp <- abs(report.e_bp$preciseTAD_boundary - report.e_bp$closest_IS.bound)
  
summary(report.e_bp$error_bp)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       0   15000   40000   77269  115000  600000
plot(density(report.e_bp$error_bp), main = 'Density of Error bp from preciseTAD and closest IS boundary')

print(paste0('Number of overlapped TAD is ', length(which(report.e_bp$error_bp == 0)) ))
## [1] "Number of overlapped TAD is 25"




2000. PreciseTAD with sliding window of 2000 (5KB resolution) and smoothing h = 1100

e = 0.1 and t = 0.1

Arm1

##   left_TAD right_TAD center_TAD averageProb_diff error_symetric overlap
## 1   900000   2555000    1720000        0.6347220     0.01829268       0
## 2  2410000   2555000    2480000        0.5139072     0.07142857       0
## 3  2555000   3455000    2995000        0.8111084     0.04545455       0
## 4  2555000   3655000    3080000        0.8177772     0.09523810       0
## 5  2555000   3655000    3105000        0.8356176     0.00000000       0
## 6  2555000   3890000    3200000        0.8205000     0.06976744       0
##   actual_size
## 1     1655000
## 2      145000
## 3      900000
## 4     1100000
## 5     1100000
## 6     1335000
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   55000  175000 1255000 1584748 2707500 4875000
## report error of closest IS boundary and preciseTAD
### Find Distance of closest IS boundaries and preciseTAD boundary 
arm.bound.1b = unique(c(report1b$left_TAD, report1b$right_TAD))
closest_IS.bound <- sapply(arm.bound.1b, function(x) {
  distances = abs(boundaryIS_ch1$Start - x)
  min.d.pos = which(distances == min(distances) )
  closest.bound = boundaryIS_ch1$Start[min.d.pos[1]]
  return(closest.bound)
} )

report.e_bp <- data.frame(preciseTAD_boundary = arm.bound.1b, 
                          closest_IS.bound)
report.e_bp$error_bp <- abs(report.e_bp$preciseTAD_boundary - report.e_bp$closest_IS.bound)
  
summary(report.e_bp$error_bp)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       0   15000   42500   77500  115000  600000
plot(density(report.e_bp$error_bp), main = 'Density of Error bp from preciseTAD and closest IS boundary')

print(paste0('Number of overlapped TAD is ', length(which(report.e_bp$error_bp == 0)) ))
## [1] "Number of overlapped TAD is 25"




5000. PreciseTAD with sliding window of 5000 (5KB resolution) and smoothing h = 1100

e = 0.1 and t = 0.1

Arm1

##   left_TAD right_TAD center_TAD averageProb_diff error_symetric overlap
## 1   900000   2555000    1720000        0.6347220     0.01829268       0
## 2  2410000   2555000    2480000        0.5139072     0.07142857       0
## 3  2555000   3455000    2995000        0.8111084     0.04545455       0
## 4  2555000   3655000    3080000        0.8177772     0.09523810       0
## 5  2555000   3655000    3105000        0.8356176     0.00000000       0
## 6  2555000   3890000    3200000        0.8205000     0.06976744       0
##   actual_size
## 1     1655000
## 2      145000
## 3      900000
## 4     1100000
## 5     1100000
## 6     1335000
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    55000   376250  3617500  4547469  7705000 14835000
## report error of closest IS boundary and preciseTAD
arm.bound.1c <- unique(c(report1c$left_TAD, report1c$right_TAD))
closest_IS.bound <- sapply(arm.bound.1c, function(x) {
  distances = abs(boundaryIS_ch1$Start - x)
  min.d.pos = which(distances == min(distances) )
  closest.bound = boundaryIS_ch1$Start[min.d.pos[1]]
  return(closest.bound)
} )

report.e_bp <- data.frame(preciseTAD_boundary = arm.bound.1c, 
                          closest_IS.bound)
report.e_bp$error_bp <- abs(report.e_bp$preciseTAD_boundary - report.e_bp$closest_IS.bound)
  
summary(report.e_bp$error_bp)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       0   15000   45000   79464  120000  600000
plot(density(report.e_bp$error_bp), main = 'Density of Error bp from preciseTAD and closest IS boundary')

print(paste0('Number of overlapped TAD is ', length(which(report.e_bp$error_bp == 0)) ))
## [1] "Number of overlapped TAD is 26"




7000. PreciseTAD with sliding window of 7000 (5KB resolution) and smoothing h = 1100

e = 0.1 and t = 0.1

Arm1

##   left_TAD right_TAD center_TAD averageProb_diff error_symetric overlap
## 1   265000  26840000   12910000        0.8104820     0.10162119       0
## 2   265000  26840000   12955000        0.8065008     0.09416864       0
## 3   265000  26840000   13020000        0.8179160     0.08349667       0
## 4   265000  26840000   13055000        0.8068556     0.07779515       0
## 5   265000  26840000   13135000        0.7944448     0.06487956       0
## 6   265000  26840000   13165000        0.7721396     0.06007752       0
##   actual_size
## 1    26575000
## 2    26575000
## 3    26575000
## 4    26575000
## 5    26575000
## 6    26575000
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    55000   356250  8157500  9855754 16195000 34615000
## report error of closest IS boundary and preciseTAD
arm.bound.1d <- unique(c(report1d$left_TAD, report1d$right_TAD))
closest_IS.bound <- sapply(arm.bound.1d, function(x) {
  distances = abs(boundaryIS_ch1$Start - x)
  min.d.pos = which(distances == min(distances) )
  closest.bound = boundaryIS_ch1$Start[min.d.pos[1]]
  return(closest.bound)
} )

report.e_bp <- data.frame(preciseTAD_boundary = arm.bound.1d, 
                          closest_IS.bound)
report.e_bp$error_bp <- abs(report.e_bp$preciseTAD_boundary - report.e_bp$closest_IS.bound)
  
summary(report.e_bp$error_bp)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       0   15000   45000   80099  121250  600000
plot(density(report.e_bp$error_bp), main = 'Density of Error bp from preciseTAD and closest IS boundary')

print(paste0('Number of overlapped TAD is ', length(which(report.e_bp$error_bp == 0)) ))
## [1] "Number of overlapped TAD is 25"