RMSF Per Atom Service
GitHub Link to Code.
Per-atom RMSF service variant.
- class mdxplain.analysis.structure.services.rmsf_per_atom_service.RMSFPerAtomService(pipeline_data: PipelineData | None, metric: Literal['mean', 'median', 'mad'])
Provide per-atom RMSF computations for a fixed metric variant.
Resolves trajectory selections and atom filters before delegating the numerical calculations to
RMSFCalculator. The deviation metric is fixed during construction while the reference strategy remains selectable per method call.Returns
- RMSFPerAtomService
Service exposing helper to compute per-atom RMSF values for the stored metric.
Examples
>>> service = RMSFPerAtomService(pipeline_data, metric="mean") >>> isinstance(service, RMSFPerAtomService) True
- __init__(pipeline_data: PipelineData | None, metric: Literal['mean', 'median', 'mad']) None
Store pipeline settings and the robust deviation metric.
Validates presence of pipeline data and records the chosen metric so all subsequent computations use consistent aggregation rules.
Parameters
- pipeline_dataPipelineData | None
Pipeline context carrying chunking and memmap configuration.
- metric{‘mean’, ‘median’, ‘mad’}
Robust deviation metric (
"mean","median", or"mad").
Returns
- None
The initializer does not return anything.
Examples
>>> service = RMSFPerAtomService(pipeline_data, metric="mean") >>> service.metric 'mean'
- to_mean_reference(traj_selection: int | str | List[int | str] | all = 'all', atom_selection: str = 'all', cross_trajectory: bool = False) Dict[str, ndarray]
Compute per-atom RMSF relative to the mean structure.
Derives a mean reference structure across the selected trajectories and returns per-atom RMSF values using the variant metric.
Parameters
- traj_selectionUnion[int, str, list[Union[int, str]], ‘all’], optional
Selection describing which trajectories to analyse. Defaults to
"all".- atom_selectionstr, optional
MDTraj atom selection string. Defaults to
"all".- cross_trajectorybool, optional
Combine all selected trajectories into a single RMSF profile when
True. Defaults toFalse.
Returns
- dict
Mapping of trajectory names – or
"combined"whencross_trajectoryisTrue– to per-atom RMSF arrays.
Examples
>>> service = RMSFPerAtomService(pipeline_data, metric="median") >>> result = service.to_mean_reference() {...}
- to_median_reference(traj_selection: int | str | List[int | str] | all = 'all', atom_selection: str = 'all', cross_trajectory: bool = False) Dict[str, ndarray]
Compute per-atom RMSF relative to the median structure.
Uses a median reference structure across the selected trajectories and returns per-atom RMSF values using the configured metric.
Parameters
- traj_selectionUnion[int, str, list[Union[int, str]], ‘all’], optional
Selection describing which trajectories to analyse. Defaults to
"all".- atom_selectionstr, optional
MDTraj atom selection string. Defaults to
"all".- cross_trajectorybool, optional
Combine all selected trajectories into a single RMSF profile when
True. Defaults toFalse.
Returns
- dict
Mapping of trajectory names – or
"combined"whencross_trajectoryisTrue– to per-atom RMSF arrays.
Examples
>>> service = RMSFPerAtomService(pipeline_data, metric="mad") >>> result = service.to_median_reference() {...}