Skip to contents

Computes the Z-score for a given chromosome of a test sample against a control group. The Z-score measures how many standard deviations the sample's chromosomal fraction deviates from the control mean.

Usage

nipter_z_score(sample, control_group, chromo_focus)

Arguments

sample

A NIPTeRSample object (the test sample).

control_group

A NIPTeRControlGroup object.

chromo_focus

Integer; the chromosome to test (1-22).

Value

A list of class "NIPTeRZScore" with elements:

sample_z_score

The test sample's Z-score (numeric scalar).

focus_chromosome

Character; the tested chromosome.

control_statistics

Named numeric vector with mean, sd, and shapiro_p_value.

control_z_scores

Named numeric vector of Z-scores for each control sample.

correction_status

Character vector of correction statuses.

sample_name

Character; the test sample name.

Examples

if (FALSE) { # \dontrun{
z21 <- nipter_z_score(sample, cg, chromo_focus = 21)
z21$sample_z_score
} # }