build_lookup_from_fastas {TCRconvertR}R Documentation

Create lookup tables

Description

build_lookup_from_fastas() processes IMGT reference FASTA files in a given folder to generate lookup tables used for making gene name conversions. It extracts all gene names and transforms them into 10X and Adaptive formats following predefined conversion rules. The resulting files are created:

The files are stored in a given subfolder (species) within the appropriate application folder via rappdirs. For example:

If a folder named species already exists in that location, it will be replaced.

Usage

build_lookup_from_fastas(data_dir, species)

Arguments

data_dir

A string, the directory containing FASTA files.

species

A string, the name of species that will be used when running TCRconvert with these lookup tables.

Details

Key transformations from IMGT:

Value

A string, path to new lookup directory

Examples

# For the example, create and use a temporary folder
fastadir <- file.path(tempdir(), "TCRconvertR_tmp")
dir.create(fastadir, showWarnings = FALSE, recursive = TRUE)
trav <- get_example_path("fasta_dir/test_trav.fa")
trbv <- get_example_path("fasta_dir/test_trbv.fa")
file.copy(c(trav, trbv), fastadir)

# Build lookup tables
build_lookup_from_fastas(fastadir, "rabbit")

# Clean up temporary folder
unlink(fastadir, recursive = TRUE)

[Package TCRconvertR version 1.0 Index]