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
6 changes: 3 additions & 3 deletions R/colocboost_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -794,17 +794,17 @@ get_model_info <- function(cb_obj, outcome_names = NULL) {
model_coveraged <- cb_obj$cb_model_para$coveraged
jk_update <- cb_obj$cb_model_para$real_update_jk
outcome_proximity_obj <- lapply(cb_obj$cb_model, function(cb) cb$obj_path)
outcome_coupled_obj <- lapply(cb_obj$cb_model, function(cb) cb$obj_single)
outcome_coupled_best_update_obj <- lapply(cb_obj$cb_model, function(cb) cb$obj_single)
outcome_profile_loglik <- lapply(cb_obj$cb_model, function(cb) cb$profile_loglike_each)
names(outcome_proximity_obj) <- names(outcome_coupled_obj) <-
names(outcome_proximity_obj) <- names(outcome_coupled_best_update_obj) <-
names(outcome_profile_loglik) <- outcome_names
ll <- list(
"model_coveraged" = model_coveraged,
"n_updates" = n_updates,
"profile_loglik" = profile_loglik,
"outcome_profile_loglik" = outcome_profile_loglik,
"outcome_proximity_obj" = outcome_proximity_obj,
"outcome_coupled_obj" = outcome_coupled_obj,
"outcome_coupled_best_update_obj" = outcome_coupled_best_update_obj,
"jk_update" = jk_update
)
return(ll)
Expand Down
38 changes: 27 additions & 11 deletions R/colocboost_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,18 @@ colocboost_plot <- function(cb_output, y = "log10p",
# - begin plotting
coloc_cos <- cb_plot_input$cos
outcomes <- cb_plot_input$outcomes
if (length(y)==1) outcome_idx <- 1
if (is.null(outcome_idx)) {
if (is.null(coloc_cos)) {
# - no colocalized effects, draw all outcomes in this region
if (length(cb_plot_input$outcomes) == 1) {
message("There is no fine-mapped causal effect in this region!. Showing margianl for this outcome!")
} else {
message("There is no colocalization in this region!. Showing margianl for all outcomes!")
if (length(y) == 1){
message("There is no colocalization in this region!. Showing VCP = 0!")
} else {
message("There is no colocalization in this region!. Showing margianl for all outcomes!")
}
}
outcome_idx <- 1:length(y)
} else {
Expand Down Expand Up @@ -195,10 +200,12 @@ colocboost_plot <- function(cb_output, y = "log10p",
} else {
do.call(plot, args)
}
mtext(outcomes[iy],
side = cb_plot_init$outcome_legend_pos, line = 0.2, adj = 0.5,
cex = cb_plot_init$outcome_legend_size, font = 1
)
if (length(y)!=1){
mtext(outcomes[iy],
side = cb_plot_init$outcome_legend_pos, line = 0.2, adj = 0.5,
cex = cb_plot_init$outcome_legend_size, font = 1
)
}
if (add_vertical) {
for (iii in 1:length(add_vertical_idx)) {
abline(v = add_vertical_idx[iii], col = "#E31A1C", lwd = 1.5, lty = "dashed")
Expand All @@ -209,6 +216,7 @@ colocboost_plot <- function(cb_output, y = "log10p",
if (!is.null(coloc_cos)) {
n.coloc <- length(coloc_cos)
coloc_index <- cb_plot_input$coloc_index
if (length(y)==1){coloc_index = lapply(coloc_index, function(i) 1 )}
legend_text <- list(col = vector())
legend_text$col <- head(cb_plot_init$col, n.coloc)

Expand Down Expand Up @@ -312,6 +320,7 @@ get_input_plot <- function(cb_output, plot_cos_idx = NULL,
variables <- cb_output$data_info$variables
Z <- cb_output$data_info$z
coef <- cb_output$data_info$coef
vcp <- list(as.numeric(cb_output$vcp))

# if finemapping
if (cb_output$data_info$n_outcomes == 1) {
Expand All @@ -336,7 +345,7 @@ get_input_plot <- function(cb_output, plot_cos_idx = NULL,
names(coloc_hits) <- names(coloc_cos)
if (!is.null(coloc_cos)) {
# extract vcp each outcome
vcp <- lapply(1:length(analysis_outcome), function(iy) {
cos_vcp <- lapply(1:length(analysis_outcome), function(iy) {
pos <- which(sapply(coloc_index, function(idx) iy %in% idx))
if (length(pos) != 0) {
w <- do.call(cbind, cb_output$cos_details$cos_vcp[pos])
Expand Down Expand Up @@ -372,8 +381,9 @@ get_input_plot <- function(cb_output, plot_cos_idx = NULL,
} else {
warnings("No colocalized effects in this region!")
}
coloc_index <- NULL
vcp <- rep(0, cb_output$data_info$n_variables)
coloc_index <- select_cs <- NULL
vcp <- list(rep(0, cb_output$data_info$n_variables))
cos_vcp <- lapply(1:length(analysis_outcome), function(iy) rep(0, cb_output$data_info$n_variables) )
}
# extract x axis
if (variant_coord) {
Expand All @@ -398,6 +408,7 @@ get_input_plot <- function(cb_output, plot_cos_idx = NULL,
"x" = x,
"Zscores" = Z,
"vcp" = vcp,
"cos_vcp" = cos_vcp,
"coef" = coef,
"cos" = coloc_cos,
"cos_hits" = coloc_hits,
Expand Down Expand Up @@ -528,18 +539,22 @@ plot_initial <- function(cb_plot_input, y = "log10p",
} else if (y == "z_original") {
plot_data <- cb_plot_input$Zscores
ylab <- "Z score"
} else if (y == "cos_vcp") {
plot_data <- cb_plot_input$cos_vcp
ylab <- "CoS-specific VCP"
args$ylim <- c(0, 1)
} else if (y == "vcp") {
plot_data <- cb_plot_input$vcp
ylab <- "VCP"
if (length(cb_plot_input$outcomes) == 1) {
ylab <- "VPA"
}
ylab <- "VCP"
args$ylim <- c(0, 1)
} else if (y == "coef") {
}else if (y == "coef") {
plot_data <- cb_plot_input$coef
ylab <- "Coefficients"
} else {
stop("Invalid y value! Choose from 'z' or 'z_original'")
stop("Invalid y value! Choose from 'log10p', 'z_original', 'vcp', 'coef', or 'cos_vcp'!")
}
if (!exists("xlab", args)) args$xlab <- "variables"
if (!exists("ylab", args)) args$ylab <- ylab
Expand Down Expand Up @@ -607,3 +622,4 @@ plot_initial <- function(cb_plot_input, y = "log10p",

return(args)
}

2 changes: 1 addition & 1 deletion R/colocboost_workhorse.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ colocboost_workhorse <- function(cb_data,
# - if all outcomes do not have signals, STOP
message(paste0(
"Using multiple testing correction method: ", func_multi_test,
". Stop ColocBoost since no outcomes ", focal_outcome_idx, " have association signals."
". Stop ColocBoost since no outcomes ", focal_outcome_idx, "have association signals."
))
} else {
message(paste0(
Expand Down
60 changes: 38 additions & 22 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,76 +1,92 @@
#' Individual level data for 5 traits
#'
#' An example dataset with simulated genotypes and outcomes for 5 traits
#' An example dataset with simulated genotypes and traits for 5 traits
#'
#' @format ## `Ind_5traits`
#' A list with 3 elements
#' \describe{
#' \item{X}{List of genotype matrices}
#' \item{Y}{List of outcomes}
#' \item{TrueCausalVariants}{List of causal variants}
#' \item{Y}{List of traits}
#' \item{true_effect_variants}{List of causal variants}
#' }
#' @source See Cao et. al. 2025 for details. TO-DO-LIST
#' @source The Ind_5traits dataset contains 5 simulated phenotypes alongside corresponding genotype matrices.
#' The dataset is specifically designed for evaluating and demonstrating the capabilities of ColocBoost in multi-trait colocalization analysis
#' with individual-level data. See Cao et. al. 2025 for details.
#'
#' @family colocboost_data
"Ind_5traits"

#' Summary level data for 5 traits
#'
#' An example dataset with simulated statistics and LD for 5 traits
#' An example dataset with simulated statistics for 5 traits
#'
#' @format ## `Sumstat_5traits`
#' A list with 2 elements
#' \describe{
#' \item{sumstat}{Summary statistics for 5 traits}
#' \item{TrueCausalVariants}{List of causal variants}
#' \item{true_effect_variants}{List of causal variants}
#' }
#' @source See Cao et. al. 2025 for details. TO-DO-LIST
#' @source The Sumstat_5traits dataset contains 5 simulated summary statistics,
#' where it is directly derived from the Ind_5traits dataset using marginal association.
#' The dataset is specifically designed for evaluating and demonstrating the capabilities of ColocBoost
#' in multi-trait colocalization analysis with summary association data. See Cao et. al. 2025 for details.
#'
#' @family colocboost_data
"Sumstat_5traits"


#' Summary level data for 5 traits
#' Individual level data for 2 traits and 2 causal variants with heterogeneous effects
#'
#' An example dataset with simulated statistics and LD for 5 traits
#' An example dataset with simulated genotypes and traits for 2 traits and 2 common causal variants with heterogeneous effects
#'
#' @format ## `Heterogeneous_Effect`
#' A list with 3 elements
#' \describe{
#' \item{X}{List of genotype matrices}
#' \item{Y}{List of outcomes}
#' \item{TrueCausalVariants}{List of causal variants}
#' \item{Y}{List of traits}
#' \item{variant}{Incides of two causal variants}
#' }
#' @source See Cao et. al. 2025 for details. TO-DO-LIST
#' @source The Heterogeneous_Effect dataset contains 2 simulated phenotypes alongside corresponding genotype matrices.
#' There are two causal variants, both of which have heterogeneous effects on two traits.
#' See Figure 2b in Cao et. al. 2025 for details.
#'
#' @family colocboost_data
"Heterogeneous_Effect"


#' Summary level data for 5 traits
#' Individual level data for 2 traits and 2 causal variants with weaker effects for focal trait
#'
#' An example dataset with simulated statistics and LD for 5 traits
#' An example dataset with simulated genotypes and traits for 2 traits and 2 common causal variants with heterogeneous effects
#'
#' @format ## `Weaker_GWAS_Effect`
#' A list with 3 elements
#' \describe{
#' \item{X}{List of genotype matrices}
#' \item{Y}{List of outcomes}
#' \item{TrueCausalVariants}{List of causal variants}
#' \item{Y}{List of traits}
#' \item{variant}{Incides of two causal variants}
#' }
#' @source See Cao et. al. 2025 for details. TO-DO-LIST
#' @source The Weaker_GWAS_Effect dataset contains 2 simulated phenotypes alongside corresponding genotype matrices.
#' There are two causal variants, one of which has a weaker effect on the focal trait compared to the other trait.
#' See Figure 2b in Cao et. al. 2025 for details.
#'
#' @family colocboost_data
"Weaker_GWAS_Effect"


#' Summary level data for 5 traits
#' Individual level data for 2 traits and 2 causal variants, but the strongest margianl association is not causal
#'
#' An example dataset with simulated statistics and LD for 5 traits
#' An example dataset with simulated genotypes and traits for 2 traits and 2 common causal variants, but the strongest marginal association is not causal variant.
#'
#' @format ## `Non_Causal_Strongest_Marginal`
#' A list with 3 elements
#' \describe{
#' \item{X}{List of genotype matrices}
#' \item{Y}{List of outcomes}
#' \item{TrueCausalVariants}{List of causal variants}
#' \item{Y}{List of traits}
#' \item{variant}{Incides of two causal variants}
#' }
#' @source See Cao et. al. 2025 for details. TO-DO-LIST
#' @source The Non_Causal_Strongest_Marginal dataset contains 2 simulated phenotypes alongside corresponding genotype matrices.
#' There are two causal variants, but the strongest marginal association is not a causal variant.
#' See Figure 2b in Cao et. al. 2025 for details.
#'
#' @family colocboost_data
"Non_Causal_Strongest_Marginal"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Learn how to perform colocalization analysis with step-by-step examples. For det

If you use ColocBoost in your research, please cite:

> Cao X, Sun H, Feng R, Mazumder R, Najar CFB, Li YI, de Jager PL, Bennett D, The Alzheimer's Disease Functional Genomics Consortium, Dey KK, Wang G. (2025+). Integrative multi-omics QTL colocalization maps regulatory architecture in aging human brain. bioRxiv. [https://doi.org/](https://doi.org/)
> Cao X, Sun H, Feng R, Mazumder R, Najar CFB, Li YI, de Jager PL, Bennett D, The Alzheimer's Disease Functional Genomics Consortium, Dey KK, Wang G. (2025+). Integrative multi-omics QTL colocalization maps regulatory architecture in aging human brain. medRxiv. [https://doi.org/](https://doi.org/)


## License
Expand Down
27 changes: 27 additions & 0 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
citHeader("To cite colocboost in publications use:")

citEntry(
entry = "Article",
title = "Integrative multi-omics QTL colocalization maps regulatory architecture in aging human brain",
author = c(person("Xuewei", "Cao"),
person("Haochen", "Sun"),
person("Ru", "Feng"),
person("Rajib", "Mazumder"),
person("Cristian F. B.", "Najar"),
person("Yang I.", "Li"),
person("Philip L.", "de Jager"),
person("David", "Bennett"),
person("The Alzheimer's Disease Functional Genomics Consortium"),
person("Kushal K.", "Dey"),
person("Guanghao", "Wang")),
journal = "medRxiv",
year = "2025",
note = "Preprint",
url = "https://doi.org/",
textVersion = paste(
"Cao X, Sun H, Feng R, Mazumder R, Najar CFB, Li YI, de Jager PL, Bennett D, The Alzheimer's Disease Functional Genomics Consortium, Dey KK, Wang G. (2025).",
"Integrative multi-omics QTL colocalization maps regulatory architecture in aging human brain.",
"medRxiv.",
"https://doi.org/[YOUR_DOI_HERE]"
)
)
12 changes: 7 additions & 5 deletions man/Heterogeneous_Effect.Rd

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

10 changes: 6 additions & 4 deletions man/Ind_5traits.Rd

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

12 changes: 7 additions & 5 deletions man/Non_Causal_Strongest_Marginal.Rd

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

Loading
Loading