R6 Class for Native R Influence Calculator
Source:R/influence-calculator-r.R
InfluenceCalculatorR.RdNative R implementation of the ConnectomeInfluenceCalculator functionality.
Details
This class provides a pure R implementation of connectome influence calculation using efficient sparse matrix operations.
Public fields
W_signedWhether connectivity matrix uses signed weights
metaMetadata table from database
n_neuronsNumber of neurons in the network
WSparse connectivity matrix
id_to_indexMapping from neuron IDs to matrix indices
index_to_idMapping from matrix indices to neuron IDs
constConstant value for adjusted influence calculation
edgelist_hashHash of edgelist for cache validation
W_normalizedCached normalized connectivity matrix
W_factorizationCached matrix factorization for solving
max_eigenvalueCached maximum eigenvalue for normalization
lambda_maxTarget spectral radius of the rescaled matrix
inhibitory_ntstop_nt values whose pre-neurons get negated weights when signed
excluded_ntstop_nt values whose pre-neurons contribute nothing to W
syn_weight_measureEdge column used to populate W ("norm" or "count")
Methods
Method new()
Create a new InfluenceCalculatorR object
Usage
InfluenceCalculatorR$new(
edgelist_simple = NULL,
meta = NULL,
filename = NULL,
sqlite = FALSE,
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_simpleData frame with edge list
metaData frame with metadata
filenamePath to SQLite database
sqliteWhether to use SQLite database
signedWhether to use signed connectivity matrix
count_threshMinimum synapse count threshold
constConstant value for adjusted influence calculation
inhibitory_ntsCharacter vector of
top_ntvalues whose pre-neurons receive negative weights whensigned = TRUE. Required for signed mode.excluded_ntsCharacter vector of
top_ntvalues whose pre-neurons contribute nothing to W (their outgoing edges are dropped). Independent ofsigned.lambda_maxTarget spectral radius of the rescaled W~; default 0.99. See
influence_calculator_r()for the trade-off it controls.syn_weight_measureEdge column used to populate W,
"norm"(default) or"count". Seeinfluence_calculator_r()for the trade-off.
Method calculate_influence()
Calculate influence scores for given seed neurons
Usage
InfluenceCalculatorR$calculate_influence(
seed_ids,
silenced_neurons = numeric(0),
const = NULL
)Arguments
seed_idsVector of seed neuron IDs
silenced_neuronsVector of neuron IDs to silence (default: none, for performance)
constConstant value added to log(influence) to ensure non-negative adjusted influence scores. Should be set to -log(minimum_accepted_influence) where minimum_accepted_influence is the smallest influence value considered meaningful. If NULL, uses value from initialization (default: NULL).