gsPEN_R {PANPRSnext}R Documentation

Run the gsPEN algorithm for multiple traits, without functional annotations.

Description

Run the gsPEN algorithm for multiple traits, without functional annotations.

Usage

gsPEN_R(
  summary_z,
  n_vec,
  plinkLD,
  n_iter = 100,
  upper_val = NULL,
  breaking = 1,
  z_scale = 1,
  tuning_matrix = NULL,
  tau_factor = c(1/25, 1, 10),
  len_lim_lambda = 10,
  sub_tuning = 50,
  lim_lambda = c(0.5, 0.9),
  len_lambda = 200,
  df_max = NULL,
  sparse_beta = FALSE,
  debug_output = FALSE,
  verbose = FALSE
)

Arguments

summary_z

A matrix of summary statistics for each SNP and trait.

n_vec

A vector of sample sizes for each of the Q traits corresponding to the Q columns of summary_z.

plinkLD

A matrix of LD values for each pair of SNPs.

n_iter

The number of iterations to run the algorithm.

upper_val

The upper bound for the tuning parameter.

breaking

The number of iterations to run before checking for convergence.

z_scale

The scaling factor for the summary statistics.

tuning_matrix

A matrix of tuning parameters.

tau_factor

A vector of factors to multiply the median value by to get the tuning parameters.

len_lim_lambda

The number of tuning parameters to use for the first iteration.

sub_tuning

The number of tuning parameters to use for the second iteration.

lim_lambda

The range of tuning parameters to use for the first iteration.

len_lambda

The number of tuning parameters to use for the second iteration.

df_max

The maximum degrees of freedom for the model.

sparse_beta

Whether to use the sparse version of the algorithm.

debug_output

Whether to output the tuning combinations that did not converge.

verbose

Whether to output information through the evaluation of the algorithm.

Value

A named list containing the following elements: beta_matrix: A matrix of the estimated coefficients for each SNP and trait. num_iter_vec: A vector of the number of iterations for each tuning combination. all_tuning_matrix: A matrix of the tuning parameters used for each tuning combination.

Examples

# Load the library and data
library(PANPRSnext)
data("summaryZ")
data("Nvec")
data("plinkLD")

# Take random subset of the data
subset <- sample(nrow(summaryZ), 100)
subset_summary_z <- summaryZ[subset, ]

# Run gsPEN
output <- gsPEN_R(
  summary_z = subset_summary_z,
  n_vec = Nvec,
  plinkLD = plinkLD
)

[Package PANPRSnext version 1.2.0 Index]