prolint.contacts.base¶
Base contact storage module.
This module provides the abstract base class for contact storage strategies.
Classes¶
Abstract base class for contact storage strategies. |
Module Contents¶
- class prolint.contacts.base.BaseContactStore(ts, contact_frames, norm_factor: float = 1.0)[source]¶
Abstract base class for contact storage strategies.
Defines the interface for storing and computing metrics on contact data. Subclasses implement specific storage and aggregation strategies.
- Parameters:
See also
ExactContactsConcrete implementation for exact contact aggregation
- abstractmethod run(database_resnames: str | List = None)[source]¶
Process contact frames into aggregated contact data.
- Parameters:
database_resnames (str or list of str, optional) – Residue names to process. If None, processes all.
- Raises:
NotImplementedError – Subclasses must implement this method.
- compute(metric: str, target_resname=None)[source]¶
Compute a standard metric on contacts.
- Parameters:
metric ({"max", "sum", "mean", "occupancy"}) – Metric to compute.
target_resname (str, optional) – Filter by residue name.
- Returns:
Computed metric values.
- Return type:
- Raises:
ValueError – If metric is not recognized.
- abstractmethod compute_metric(metric: str, target_resname=None)[source]¶
Compute a specific metric. Implemented by subclasses.
- Parameters:
- Raises:
NotImplementedError – Subclasses must implement this method.
- abstractmethod apply_function(func: Callable, target_resname=None)[source]¶
Apply a custom function to contact data.
- Parameters:
func (callable) – Function to apply to contact durations.
target_resname (str, optional) – Filter by residue name.
- Raises:
NotImplementedError – Subclasses must implement this method.
- property contacts[source]¶
Processed contact data.
- Returns:
Contact data organized by residue and database molecule.
- Return type:
- Raises:
ValueError – If run() has not been called yet.