From c0ad0e1defa9d4d45a032df919566b532729d20f Mon Sep 17 00:00:00 2001 From: xuewei cao <36172337+xueweic@users.noreply.github.com> Date: Sat, 22 Mar 2025 20:13:26 -0400 Subject: [PATCH 1/7] Update raiss.R --- R/raiss.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/raiss.R b/R/raiss.R index 313c5483..d3033c51 100644 --- a/R/raiss.R +++ b/R/raiss.R @@ -45,7 +45,7 @@ raiss_single_matrix <- function(ref_panel, known_zscores, LD_matrix, lamb = 0.01 } # Extract zt, sig_t, and sig_i_t - zt <- known_zscores$z[knowns] + zt <- known_zscores$z sig_t <- LD_matrix[knowns, knowns, drop = FALSE] sig_i_t <- LD_matrix[unknowns, knowns, drop = FALSE] From 0c4d19c311503514ffa49e2ded0974645ed611f6 Mon Sep 17 00:00:00 2001 From: xuewei cao <36172337+xueweic@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:25:30 -0400 Subject: [PATCH 2/7] Update LD.R --- R/LD.R | 73 +++++++++++++++++++++------------------------------------- 1 file changed, 26 insertions(+), 47 deletions(-) diff --git a/R/LD.R b/R/LD.R index f3e93224..4803e513 100644 --- a/R/LD.R +++ b/R/LD.R @@ -250,49 +250,36 @@ extract_LD_for_region <- function(LD_matrix, variants, region, extract_coordinat # Create a combined LD matrix from multiple matrices create_combined_LD_matrix <- function(LD_matrices, variants) { - # Extract unique variant names from the list of variants with position tracking + # Extract unique variant names from the list of variants mergeVariants <- function(LD_variants_list) { + # Initialize an empty vector to store the merged variants mergedVariants <- character(0) - block_starts <- integer(length(LD_variants_list)) - block_ends <- integer(length(LD_variants_list)) - - for (i in seq_along(LD_variants_list)) { - currentVariants <- get_nested_element(LD_variants_list[[i]], "variants") + # Loop over the list of LD matrices using sapply + sapply(LD_variants_list, function(LD_variants) { + # Extract the variants from the current LD matrix + currentVariants <- get_nested_element(LD_variants, "variants") if (length(currentVariants) == 0) { - block_starts[i] <- length(mergedVariants) + 1 - block_ends[i] <- length(mergedVariants) - next + return(NULL) } - block_starts[i] <- length(mergedVariants) + 1 - - # Merge variants, handling overlap - using <<- to modify parent environment variable + # Merge variants with the previously merged variants vector + # Checking if the last variant is the same as the first of the current, if so, skip the first if (length(mergedVariants) > 0 && tail(mergedVariants, 1) == currentVariants[1]) { mergedVariants <<- c(mergedVariants, currentVariants[-1]) } else { mergedVariants <<- c(mergedVariants, currentVariants) } + }) - block_ends[i] <- length(mergedVariants) - } - - return(list( - variants = mergedVariants, - block_starts = block_starts, - block_ends = block_ends - )) + # Return the merged vector of variants + return(mergedVariants) } - - # Get merged variants and block positions - merged_result <- mergeVariants(variants) - unique_variants <- merged_result$variants - + unique_variants <- mergeVariants(variants) # Initialize an empty combined LD matrix with the unique variants combined_LD_matrix <- matrix(0, nrow = length(unique_variants), ncol = length(unique_variants)) rownames(combined_LD_matrix) <- unique_variants colnames(combined_LD_matrix) <- unique_variants - # Define a function to align the values from each LD matrix to the combined matrix align_matrix <- function(ld_matrix, combined_matrix, variant_names) { # Find the indices of the variant names in the combined matrix @@ -301,20 +288,13 @@ create_combined_LD_matrix <- function(LD_matrices, variants) { combined_matrix[indices, indices] <- ld_matrix return(combined_matrix) } - - # Apply the align_matrix function to each LD matrix and accumulate the results + # Apply the fill_matrix function to each LD matrix and accumulate the results combined_LD_matrix <- Reduce( function(x, y) align_matrix(y[[1]], x, y[[2]]), Map(list, LD_matrices, lapply(LD_matrices, rownames)), combined_LD_matrix ) - - # Return both the matrix and block positions - return(list( - matrix = combined_LD_matrix, - block_starts = merged_result$block_starts, - block_ends = merged_result$block_ends - )) + combined_LD_matrix } #' Load and Process Linkage Disequilibrium (LD) Matrix @@ -360,7 +340,6 @@ load_LD_matrix <- function(LD_meta_file_path, region, extract_coordinates = NULL ) extracted_LD_matrices_list[[j]] <- extracted_LD_list$extracted_LD_matrix extracted_LD_variants_list[[j]] <- extracted_LD_list$extracted_LD_variants - if (nrow(extracted_LD_variants_list[[j]]) > 0) { block_chroms[j] <- as.character(extracted_LD_variants_list[[j]]$chrom[1]) } else { @@ -372,22 +351,21 @@ load_LD_matrix <- function(LD_meta_file_path, region, extract_coordinates = NULL rm(LD_matrix_processed, extracted_LD_list) } - # Create combined LD matrix with accurate block positions - combined_LD_result <- create_combined_LD_matrix( + # Create combined LD matrix + combined_LD_matrix <- create_combined_LD_matrix( LD_matrices = extracted_LD_matrices_list, variants = extracted_LD_variants_list ) - - # Extract the matrix and position information - combined_LD_matrix <- combined_LD_result$matrix - - # Create block metadata with size calculated from the actual block positions + combined_LD_variants = rownames(combined_LD_matrix) + + # Now create block_metadata with all the information we've accumulated + block_variants <- lapply(extracted_LD_variants_list, function(v) v$variants ) block_metadata <- data.frame( block_id = seq_along(LD_file_paths), chrom = block_chroms, - size = combined_LD_result$block_ends - combined_LD_result$block_starts + 1, - start_idx = combined_LD_result$block_starts, - end_idx = combined_LD_result$block_ends, + size = sapply(block_variants, length), + start_idx = sapply(block_variants, function(v) min(match(v, combined_LD_variants)) ), + end_idx = sapply(block_variants, function(v) max(match(v, combined_LD_variants)) ), stringsAsFactors = FALSE ) @@ -408,8 +386,9 @@ load_LD_matrix <- function(LD_meta_file_path, region, extract_coordinates = NULL # Return the combined LD list combined_LD_list <- list( - combined_LD_variants = rownames(combined_LD_matrix), + combined_LD_variants = combined_LD_variants, combined_LD_matrix = combined_LD_matrix, + block_LD_variants = extracted_LD_variants_list, ref_panel = ref_panel, block_metadata = block_metadata ) From 1d1f212093c0b72b98391169a468a5299207b7db Mon Sep 17 00:00:00 2001 From: xuewei cao <36172337+xueweic@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:27:02 -0400 Subject: [PATCH 3/7] Update raiss.R --- R/raiss.R | 72 ++++++++++++++++--------------------------------------- 1 file changed, 20 insertions(+), 52 deletions(-) diff --git a/R/raiss.R b/R/raiss.R index 0f1ce68a..44ab5783 100644 --- a/R/raiss.R +++ b/R/raiss.R @@ -127,42 +127,17 @@ raiss <- function(ref_panel, known_zscores, LD_matrix, variant_indices = NULL, l if (verbose) message("Processing multiple LD blocks...") - combine_with_boundary_check <- function(combined_result, new_result) { - # If either is empty, simply return the non-empty one or empty data frame - if (nrow(combined_result) == 0) { - return(new_result) - } - if (nrow(new_result) == 0) { - return(combined_result) - } - - # Check if the last variant of combined matches the first of new - last_var <- combined_result$variant_id[nrow(combined_result)] - first_var <- new_result$variant_id[1] - - if (last_var == first_var) { - if (new_result$raiss_R2[1] > combined_result$raiss_R2[nrow(combined_result)]) { - # Replace the last row in combined with first row from new - combined_result[nrow(combined_result), ] <- new_result[1, ] - } - - # Add remaining rows from new (excluding first) - if (nrow(new_result) > 1) { - combined_result <- bind_rows(combined_result, new_result[-1, ]) - } - } else { - combined_result <- bind_rows(combined_result, new_result) - } - - return(combined_result) - } - + # Prepare list to collect results from each block results_list <- list() + + # Get unique block IDs block_ids <- unique(variant_indices$block_id) + # Process each block for (block_id in block_ids) { if (verbose) message(paste("Processing block", block_id, "of", length(block_ids))) + # Get variants in this block block_variant_ids <- variant_indices$variant_id[variant_indices$block_id == block_id] # Subset ref_panel and LD_matrix for this block @@ -170,6 +145,8 @@ raiss <- function(ref_panel, known_zscores, LD_matrix, variant_indices = NULL, l block_ref_panel <- ref_panel[block_indices, ] block_LD_matrix <- LD_matrix$ld_matrices[[block_id]] block_known_zscores <- known_zscores %>% filter(variant_id %in% block_variant_ids) + + # Check dimensions match if (nrow(block_LD_matrix) != nrow(block_ref_panel)) { stop(paste("Block", block_id, ": LD matrix dimension does not match number of variants in reference panel")) } @@ -187,39 +164,30 @@ raiss <- function(ref_panel, known_zscores, LD_matrix, variant_indices = NULL, l } } + # If no valid blocks were processed if (length(results_list) == 0) { if (verbose) message("No blocks could be processed. Check that known_zscores overlap with variants in the blocks.") return(NULL) } - # Combine results sequentially to handle boundary duplicates - combined_nofilter <- results_list[[1]]$result_nofilter - combined_filter <- results_list[[1]]$result_filter - - if (length(results_list) > 1) { - for (i in 2:length(results_list)) { - combined_nofilter <- combine_with_boundary_check( - combined_nofilter, - results_list[[i]]$result_nofilter - ) - - combined_filter <- combine_with_boundary_check( - combined_filter, - results_list[[i]]$result_filter - ) - } - } - + # Combine results from all blocks + nofilter_results <- results_list %>% lapply(function(x) x$result_nofilter) %>% bind_rows() + filter_results <- results_list %>% lapply(function(x) x$result_filter) %>% bind_rows() ld_filtered_list <- lapply(results_list, function(x) x$LD_mat) - variant_list <- lapply(ld_filtered_list, function(ld) data.frame(variants = colnames(ld))) + variant_list <- lapply(ld_filtered_list, function(ld) data.frame(variants = colnames(ld)) ) combined_LD_matrix <- create_combined_LD_matrix( LD_matrices = ld_filtered_list, variants = variant_list - )$matrix + ) + + # Combine into data frames + result_nofilter <- bind_rows(nofilter_results) %>% arrange(pos) + result_filter <- bind_rows(filter_results) %>% arrange(pos) + # Return combined results return(list( - result_nofilter = combined_nofilter, - result_filter = combined_filter, + result_nofilter = result_nofilter, + result_filter = result_filter, LD_mat = combined_LD_matrix )) } From 007166f505c13b7c6f88aeea48418d6c76d116ea Mon Sep 17 00:00:00 2001 From: xuewei cao <36172337+xueweic@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:28:01 -0400 Subject: [PATCH 4/7] Update LD.R --- R/LD.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/LD.R b/R/LD.R index 4803e513..a9dd8445 100644 --- a/R/LD.R +++ b/R/LD.R @@ -388,7 +388,6 @@ load_LD_matrix <- function(LD_meta_file_path, region, extract_coordinates = NULL combined_LD_list <- list( combined_LD_variants = combined_LD_variants, combined_LD_matrix = combined_LD_matrix, - block_LD_variants = extracted_LD_variants_list, ref_panel = ref_panel, block_metadata = block_metadata ) From 0bf6b94519f0c1a62c3511b55088859c3cdb7107 Mon Sep 17 00:00:00 2001 From: xueweic Date: Sun, 23 Mar 2025 03:29:52 +0000 Subject: [PATCH 5/7] Update documentation --- NAMESPACE | 1 - R/RcppExports.R | 11 ++++++----- man/raiss_single_matrix.Rd | 40 -------------------------------------- 3 files changed, 6 insertions(+), 46 deletions(-) delete mode 100644 man/raiss_single_matrix.Rd diff --git a/NAMESPACE b/NAMESPACE index 0b1271ff..9328ad5f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -79,7 +79,6 @@ export(prs_cs_weights) export(qr_screen) export(quantile_twas_weight_pipeline) export(raiss) -export(raiss_single_matrix) export(region_to_df) export(rss_analysis_pipeline) export(rss_basic_qc) diff --git a/R/RcppExports.R b/R/RcppExports.R index 814b38fd..efa6874d 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -2,21 +2,22 @@ # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 dentist_iterative_impute <- function(LD_mat, nSample, zScore, pValueThreshold, propSVD, gcControl, nIter, gPvalueThreshold, ncpus, seed, correct_chen_et_al_bug, verbose = FALSE) { - .Call("_pecotmr_dentist_iterative_impute", PACKAGE = "pecotmr", LD_mat, nSample, zScore, pValueThreshold, propSVD, gcControl, nIter, gPvalueThreshold, ncpus, seed, correct_chen_et_al_bug, verbose) + .Call('_pecotmr_dentist_iterative_impute', PACKAGE = 'pecotmr', LD_mat, nSample, zScore, pValueThreshold, propSVD, gcControl, nIter, gPvalueThreshold, ncpus, seed, correct_chen_et_al_bug, verbose) } rcpp_mr_ash_rss <- function(bhat, shat, z, R, var_y, n, sigma2_e, s0, w0, mu1_init, tol = 1e-8, max_iter = 1e5L, update_w0 = TRUE, update_sigma = TRUE, compute_ELBO = TRUE, standardize = FALSE, ncpus = 1L) { - .Call("_pecotmr_rcpp_mr_ash_rss", PACKAGE = "pecotmr", bhat, shat, z, R, var_y, n, sigma2_e, s0, w0, mu1_init, tol, max_iter, update_w0, update_sigma, compute_ELBO, standardize, ncpus) + .Call('_pecotmr_rcpp_mr_ash_rss', PACKAGE = 'pecotmr', bhat, shat, z, R, var_y, n, sigma2_e, s0, w0, mu1_init, tol, max_iter, update_w0, update_sigma, compute_ELBO, standardize, ncpus) } prs_cs_rcpp <- function(a, b, phi, bhat, maf, n, ld_blk, n_iter, n_burnin, thin, verbose, seed) { - .Call("_pecotmr_prs_cs_rcpp", PACKAGE = "pecotmr", a, b, phi, bhat, maf, n, ld_blk, n_iter, n_burnin, thin, verbose, seed) + .Call('_pecotmr_prs_cs_rcpp', PACKAGE = 'pecotmr', a, b, phi, bhat, maf, n, ld_blk, n_iter, n_burnin, thin, verbose, seed) } qtl_enrichment_rcpp <- function(r_gwas_pip, r_qtl_susie_fit, pi_gwas = 0, pi_qtl = 0, ImpN = 25L, shrinkage_lambda = 1.0, num_threads = 1L) { - .Call("_pecotmr_qtl_enrichment_rcpp", PACKAGE = "pecotmr", r_gwas_pip, r_qtl_susie_fit, pi_gwas, pi_qtl, ImpN, shrinkage_lambda, num_threads) + .Call('_pecotmr_qtl_enrichment_rcpp', PACKAGE = 'pecotmr', r_gwas_pip, r_qtl_susie_fit, pi_gwas, pi_qtl, ImpN, shrinkage_lambda, num_threads) } sdpr_rcpp <- function(bhat, LD, n, per_variant_sample_size = NULL, array = NULL, a = 0.1, c = 1.0, M = 1000L, a0k = 0.5, b0k = 0.5, iter = 1000L, burn = 200L, thin = 5L, n_threads = 1L, opt_llk = 1L, verbose = TRUE) { - .Call("_pecotmr_sdpr_rcpp", PACKAGE = "pecotmr", bhat, LD, n, per_variant_sample_size, array, a, c, M, a0k, b0k, iter, burn, thin, n_threads, opt_llk, verbose) + .Call('_pecotmr_sdpr_rcpp', PACKAGE = 'pecotmr', bhat, LD, n, per_variant_sample_size, array, a, c, M, a0k, b0k, iter, burn, thin, n_threads, opt_llk, verbose) } + diff --git a/man/raiss_single_matrix.Rd b/man/raiss_single_matrix.Rd deleted file mode 100644 index 40c40e54..00000000 --- a/man/raiss_single_matrix.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/raiss.R -\name{raiss_single_matrix} -\alias{raiss_single_matrix} -\title{Core RAISS implementation for a single LD matrix} -\usage{ -raiss_single_matrix( - ref_panel, - known_zscores, - LD_matrix, - lamb = 0.01, - rcond = 0.01, - R2_threshold = 0.6, - minimum_ld = 5, - verbose = TRUE -) -} -\arguments{ -\item{ref_panel}{A data frame containing 'chrom', 'pos', 'variant_id', 'A1', and 'A2'.} - -\item{known_zscores}{A data frame containing 'chrom', 'pos', 'variant_id', 'A1', 'A2', and 'z' values.} - -\item{LD_matrix}{A square matrix of dimension equal to the number of rows in ref_panel.} - -\item{lamb}{Regularization term added to the diagonal of the LD_matrix.} - -\item{rcond}{Threshold for filtering eigenvalues in the pseudo-inverse computation.} - -\item{R2_threshold}{R square threshold below which SNPs are filtered from the output.} - -\item{minimum_ld}{Minimum LD score threshold for SNP filtering.} - -\item{verbose}{Logical indicating whether to print progress information.} -} -\value{ -A list containing filtered and unfiltered results, and filtered LD matrix. -} -\description{ -Core RAISS implementation for a single LD matrix -} From 992231192e57fea0e7b38046f381ac1423fdd7c6 Mon Sep 17 00:00:00 2001 From: xuewei cao <36172337+xueweic@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:31:09 -0400 Subject: [PATCH 6/7] Update raiss.R --- R/raiss.R | 72 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/R/raiss.R b/R/raiss.R index 44ab5783..0f1ce68a 100644 --- a/R/raiss.R +++ b/R/raiss.R @@ -127,17 +127,42 @@ raiss <- function(ref_panel, known_zscores, LD_matrix, variant_indices = NULL, l if (verbose) message("Processing multiple LD blocks...") - # Prepare list to collect results from each block - results_list <- list() + combine_with_boundary_check <- function(combined_result, new_result) { + # If either is empty, simply return the non-empty one or empty data frame + if (nrow(combined_result) == 0) { + return(new_result) + } + if (nrow(new_result) == 0) { + return(combined_result) + } + + # Check if the last variant of combined matches the first of new + last_var <- combined_result$variant_id[nrow(combined_result)] + first_var <- new_result$variant_id[1] + + if (last_var == first_var) { + if (new_result$raiss_R2[1] > combined_result$raiss_R2[nrow(combined_result)]) { + # Replace the last row in combined with first row from new + combined_result[nrow(combined_result), ] <- new_result[1, ] + } + + # Add remaining rows from new (excluding first) + if (nrow(new_result) > 1) { + combined_result <- bind_rows(combined_result, new_result[-1, ]) + } + } else { + combined_result <- bind_rows(combined_result, new_result) + } + + return(combined_result) + } - # Get unique block IDs + results_list <- list() block_ids <- unique(variant_indices$block_id) - # Process each block for (block_id in block_ids) { if (verbose) message(paste("Processing block", block_id, "of", length(block_ids))) - # Get variants in this block block_variant_ids <- variant_indices$variant_id[variant_indices$block_id == block_id] # Subset ref_panel and LD_matrix for this block @@ -145,8 +170,6 @@ raiss <- function(ref_panel, known_zscores, LD_matrix, variant_indices = NULL, l block_ref_panel <- ref_panel[block_indices, ] block_LD_matrix <- LD_matrix$ld_matrices[[block_id]] block_known_zscores <- known_zscores %>% filter(variant_id %in% block_variant_ids) - - # Check dimensions match if (nrow(block_LD_matrix) != nrow(block_ref_panel)) { stop(paste("Block", block_id, ": LD matrix dimension does not match number of variants in reference panel")) } @@ -164,30 +187,39 @@ raiss <- function(ref_panel, known_zscores, LD_matrix, variant_indices = NULL, l } } - # If no valid blocks were processed if (length(results_list) == 0) { if (verbose) message("No blocks could be processed. Check that known_zscores overlap with variants in the blocks.") return(NULL) } - # Combine results from all blocks - nofilter_results <- results_list %>% lapply(function(x) x$result_nofilter) %>% bind_rows() - filter_results <- results_list %>% lapply(function(x) x$result_filter) %>% bind_rows() + # Combine results sequentially to handle boundary duplicates + combined_nofilter <- results_list[[1]]$result_nofilter + combined_filter <- results_list[[1]]$result_filter + + if (length(results_list) > 1) { + for (i in 2:length(results_list)) { + combined_nofilter <- combine_with_boundary_check( + combined_nofilter, + results_list[[i]]$result_nofilter + ) + + combined_filter <- combine_with_boundary_check( + combined_filter, + results_list[[i]]$result_filter + ) + } + } + ld_filtered_list <- lapply(results_list, function(x) x$LD_mat) - variant_list <- lapply(ld_filtered_list, function(ld) data.frame(variants = colnames(ld)) ) + variant_list <- lapply(ld_filtered_list, function(ld) data.frame(variants = colnames(ld))) combined_LD_matrix <- create_combined_LD_matrix( LD_matrices = ld_filtered_list, variants = variant_list - ) - - # Combine into data frames - result_nofilter <- bind_rows(nofilter_results) %>% arrange(pos) - result_filter <- bind_rows(filter_results) %>% arrange(pos) + )$matrix - # Return combined results return(list( - result_nofilter = result_nofilter, - result_filter = result_filter, + result_nofilter = combined_nofilter, + result_filter = combined_filter, LD_mat = combined_LD_matrix )) } From a9926ca996b912ac27952c9849ce6783d493ea97 Mon Sep 17 00:00:00 2001 From: xuewei cao <36172337+xueweic@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:47:21 -0400 Subject: [PATCH 7/7] Update RcppExports.R --- R/RcppExports.R | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index efa6874d..814b38fd 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -2,22 +2,21 @@ # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 dentist_iterative_impute <- function(LD_mat, nSample, zScore, pValueThreshold, propSVD, gcControl, nIter, gPvalueThreshold, ncpus, seed, correct_chen_et_al_bug, verbose = FALSE) { - .Call('_pecotmr_dentist_iterative_impute', PACKAGE = 'pecotmr', LD_mat, nSample, zScore, pValueThreshold, propSVD, gcControl, nIter, gPvalueThreshold, ncpus, seed, correct_chen_et_al_bug, verbose) + .Call("_pecotmr_dentist_iterative_impute", PACKAGE = "pecotmr", LD_mat, nSample, zScore, pValueThreshold, propSVD, gcControl, nIter, gPvalueThreshold, ncpus, seed, correct_chen_et_al_bug, verbose) } rcpp_mr_ash_rss <- function(bhat, shat, z, R, var_y, n, sigma2_e, s0, w0, mu1_init, tol = 1e-8, max_iter = 1e5L, update_w0 = TRUE, update_sigma = TRUE, compute_ELBO = TRUE, standardize = FALSE, ncpus = 1L) { - .Call('_pecotmr_rcpp_mr_ash_rss', PACKAGE = 'pecotmr', bhat, shat, z, R, var_y, n, sigma2_e, s0, w0, mu1_init, tol, max_iter, update_w0, update_sigma, compute_ELBO, standardize, ncpus) + .Call("_pecotmr_rcpp_mr_ash_rss", PACKAGE = "pecotmr", bhat, shat, z, R, var_y, n, sigma2_e, s0, w0, mu1_init, tol, max_iter, update_w0, update_sigma, compute_ELBO, standardize, ncpus) } prs_cs_rcpp <- function(a, b, phi, bhat, maf, n, ld_blk, n_iter, n_burnin, thin, verbose, seed) { - .Call('_pecotmr_prs_cs_rcpp', PACKAGE = 'pecotmr', a, b, phi, bhat, maf, n, ld_blk, n_iter, n_burnin, thin, verbose, seed) + .Call("_pecotmr_prs_cs_rcpp", PACKAGE = "pecotmr", a, b, phi, bhat, maf, n, ld_blk, n_iter, n_burnin, thin, verbose, seed) } qtl_enrichment_rcpp <- function(r_gwas_pip, r_qtl_susie_fit, pi_gwas = 0, pi_qtl = 0, ImpN = 25L, shrinkage_lambda = 1.0, num_threads = 1L) { - .Call('_pecotmr_qtl_enrichment_rcpp', PACKAGE = 'pecotmr', r_gwas_pip, r_qtl_susie_fit, pi_gwas, pi_qtl, ImpN, shrinkage_lambda, num_threads) + .Call("_pecotmr_qtl_enrichment_rcpp", PACKAGE = "pecotmr", r_gwas_pip, r_qtl_susie_fit, pi_gwas, pi_qtl, ImpN, shrinkage_lambda, num_threads) } sdpr_rcpp <- function(bhat, LD, n, per_variant_sample_size = NULL, array = NULL, a = 0.1, c = 1.0, M = 1000L, a0k = 0.5, b0k = 0.5, iter = 1000L, burn = 200L, thin = 5L, n_threads = 1L, opt_llk = 1L, verbose = TRUE) { - .Call('_pecotmr_sdpr_rcpp', PACKAGE = 'pecotmr', bhat, LD, n, per_variant_sample_size, array, a, c, M, a0k, b0k, iter, burn, thin, n_threads, opt_llk, verbose) + .Call("_pecotmr_sdpr_rcpp", PACKAGE = "pecotmr", bhat, LD, n, per_variant_sample_size, array, a, c, M, a0k, b0k, iter, burn, thin, n_threads, opt_llk, verbose) } -