This function computes a pseudospatial distance between beads that combines spatial distance and distance from the expression space, then using the silhouette score and hierarchical clustering, segregates beads into bins
bin(
dat,
md,
k,
pos = TRUE,
pos_k = 55,
ex_k = 1,
hc_function = "ward.D2",
plot_directory
)
A data.table of bead metadata combined with bin designations
data.table of smoothed relative expression intensities
data.table of metadata of each bead
number of malignant bins to set
TRUE if doing spatial and expressional binning, FALSE if just expressional binning
positional weight
expressional weight
hierarchical clustering function
output plot directory path