find_bed_to_bed_interaction_solo: help find_bed_to_bed_interaction finish its work

Description Arguments Examples

View source: R/calbed.R

Description

help find_bed_to_bed_interaction finish its work

Arguments

i
cmap
bed_matrix
bed_bin
bedfile
chr
st_cmap
m_threshold

Examples

 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
##---- 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 (i, cmap, bed_matrix, bed_bin, bedfile, chr = "chr4",
    st_cmap, m_threshold = 0)
{
    jj = which(cmap[i, (i + 1):(dim(bed_matrix)[1])] > m_threshold)
    jjj = jj + i
    ooo = NULL
    if (bed_matrix[i] != 0) {
        jjjj = which(bed_matrix[jjj] != 0)
        jjjjj = jjj[jjjj]
        j_length = length(jjjjj)
        if (j_length >= 1) {
            for (k in 1:4) {
                m_all = which(bed_bin[, k] == i)
                m_all_length = length(m_all)
                if (m_all_length > 0) {
                  for (mn in 1:m_all_length) {
                    m = m_all[mn]
                    if (bedfile[m, 1] == chr) {
                      for (hh in 1:j_length) {
                        mj = jjjjj[hh]
                        for (kk in 1:4) {
                          mm_all = which(bed_bin[, kk] == mj)
                          mm_all_length = length(mm_all)
                          if (mm_all_length > 0) {
                            for (mmn in 1:mm_all_length) {
                              mm = mm_all[mmn]
                              if (bedfile[mm, 1] == chr) {
                                ooo = rbind(ooo, cbind(m, bedfile[m,
                                  1], bedfile[m, 2], bedfile[m,
                                  3], k, bedfile[m, 4], mm, bedfile[mm,
                                  1], bedfile[mm, 2], bedfile[mm,
                                  3], kk, bedfile[mm, 4], st_cmap[i,
                                  mj], i, mj))
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
            }
        }
    }
    return(ooo)
  }

HBP documentation built on July 7, 2017, 9:02 a.m.