LowRank.ComponentReliability

LowRank.ComponentReliability#

LowRank.ComponentReliability.py

Per-component reliability scoring for Decomposition objects.

The score combines two signals:
  • Rg distinctiveness (70 %): how well separated this component’s Rg is from the nearest other component’s Rg (relative separation). A score of 0 means two components have the same Rg (physically implausible); 1 means they are well-separated (≥ 30 % relative difference).

  • Proportion (30 %): components with a very small area fraction (< 5 %) are likely noise artifacts.

Special cases:
  • If Guinier fitting failed (Rg is nan): score = 0.0.

  • If there is only one component: Rg distinctiveness is inapplicable; score is determined by proportion alone.

The threshold for is_component_reliable defaults to 0.5.

component_quality_scores(decomp)#

Compute a per-component reliability score in [0, 1].

Parameters:

decomp (Decomposition) – A decomposition object returned by quick_decomposition().

Returns:

scores – Reliability score for each component. Higher is more reliable.

  • 1.0 → strongly reliable (distinct Rg, non-trivial proportion)

  • 0.0 → Guinier fitting failed, or Rg is identical to another component

Return type:

list of float

Notes

The score blends two signals:

  • Rg distinctiveness (weight 0.7): relative Rg separation from the nearest other component, normalised so that 30 % relative separation gives a score of 1.

  • Proportion (weight 0.3): area fraction normalised so that 5 % proportion gives a score of 1.

When there is only one component, Rg distinctiveness is inapplicable and the score is derived from proportion alone.

is_component_reliable(decomp, index, threshold=0.5)#

Return True if component index has a quality score above threshold.

Parameters:
  • decomp (Decomposition) – A decomposition object.

  • index (int) – Zero-based component index.

  • threshold (float, optional) – Minimum score to be considered reliable. Default 0.5.

Return type:

bool