ras_scan_external_original: Summary-Informed RAS Scan on All Samples (In-Memory)

View source: R/sumstats.R

ras_scan_external_originalR Documentation

Summary-Informed RAS Scan on All Samples (In-Memory)

Description

The in-memory counterpart of ras_scan_external, for cohorts small enough that a dense n \times m genotype matrix and its PGS matrix fit in RAM. At biobank scale use ras_scan_external instead: at 453,698 samples by 332,690 variants the dense double alone is over a petabyte.

Usage

ras_scan_external_original(
  geno,
  phenotype,
  covariates,
  covariate_cols,
  weights,
  is_continuous = TRUE,
  skip1 = 10,
  skip2 = 20,
  min_window_size = 5,
  max_window_size = 100,
  scan_test = c("glm", "score"),
  chrom = 1,
  save_dir = NULL
)

Arguments

geno

Numeric n \times m genotype dosage matrix.

phenotype

Numeric vector of length n.

covariates

Data frame with n rows containing covariate_cols.

covariate_cols

Character vector of covariate column names.

weights

Numeric vector of length m, aligned to the columns of geno.

is_continuous

Logical. TRUE for quantitative traits.

skip1, skip2, min_window_size, max_window_size

Scan geometry, as in ras_scan_original.

scan_test

"glm" (per-window Wald) or "score" (Rao score test).

chrom

Integer/character. Chromosome label used in output filenames.

save_dir

Character or NULL. Directory to save the profile in.

Value

A list with x (grid point variant indices) and y (the profile).

See Also

ras_scan_external, ras_harmonize_sumstats


RAS documentation built on Nov. 3, 2026, 1:07 a.m.