Skip to contents

An internal function that filters tumor cells from a Seurat object based on metadata column values. This function identifies tumor cells using pattern matching on cell type labels and creates a subset containing only tumor cells. It also records dimension information before and after filtering for traceability.

Usage

FilterTumorCell(obj, column2only_tumor = NULL, verbose = TRUE)

Arguments

obj

Seurat object with a column to filter out tumor cells.

column2only_tumor

Name of the column to filter out tumor cells.

verbose

logical, whether to print progress messages

Value

A Seurat object containing only tumor cells, with the following attributes stored in @misc:

  • self_dim: Dimensions of the filtered object

  • raw_dim: Original dimensions before filtering

  • column2only_tumor: The column name used for filtering

If column2only_tumor is NULL or the specified column is not found, returns the original object unchanged.