Uses Euclidean distances to identify neighborhoods of cells. Three clustering methods are available, including hierarchical clustering, dbscan, and (Rphenograph).
identify_neighborhoods(
spe_object,
method = "hierarchical",
cell_types_of_interest,
radius,
min_neighborhood_size = 10,
k = 100,
feature_colname,
no_pheno = NULL
)
SpatialExperiment object in the form of the output of
format_image_to_spe
.
String. The clustering method. Choose from "hierarchical", "dbscan" and "Rphenograph". (Note Rphenograph function is not available for this version yet).
String Vector of phenotypes to consider.
Numeric specifying the radius of search. Need to specify when `method` is "hierarchical" or "dbscan".
Numeric. The minimum number of cells within each cluster. Need to specify when `method` is "hierarchical" or "dbscan".
Numeric. The parameter for "Rphenograph" method.
String. Column from which the cell types are selected.
Cell type corresponding to cells without a known phenotype (e.g. "None", "Other")
An spe object and a plot is returned. The spe object contains information of the defined neighborhood under "Neighborhood" column. The cells of interest that do not form clusters are labelled "Free_cell", cells not of interest are labelled `NA`.
neighborhoods <- identify_neighborhoods(image_no_markers, method = "hierarchical",
min_neighborhood_size = 100, cell_types_of_interest = c("Immune", "Immune1", "Immune2"),
radius = 50, feature_colname = "Cell.Type")