knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) library(hlatools)
hlatools
provides a collection of tools to work with IPD-IMGT/HLA data
Install from GitHub using remotes
:
remotes::install_github("gschofl/hlatools")
clone_IMGTHLA()
: Clone the ANHIG/IMGTHLA repo on GitHub to a location specified by the option hlatools.local_repos
. Defaults to ~/local/db/.
pull_IMGTHLA()
: Send a pull request to ANHIG/IMGTHLA.
check_IMGTHLA()
: Check if your local repository is up-to-date.
A HLA gene can be read into a HLAGene
object:
x <- hlatools::HLAGene("DPB1") x
A number of accessor functions can be used to work with these objects:
x <- hlatools::HLAGene("DPA1") hlatools::db_version(x) hlatools::locusname(x) x1 <- x[hlatools::is_complete(x)][1:10] hlatools::allele_name(x1) hlatools::cwd_status(x1) hlatools::ethnicity(x1) hlatools::g_group(x1) hlatools::p_group(x1) hlatools::sequences(x1) hlatools::exon(x1, exon = 2)
We can access previous releases of the IPD-IMGT/HLA database:
x <- hlatools::HLAGene("DPB1", db_version = "3.25.0") x hlatools::db_version(x) hlatools::locusname(x) x[hlatools::cwd_status(x) == "Common"][1:10]
These objects come with an additional set of R6
-methods that implement an API used mostly in conjunction with the DR2S
package:
x$get_closest_complete_neighbor(allele, partially = TRUE)
: Find the closest full-length allele based on the genetic distance between exon sequences.
x$get_reference_sequence(allele)
: Return a BStringSet
object of a full-length reference sequence for allele
. If allele
is not fully known the missing stretches are taken from the allele returned by a call to get_closest_complete_neighbor()
.
devtools::session_info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.