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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
^\.pixi
^cran-comments\.md$
^LICENSE\.md$
^README\.md$
7 changes: 5 additions & 2 deletions .github/environment/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ libc = { family="glibc", version="2.17" }
devtools_document = "R -e 'devtools::document()'"
devtools_test = "R -e 'devtools::test()'"
codecov = "R -e 'covr::codecov(quiet = FALSE)'"
rcmdcheck = "R -e 'rcmdcheck::rcmdcheck()'"
build = "R -e 'devtools::build()'"
rcmdcheck = "R -e 'pkg <- list.files(\"..\", pattern = \".tar.gz\", full.names = TRUE); rcmdcheck::rcmdcheck(path = pkg[1], args = c(\"--as-cran\", \"--no-manual\"))'"
use_major_version = "R -e 'usethis::Use_version(which = \"major\", push = FALSE)'"
use_minor_version = "R -e 'usethis::use_version(which = \"minor\", push = FALSE)'"
use_patch_version = "R -e 'usethis::use_version(which = \"patch\", push = FALSE)'"
Expand All @@ -26,7 +27,9 @@ r43 = {features = ["r43"]}
r44 = {features = ["r44"]}

[dependencies]
"r-ashr" = "*"
"r-covr" = "*"
"r-devtools" = "*"
"r-mass" = "*"
"r-rcmdcheck" = "*"
"r-covr" = "*"
"r-tidyverse" = "*"
50 changes: 0 additions & 50 deletions .github/workflows/R-CMD-check.yaml

This file was deleted.

25 changes: 17 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ jobs:
- name: Run unit tests
run: pixi run --environment ${{ matrix.environment }} devtools_test

# - name: Check unit test code coverage
# run: pixi run --environment ${{ matrix.environment }} codecov
- name: Run R CMD CHECK
run: |
pixi install --environment ${{ matrix.environment }}
ln -sf $(pwd)/.pixi/envs/default/lib/libhwasan.so.0 $(pwd)/.pixi/envs/default/lib/libhwasan.so
ln -sf $(pwd)/.pixi/envs/${{ matrix.environment }}/lib/libhwasan.so.0 $(pwd)/.pixi/envs/${{ matrix.environment }}/lib/libhwasan.so
pixi run --environment ${{ matrix.environment }} build
pixi run --environment ${{ matrix.environment }} rcmdcheck

#- name: Run R CMD CHECK
#run: pixi run rcmdcheck
- name: Check unit test code coverage
run: pixi run --environment ${{ matrix.environment }} codecov

ci_osx-64:
name: osx-64 CI
Expand All @@ -62,8 +67,10 @@ jobs:
- name: Run unit tests
run: pixi run --environment ${{ matrix.environment }} devtools_test

#- name: Run R CMD CHECK
#run: pixi run rcmdcheck
- name: Run R CMD CHECK
run: |
pixi run --environment ${{ matrix.environment }} build
pixi run --environment ${{ matrix.environment }} rcmdcheck

ci_osx-arm64:
name: osx-arm64 CI
Expand All @@ -88,5 +95,7 @@ jobs:
- name: Run unit tests
run: pixi run --environment ${{ matrix.environment }} devtools_test

