Skip to content

scdef.tl.set_confident_signatures

set_confident_signatures(model: scDEF, confidence_threshold: float = 0.9, tau_quantile: float = 0.99, min_effect: Optional[float] = None, mc_samples: int = 100, random_seed: int = 0) -> Dict[str, List[str]]

Precompute and cache confident signatures/scores for all layers.

Stores signatures, per-gene confidences, combined scores, and per-factor weighted signature Jaccard confidences (posterior stability of each confident gene list, weighted by combined_scores) in model.adata.uns['confident_signatures'] for reuse by plotting.

Parameters:

Name Type Description Default
model scDEF

fitted scDEF model.

required
confidence_threshold float

a gene enters a factor's signature when P(W > tau) reaches this value. Raise it for shorter, more certain signatures; lower it to admit weaker genes.

0.9
tau_quantile float

quantile of the factor's loadings used as the effect threshold tau, so the test asks whether a gene is confidently among the factor's strongest.

0.99
min_effect Optional[float]

absolute floor on tau, applied when the quantile alone would put it too low to be meaningful. Defaults to no floor.

None
mc_samples int

number of posterior samples drawn to estimate the per-gene probabilities and the signature stability.

100
random_seed int

seed for those posterior draws, so the cache is reproducible.

0

Returns:

Type Description
Dict[str, List[str]]

The confident signature per factor, flattened across all layers.