clonalBias: Examine skew of clones towards a cluster or compartment

View source: R/clonalBias.R

clonalBiasR Documentation

Examine skew of clones towards a cluster or compartment

Description

The metric seeks to quantify how individual clones are skewed towards a specific cellular compartment or cluster. A clone bias of 1 - indicates that a clone is composed of cells from a single compartment or cluster, while a clone bias of 0 - matches the background subtype distribution. Please read and cite the following manuscript if using clonalBias().

Usage

clonalBias(
  sc.data,
  cloneCall = "strict",
  split.by = NULL,
  group.by = NULL,
  n.boots = 20,
  min.expand = 10,
  exportTable = FALSE,
  palette = "inferno"
)

Arguments

sc.data

The single-cell object after combineExpression().

cloneCall

How to call the clone - VDJC gene (gene), CDR3 nucleotide (nt), CDR3 amino acid (aa), VDJC gene + CDR3 nucleotide (strict) or a custom variable in the data.

split.by

The variable to use for calculating the baseline frequencies. For example, "Type" for lung vs peripheral blood comparison

group.by

The variable to use for calculating bias

n.boots

number of bootstraps to downsample.

min.expand

clone frequency cut off for the purpose of comparison.

exportTable

Returns the data frame used for forming the graph.

palette

Colors to use in visualization - input any hcl.pals.

Value

ggplot scatter plot with clone bias

Examples

#Making combined contig data
combined <- combineTCR(contig_list, 
                        samples = c("P17B", "P17L", "P18B", "P18L", 
                                    "P19B","P19L", "P20B", "P20L"))

#Getting a sample of a Seurat object
scRep_example <- get(data("scRep_example"))

#Using combineExpresion()
scRep_example <- combineExpression(combined, scRep_example)
scRep_example$Patient <- substring(scRep_example$orig.ident,1,3)

#Using clonalBias()
clonalBias(scRep_example, 
              cloneCall = "aa", 
              split.by = "Patient", 
              group.by = "seurat_clusters",
              n.boots = 5, 
              min.expand = 2)



ncborcherding/scRepertoire documentation built on Nov. 5, 2024, 2:05 p.m.