You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 3.evaluate_model/scripts/nbconverted/process_jump_phenotype_profiles.py
+9-156Lines changed: 9 additions & 156 deletions
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,10 @@
13
13
#
14
14
# 1. Load in this data from the JUMP-single-cell repo
15
15
# 2. Summarize replicate KS test metrics (mean value) and align across cell types and time variables
16
-
# 3. Explore the top results per phenotype/treatment_type/model_type
16
+
# 3. Explore the top results per phenotype/treatment_type/model_type (Supplementary Table S1)
17
17
# 4. Convert it to wide format
18
18
#
19
19
# This wide format represents a "phenotypic profile" which we can use similarly as an image-based morphology profile.
20
-
#
21
-
# We also fit a UMAP to this phenotypic profile for downstream visualization.
22
20
23
21
# In[1]:
24
22
@@ -33,46 +31,6 @@
33
31
# In[2]:
34
32
35
33
36
-
defumap_phenotype(
37
-
phenotype_df: pd.DataFrame,
38
-
feature_columns: List[str],
39
-
metadata_columns: List[str],
40
-
n_components: int,
41
-
random_seed: int,
42
-
model_type: str
43
-
) ->pd.DataFrame:
44
-
"""
45
-
Fit a UMAP (Uniform Manifold Approximation and Projection) model on the provided phenotype profile and return a transformed DataFrame with metadata.
46
-
47
-
Parameters:
48
-
- phenotype_df (pd.DataFrame): DataFrame containing the phenotype profile with both feature and metadata columns.
49
-
- feature_columns (List[str]): List of column names in phenotype_df that represent the features to be used for UMAP embedding.
50
-
- metadata_columns (List[str]): List of column names in phenotype_df that represent metadata to be retained in the output.
51
-
- n_components (int): Number of dimensions for the UMAP embedding.
52
-
- random_seed (int): Random seed for reproducibility of the UMAP model.
53
-
- model_type (str): Identifier for the model type, to be added as a column in the output DataFrame.
54
-
55
-
Returns:
56
-
- umap_embeddings_with_metadata_df (pd.DataFrame): DataFrame with UMAP embeddings and specified metadata columns, including an additional 'model_type' column.
0 commit comments