run_hdbscan_haplotyping() performs HDBSCAN clustering of SNPs in region of interest to identify marker groups. Individuals are classified by haplotype combination based on shared combinations of marker group alleles. Returns a comprehensive haplotyping object (HapObject), which can be visualized with reference to phenotype and metadata using crosshap_viz() (set epsilon to 1 as a dummy value).
run_hdbscan_haplotyping(
vcf,
LD,
pheno,
MGmin,
minHap = 5,
hetmiss_as = "allele",
metadata = NULL,
keep_outliers = FALSE
)A comprehensive haplotyping S3 object (HapObject) for each provided epsilon value, needed for clustree_viz() and crosshap_viz().
Input VCF for region of interest.
Pairwise correlation matrix of SNPs in region (e.g. from PLINK).
Input numeric phenotype data for each individual.
Minimum SNPs in marker groups, MinPts parameter for DBscan.
Minimum nIndividuals in a haplotype combination.
If hetmiss_as = "allele", heterozygous-missing SNPs './N' are recoded as 'N/N', if hetmiss_as = "miss", the site is recoded as missing.
Metadata input (optional).
When FALSE, marker group smoothing is performed to remove outliers.