Skip to contents

This function loads TWAS weights from RDS files and performs grouped integration using both correlation-based clustering and fixed tau intervals.

Usage

load_quantile_twas_weights(
  weight_db_files,
  tau_values = seq(0.01, 0.99, 0.01),
  between_cluster = 0.8,
  num_intervals = 3
)

Arguments

weight_db_files

A character vector of file paths to the RDS files containing TWAS weights.

tau_values

A numeric vector representing the tau values (quantiles) to use. Default is seq(0.01, 0.99, 0.01).

between_cluster

A numeric value specifying the correlation threshold for clustering. Default is 0.8.

num_intervals

The number of fixed non-overlapping intervals to divide the tau values. Default is 3.

Value

A list containing:

weights

A list of integrated TWAS weights for each context.

twas_cv_performance

A list of TWAS cross-validation performance metrics for each context.

Examples

weight_db_files <- c("file1.rds", "file2.rds")
tau_values <- seq(0.01, 0.99, by = 0.01)
result <- load_quantile_twas_weights(weight_db_files, tau_values)
#> Warning: cannot open compressed file 'file1.rds', probable reason 'No such file or directory'
#> Error in gzfile(file, "rb"): cannot open the connection
weights <- result$weights
#> Error: object 'result' not found
performance <- result$twas_cv_performance
#> Error: object 'result' not found