add_dbscan_variable | R Documentation |
Leverages dbscan::dbscan()
to identify tissue sections
on the slide and to group barcode spots accordingly. Required to approximate
the outline of the tissue section(s).
add_dbscan_variable(coords_df, eps, minPts = 3, name = "dbscan", ...)
add_tissue_section_variable(coords_df, ccd, minPts = 3, ...)
coords_df |
Data.frame with x and y variable. |
eps |
size (radius) of the epsilon neighborhood. Can be omitted if
|
minPts |
number of minimum points required in the eps neighborhood for core points (including the point itself). |
name |
Name of the added variable. |
... |
To silently drop deprecated arguments. |
ccd |
Center to center distance in pixel units. |
Data.frame with additional variable containing numbers. 0 means that the spot is not connected to any other spot (probably artefact). 1-n corresponds to the tissue sections.
add_dbscan_variable()
is the working horse. add_tissue_section_variable()
has specific defaults.
# --- identify tissue sections
object <- downloadPubExample("MCI_LMU", verbose = FALSE)
coords_df <- getCoordsDf(object)
coords_df <- add_tissue_section_variable(coords_df, ccd = getCCD(object, "px"))
plotSurface(coords_df, color_by = "section")
# --- identify artefact spots
object <- SPATAData::downloadSpataObject("269_T", verbose = FALSE)
coords_df <- getCoordsDf(object)
coords_df <- add_tissue_section_variable(coords_df, ccd = getCCD(object, "px"))
plotSurface(coords_df, color_by = "section")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.