MetaSTAAR_worker_cov: Generating sparse weighted covariance file using...

View source: R/MetaSTAAR_worker_cov.R

MetaSTAAR_worker_covR Documentation

Generating sparse weighted covariance file using MetaSTAARWorker

Description

The MetaSTAAR_worker_cov function takes in genotype, the object from fitting the null model, and variant position to generate the sparse weighted covariance file for the given variant-set as a rectangle format.

Usage

MetaSTAAR_worker_cov(
  genotype,
  obj_nullmodel,
  cov_maf_cutoff,
  variant_pos,
  region_midpos,
  qc_label = NULL,
  segment.size = 5e+05,
  signif.digits = 3
)

Arguments

genotype

an n*p genotype matrix (dosage matrix) of the target sequence, where n is the sample size and p is the number of genetic variants. If the input genotype matrix is sparse (e.g. dgCMatrix format), it is assumed that it has been flipped to represent minor allele coding.

obj_nullmodel

an object from fitting the null model, which is the output from either fit_null_glm function for unrelated samples or fit_null_glmmkin function for related samples in the STAAR package.

cov_maf_cutoff

a numeric value indicating the maximum minor allele frequency cutoff under which the sparse weighted covariance file between variants is stored.

variant_pos

a numeric vector of length p (listed in the same order as the columns of genotype) indicating the position of the variants in the variant-set.

region_midpos

a numeric value indicating the middle position of variant-set by which the shorter edge of the rectangle is defined.

qc_label

a vector of quality control status for each variant in variant_pos, where a pass variant is labeled as "PASS". If qc_label is NULL, it is assumed that all variants are pass variants in the study (default = NULL).

segment.size

a numeric value indicating the length of each segment of which the sparse weighted covariance file is stored (default = 5e+05).

signif.digits

an integer indicating the number of significant digits to be used for storing the sparse weighted covariance file. If signif.digits is NULL, it is assumed that no rounding will be performed (default = 3).

Value

GTSinvG_rare: the sparse matrix of all variants in the variant-set whose minor allele frequency is below cov_maf_cutoff (the sparse weighted covariance file), stored as a rectangle format.

References

Li, X., et al. (2023). Powerful, scalable and resource-efficient meta-analysis of rare variant associations in large whole genome sequencing studies. Nature Genetics, 55(1), 154-164. (pub)


xihaoli/MetaSTAAR documentation built on Nov. 10, 2024, 5:26 a.m.