chi_correct: Performs chi-square based variation reduction

Description Usage Arguments Details Value Examples

Description

Performs chi-square based variation reduction

Usage

1
2
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?

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

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]]

Examples

1
2
3
4
5
6
7
8
9
## 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)

NIPTeR documentation built on May 2, 2019, 7:55 a.m.