dynsight.trajectory.OnionInsight¶
- class dynsight.trajectory.OnionInsight(labels, state_list, reshaped_data, meta=<factory>)[source]¶
Contains an onion-clustering analysis.
- Parameters:
- labels¶
The labels assigned by the clustering algorithm.
- reshaped_data¶
The input data reshaped for onion-clustering.
- Type:
NDArray[np.float64]
Methods
Save the OnionInsight to a JSON file and .npy file.
Load the OnionInsight object from JSON and .npy files.
Plot the average sequence of each onion cluster.
Plot one particle's trajectory colored according to clustering.
Plot the overall onion clustering result.
Plot the Sankey diagram of the onion clustering.
Plot each state's population along the trajectory.
Attributes
- dump_to_json(file_path)[source]¶
Save the OnionInsight to a JSON file and .npy file.
- Parameters:
file_path (Path)
- Return type:
None
- classmethod load_from_json(file_path, mmap_mode=None)[source]¶
Load the OnionInsight object from JSON and .npy files.
- Parameters:
file_path (Path) – Path to the .json file.
mmap_mode (Literal['r', 'r+', 'w+', 'c'] | None) – If given, used as np.load(…, mmap_mode=mmap_mode) for memory mapping.
- Raises:
ValueError – if required keys are missing.
- Return type:
- plot_medoids(file_path, data_insight)[source]¶
Plot the average sequence of each onion cluster.
- Parameters:
file_path (Path)
data_insight (Insight)
- Return type:
None
- plot_one_trj(file_path, data_insight, particle_id)[source]¶
Plot one particle’s trajectory colored according to clustering.
- plot_output(file_path, data_insight)[source]¶
Plot the overall onion clustering result.
- Parameters:
file_path (Path)
data_insight (Insight)
- Return type:
None