Using a custom species

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

By default, TCRconvertR supports alpha-beta and gamma-delta V, D, J, and C genes for human, mouse, and rhesus macaque from the IMGT F+ORF+in-frame P references. For other species, follow these steps:

1. Create a folder of IMGT FASTA files

The simplest way is to download from IMGT.

Details:

TCRconvertR expects a folder containing files ending in .fasta or .fa with headers in the IMGT format:

>SomeText|TRBV10-1*02|MoreText|...

The sequences are not used, so a text file containing headers and ending in .fa would also work.

2. Run build_lookup_from_fastas()

The species parameter should be the species name you'll use when calling convert_gene().

library(TCRconvertR)

# For this example, create a temporary input folder
fastadir <- file.path(tempdir(), "TCRconvertR_tmp")
dir.create(fastadir, showWarnings = FALSE)
file.copy(get_example_path("fasta_dir/test_trav.fa"), fastadir)

# Build lookup tables
new_lookup_dir <- build_lookup_from_fastas(fastadir, species = "rabbit")

# Confirm they exist now
list.files(new_lookup_dir)

Details:

species will also be the name of the folder storing lookup tables, so these characters are not allowed:

/ \ : * ? " < > | ~ ` \n \t



Try the TCRconvertR package in your browser

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

TCRconvertR documentation built on June 8, 2025, 10:43 a.m.