Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion R/multivariate_pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#' @param sample_partition Optional data frame with Sample and Fold columns for cross-validation.
#' @param mrmash_max_iter The maximum number of iterations for mr.mash. Default is 5000.
#' @param mvsusie_max_iter The maximum number of iterations for mvSuSiE. Default is 200.
#' @param estimate_residual_variance Passed to \code{mvsusieR::mvsusie()}. Default is TRUE.
#' @param min_cv_maf The minimum minor allele frequency for variants to be included in cross-validation. Default is 0.05.
#' @param max_cv_variants The maximum number of variants to be included in cross-validation. Defaults to -1 which means no limit.
#' @param cv_folds The number of folds to use for cross-validation. Set to 0 to skip cross-validation. Default is 5.
Expand Down Expand Up @@ -87,6 +88,7 @@ multivariate_analysis_pipeline <- function(
canonical_prior_matrices = TRUE,
mrmash_max_iter = 5000,
mvsusie_max_iter = 200,
estimate_residual_variance = TRUE,
# fine-mapping results summary
signal_cutoff = 0.025,
coverage = c(0.95, 0.7, 0.5),
Expand Down Expand Up @@ -287,7 +289,7 @@ multivariate_analysis_pipeline <- function(
res$mvsusie_fitted <- mvsusieR::mvsusie(X, Y,
L = L, L_greedy = L_greedy,
prior_variance = mvsusie_reweighted_mixture_prior$data_driven_prior_matrices,
residual_variance = resid_Y, estimate_residual_variance = TRUE,
residual_variance = resid_Y, estimate_residual_variance = estimate_residual_variance,
max_iter = mvsusie_max_iter,
verbose = verbose, coverage = coverage[1]
)
Expand Down
5 changes: 4 additions & 1 deletion R/univariate_pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#' @param finemapping_extra_opts Additional options passed to \code{susieR::susie()}.
#' SuSiE-inf is always fitted with \code{refine = FALSE}; the ordinary SuSiE
#' fit keeps these options and is initialized with \code{model_init}.
#' @param estimate_residual_variance Passed to \code{susieR::susie()}. Default is TRUE.
#' @param add_susie_inf Whether to fit SuSiE-inf before ordinary SuSiE. Default
#' is TRUE for existing pipeline compatibility. If FALSE, ordinary SuSiE is
#' fitted directly and SuSiE-inf fitted objects/results are not returned.
Expand Down Expand Up @@ -63,6 +64,7 @@ univariate_analysis_pipeline <- function(
coverage = c(0.95, 0.7, 0.5),
min_abs_corr = 0.8,
finemapping_extra_opts = list(refine = TRUE),
estimate_residual_variance = TRUE,
add_susie_inf = TRUE,
# TWAS weights and CV for TWAS weights
twas_weights = TRUE,
Expand Down Expand Up @@ -126,7 +128,8 @@ univariate_analysis_pipeline <- function(

susie_args <- modifyList(
finemapping_extra_opts,
list(L = L, L_greedy = L_greedy, coverage = coverage[1])
list(L = L, L_greedy = L_greedy, coverage = coverage[1],
estimate_residual_variance = estimate_residual_variance)
)
if (isTRUE(add_susie_inf)) {
message("Fitting SuSiE-inf model on input data ...")
Expand Down
3 changes: 3 additions & 0 deletions man/multivariate_analysis_pipeline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/univariate_analysis_pipeline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.