Skip to contents

Generate a null distribution from healthy tissue cells and calculate thresholds for classifying sensitive and resistant cells.

Usage

scPharmGenNullDist(
  object,
  cancer,
  nmcs = 50,
  nfeatures = 200,
  cores = 1,
  features = NULL,
  slot = "data",
  layer = NULL,
  assay = "RNA",
  bulkdata = NULL,
  gdscdata = NULL
)

Arguments

object

A Seurat object containing cells from healthy/normal tissue.

cancer

TCGA cancer type(s) for context. A character string or vector. Use "pan" for pan-cancer analysis.

nmcs

Number of MCA components. Default: 50.

nfeatures

Number of genes for cell identity signature. Default: 200.

cores

Number of CPU cores. Default: 1.

features

Character vector of gene names to use. If NULL, uses all.

slot

Slot for Seurat V4. Default: "data".

layer

Layer for Seurat V5. If NULL, uses slot value.

assay

Assay to use. Default: "RNA".

bulkdata

Bulk RNA-seq data. If NULL, uses built-in data.

gdscdata

GDSC data. If NULL, uses built-in data.

Value

A list containing:

NullDist

Numeric vector of NES values from normal cells

threshold_s

Threshold for sensitive cells (NES < threshold_s)

threshold_r

Threshold for resistant cells (NES > threshold_r)

Details

This function computes NES distributions from normal cells and uses a two-component Gaussian mixture model to determine thresholds. The thresholds are calculated as mean +/- 1 standard deviation of each component.

See also

Examples

if (FALSE) { # \dontrun{
# Using healthy tissue cells
thresholds <- scPharmGenNullDist(healthy_seurat, cancer = "BRCA")
print(thresholds$threshold_s)
print(thresholds$threshold_r)
} # }