select_differential_edges: Select Differential Edges by Posterior Directional Error

View source: R/differential_fdr.R

select_differential_edgesR Documentation

Select Differential Edges by Posterior Directional Error

Description

Uses the final final-model Rao-Blackwell probabilities from a staged run. The selection unit is one treatment cluster and unordered gene pair; all K clusters form a single family. The most supported direction under the frozen map is reported. For 'all_matchings', its error is bounded by the largest posterior error over all K possible control counterparts. This is a conservative bound for every fixed bijection, not a posterior distribution over matchings and not a frequentist FDR guarantee.

Usage

select_differential_edges(
  result,
  fdr_level = 0.05,
  scope = c("frozen", "all_matchings"),
  min_draws = 200L,
  rule = c("delta_threshold", "posterior_error")
)

Arguments

result

Output of a staged [run_scNPM()] fit.

fdr_level

Target posterior expected directional FDP in (0, 1).

scope

'frozen' (default) uses the selected matching. 'all_matchings' bounds errors over every control counterpart for sensitivity analysis.

min_draws

Minimum retained iterations before producing discoveries, at least 20, default 200. This guard does not establish convergence.

rule

'delta_threshold' scans strict absolute contrast thresholds without splitting tied scores; 'posterior_error' uses the version 1.0.4 error prefix.

Details

The selected set has mean estimated directional error at most 'fdr_level'. Monte Carlo approximation, label identification and model assumptions still apply. Edge states refer to continuous spike/slab allocations, not exact zero precision entries. Batch MCSE is a diagnostic, not a confidence bound or convergence certificate.

Value

A list with threshold (strict |Delta P| > threshold), threshold_curve, rule, and the full edge table, selected rows, estimated error bound, target, scope, sample count and status. Each table row has an 'error_bound' for that edge and a 'frozen_error' for its reported pairing. 'estimated_error_bound' is the mean bound across selected rows.


scNPM documentation built on Oct. 19, 2026, 5:10 p.m.