CalculateTcrDistances.RdThis function calculates pairwise TCR distances and stores them in a Seurat Object.
CalculateTcrDistances(
inputData = NULL,
organism = "human",
chains = c("TRA", "TRB"),
spikeInDataframe = NULL,
minimumCloneSize = 2,
calculateChainPairs = FALSE,
debugMode = FALSE,
verbose = FALSE,
method = "tcrdist3"
)Either a seurat Object containing TCR information or a dataframe containing metadata
Organism to use for reference segments. Default is 'human'.
Vector of TCR chains to include in the analysis. Default is c("TRA", "TRB").
An optional data frame containing additional CDR3s and gene segments to be included in the clustering, such as published clonotypes.
Minimum number of clones per subject to include in the analysis. Default is 2.
Boolean controlling whether to compute joint multi-chain distance matrices for observed chain combinations.
Boolean that will result in more debugging information to be printed
Boolean controlling whether to print additional information about procesing
The method for clustering. Currently only tcrdist3 is supported
if (FALSE) { # \dontrun{
# When providing a dataframe, a new seurat object will be returned:
seuratObj_TCR <- CalculateTcrDistances(inputData = seuratObj@meta.data,
chains = c("TRA", "TRB"),
minimumCloneSize = 2,
calculateChainPairs = FALSE,
verbose = FALSE)
# When providing a seuratObj, the original object will be returned, with the clustering results added as assays:
seuratObj <- CalculateTcrDistances(inputData = seuratObj,
chains = c("TRA", "TRB", "TRG", "TRD"),
calculateChainPairs = TRUE,
verbose = TRUE)
spikeInDataframe <- data.frame(CloneNames = rep(1:3),
TRA_V = c("TRAV1-2", "TRAV1-2", "TRAV1-2"),
TRA_J = c("TRAJ33", "TRAJ20", "TRAJ33"),
TRA = c("CAVRDSNYQLIW", "CAVSLQDYKLSF", "CAVRDSNYQLIW"),
TRB_V = c("TRBV6-4", "TRBV6-4", "TRBV6-4"),
TRB_J = c("TRBJ1-1", "TRBJ2-1", "TRBJ2-3"),
TRB = c("CASSAAAAAAAAFF", "CASSVVVVVVVVQF", "CASSWWWWWWWWQY"))
} # }