Learn R Programming

bigsnpr (version 1.12.15)

snp_lassosum2: lassosum2

Description

lassosum2

Usage

snp_lassosum2(
  corr,
  df_beta,
  delta = c(0.001, 0.01, 0.1, 1),
  nlambda = 30,
  lambda.min.ratio = 0.01,
  dfmax = 2e+05,
  maxiter = 1000,
  tol = 1e-05,
  ind.corr = cols_along(corr),
  ncores = 1
)

Value

A matrix of effect sizes, one vector (column) for each row in attr(<res>, "grid_param"). Missing values are returned when strong divergence is detected.

Arguments

corr

Sparse correlation matrix as an SFBM. If corr is a dsCMatrix or a dgCMatrix, you can use as_SFBM(corr).

df_beta

A data frame with 3 columns:

  • $beta: effect size estimates

  • $beta_se: standard errors of effect size estimates

  • $n_eff: either GWAS sample size(s) when estimating beta for a continuous trait, or in the case of a binary trait, this is 4 / (1 / n_control + 1 / n_case); in the case of a meta-analysis, you should sum the effective sample sizes of each study instead of using the total numbers of cases and controls, see tools:::Rd_expr_doi("10.1016/j.biopsych.2022.05.029"); when using a mixed model, the effective sample size needs to be adjusted as well, see tools:::Rd_expr_doi("10.1016/j.xhgg.2022.100136").

delta

Vector of shrinkage parameters to try (L2-regularization). Default is c(0.001, 0.01, 0.1, 1).

nlambda

Number of different lambdas to try (L1-regularization). Default is 30.

lambda.min.ratio

Ratio between last and first lambdas to try. Default is 0.01.

dfmax

Maximum number of non-zero effects in the model. Default is 200e3.

maxiter

Maximum number of iterations before convergence. Default is 1000.

tol

Tolerance parameter for assessing convergence. Default is 1e-5.

ind.corr

Indices to "subset" corr, as if this was run with corr[ind.corr, ind.corr] instead. No subsetting by default.

ncores

Number of cores used. Default doesn't use parallelism. You may use bigstatsr::nb_cores().