Unified Interface for Influence Calculation
Source:R/influence-calculator-r.R
influence_calculator.RdProvides a unified interface that can use either the Python or R implementation of influence calculation.
Usage
influence_calculator(
edgelist_simple = NULL,
meta = NULL,
filename = NULL,
sqlite = FALSE,
method = "r",
signed = FALSE,
count_thresh = 3,
const = 24,
inhibitory_nts = NULL,
excluded_nts = NULL,
lambda_max = 0.99,
syn_weight_measure = c("norm", "count")
)Arguments
- edgelist_simple
Data frame with edge list. See
influence_calculator_r()for column requirements.- meta
Data frame with metadata. See
influence_calculator_r()for column requirements.- filename
Character. Path to a connectome data file. SQLite is the legacy format; the Python backend additionally supports CSV / Parquet / Feather detected by extension.
- sqlite
Logical. Whether to load data from SQLite database (default: FALSE).
- method
Character. Either "python" or "r" (default: "r").
- signed
Logical. Whether to use signed connectivity matrix (default: FALSE).
- count_thresh
Numeric. Minimum threshold count (default: 3).
- const
Numeric. Adjustment constant for the log transform applied by the R backend's
calculate_influence(). Seeinfluence_calculator_r()for details.- inhibitory_nts
Character vector of
top_ntvalues whose pre-neurons get negated weights whensigned = TRUE. Required for signed mode.- excluded_nts
Character vector of
top_ntvalues whose pre-neurons contribute nothing to W. Independent ofsigned.- lambda_max
Numeric in
(0, 1). Target spectral radius of the rescaled matrix; default0.99. Seeinfluence_calculator_r().- syn_weight_measure
Character, one of
"norm"(default) or"count". Edge column used to populate W; forwarded to both backends. Seeinfluence_calculator_r()for the trade-off.
Examples
if (FALSE) { # \dontrun{
# Use R implementation with data frames (recommended)
ic.df <- influence_calculator(edgelist_simple = my_edges, meta = my_meta)
# Use R implementation with SQLite database
ic.sqlite <- influence_calculator(filename = "connectome.sqlite", sqlite = TRUE)
# Use Python implementation directly with data frames (no temp SQLite needed)
ic.py <- influence_calculator(edgelist_simple = my_edges, meta = my_meta,
method = "python")
} # }