This function consolidates a list of BCR sequencing results to the level
of the individual cell barcodes. Using the samples and ID parameters,
the function will add the strings as prefixes to prevent issues with
repeated barcodes. The resulting new barcodes will need to match the
Seurat or SCE object in order to use, combineExpression()
.
Unlike combineTCR()
, combineBCR produces a column
CTstrict
of an index of nucleotide sequence and the
corresponding V and J genes using clonalCluster()
.
combineBCR(
input.data,
samples = NULL,
ID = NULL,
chain = "both",
sequence = "nt",
call.related.clones = TRUE,
group.by = NULL,
threshold = 0.85,
cluster.method = "components",
use.V = TRUE,
use.J = TRUE,
removeNA = FALSE,
removeMulti = FALSE,
filterMulti = TRUE,
filterNonproductive = TRUE
)
List of filtered contig annotations or outputs from
loadContigs()
.
A character vector of sample labels. Must be the same length as the input list.
An optional character vector for additional sample identifiers.
The chain to use for clustering when call.related.clones = TRUE
.
Passed to clonalCluster()
. Default is "both"
.
The sequence type ("nt"
or "aa"
) to use for clustering.
Passed to clonalCluster()
. Default is "nt"
.
Logical. If TRUE
, uses clonalCluster()
to
identify related clones based on sequence similarity. If FALSE
, defines
clones by the exact V-gene and CDR3 amino acid sequence.
The column header used for to group clones. If (`NULL“), clusters will be calculated across samples.
The similarity threshold passed to clonalCluster()
if
call.related.clones = TRUE
. See ?clonalCluster
for details.
The clustering algorithm to use. Defaults to "components"
,
which finds connected subgraphs.
Logical. If TRUE
, sequences must share the same V gene to be
clustered together.
Logical. If TRUE
, sequences must share the same J gene to be
clustered together.
This will remove any chain without values.
Logical. If TRUE
, removes cells that have more than
one distinct heavy or light chain after processing.
Logical. If TRUE
, filters multi-chain cells to retain
only the most abundant IGH and IGL/IGK chains.
Logical. If TRUE
, removes non-productive contigs
from the analysis.
A list of data frames, where each data frame represents a sample. Each row corresponds to a unique cell barcode, with columns detailing the BCR chains and the assigned clone ID.
# Data derived from the 10x Genomics intratumoral NSCLC B cells
BCR <- read.csv("https://www.borch.dev/uploads/contigs/b_contigs.csv")
combined <- combineBCR(BCR,
samples = "Patient1",
threshold = 0.85)