View source: R/clusterize_TCR.R
clusterize_TCR | R Documentation |
Find clusters of similar TCRs that are likely to recognize the same epitope.
clusterize_TCR(
sequence_df,
chains,
tmp_folder,
id_col,
scores_filename = NA,
threshold = NA,
ncores = 1
)
sequence_df |
A data.frame containing TCR sequence data. Each row must describe a unique TCR sequence. Following fields are required:
If chains="AB" junction_alpha, v_alpha and j_alpha must be provided too. |
chains |
Which chains to cluster. "B" for beta chain only, "AB" for paired alpha and beta chains. |
tmp_folder |
Path to a directory where temporary files could be stored. They are deleted when clustering is finished. |
id_col |
Name of a column with unique ids for each TCR. |
scores_filename |
If a character string for naming a file is provided BL-scores of each TCR pair will be exported to this file. Supported formats: .Rds, .csv. |
threshold |
Clustering threshold (optional). |
ncores |
The number of cores to use for parallel computation (default = 1). Using >1 core is not supported in Windows. |
The default clustering thresholds were defined to optimally detect clusters of TCRs recognizing the same epitope. If instead of full junction only CDR3 sequence witout flanking residues is provided the scores will be overestimated which may lead to wrong cluster assignment.
A data.frame containing same information as sequence_df plus the cluster ids. If scores_filename is provided a file with pairwise BL-scores is created.
clusters <- clusterize_TCR(example_TCR_df, chains="AB", id_col="id", tmp_folder=".", ncores=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.