remove_background: remove background spots (not covered by tissue) from ST data...

Description Usage Arguments Details Value

View source: R/remove_background.R

Description

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.

Usage

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
)

Arguments

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.

Details

nx and ny depend on the cropping of the image. the area of measurements in an ST experiment is

Value

list containing four entries

  1. spots.to.keep - vector of barcodes / spot names of the spots that should not be removed

  2. spots.keep.clustering - vector of barcodes / spot names of the spots that should not be removed based on clustering in addition to image analysis

  3. 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.

  4. clustering.tsne tSNE embedding of spots coloured by classification (background/tissue)


tmirus/TTT documentation built on April 17, 2021, 11:04 p.m.