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
11 changes: 6 additions & 5 deletions R/colocboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@
#' colnames(X) <- paste0("SNP", 1:P)
#' L = 3
#' true_beta <- matrix(0, P, L)
#' true_beta[5, 1] <- 0.5 # SNP5 affects trait 1
#' true_beta[5, 2] <- 0.4 # SNP5 also affects trait 2 (colocalized)
#' true_beta[10, 2] <- 0.3 # SNP10 only affects trait 2
#' true_beta[20, 3] <- 0.6 # SNP20 only affects trait 3
#' true_beta[10, 1] <- 0.5 # SNP10 affects trait 1
#' true_beta[10, 2] <- 0.4 # SNP10 also affects trait 2 (colocalized)
#' true_beta[50, 2] <- 0.3 # SNP50 only affects trait 2
#' true_beta[80, 3] <- 0.6 # SNP80 only affects trait 3
#' Y <- matrix(0, N, L)
#' for (l in 1:L){ Y[, l] <- X %*% true_beta[, l] + rnorm(N, 0, 1) }
#' res <- colocboost(X = X, Y = Y)
#' res$cos_details$cos$cos_index
#'
#' @family colocboost
#' @importFrom stats na.omit
Expand Down Expand Up @@ -551,7 +552,7 @@ colocboost <- function(X = NULL, Y = NULL, # individual data
if (min_variables < 100) {
warning(
"Warning message about the number of variables.\n",
"The smallest number of variables across outcomes is ", min_variables, "< 100.",
"The smallest number of variables across outcomes is ", min_variables, " < 100.",
" If this is what you expected, this is not a problem.",
" If this is not what you expected, please check input data."
)
Expand Down
26 changes: 14 additions & 12 deletions R/colocboost_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#' colnames(X) <- paste0("SNP", 1:P)
#' L = 3
#' true_beta <- matrix(0, P, L)
#' true_beta[5, 1] <- 0.5 # SNP5 affects trait 1
#' true_beta[5, 2] <- 0.4 # SNP5 also affects trait 2 (colocalized)
#' true_beta[10, 2] <- 0.3 # SNP10 only affects trait 2
#' true_beta[20, 3] <- 0.6 # SNP20 only affects trait 3
#' true_beta[10, 1] <- 0.5 # SNP10 affects trait 1
#' true_beta[10, 2] <- 0.4 # SNP10 also affects trait 2 (colocalized)
#' true_beta[50, 2] <- 0.3 # SNP50 only affects trait 2
#' true_beta[80, 3] <- 0.6 # SNP80 only affects trait 3
#' Y <- matrix(0, N, L)
#' for (l in 1:L){ Y[, l] <- X %*% true_beta[, l] + rnorm(N, 0, 1) }
#' res <- colocboost(X = X, Y = Y)
Expand Down Expand Up @@ -159,14 +159,16 @@ get_cos_summary <- function(cb_output,
#' colnames(X) <- paste0("SNP", 1:P)
#' L = 3
#' true_beta <- matrix(0, P, L)
#' true_beta[5, 1] <- 0.5 # SNP5 affects trait 1
#' true_beta[5, 2] <- 0.4 # SNP5 also affects trait 2 (colocalized)
#' true_beta[10, 2] <- 0.3 # SNP10 only affects trait 2
#' true_beta[20, 3] <- 0.6 # SNP20 only affects trait 3
#' true_beta[10, 1] <- 0.5 # SNP10 affects trait 1
#' true_beta[10, 2] <- 0.4 # SNP10 also affects trait 2 (colocalized)
#' true_beta[50, 2] <- 0.3 # SNP50 only affects trait 2
#' true_beta[80, 3] <- 0.6 # SNP80 only affects trait 3
#' Y <- matrix(0, N, L)
#' for (l in 1:L){ Y[, l] <- X %*% true_beta[, l] + rnorm(N, 0, 1) }
#' res <- colocboost(X = X, Y = Y)
#' res$cos_details$cos$cos_index
#' filter_res <- get_strong_colocalization(res, cos_npc_cutoff = 0.5, npc_outcome_cutoff = 0.2)
#' filter_res$cos_details$cos$cos_index
#'
#' @family colocboost_inference
#' @export
Expand Down Expand Up @@ -472,10 +474,10 @@ get_ucos_summary <- function(cb_output, outcome_names = NULL, region_name = NULL
#' colnames(X) <- paste0("SNP", 1:P)
#' L = 3
#' true_beta <- matrix(0, P, L)
#' true_beta[5, 1] <- 0.5 # SNP5 affects trait 1
#' true_beta[5, 2] <- 0.4 # SNP5 also affects trait 2 (colocalized)
#' true_beta[10, 2] <- 0.3 # SNP10 only affects trait 2
#' true_beta[20, 3] <- 0.6 # SNP20 only affects trait 3
#' true_beta[10, 1] <- 0.5 # SNP10 affects trait 1
#' true_beta[10, 2] <- 0.4 # SNP10 also affects trait 2 (colocalized)
#' true_beta[50, 2] <- 0.3 # SNP50 only affects trait 2
#' true_beta[80, 3] <- 0.6 # SNP80 only affects trait 3
#' Y <- matrix(0, N, L)
#' for (l in 1:L){ Y[, l] <- X %*% true_beta[, l] + rnorm(N, 0, 1) }
#' res <- colocboost(X = X, Y = Y)
Expand Down
9 changes: 5 additions & 4 deletions R/colocboost_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@
#' colnames(X) <- paste0("SNP", 1:P)
#' L = 3
#' true_beta <- matrix(0, P, L)
#' true_beta[5, 1] <- 0.5 # SNP5 affects trait 1
#' true_beta[5, 2] <- 0.4 # SNP5 also affects trait 2 (colocalized)
#' true_beta[10, 2] <- 0.3 # SNP10 only affects trait 2
#' true_beta[20, 3] <- 0.6 # SNP20 only affects trait 3
#' true_beta[10, 1] <- 0.5 # SNP10 affects trait 1
#' true_beta[10, 2] <- 0.4 # SNP10 also affects trait 2 (colocalized)
#' true_beta[50, 2] <- 0.3 # SNP50 only affects trait 2
#' true_beta[80, 3] <- 0.6 # SNP80 only affects trait 3
#' Y <- matrix(0, N, L)
#' for (l in 1:L){ Y[, l] <- X %*% true_beta[, l] + rnorm(N, 0, 1) }
#' res <- colocboost(X = X, Y = Y)
#' colocboost_plot(res, plot_cols = 1)
#' colocboost_plot(res, plot_cols = 1, outcome_idx = 1:3)
#'
#'
#' @importFrom utils head tail
Expand Down
17 changes: 17 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ navbar:
- icon: fa-github
href: https://github.com/StatFunGen/colocboost

articles:
- title: Vignettes
contents:
- Input_Data_Format
- Individual_Level_Colocalization
- Summary_Level_Colocalization
- ColocBoost_tutorial_basic
- ColocBoost_tutorial_advance
- ColocBoost_tutorial_GTEx
- ColocBoost_tutorial_strong_colocalization
- ColocBoost_tutorial_diagnostic

- title: internal
contents:
- announcements
- installation

reference:
- title: "Example Data"
desc: "Example datasets for demonstration and testing"
Expand Down
9 changes: 5 additions & 4 deletions man/colocboost.Rd

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

9 changes: 5 additions & 4 deletions man/colocboost_plot.Rd

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

8 changes: 4 additions & 4 deletions man/get_cos.Rd

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

8 changes: 4 additions & 4 deletions man/get_cos_summary.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/get_strong_colocalization.Rd

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

89 changes: 0 additions & 89 deletions tmp_readme.md

This file was deleted.