hla_df_from_xml: Prepare a data frame from a xml file containing hla allele...

View source: R/hla_df_from_xml.R

hla_df_from_xmlR Documentation

Prepare a data frame from a xml file containing hla allele information

Description

The xml file required for this function may be downloaded from the GitHub repository of the IMGT/HLA organization: https://github.com/ANHIG/IMGTHLA/blob/Latest/xml/hla.xml.zip. The function then creates a dataframe from this xml which can be used subsequently to match reads of HLA-loci from bulk or single cell RNA seq. By default the sequence of the 2nd + 3rd exon are returned in an extra column as these will most likely be used to infer the HLA type in case of MHC-I.

Usage

hla_df_from_xml(file_path, lapply_fun = lapply, replace_none_pg = T, ...)

Arguments

file_path

path to the xml file, may be in zipped format

lapply_fun

function name without quotes; lapply, pbapply::pblapply or parallel::mclapply are suggested

replace_none_pg

replace "None" in p_group and g_group with allele_protein and allele_coding, respectively

...

additional argument to the lapply function; e.g. mc.cores may be passed when parallel::mclapply is chosen above

Details

HLA nomenclature: http://hla.alleles.org/nomenclature/naming.html

Value

a data frame

Examples

## Not run: 
hla_df_from_xml(file_path = "path/hla.xml", lapply_fun = parallel::mclapply,
mc.cores = parallel::detectCores())

## End(Not run)

Close-your-eyes/scexpr documentation built on April 21, 2023, 10:27 a.m.