ReadHPA: Read Haplotype Presence-Absence (HPA) file

View source: R/ReadHPA.R

ReadHPAR Documentation

Read Haplotype Presence-Absence (HPA) file

Description

This function reads and format HPA files generated by HaploCharmer.

Usage

ReadHPA(
  File,
  MaxMarkerMissing = 0.2,
  MaxIndMissing = 0.2,
  TotalDepthField = "DP",
  AlleleDepthField = "AD",
  NbThreads = 0L,
  Verbose = TRUE
)

Arguments

File

Path to HPA file

MaxMarkerMissing

Maximum proportion of missing values for marker above which the marker is discarded

MaxIndMissing

Maximum proportion of missing values for individual above which the individual is discarded (applied after marker filtering)

TotalDepthField

Total read depth FORMAT field in the HPA file to get allele depth proportions

AlleleDepthField

Alternative allele read depth FORMAT field in the HPA file to get allele depth proportions

NbThreads

Number of threads to be used (positive integer) with a default value of 0 setting automatically all threads available

Verbose

A boolean describing if detailed information should be printed

Details

The function ReadHPA() reads Hapotype Presence-Absence (HPA) files generated by HaploCharmer.

This function generates genotypic data coded as haplotype read depth ratios using the read depths from the haplotype (AlleleDepthField) and total read depth (TotalDepthField) fields of the HPA file.

Filtering of missing data can be applied to individuals and markers by setting the maximum percentages MaxMarkerMissing and MaxIndMissing, respectively.

By default, all available threads/CPU cores are used but the number can be chosen using NbThreads.

Value

A list of three items: a filtered list of genotying matrices (Geno), a dataframe with variant information (MarkerInfo), and a dataframe to be used as a genetic map proxy for local admixture inference (GeneticMap). The genetic map proxy is based on physical positions assuming all chromosomes are 100cM long.

See Also

ReadHPA() to read VCF files

Examples

## Read HPA
hpa_path <- system.file("extdata", "Test.hpa", package = "AdmixPoly")
DataHPA <- AdmixPoly::ReadHPA(File = hpa_path, NbThreads=1)

AdmixPoly documentation built on June 18, 2026, 1:06 a.m.