#- name: Run R CMD CHECK
#run: pixi run rcmdcheck
- name: Run R CMD CHECK
run: |
pixi run --environment ${{ matrix.environment }} build
pixi run --environment ${{ matrix.environment }} rcmdcheck
28 changes: 0 additions & 28 deletions .github/workflows/test-coverage.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: colocboost
Type: Package
Date: 2024-09-01
Date: 2025-04-13
Title: Multi-Context Colocalization Analysis Tool for Molecular QTL and GWAS Studies
Version: 0.1.0
Authors@R: c(
Expand Down Expand Up @@ -28,8 +28,8 @@ Suggests:
testthat (>= 3.0.0),
knitr,
rmarkdown,
susieR,
ashr
ashr,
MASS
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Expand Down
3 changes: 0 additions & 3 deletions R/colocboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#' (default is 0.8) but within the same locus. This step addresses potential instabilities in linkage disequilibrium (LD) estimation
#' that may arise from small sample sizes or discrepancies in minor allele frequencies (MAF) across different confidence sets.
#'
#' @section Input Data:
#' @param X A list of genotype matrices for different outcomes, or a single matrix if all outcomes share the same genotypes.
#' Each matrix should have column names, if sample sizes and variables possibly differing across matrices.
#' @param Y A list of vectors of outcomes or an N by L matrix if it is considered for the same X and multiple outcomes.
Expand All @@ -40,7 +39,6 @@
#' @param effect_se Matrix of standard errors associated with the beta values
#' @param effect_n A scalar or a vector of sample sizes for estimating regression coefficients. Highly recommended!
#'
#' @section Model Parameters
#' @param M The maximum number of gradient boosting rounds. If the number of outcomes are large, it will be automatically increased to a larger number.
#' @param stop_thresh The stop criterion for overall profile loglikelihood function.
#' @param tau The smooth parameter for proximity adaptive smoothing weights for the best update jk-star.
Expand All @@ -64,7 +62,6 @@
#' @param p.adjust.methods The adjusted pvalue method in stats:p.adj when \code{func_multi_test = "fdr"}
#' @param residual_correlation The residual correlation based on the sample overlap, it is diagonal if it is NULL.
#'
#' @section Post Inference Parameters
#' @param coverage A number between 0 and 1 specifying the \dQuote{coverage} of the estimated colocalization confidence sets (CoS) (default is 0.95).
#' @param min_cluster_corr The small correlation for the weights distributions across different iterations to be decided having only one cluster.
#' @param dedup If \code{dedup = TRUE}, the duplicate confidence sets will be removed in the post-processing.
Expand Down
2 changes: 0 additions & 2 deletions R/colocboost_init.R
Original file line number Diff line number Diff line change
Expand Up @@ -571,5 +571,3 @@ get_multiple_correction <- function(z, miss_idx = NULL, func_multi_test = "lfdr"
}

}


77 changes: 70 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,77 @@
# ColocBoost for multi-context colocalization in molecular QTL and GWAS studies
# ColocBoost for multi-trait colocalization in molecular QTL and GWAS studies
[![Codecov test coverage](https://codecov.io/gh/StatFunGen/colocboost/branch/master/graph/badge.svg)](https://codecov.io/gh/StatFunGen/colocboost?branch=master)
[![CRAN Version](https://www.r-pkg.org/badges/version/colocboost)](https://cran.r-project.org/package=colocboost)

This R package implements ColocBoost --- motivated and designed for colocalization analysis ([first formulated here](https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1004383)) of multiple genetic association studies --- as a multi-task learning approach to variable selection regression with highly correlated predictors and sparse effects, based on frequentist statistical inference. It provides statistical evidence to identify which subsets of predictors have non-zero effects on which subsets of response variables.

Temporary usage before our cran or conda release
- clone the repo to your local folder, then
## Installation

### Conda
Install major releases from conda (recommended)

```bash
cd colocboost
R --slave -e "devtools::install()"
conda install -c dnachun r-colocboost
```

### CRAN
Install released versions from cran

```r
install.packages("colocboost")
```

### GitHub
Install the development version from GitHub

```r
devtools::install_github("StatFunGen/colocboost")
```

## Usage

### Single-trait Fine-mapping (FineBoost)
Run FineBoost for single-trait fine-mapping (similar interface to SuSiE)
```r
result <- colocboost(X=X, Y=y)
```

### Multi-trait Colocalization
```r
# Basic multi-trait analysis
result <- colocboost(X=list(X), Y=list(y1, y2, y3))

# Using summary statistics
result <- colocboost(sumstat=list(sumstat1, sumstat2), LD=LD_matrix)

# View colocalization summary
summary <- get_cos_summary(result)

# Visualize results
colocboost_plot(result)

# Filter for stronger colocalization evidence
filtered <- get_strong_colocalization(result, cos_npc_cutoff = 0.5)
```
- To run FineBoost, you need `colocboost(X=X, Y=y)`, where X and y are the same as `susie(X,y)`
- To run ColocBoost we suggest using [this pipeline wrapper](https://github.com/StatFunGen/pecotmr/blob/main/R/colocboost_pipeline.R) to manage multiple data-sets mixing individual level and summary statistics data. The `pecotmr` package can be installed either from source or from our conda package at https://anaconda.org/dnachun/r-pecotmr

For more complex analyses involving multiple datasets mixing individual level and summary statistics data, we recommend using [this pipeline wrapper](https://github.com/StatFunGen/pecotmr/blob/main/R/colocboost_pipeline.R) from the `pecotmr` package. The `pecotmr` package can be installed either from source or from our conda package at https://anaconda.org/dnachun/r-pecotmr.

## Citation

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/)

## Documentation

For detailed documentation, use the R help system:

```r
?colocboost
?colocboost_plot
?get_cos_summary
?get_strong_colocalization
```

## License

This package is released under the MIT License.
12 changes: 0 additions & 12 deletions man/colocboost.Rd

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

Loading
Loading