Cluster Add Service

GitHub Link to Code.

Service for adding clustering algorithms without explicit type instantiation.

class mdxplain.clustering.services.cluster_add_service.ClusterAddService(manager: ClusterManager, pipeline_data: PipelineData)

Service for adding clustering algorithms without explicit type instantiation.

This service provides an intuitive interface for adding clustering algorithms without requiring users to import and instantiate cluster types directly. Provides both standard calls with default center method and explicit selection.

Examples

>>> # Standard calls with default centroid centers
>>> pipeline.clustering.add.dbscan("my_features", eps=0.5, min_samples=5)
>>> pipeline.clustering.add.hdbscan("my_features", min_cluster_size=10)
>>> pipeline.clustering.add.dpa("my_features", Z=2.0)
>>> # Explicit center method selection
>>> pipeline.clustering.add.dbscan.with_median_centers("my_features", eps=0.5)
>>> pipeline.clustering.add.hdbscan.with_density_peak_centers("my_features", min_cluster_size=10)
>>> pipeline.clustering.add.dpa.with_rmsd_centroid_centers("my_features", Z=2.0)
__init__(manager: ClusterManager, pipeline_data: PipelineData) None

Initialize service with manager and pipeline data.

Parameters

managerClusterManager

Cluster manager instance

pipeline_dataPipelineData

Pipeline data container (injected by AutoInjectProxy)

Returns

None

property dbscan: DBSCANAddService

Service for adding DBSCAN clustering.

Uses centroid (medoid) center calculation by default. The centroid is the actual data point closest to the cluster mean, ensuring the cluster center is a real conformational state from the trajectory.

For alternative center methods, use:

  • .with_mean_centers() - Arithmetic mean (may not be real state)

  • .with_median_centers() - Feature-wise median (robust to outliers)

  • .with_density_peak_centers() - Highest density point

  • .with_median_centroid_centers() - Medoid from median

  • .with_rmsd_centroid_centers() - RMSD-based centroid

Returns

DBSCANAddService

Service for DBSCAN clustering with flexible center method selection

Examples

>>> # Standard call with default centroid centers
>>> pipeline.clustering.add.dbscan("features", eps=0.5, min_samples=5)
>>> # Explicit center method
>>> pipeline.clustering.add.dbscan.with_median_centers("features", eps=0.5)
property hdbscan: HDBSCANAddService

Service for adding HDBSCAN clustering.

Uses centroid (medoid) center calculation by default. The centroid is the actual data point closest to the cluster mean, ensuring the cluster center is a real conformational state from the trajectory.

For alternative center methods, use:

  • .with_mean_centers() - Arithmetic mean (may not be real state)

  • .with_median_centers() - Feature-wise median (robust to outliers)

  • .with_density_peak_centers() - Highest density point

  • .with_median_centroid_centers() - Medoid from median

  • .with_rmsd_centroid_centers() - RMSD-based centroid

Returns

HDBSCANAddService

Service for HDBSCAN clustering with flexible center method selection

Examples

>>> # Standard call with default centroid centers
>>> pipeline.clustering.add.hdbscan("features", min_cluster_size=10)
>>> # Explicit center method
>>> pipeline.clustering.add.hdbscan.with_density_peak_centers("features", min_cluster_size=10)
property dpa: DPAAddService

Service for adding DPA clustering.

Uses centroid (medoid) center calculation by default. The centroid is the actual data point closest to the cluster mean, ensuring the cluster center is a real conformational state from the trajectory.

For alternative center methods, use:

  • .with_mean_centers() - Arithmetic mean (may not be real state)

  • .with_median_centers() - Feature-wise median (robust to outliers)

  • .with_density_peak_centers() - Highest density point

  • .with_median_centroid_centers() - Medoid from median

  • .with_rmsd_centroid_centers() - RMSD-based centroid

Returns

DPAAddService

Service for DPA clustering with flexible center method selection

Examples

>>> # Standard call with default centroid centers
>>> pipeline.clustering.add.dpa("features", Z=2.0)
>>> # Explicit center method
>>> pipeline.clustering.add.dpa.with_rmsd_centroid_centers("features", Z=2.0)