updog_centers: Estimate Centers for Standardization Using Updog Bias

View source: R/standardization.R

updog_centersR Documentation

Estimate Centers for Standardization Using Updog Bias

Description

This function calculates the centers for standardization based on the estimated bias from the 'updog' package. It identifies genotype dosage clusters and determines whether markers should be retained or removed based on the number of clusters.

Usage

updog_centers(multidog_obj, threshold.n.clusters = 2, rm.mks)

Arguments

multidog_obj

An object of class 'multidog' (from the 'updog' package), containing information about SNPs, ploidy, sequencing error rates, and bias.

threshold.n.clusters

An integer specifying the minimum number of dosage clusters (heterozygous classes) required for a marker to be retained for standardization. Default is '2'.

rm.mks

A logical vector indicating which markers should be removed. The names of the vector correspond to the marker names.

Details

The function uses the 'xi_fun' to calculate the cluster centers for each marker based on the ploidy, sequencing error rate, and bias. Markers with fewer clusters than the specified threshold are flagged for removal.

Value

A named list where each element corresponds to a marker and contains: - 'rm': An integer flag indicating whether the marker is retained ('0') or removed ('1'). - 'centers_theta': A numeric vector of cluster centers (sorted in descending order). - 'MarkerName': The name of the marker. - 'n.clusters': The number of clusters identified for the marker.


Qploidy documentation built on June 8, 2025, 10 a.m.