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()
.
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
)
The product of combineTCR()
,
combineBCR()
or a list of
both c(combineTCR()
, combineBCR()
).
The Seurat or Single-Cell Experiment (SCE) object to attach
Defines the clonal sequence grouping. Accepted values
are: gene
(VDJC genes), nt
(CDR3 nucleotide sequence), aa
(CDR3 amino
acid sequence), or strict
(VDJC). A custom column header can also be used.
The TCR/BCR chain to use. Use both
to include both chains
(e.g., TRA/TRB). Accepted values: TRA
, TRB
, TRG
, TRD
, IGH
, IGL
(for both light chains), both
.
A column header in lists to group the analysis
by (e.g., "sample", "treatment"). If NULL
, will be based on the list element.
Whether to proportion (TRUE
) or total
frequency (FALSE
) of the clone based on the group.by variable.
Method to subset Seurat/SCE object of barcodes without clone information
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
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.
Single-cell object with clone information added to meta data information
# 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)