Description Usage Arguments Details Value
View source: R/remove_background.R
remove background spots (not covered by tissue) from ST data based on tissue image. Manual checking of the result and adjustment of the threshold is needed.
1 2 3 4 5 6 7 8 9 | remove_background(
img = NULL,
nx = 35,
ny = 33,
ids,
counts,
threshold = 0.7,
plot.params = NULL
)
|
img |
image of the ST slide, cropped to the spot area. image read by EBimage::readImage() |
nx |
number of spots shown in the image on the horizontal axis |
ny |
number of spots shown in the image on the vertical axis |
ids |
data frame assigning barcodes / spot names to spatial coordinates |
counts |
non-negative numeric matrix containing gene counts, rows correspond to spots, columns correspond to genes |
threshold |
relative brightness. spots above this threshold are discarded |
plot.params |
list as returned by plot_adjustment(). optional but recommended for optimal results. |
nx and ny depend on the cropping of the image. the area of measurements in an ST experiment is
list containing four entries
spots.to.keep - vector of barcodes / spot names of the spots that should not be removed
spots.keep.clustering - vector of barcodes / spot names of the spots that should not be removed based on clustering in addition to image analysis
image - image showing the areas that are retained.
typically framed by spots for which there exist no measurements. Depending on whether these are contained
in the image or not, different values need to be chosen for nx, ny. If they are included, the
default values of nx=35 and ny=33 are sensible. If not, it should be nx=33 and ny=31.
The image is assumed to be oriented such that the rectangular 4x4 array of spots in one of the corners
is in the lower right corner and on the x-axis (left to right) there are more spots than on the y-axis.
clustering.tsne tSNE embedding of spots coloured by classification (background/tissue)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.