| Title: | Inferring Cell-Specific Gene Regulatory Network |
|---|---|
| Description: | Inferring cell-type specific gene regulatory network using sparse regression model from single-cell transcriptomic data. |
| Authors: | Meng Xu [aut, cre] (ORCID: <https://orcid.org/0000-0002-8300-1054>) |
| Maintainer: | Meng Xu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.5 |
| Built: | 2026-10-14 14:09:10 UTC |
| Source: | https://github.com/mengxu98/infercsn |
Inferring cell-type specific gene regulatory network using sparse regression model from single-cell transcriptomic data.
Meng Xu (Maintainer), [email protected]
https://mengxu98.github.io/inferCSN/
Useful links:
Filter and sort a network matrix
filter_sort_matrix(network_matrix, regulators = NULL, targets = NULL)filter_sort_matrix(network_matrix, regulators = NULL, targets = NULL)
network_matrix |
Network weight matrix. |
regulators, targets
|
Nodes to include. |
A filtered and sorted matrix.
Fits a standardized sparse linear model by BIC-decreasing support updates.
fit_greedy_l0( x, y, max_support_size = NULL, min_improvement = 1e-10, verbose = TRUE )fit_greedy_l0( x, y, max_support_size = NULL, min_improvement = 1e-10, verbose = TRUE )
x |
Numeric predictor matrix with observations in rows. |
y |
Numeric response vector. |
max_support_size |
Optional positive integer support limit. |
min_improvement |
Minimum RSS improvement considered. |
verbose |
Logical verbosity flag. |
A list with 'model', 'metrics', and 'coefficients'.
Fits multiple responses from shared predictor cross-products.
fit_greedy_l0_batch( gram, xty, response_ss, candidates, n_obs, max_support_size = NULL, min_improvement = 1e-10 )fit_greedy_l0_batch( gram, xty, response_ss, candidates, n_obs, max_support_size = NULL, min_improvement = 1e-10 )
gram |
Numeric square predictor cross-product matrix. |
xty |
Numeric predictor-by-response cross-product matrix. |
response_ss |
Numeric response sums of squares. |
candidates |
List of one-based predictor indices, one element per response. |
n_obs |
Number of observations used for the cross-products. |
max_support_size |
Optional positive integer support limit. |
min_improvement |
Minimum RSS reduction proposed during forward search. |
Batched coefficients, deletion evidence, and fit summaries.
inferring cell-type specific gene regulatory network
inferCSN( object, pseudotime = NULL, regulators = NULL, targets = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... ) ## S4 method for signature 'matrix' inferCSN( object, pseudotime = NULL, regulators = NULL, targets = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... ) ## S4 method for signature 'sparseMatrix' inferCSN( object, pseudotime = NULL, regulators = NULL, targets = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... )inferCSN( object, pseudotime = NULL, regulators = NULL, targets = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... ) ## S4 method for signature 'matrix' inferCSN( object, pseudotime = NULL, regulators = NULL, targets = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... ) ## S4 method for signature 'sparseMatrix' inferCSN( object, pseudotime = NULL, regulators = NULL, targets = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... )
object |
Numeric expression matrix with cells in rows and genes in columns. |
pseudotime |
Optional pseudotime vector or branch matrix for either method. Regulators in earlier states predict targets in later states; tied states are averaged and shared branch transitions are counted once. |
regulators, targets
|
Optional gene subsets. |
max_support_size |
Optional support-size limit. |
lag_fraction |
Fractional lag used when |
lag_steps |
Optional integer lag. L0Learn centers and scales lagged expression within each branch and defaults to fitting without an intercept. |
cores |
Number of inference workers. |
verbose |
Whether to report progress. |
method |
|
... |
Arguments passed to the method. |
A data frame containing exactly regulator, target, and weight.
data(example_matrix) data(example_meta_data) network_table <- inferCSN( example_matrix, pseudotime = example_meta_data$pseudotime ) head(network_table) inferCSN( example_matrix, regulators = c("g1", "g2"), targets = c("g3", "g4") )data(example_matrix) data(example_meta_data) network_table <- inferCSN( example_matrix, pseudotime = example_meta_data$pseudotime ) head(network_table) inferCSN( example_matrix, regulators = c("g1", "g2"), targets = c("g3", "g4") )
The inferCSN logo, using ASCII or Unicode characters Use cli::ansi_strip to get rid of the colors.
infercsn_logo(unicode = cli::is_utf8_output())infercsn_logo(unicode = cli::is_utf8_output())
unicode |
Unicode symbols on UTF-8 platforms. Default is cli::is_utf8_output. |
A character vector.
https://github.com/tidyverse/tidyverse/blob/main/R/logo.R
infercsn_logo()infercsn_logo()
Format a network table
network_format( network_table, regulators = NULL, targets = NULL, abs_weight = TRUE )network_format( network_table, regulators = NULL, targets = NULL, abs_weight = TRUE )
network_table |
Network edge table. |
regulators, targets
|
Nodes to include. |
abs_weight |
Whether to use absolute weights and add interaction signs. |
A formatted network edge table.
Print logo
## S3 method for class 'infercsn_logo' print(x, ...)## S3 method for class 'infercsn_logo' print(x, ...)
x |
Input information. |
... |
Other parameters. |
Print the ASCII logo
Select features with significant trends
select_trend_features( x = NULL, pseudotime = NULL, method = c("pretsa", "gam"), padjust_threshold = 0.05, n_candidates = NULL, statistics = NULL, ... )select_trend_features( x = NULL, pseudotime = NULL, method = c("pretsa", "gam"), padjust_threshold = 0.05, n_candidates = NULL, statistics = NULL, ... )
x |
Numeric matrix with observations in rows and features in columns,
or NULL when supplying |
pseudotime |
Numeric coordinate per observation. |
method |
Fitting method: |
padjust_threshold |
Strict adjusted P-value cutoff between zero and one. |
n_candidates |
Maximum number of selected features, or NULL for no cap. |
statistics |
Precomputed table with feature row names and |
... |
Numerical options passed to |
A list with features, statistics, and fit (NULL for precomputed
input). Nonfinite P-values are excluded. Input order is retained unless
the cap is exceeded; then the smallest P-values are selected with stable ties.
t <- seq(0, 1, length.out = 40) x <- cbind(a = sin(t * 5), b = cos(t * 3)) select_trend_features(x, t)$featurest <- seq(0, 1, length.out = 40) x <- cbind(a = sin(t * 5), b = cos(t * 3)) select_trend_features(x, t)$features
Construct network for single target gene
single_network( matrix, regulators, target, pseudotime = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... )single_network( matrix, regulators, target, pseudotime = NULL, max_support_size = NULL, lag_fraction = 0.05, lag_steps = NULL, cores = 1, verbose = TRUE, method = c("greedy_l0", "L0", "L0L1", "L0L2"), ... )
matrix |
An expression matrix. |
regulators |
Candidate regulator genes. |
target |
The target gene. |
pseudotime |
Optional pseudotime vector or branch matrix passed to [inferCSN()]. |
max_support_size |
Optional support-size cap passed to [inferCSN()]. |
lag_fraction |
Fractional state lag passed to [inferCSN()]. |
lag_steps |
Optional integer state lag passed to [inferCSN()]. |
cores |
Number of inference workers. |
verbose |
Whether to report progress. |
method |
|
... |
Arguments passed to the method. |
A data frame with regulator, target, and weight columns. Greedy-L0 returns selected edges. L0Learn retains the original per-regulator coefficients, including zeros; [inferCSN()] removes zero weights from the complete network.
data(example_matrix) head( single_network( example_matrix, regulators = colnames(example_matrix), target = "g1" ) ) single_network( example_matrix, regulators = c("g1", "g2", "g3"), target = "g1" )data(example_matrix) head( single_network( example_matrix, regulators = colnames(example_matrix), target = "g1" ) ) single_network( example_matrix, regulators = c("g1", "g2", "g3"), target = "g1" )