# NOT RUN {
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (cmap, bed_matrix, bed_bin, bedfile, chr = "chr4", st_cmap,
m_threshold = 0)
{
n = dim(cmap)[1]
bed_count = 0
nm_count = 0
all_count = 0
cccc = 0
ooo <- data.frame(chr_nm1 = character(0), n_start1 = numeric(0),
bed_seq1 = character(0), chr_nm2 = character(0), n_start2 = numeric(0),
bed_seq2 = character(0), read_count = numeric(0), stringsAsFactors = FALSE)
ooo = lapply(rbind(1:(dim(bed_matrix)[1] - 1)), calculate_omiccircos_data_solo,
cmap = cmap, bed_matrix = bed_matrix, bed_bin = bed_bin,
bedfile = bedfile, chr = chr, st_cmap = st_cmap, m_threshold = m_threshold)
final_ooo <- data.frame(chr_nm1 = character(0), n_start1 = numeric(0),
bed_seq1 = character(0), chr_nm2 = character(0), n_start2 = numeric(0),
bed_seq2 = character(0), read_count = numeric(0), stringsAsFactors = FALSE)
for (tt in 1:(dim(bed_matrix)[1] - 1)) {
if (!is.null(ooo[tt][[1]])) {
final_ooo = rbind(final_ooo, as.data.frame(ooo[tt][[1]]))
}
}
colnames(final_ooo) = c("chr_nm1", "n_start1", "bed_seq1",
"chr_nm2", "n_start2", "bed_seq2", "read_count")
return(final_ooo)
}
# }
Run the code above in your browser using DataLab