MetaSTAAR_merge_varlist_cond: The preliminary data manipulation step for 'MetaSTAAR_cond'...

View source: R/MetaSTAAR_merge_varlist_cond.R

MetaSTAAR_merge_varlist_condR Documentation

The preliminary data manipulation step for MetaSTAAR_cond given a variant list

Description

The MetaSTAAR_merge_varlist_cond function takes in the summary statistics file and the sparse weighted of the covariance file (the output from MetaSTAAR_worker_sumstat and MetaSTAAR_worker_cov) as well as the covariance file for conditional analysis (the output from MetaSTAAR_worker_cov_cond) from each participating study and performs the preliminary data manipulation step by merging them into a single unified conditional summary statistics file and a conditional covariance file, respectively, adjusting for a given list of variants.

Usage

MetaSTAAR_merge_varlist_cond(
  chr,
  variant_pos,
  study.names,
  sample.sizes,
  sumstat.dir,
  cov.dir,
  covcond.dir,
  rare_maf_cutoff = 0.01,
  cov_maf_cutoff,
  trait,
  region,
  segment.size = 5e+05,
  effect.cond = c("homogeneous", "heterogeneous"),
  check_qc_label = FALSE
)

Arguments

chr

a numeric value indicating the chromosome of the genetic region of interest.

variant_pos

a numeric vector indicating all possible positions of the variants to be included in the variant-set.

study.names

a character vector containing the name of each participating study in the meta-analysis.

sample.sizes

a numeric vector with the length of study.names indicating the sample size of each study.

sumstat.dir

a character vector containing the directories of the study-specific summary statistics file folders.

cov.dir

a character vector containing the directories of the study-specific sparse weighted covariance file folders.

covcond.dir

a character vector containing the directories of the study-specific covariance file folders for conditional analysis.

rare_maf_cutoff

the cutoff of maximum minor allele frequency in defining rare variants (default = 0.01).

cov_maf_cutoff

a numeric vector with the length of study.names indicating the maximum minor allele frequency cutoffs under which the sparse weighted covariance files between variants are stored.

trait

a character value indicating the underlying trait of interest for the meta-analysis.

region

a character value indicating the underlying region of a given list of variants adjusted for conditional analysis of the meta-analysis.

segment.size

a numeric value indicating the length of each segment of which the summary statistics and sparse weighted covariance files are stored. Note that the input value should be aligned with the input values of MetaSTAAR_worker_cov (default = 5e+05).

effect.cond

a character value indicating the effects of variants to be adjusted for in conditional analysis are "homogeneous" or "heterogeneous" (default = "homogeneous").

check_qc_label

a logical value indicating whether variants need to be dropped according to qc_label specified in MetaSTAAR_worker_sumstat and MetaSTAAR_worker_cov. If check_qc_label is FALSE, it is assumed that no variant will be dropped (default = FALSE).

Value

a list with the following members:

info: the merged data frame of all variants in the given variant position list of interest whose combined minor allele frequency is below rare_maf_cutoff, including the following information (listed in the same order as U and the rows/columns of cov): chromosome (chr), position (pos), reference allele (ref), alternative allele (alt), combined minor allele count (MAC), and combined minor allele frequency (MAF).

U_cond: the merged conditional score statistics vector of all variants in the given variant position list of interest whose combined minor allele frequency is below rare_maf_cutoff, adjusting for a given list of variants.

cov_cond: the merged conditional covariance matrix of all variants in the given variant position list of interest whose combined minor allele frequency is below rare_maf_cutoff, adjusting for a given list of variants.

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.