fast_forward.score module¶
- fast_forward.score.calc_score(ref, test, weights=None, interaction_type='distances')[source]¶
Compute the score between two distributions. The score is a weighted sum of the Hellinger distance and the difference in means of the distributions normalized by the standard deviation of the reference distribution. If mean is outside of the standard deviation of the reference distribution, it is capped at 1.
- refnp.ndarray
Reference distribution.
- testnp.ndarray
Test distribution.
- weightslist
Weights with which to calculate the final score. Should be ordered [Hellinger weight, non-Hellinger weight]
- interaction_typestr
interaction type to calculate the score for.
- Returns:
Score between the two distributions, between [0, 1].
- Return type:
- fast_forward.score.score_matrix(molname, block, universe, file_map: dict, file_prefix: str, hellinger_weight=0.7, include_constraints=False)[source]¶
Compute a pairwise distance score matrix by comparing simulated distributions from the trajectory with reference distributions loaded from disk.
- Parameters:
molname (str) – Name of the molecule in the universe.
block (
Block) – Molecule block containing atom definitions and constraints.universe (
Universe) – Universe used to compute simulated pairwise distance distributions.file_map (dict) – Map of reference file names to their paths.
file_prefix (str) – Prefix used to construct expected reference filenames.
hellinger_weight (float) – Optional. Weight for the Hellinger distance contribution.
include_constraints (bool) – Optional. Whether constrained atom pairs should use normal weights.
- Returns:
score_matrix (ndarray) – Symmetric matrix of pairwise scores.
plot_data (dict) – Reference and simulated distributions for plotting.