combineExpression {scRepertoire} | R Documentation

## Adding clonotype information to a seurat or SCE object

### Description

This function adds the immune receptor information to the seurat or SCE object to the meta data. By defualt this function also calculates the frequencies of the clonotypes by sequencing run (groupBy = "none"). To change how the frequencies are calculated, select a column header for the groupBy variable. Importantly, before using combineExpression() ensure the barcodes of the seurat or SCE object match the barcodes in the output of the combinedContig() call. Check changeNames() to change the prefix of the seurat object. If the dominant clonotypes have a greater frequency than 500, adjust the cloneTypes variable.

### Usage

    combineExpression(
      df,
      sc,
      cloneCall = "gene+nt",
      groupBy = "none",
      cloneTypes = c(None = 0, Single = 1, Small = 5, Medium = 20, Large = 100,
        Hyperexpanded = 500),
      filterNA = FALSE
    )

### Arguments

`df` | The product of CombineTCR() or CombineBCR().
`sc` | The seurat or SingleCellExperiment (SCE) object to attach
`cloneCall` | How to call the clonotype - CDR3 gene (gene), CDR3 nucleotide (nt) CDR3 amino acid (aa), or CDR3 gene+nucleotide (gene+nt).
`groupBy` | The column label in the combined contig object in which clonotype frequency will be calculated.
`cloneTypes` | The bins for the grouping based on frequency
`filterNA` | Method to subset seurat object of barcodes without clonotype information

### Value

seurat or SingleCellExperiment object with attached clonotype information

### Examples

    #Getting the combined contigs
    combined <- combineTCR(contig_list, rep(c("PX", "PY", "PZ"), each=2),
    rep(c("P", "T"), 3), cells ="T-AB")

    #Getting a sample of a Seurat object
    screp_example <- get(data("screp_example"))
    sce <- suppressMessages(Seurat::UpdateSeuratObject(screp_example))
    sce <- Seurat::as.SingleCellExperiment(sce)

    #Using combineExpresion()
    sce <- combineExpression(combined, sce)

[Package scRepertoire version 1.0.0 Index]