getHlaFrequencies: Calculate HLA allele frequencies

View source: R/transformationFunctions.R

getHlaFrequenciesR Documentation

Calculate HLA allele frequencies

Description

getHlaFrequencies calculates allele frequencies in HLA calls data frame.

Usage

getHlaFrequencies(
  hla_calls,
  carrier_frequency = FALSE,
  compare = FALSE,
  ref_pop = c("USA NMDP African American pop 2", "USA NMDP Chinese",
    "USA NMDP European Caucasian", "USA NMDP Hispanic South or Central American",
    "USA NMDP Japanese", "USA NMDP North American Amerindian",
    "USA NMDP South Asian Indian"),
  ref = allele_frequencies
)

Arguments

hla_calls

HLA calls data frame, as returned by readHlaCalls function.

carrier_frequency

Logical flag indicating if carrier frequency should be returned.

compare

Logical flag indicating if hla_calls frequencies should be compared to reference frequencies given in ref.

ref_pop

Character vector giving names of reference populations in ref to compare with. Optionally vector can be named, then those names will be used as population names.

ref

Data frame giving reference allele frequencies. See allele_frequencies for an example.

Details

Both gene copies are taken into consideration for frequencies calculation, frequency = n / (2 * j) where n is the number of allele occurrences and j is the number of samples in hla_calls.

Value

Data frame with each row holding HLA allele, it's count and frequency.

Examples

getHlaFrequencies(MiDAS_tut_HLA)


Genentech/midasHLA documentation built on Feb. 12, 2024, 9:38 a.m.