Functions that remove molecules from the SPATA2 object by removing them from count matrix and all processed matrices of the respective assay.

  • removeMolecules(): Removes user specified molecules.

  • removeMoleculesZeroCounts(): Removes molecules that do not have a single count across all observations.

Wrappers for transcriptomic assay:

  • removeGenes(): Removes user specified genes.

  • removeGenesMitochondrial(): Removes mitochondrial genes.

  • removeGenesRibosomal(): Removes ribosomal genes.

  • removeGenesStress(): Removes stress related genes.

  • removeGenesZeroCounts(): Removes genes that do not have a single count across all observations.

removeGenes(object, genes, show_warnings = FALSE, verbose = NULL)

removeGenesMitochondrial(object, verbose = NULL, ...)

removeGenesRibosomal(object, verbose = NULL, ...)

removeGenesStress(object, verbose = NULL)

removeGenesZeroCounts(object, verbose = NULL)

removeMolecules(
  object,
  molecules,
  show_warnings = FALSE,
  ref = "molecule",
  assay_name = activeAssay(object),
  verbose = NULL
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

genes

Character vector. Names of genes to remove.

show_warnings

Logical value. If TRUE, warnings about genes that were not found although they were mentioned in the vector of genes that are to be discarded are suppressed.

verbose

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

(Warning messages will always be printed.)

...

Used to absorb deprecated arguments or functions.

assay_name

Only relevant if the SPATA2 object contains more than one assay: Denotes the assay of interest and thus the molecular modality to use. Defaults to the active assay as set by activateAssay().

Value

The updated input object, containing the added, removed or computed results.

Details

This step affects the matrices of the object and thus all subsequent analysis steps. Analysis steps that have already been conducted are not affected! It is advisable to integrate this step as early as possible in the processing pipeline.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF313T_diet

genes <- getGenes(object)
head(genes)
length(genes)

object <- removeGenesZeroCounts(object)
object <- removeGenesStress(object)

genes_new <- getGenes(object)
length(genes_new)