Skip to contents

combineBCR merges annotations from data frames holding repertoire data as metadata of a Seurat object.

Usage

combineBCR(
  vdj,
  SeuratObj,
  keep_columns = c("v_gene", "d_gene", "j_gene", "c_gene", "full_length", "productive",
    "cdr3", "cdr3_nt", "reads", "umis"),
  seurat_sample_column = NULL,
  seurat_cell_name_column = NULL
)

Arguments

vdj

a data.frame of VDJ data after running collapseBCR.

SeuratObj

Seurat object.

keep_columns

a vector of column names in vdj to be kept and added to the metadata slot of the Seurat object. By default the following informations are included: VDJ gene usage, isotype, CDR3 sequence, as well as binary indications of full-length/productive.

seurat_sample_column

(Optional) Column name in SeuratObj metadata where the sample name/ID information is stored. Used when the barcode column from vdj data frame does not match cell names from the Seurat object given by Cells(SeuratObj).

seurat_cell_name_column

(Optional) Column name in SeuratObj metadata where the cell barcodes are stored. Used when the barcode column from vdj data frame does not match cell names from the Seurat object given by Cells(SeuratObj).

Value

Seurat object with VDJ annotations added to the metadata slot.

Details

The function first reorganises the VDJ data frame such that one line represent 1 cell. It then selects columns from this data frame and add them as metadata in the given Seurat object.