grassp.pl.aligned_umap#
- aligned_umap(data, data2, highlight_hits=None, highlight_annotation_col=None, aligned_umap_key='X_aligned_umap', data1_label='data1', data2_label='data2', color_by='perturbation', data1_color='#C7E8F9', data2_color='#FFCCC2', figsize=(8.25, 6), size=80, alpha=0.4, ax=None, show=None, save=None)[source]#
Plot aligned UMAP embeddings for two datasets.
- Parameters:
- data
AnnData
First annotated data matrix
- data2
AnnData
Second annotated data matrix
- highlight_hits
Union
[List
[str
],ndarray
[bool
,Any
],None
] (default:None
) List of protein names or boolean mask to highlight trajectories between datasets
- highlight_annotation_col
Optional
[str
] (default:None
) Column in data.obs to use for highlighting specific proteins
- aligned_umap_key
str
(default:'X_aligned_umap'
) Key in data.obsm containing aligned UMAP coordinates
- data1_label
str
(default:'data1'
) Label for first dataset in legend
- data2_label
str
(default:'data2'
) Label for second dataset in legend
- color_by
Literal
['perturbation'
,'cluster'
] (default:'perturbation'
) Whether to color by ‘perturbation’ or ‘cluster’
- data1_color
str
(default:'#C7E8F9'
) Color for first dataset points if coloring by perturbation
- data2_color
str
(default:'#FFCCC2'
) Color for second dataset points if coloring by perturbation
- figsize
tuple
[float
,float
] (default:(8.25, 6)
) Size of the figure in inches
- size
int
(default:80
) Size of scatter points
- alpha
float
(default:0.4
) Transparency of scatter points
- ax
Optional
[Axes
] (default:None
) Matplotlib axes to plot on
- show
Optional
[bool
] (default:None
) Whether to display the plot
- save
Union
[bool
,str
,None
] (default:None
) Whether to save the plot and optional filename
- data
- Return type:
Axes
|None
- Returns:
matplotlib.pyplot.Axes or None If show=False returns the axes object, otherwise returns None