View source: R/clonalCluster.R
clonalCluster | R Documentation |
This function uses edit distances of either the nucleotide or amino acid
sequences of the CDR3 and V genes to cluster similar TCR/BCRs together.
As a default, the function takes the input from combineTCR()
,
combineBCR()
or combineExpression()
and amends a
cluster to the data frame or meta data. If exportGraph is set
to TRUE, the function returns an igraph object of the connected sequences.
If multiple sequences per chain are present, this function only compares
the first sequence.
clonalCluster(
input.data,
chain = "TRB",
sequence = "aa",
samples = NULL,
threshold = 0.85,
group.by = NULL,
exportGraph = FALSE
)
input.data |
The product of |
chain |
Indicate if both or a specific chain should be used - e.g. "both", "TRA", "TRG", "IGH", "IGL". |
sequence |
Clustering based on either "aa" or "nt". |
samples |
The specific samples to isolate for visualization. |
threshold |
The normalized edit distance to consider. The higher the number the more similarity of sequence will be used for clustering. |
group.by |
The column header used for to group contigs. If (NULL), clusters will be calculated across samples. |
exportGraph |
Return an igraph object of connected sequences (TRUE) or the amended input with a new cluster-based variable (FALSE). |
Either amended input with edit-distanced clusters added or igraph object of connect sequences
# Getting the combined contigs
combined <- combineTCR(contig_list,
samples = c("P17B", "P17L", "P18B", "P18L",
"P19B","P19L", "P20B", "P20L"))
sub_combined <- clonalCluster(combined[c(1,2)],
chain = "TRA",
sequence = "aa")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.