constructBipartiteGraph: Construct Bipartite Graph Edge Weight Matrix of Gene-drug...

Description Usage Arguments Value Examples

View source: R/HierBipartite.R

Description

Constructs edge weight matrix B representing association between set of variables in mat1 and set of variables in mat2 (see paper).

Usage

1
2
3
4
5
6
7
8
constructBipartiteGraph(
  mat1,
  mat2,
  n_subsample = 1,
  subsampling_ratio = 1,
  parallel = FALSE,
  maxCores = 7
)

Arguments

mat1

an n x p matrix of variable set 1 (e.g. gene expression)

mat2

an n x q matrix of variable set 2 (e.g. drug sensitivity)

n_subsample

number of times to perform subsampling to generate B

subsampling_ratio

fraction of samples to subsample each time

parallel

boolean for whether to parallelize subsampling

maxCores

maximum number of cores to use (only applicable when parallel = TRUE)

Value

a p x q matrix of bipartite graph edge weights

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Extract bipartite edge weight matrix B for cell lines from the
# squamous cell carcinoma, esophagus group
data(ctrp2)

groups = ctrp2$groups
X = ctrp2$X
Y = ctrp2$Y

x = X[groups[["squamous_cell_carcinoma_esophagus"]], ]
y = Y[groups[["squamous_cell_carcinoma_esophagus"]], ]

# Extract bipartite edge weight matrix B with subsampling
## Not run: 
B = constructBipartiteGraph(x, y, n_subsample = 100,
                            subsampling_ratio = 0.90,
                            parallel = TRUE, maxCores = 2)

## End(Not run)

hierBipartite documentation built on Feb. 16, 2021, 5:07 p.m.