combineExpression: Adding clone information to a single-cell object

View source: R/combineExpression.R

combineExpressionR Documentation

Adding clone information to a single-cell object

Description

This function adds the immune receptor information to the Seurat or SCE object to the meta data. By default this function also calculates the frequencies and proportion of the clones by sequencing run (group.by = NULL). To change how the frequencies/proportions are calculated, select a column header for the group.by variable. Importantly, before using combineExpression() ensure the barcodes of the single-cell object object match the barcodes in the output of the combineTCR() or combineBCR().

Usage

combineExpression(
  input.data,
  sc.data,
  cloneCall = "strict",
  chain = "both",
  group.by = NULL,
  proportion = TRUE,
  filterNA = FALSE,
  cloneSize = c(Rare = 1e-04, Small = 0.001, Medium = 0.01, Large = 0.1, Hyperexpanded =
    1),
  addLabel = FALSE
)

Arguments

input.data

The product of combineTCR(), combineBCR() or a list of both c(combineTCR(), combineBCR()).

sc.data

The Seurat or Single-Cell Experiment (SCE) object to attach

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.

chain

indicate if both or a specific chain should be used - e.g. "both", "TRA", "TRG", "IGH", "IGL".

group.by

The column label in the combined clones in which clone frequency will be calculated. NULL or "none" will keep the format of input.data.

proportion

Whether to proportion (TRUE) or total frequency (FALSE) of the clone based on the group.by variable.

filterNA

Method to subset Seurat/SCE object of barcodes without clone information

cloneSize

The bins for the grouping based on proportion or frequency. If proportion is FALSE and the cloneSizes are not set high enough based on frequency, the upper limit of cloneSizes will be automatically updated.S

addLabel

This will add a label to the frequency header, allowing the user to try multiple group.by variables or recalculate frequencies after subsetting the data.

Value

Single-cell object with clone information added to meta data information

Examples

#Getting the combined contigs
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)


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