texture.render: Render a sample matrix as pathway-level texture features

View source: R/render-texture.R

texture.renderR Documentation

Render a sample matrix as pathway-level texture features

Description

From a matrix of continuous gene or protein values, calculate selected Haralick texture features for a collection of pathways. Haralick et al. (1973) developed the method for regular image grids; this implementation evaluates co-occurrence between adjacent nodes in irregular pathway-scale subnetworks extracted from the global network. Subset fgs before calling when only some sets are required.

Usage

texture.render(
  fgs,
  mtr,
  net,
  t_level = 3,
  min_ngenes = 5,
  norm_dir = c("row", "col", "non"),
  features = c("asm", "con", "cor", "den", "dva", "ent", "f12", "f13", "idm", "pro",
    "sav", "sen", "sha", "sva", "var"),
  scope = c("within-pathway", "boundary-expanded"),
  case_sensitive = FALSE,
  n_cores = 1L,
  verbose = TRUE
)

Arguments

fgs

Named list of functional gene sets whose subnetworks are extracted from the global network. Subset it before calling when needed.

mtr

Numeric gene-by-sample matrix.

net

Network with a named adjacency list in links.

t_level

Number of binary grey-level bits.

min_ngenes

Minimum mapped genes per set.

norm_dir

Rank-normalization direction.

features

Unique requested Haralick feature identifiers. The default explicitly lists all 15 implemented features.

scope

Graph scope: "within-pathway" uses within-set edges; "boundary-expanded" also uses boundary edges to one-hop neighbors.

case_sensitive

Use case-sensitive identifier matching.

n_cores

Positive integer number of worker processes. Independent functional gene sets are distributed across workers when greater than one.

verbose

Report progress with message().

Details

Each sample is discretized to 2^t_level grey levels before a pathway GLCM is constructed. norm_dir controls whether ranking is performed by gene, by sample, or over the full selected matrix. The renderer calculates descriptive texture features; it does not calculate p- or q-values.

Value

A nearender_result. scores contains one pathway-by-sample matrix for every requested Haralick feature, in request order; statistics contains the same master score matrices under the same names. Pathways below min_ngenes retain a row filled with NA. diagnostics$fgs_network_sizes reports the number of mapped network genes for every pathway, while parameters records scope, discretization, normalization direction, case policy, and workers.

Haralick features

features accepts the following identifiers:

asm

angular second moment (energy)

con

contrast

cor

correlation

den

difference entropy

dva

difference variance

ent

entropy

f12

first information measure of correlation

f13

second information measure of correlation

idm

inverse difference moment (homogeneity)

pro

cluster prominence

sav

sum average

sen

sum entropy

sha

cluster shade

sva

sum variance

var

variance

References

Haralick RM, Shanmugam K, Dinstein I (1973). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1109/TSMC.1973.4309314")}.

Kobayashi K et al. (2015). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10086-015-1507-6")}.

Alexeyenko A (2026). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.64898/2026.07.12.737672")}.

See Also

glcm.net(), haralick.net(), haralick.matrix(), spectral.render(), gsva.render()

Examples

profiles <- matrix(c(1, 5, 2, 4, 3, 3, 4, 2), nrow = 4,
  dimnames = list(letters[1:4], c("sample_1", "sample_2")))
fgs <- list(pathway = c("a", "b", "c"))
net <- list(links = list(a = "b", b = c("a", "c"),
  c = c("b", "d"), d = "c"), Ntotal = 3)
texture <- texture.render(fgs, profiles, net, min_ngenes = 3,
  features = c("asm", "con"), scope = "within-pathway",
  verbose = FALSE)
texture$scores$asm

NEArender documentation built on Nov. 28, 2026, 5:10 p.m.