Each member of the joinWith()-family takes a data.frame as input that contains at least the variables barcodes and sample. (Easily obtained with the get*()-family.) It extracts the specified variables and joins them over the barcode variable with the provided data.frame.

joinWith(
  object,
  spata_df,
  features = NULL,
  gene_sets = NULL,
  method_gs = "mean",
  genes = NULL,
  average_genes = FALSE,
  uniform_genes = "discard",
  smooth = FALSE,
  smooth_span = 0.02,
  verbose = TRUE,
  normalize = TRUE
)

joinWithFeatures(
  object,
  spata_df,
  features,
  smooth = FALSE,
  smooth_span = 0.02,
  verbose = TRUE
)

joinWithGenes(
  object,
  spata_df,
  genes,
  average_genes = FALSE,
  uniform_genes = "keep",
  smooth = FALSE,
  smooth_span = 0.02,
  normalize = TRUE,
  verbose = TRUE
)

joinWithGeneSets(
  object,
  spata_df,
  gene_sets,
  method_gs = "mean",
  smooth = FALSE,
  smooth_span = 0.02,
  normalize = TRUE,
  verbose = TRUE
)

joinWithVariables(
  object,
  spata_df,
  variables,
  method_gs = "mean",
  average_genes = FALSE,
  uniform_genes = "discard",
  smooth = FALSE,
  smooth_span = 0.02,
  normalize = TRUE,
  verbose = TRUE
)

Arguments

object

A valid spata-object.

spata_df

A data.frame containing information of barcode-spots. Must contain the variables.

barcodes

Character. The barcode-sequences (+ the sample belonging) of every barcode spot.

sample

Character. The sample belonging of every barcode-spot.

features

The features of interest specified as a character vector.

gene_sets

The gene sets of interest specified as a character vector.

method_gs

Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean' or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA().

genes

The genes of interest specified as a character vector.

average_genes

Logical. If set to TRUE the average expression of the specified genes is calculated and saved under one variable named 'mean_genes'.

uniform_genes

Character value. If set to 'discard' genes that are uniformly expressed across all barcode-spots of the specified coordinates data.frame are discarded. If set to 'keep' they are kept.

smooth

Logical. If set to TRUE values will be smoothed according to the smoooth_-parameters.

smooth_span

The amount of smoothing specified as a single numeric value.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

normalize

Logical. If set to TRUE values will be scaled to 0-1.

Hint: Variables that are uniformly expressed can not be scaled and are discarded.

variables

Character vector. The variables of interest:

Value

The input data.frame of spata_df joined with all the specified genes, gene-sets and/or features by the key-variable barcodes.

Details

Hint: Variables of the specified data.frame spata_df that have equal names as the specified features, genes and gene-sets are overwritten!