Skip to content
Snippets Groups Projects
Commit 2d9f16a3 authored by Ahmed Abbas's avatar Ahmed Abbas
Browse files

Delete calc_SCC_for_RAD21_data.R

parent bab933e7
No related merge requests found
library(hicrep)
make_map <- function(B,chr_size,bin_size,ind_min)
{
data <- B
sz <- ceiling(chr_size/bin_size)
sq_mat <- matrix(0L, nrow = sz, ncol = sz)
for(i in 1 : dim(data)[1])
{
X1 <- data[i,2]
X2 <- data[i,5]
r_ind <- floor(X1/bin_size) - ind_min + 1
c_ind <- floor(X2/bin_size) - ind_min + 1
sq_mat[r_ind,c_ind] <- sq_mat[r_ind,c_ind] + data[i,7]
sq_mat[c_ind,r_ind] <- sq_mat[c_ind,r_ind] + data[i,7]
}
return(sq_mat)
}
All <- NULL
Po_DNN <- NULL
Poe_DNN <- NULL
seq1 <- seq(2,22,by=2)
for(i in seq1)
{
if(i == 23)
{
C <- 'chrX'
}else{
C <- paste0('chr',i)
}
fname1 <- paste('/work/pathology/s206442/dbet_data/tables_SCC/Reduced_K562_',C,'_orig.bedpe',sep='')
Orig <- read.table(fname1,sep='\t',header=FALSE)
F <- paste0('/project/pathology/Mani_lab/s206442/K562_HiC/',C,'_RAD21_using_odd_training.csv')
P1 <- read.table(F,sep='\t',header=FALSE)
#P1[P1<0]<-0
Pred <- data.frame(Orig[,1:6],P1)
bin_size <- 25000
chr_size <- max(Orig[,6])
ind_min <- 0
sq_mat_orig <- make_map(Orig,chr_size,bin_size,ind_min)
sq_mat_pred <- make_map(Pred,chr_size,bin_size,ind_min)
scc.out <- get.scc(sq_mat_orig,sq_mat_pred, resol=25000,h=2,lbr=0, 1500000)
pred_scc <- scc.out$scc
print(pred_scc)
A1 <- as.vector(sq_mat_orig)
B1 <- as.vector(sq_mat_pred)
ind1 <- which(A1 != 0)
print(cor(A1[ind1],B1[ind1]))
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment