Skip to contents

Calculate per group copy number for a list of genes.

Usage

get_gene_copy(
  sce,
  assay_name,
  group_var = "all",
  gain_cutoff = 0.75,
  loss_cutoff = -gain_cutoff,
  clonal_thr = 0.75,
  gene_names = NULL,
  cancer_genes = TRUE
)

Arguments

sce

Single cell experiment object

assay_name

Name of the assay from which to pull copy number

group_var

Grouping variable (defaults to all)

gain_cutoff

Relative copy increase to be considered a copy gain

loss_cutoff

Relative copy decrease to be considered a copy loss

clonal_thr

Proportion of clones harboring a gain or loss to be considered clonal

gene_names

List of genes to get copy number

cancer_genes

Logical. Whether to include results for cancer genes. Default=TRUE.

Value

A list with three elements:

copy

Wide form data frame with one row per gene, and columns reflecting the average per clone copy, the relative copy increase or decrease versus clone average copy, clone average copy

copy_long

A melted version of copy

clonal

A filtered version of copy_long that classifies each mutation as private, shared, or clonal, and whether the type of gain or loss matches the gene's oncogene or tumor suppressor type.