Construct network for single target gene
Usage
single_network(
matrix,
regulators,
target,
cross_validation = FALSE,
seed = 1,
penalty = "L0",
r_squared_threshold = 0,
n_folds = 5,
verbose = TRUE,
...
)
Arguments
- matrix
An expression matrix.
- regulators
The regulator genes for which to infer the regulatory network.
- target
The target gene.
- cross_validation
Logical value, default is
FALSE
, whether to use cross-validation.- seed
The random seed for cross-validation, default is
1
.- penalty
The type of regularization, default is
L0
. This can take either one of the following choices:L0
,L0L1
, andL0L2
. For high-dimensional and sparse data,L0L2
is more effective.- r_squared_threshold
Threshold of \(R^2\) coefficient, default is
0
.- n_folds
The number of folds for cross-validation, default is
5
.- verbose
Logical value, default is
TRUE
, whether to print progress messages.- ...
Parameters for other methods.
Value
A data frame of the single target gene network. The data frame has three columns:
- regulator
The regulator genes.
- target
The target gene.
- weight
The weight of the regulator gene on the target gene.
Examples
data("example_matrix")
head(
single_network(
example_matrix,
regulators = colnames(example_matrix),
target = "g1"
)
)
#> regulator target weight
#> 1 g10 g1 0.009932787
#> 2 g11 g1 0.010286958
#> 3 g12 g1 0.017584462
#> 4 g13 g1 -0.002483363
#> 5 g14 g1 -0.021346832
#> 6 g15 g1 0.027390264
head(
single_network(
example_matrix,
regulators = colnames(example_matrix),
target = "g1",
cross_validation = TRUE
)
)
#> regulator target weight
#> 1 g10 g1 0.009932787
#> 2 g11 g1 0.010286958
#> 3 g12 g1 0.017584462
#> 4 g13 g1 -0.002483363
#> 5 g14 g1 -0.021346832
#> 6 g15 g1 0.027390264
single_network(
example_matrix,
regulators = c("g1", "g2", "g3"),
target = "g1"
)
#> regulator target weight
#> 1 g2 g1 0.9876086
#> 2 g3 g1 -0.1569370
single_network(
example_matrix,
regulators = c("g1", "g2"),
target = "g1"
)
#> ! [2025-05-07 09:38:57] less than 2 regulators found while modeling: g1
#> NULL