Learn R Programming

NIPTeR (version 1.0.2)

chi_correct: Performs chi-square based variation reduction

Description

Performs chi-square based variation reduction

Usage

chi_correct(nipt_sample, nipt_control_group, chi_cutoff = 3.5, include_XY = F)

Arguments

nipt_sample
The NIPTSample object that is the focus of the analysis
nipt_control_group
The NIPTControlGroup object used in the analysis
chi_cutoff
The Z-score cutoff. If a bin has a Z-score above this threshold, it will be corrected
include_XY
Also apply correction to X and Y chromosomes?

Value

Named list of length 2. The corrected nipt_sample is in index 1 and the corrected control group in index 2 to extract the corrected sample use $sample or [[1]]. To extract the control group from the list use $control_group or [[2]]

Details

The chi-squared based variation reduction identifies overdispersed bins within the control group and corrects these bins in both the sample of interest and the control group. The function takes in a `NIPTSample` and a `NIPTControlGroup` object, both to be corrected. For every corresponding bin in the control group a chi-squared score is calculated and this total score is converted to a normal distribution. Corresponding bins with a normalized score above _chi_cutoff_ (default 3.5) are corrected by dividing the number of reads by the total chi-squared score divided by degrees of freedom

Examples

Run this code
## Not run: 
# ##Apply chi-squared based variation reduction method
# chi_corrected_data <- chicorrect(nipt_sample = gc_LOESS_corrected_sample, 
#                                  nipt_control_group = subset_loess_corrected_control_group)
# ##Extract sample and control group
# loess_chi_corrected_sample <- chi_corrected_data$sample
# subset_loess_chi_corrected_control_group <- chi_corrected_data$control_group
# ## End(Not run)

Run the code above in your browser using DataLab