
This function will combine beads into bins, taking the average expression intensities, average positions, most common cluster seurat cluster, and most common cluster/tissue type of constituent beads
long_to_bin(dat_long, plot_directory, spatial = TRUE)
data.table of expression intensities at aggregated bin level
data.table of bead expression intensities per gene with metadata in long format
output plot directory path
True if using spatial information