This function removes the outlier cells from a group based on the distance patterns, as observed on an UMAP embedding. The function considers a point to be outlier if the distance to the geometric median of the group is above a given threshold determined by a quantile.
Usage
remove_outlier_cells(
cell_names,
umap_emb,
percentile_threshold = 0.75,
gmedian_point = NULL
)Arguments
- cell_names
A vector with the names of the cells defining the group.
- umap_emb
A matrix with the UMAP embedding of the cells. The matrix should have defined the rownames as the cell names.
- percentile_threshold
The percentile to be used as threshold for the distance to the geometric median. This value will be used to calculate the quantile. Defaults to 0.75.
- gmedian_point
The geometric median point of the group. If NULL, the function will calculate this point. Defaults to NULL.