MetaSTAAR_merge_varlist: The preliminary data manipulation step for 'MetaSTAAR' given...

View source: R/MetaSTAAR_merge_varlist.R

MetaSTAAR_merge_varlistR Documentation

The preliminary data manipulation step for MetaSTAAR given a variant list

Description

The MetaSTAAR_merge_varlist function takes in the summary statistics file and the sparse weighted covariance file (the output from MetaSTAAR_worker_sumstat and MetaSTAAR_worker_cov) from each participating study and performs the preliminary data manipulation step by merging them into a single unified summary statistics file and a covariance file, respectively.

Usage

MetaSTAAR_merge_varlist(
  chr,
  variant_pos,
  study.names,
  sample.sizes,
  sumstat.dir,
  cov.dir,
  rare_maf_cutoff = 0.01,
  cov_maf_cutoff,
  trait,
  segment.size = 5e+05,
  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.

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.

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).

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 the merged score statistics vector of all variants in the given variant position list of interest whose combined minor allele frequency is below rare_maf_cutoff.

cov the merged covariance matrix of all variants in the given variant position list of interest whose combined minor allele frequency is below rare_maf_cutoff.

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.