View source: R/render-spectral.R
| spectral.render | R Documentation |
Calculate pathway-level Dirichlet sums and Rayleigh quotients from a sample matrix. Dirichlet sums quantify contrasts between adjacent node states; Rayleigh quotients additionally normalize those contrasts by individual node states.
spectral.render(
fgs,
mtr,
net,
min_ngenes = 5,
features = c("rlq", "rlw", "dir", "diw"),
scope = c("within-pathway", "boundary-expanded"),
case_sensitive = FALSE,
n_cores = 1L,
verbose = TRUE
)
fgs |
Named list of functional gene sets whose subnetworks are extracted
from the global network |
mtr |
Numeric gene-by-sample matrix. Values become sample-specific node attributes. |
net |
Undirected igraph network, or a legacy network with a named
adjacency list in |
min_ngenes |
Minimum mapped genes per set before scope expansion. |
features |
Unique spectral features. |
scope |
Graph scope: |
case_sensitive |
Use case-sensitive identifier matching. |
n_cores |
Positive integer number of worker processes. Independent
spectral features are distributed across workers when |
verbose |
Report progress with |
The implemented spectral features are Dirichlet sums (dir and
diw for edge-unweighted and weighted versions, respectively) and
Rayleigh quotients (rlq and rlw for edge-unweighted and weighted
versions, respectively). The former summarize contrasts between states of
adjacent network nodes within a pathway, whereas the latter also normalize
the contrasts by individual node states. A separate pathway-by-sample
matrix is produced for each requested feature. Running
scope = "boundary-expanded" may take about ten times as long as
"within-pathway"; the exact increase depends on the network and pathway
sizes. Submit alternative scope analyses as separate calls so that each
result has an unambiguous graph scope.
A nearender_result. scores contains one
pathway-by-sample matrix for every requested feature, in request order.
statistics contains the same master score matrices under the same names.
rlq and rlw are Rayleigh quotients; dir and diw are
Dirichlet sums. Rows with fewer than min_ngenes mapped genes, or with no
usable scoped edges, contain NA. diagnostics$fgs_network_sizes
reports mapped pathway sizes; no p- or q-values are calculated.
Chung FRK (1997). Spectral Graph Theory. CBMS Regional Conference Series in Mathematics 92, American Mathematical Society. ISBN 978-0-8218-0315-8.
spectral_eigenpairs(), texture.render(), gsva.render()
profiles <- matrix(c(1, 3, 5, 2, 2, 2), nrow = 3,
dimnames = list(c("A", "B", "C"), c("sample_1", "sample_2")))
fgs <- list(pathway = c("A", "B"))
net <- list(
links = list(A = "B", B = c("A", "C"), C = "B"),
weights = list(A = c(B = 2), B = c(A = 2, C = 1), C = c(B = 1)),
Ntotal = 2)
spectral <- spectral.render(fgs, profiles, net, min_ngenes = 2,
scope = "within-pathway", verbose = FALSE)
spectral$scores$rlq
spectral$scores$rlw
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.