ClusTCR2

This package is for performing the single cell RNA-seq T cell receptor (TCR) sequence similarity of the hypervariable CDR3 sequence in the TCR. This package was based on the python software ClusTCR. This uses an edit distance (hamming distance) of one and of the same v_gene.

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(ClusTCR2)

Step 1. Example of how to use ClusTCR = hamming distance and creating the matrix.

# Example usage of mcl_cluster function with a stored file
example_file <- read.csv(system.file("extdata", "my_data.csv",package = "ClusTCR2"))
# Perform clustering using mcl_cluster function
step1 <- ClusTCR(example_file,allele = FALSE)
# Print the result
step1[1:6,1:6]

Step 2. Creating both the file need for visulising the motif and network from step 1.

# Example usage of mcl_cluster function with a stored file
step2 <- mcl_cluster(step1)
step2[[1]][1:3,1:3]
head(step2[[2]][1:6,1:6])

Visualization: Network plot

# Visualization of the network plot
netplot_ClusTCR2(step2, label = "Name_selected", Clust_selected = 1)

Visualization: Motif plot

# Visualization of the network plot
# step2[[1]]
subset(step2[[1]],step2[[1]]$Clust_size_order == 1)
motif_plot(step2,Clust_selected = 1)


Try the ClusTCR2 package in your browser

Any scripts or data that you put into this service are public.

ClusTCR2 documentation built on May 29, 2024, 9:32 a.m.