Skip to content

Status

Status enums.

PrioritizationStatus

Bases: Enum

Prioritization status for a protein pair.

Source code in src/xlranker/status.py
class PrioritizationStatus(Enum):
    """Prioritization status for a protein pair."""

    NOT_ANALYZED = auto()
    "No analysis performed yet"

    # Parsimony-based statuses

    PARSIMONY_NOT_SELECTED = auto()
    "Another entity was selected in group or cannot be selected"
    PARSIMONY_PRIMARY_SELECTED = auto()
    "Selected as the primary representative for group."
    PARSIMONY_SECONDARY_SELECTED = auto()
    "Selected as a secondary representative for group. Only possible for intra pairs."
    PARSIMONY_AMBIGUOUS = auto()
    "No clear candidate from parsimony analysis. Needs ML model."

    # Machine Learning-based statuses

    ML_NOT_SELECTED = auto()
    "Other candidate had higher score in group"
    ML_PRIMARY_SELECTED = auto()
    "Highest ML score in group or primary selection"
    ML_SECONDARY_SELECTED = auto()
    "High confidence ML score in group or secondary selection"

ML_NOT_SELECTED = auto() class-attribute instance-attribute

Other candidate had higher score in group

ML_PRIMARY_SELECTED = auto() class-attribute instance-attribute

Highest ML score in group or primary selection

ML_SECONDARY_SELECTED = auto() class-attribute instance-attribute

High confidence ML score in group or secondary selection

NOT_ANALYZED = auto() class-attribute instance-attribute

No analysis performed yet

PARSIMONY_AMBIGUOUS = auto() class-attribute instance-attribute

No clear candidate from parsimony analysis. Needs ML model.

PARSIMONY_NOT_SELECTED = auto() class-attribute instance-attribute

Another entity was selected in group or cannot be selected

PARSIMONY_PRIMARY_SELECTED = auto() class-attribute instance-attribute

Selected as the primary representative for group.

PARSIMONY_SECONDARY_SELECTED = auto() class-attribute instance-attribute

Selected as a secondary representative for group. Only possible for intra pairs.

ReportStatus

Bases: Enum

Pair reporting status.

Source code in src/xlranker/status.py
@total_ordering
class ReportStatus(Enum):
    """Pair reporting status."""

    CONSERVATIVE = 0
    """High confidence pairs, parsimonious unambiguous"""

    MINIMAL = 1
    """Medium confidence pairs, parsimonious ambiguous included, all peptides represented"""

    EXPANDED = 2
    """All pairs, including non-parsimonious pairs, high scoring ML pairs"""

    ALL = 3
    """All pairs, regardless of status"""

    NONE = -1
    """No assigned status"""

    def __lt__(self, other: object) -> bool:
        """Determine if report status has lower value (lower value means higher confidence).

        Args:
            other (object): object to compare to

        Returns:
            bool: True if this status is higher priority. False if equal or lower priority.

        """
        if isinstance(other, ReportStatus):
            return self.value < other.value
        return NotImplemented

ALL = 3 class-attribute instance-attribute

All pairs, regardless of status

CONSERVATIVE = 0 class-attribute instance-attribute

High confidence pairs, parsimonious unambiguous

EXPANDED = 2 class-attribute instance-attribute

All pairs, including non-parsimonious pairs, high scoring ML pairs

MINIMAL = 1 class-attribute instance-attribute

Medium confidence pairs, parsimonious ambiguous included, all peptides represented

NONE = -1 class-attribute instance-attribute

No assigned status

__lt__(other)

Determine if report status has lower value (lower value means higher confidence).

Parameters:

Name Type Description Default
other object

object to compare to

required

Returns:

Name Type Description
bool bool

True if this status is higher priority. False if equal or lower priority.

Source code in src/xlranker/status.py
def __lt__(self, other: object) -> bool:
    """Determine if report status has lower value (lower value means higher confidence).

    Args:
        other (object): object to compare to

    Returns:
        bool: True if this status is higher priority. False if equal or lower priority.

    """
    if isinstance(other, ReportStatus):
        return self.value < other.value
    return NotImplemented