File tree Expand file tree Collapse file tree
applications/contrastive_phenotyping/evaluation
viscy/representation/evaluation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- """Script to compute and analyze correlations between PCA/UMAP features and computed features.
2-
3- This script performs correlation analysis between dimensionality-reduced features (PCA/UMAP)
4- and computed morphological/intensity features from cell tracking data. It identifies which
5- computed features best represent the PCA and UMAP components and visualizes these
6- relationships through correlation heatmaps.
7-
8- Functions
9- ---------
10- compute_PCA : Compute PCA components from embedding features
11- compute_features : Compute various cell features and combine with PCA features
12- compute_correlation_and_save_png : Generate and save correlation heatmaps
13-
14- Notes
15- -----
16- - Uses Spearman correlation for robustness to non-linear relationships
17- - Generates high-resolution heatmaps with correlation values
18- - Processes data track by track to manage memory efficiently
19- """
20-
211from pathlib import Path
222import matplotlib .pyplot as plt
233import numpy as np
244import seaborn as sns
255from sklearn .decomposition import PCA
266import pandas as pd
27- import os
287from sklearn .preprocessing import StandardScaler
298
309from viscy .representation .embedding_writer import read_embedding_dataset
Original file line number Diff line number Diff line change @@ -142,19 +142,6 @@ class SymmetryDescriptor(TypedDict):
142142
143143class TrackFeatures (TypedDict ):
144144 """Velocity-based features extracted from a single track.
145-
146- Attributes
147- ----------
148- instantaneous_velocity : list[float]
149- Array of velocities at each timepoint.
150- mean_velocity : float
151- Mean velocity over the track.
152- max_velocity : float
153- Maximum velocity observed.
154- min_velocity : float
155- Minimum velocity observed.
156- std_velocity : float
157- Standard deviation of velocity.
158145 """
159146
160147 instantaneous_velocity : list [float ] # Array of velocities at each timepoint
You can’t perform that action at this time.
0 commit comments