Skip to content

Commit 6234855

Browse files
authored
ARG-RHE code release (#51)
- This PR contains the functions used in ARG-RHE experiments. It also contains the genotype mapping, linear association testing and ARG matrix multiplication routines. - Adds CRoaring via FetchContent. - Update to latest macos build agents as in ASMC. - Also adds ASMC py-vers-full/py-vers-pr change in build-wheels.yml to reduce CI load. - Upgrade GitHub actions. - Python code moved into src/arg-needle-lib as recommented in cibuildwheel to avoid copying any source artifacts into wheel. - Some tests marked as conditional on OS due to differences in msprime simulation.
1 parent 24fb981 commit 6234855

31 files changed

Lines changed: 1045 additions & 82 deletions

.github/workflows/build-wheels.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
include:
2323
- os: ubuntu-24.04
2424
arch: x86_64
25-
py-vers: cp39-* cp310-* cp311-* cp312-* cp313-*
25+
py-vers-full: cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*
26+
py-vers-pr: cp311-*
2627
before-all: |
2728
dnf -y install boost-devel eigen3-devel wget
2829
dnf -y install epel-release
@@ -31,28 +32,31 @@ jobs:
3132
mdt: ""
3233
- os: ubuntu-24.04-arm
3334
arch: aarch64
34-
py-vers: cp39-* cp310-* cp311-* cp312-* cp313-*
35+
py-vers-full: cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*
36+
py-vers-pr: cp312-*
3537
before-all: |
3638
dnf -y install boost-devel eigen3-devel wget
3739
dnf -y install epel-release
3840
dnf -y install hdf5-devel
3941
extra-env: ""
4042
mdt: ""
41-
- os: macos-13
43+
- os: macos-15-intel
4244
arch: x86_64
43-
py-vers: cp39-* cp310-* cp311-* cp312-* cp313-*
45+
py-vers-full: cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*
46+
py-vers-pr: cp313-*
4447
before-all: brew install boost eigen hdf5
45-
extra-env: CC="$(brew --prefix llvm@15)/bin/clang" CXX="$(brew --prefix llvm@15)/bin/clang++" HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
46-
mdt: 13
48+
extra-env: CC=clang CXX=clang++
49+
mdt: 15.0
4750
- os: macos-14
4851
arch: arm64
49-
py-vers: cp39-* cp310-* cp311-* cp312-* cp313-*
52+
py-vers-full: cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*
53+
py-vers-pr: cp314-*
5054
before-all: brew install boost eigen hdf5
51-
extra-env: CC="$(brew --prefix llvm@15)/bin/clang" CXX="$(brew --prefix llvm@15)/bin/clang++" HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
52-
mdt: 14
55+
extra-env: CC=clang CXX=clang++
56+
mdt: 14.0
5357

5458
env:
55-
CIBW_BUILD: ${{ matrix.py-vers }}
59+
CIBW_BUILD: ${{ github.event_name != 'pull_request' && matrix.py-vers-full || matrix.py-vers-pr }}
5660
CIBW_SKIP: cp3*-musllinux_*
5761
CIBW_ARCHS: ${{ matrix.arch }}
5862
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
@@ -65,12 +69,12 @@ jobs:
6569
steps:
6670

6771
- name: checkout repo & submodules
68-
uses: actions/checkout@v4
72+
uses: actions/checkout@v5
6973
with:
7074
fetch-depth: 0
7175

7276
- name: Build wheels
73-
uses: pypa/cibuildwheel@v2.22.0
77+
uses: pypa/cibuildwheel@v3.2.0
7478

7579
- uses: actions/upload-artifact@v4
7680
with:
@@ -86,13 +90,13 @@ jobs:
8690

8791
steps:
8892
- name: Download wheels from cloud runners
89-
uses: actions/download-artifact@v4
93+
uses: actions/download-artifact@v5
9094
with:
9195
pattern: wheels-cloud-*
9296
merge-multiple: true
9397
path: wheels
9498

95-
- uses: pypa/gh-action-pypi-publish@v1.12.4
99+
- uses: pypa/gh-action-pypi-publish@v1.13.0
96100
with:
97101
user: __token__
98102
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/sync.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout private repo
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v5
1515
with:
1616
fetch-depth: 0
1717
persist-credentials: false
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: Checkout public repo
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v5
3636
with:
3737
fetch-depth: 0
3838
persist-credentials: false

.github/workflows/tests-examples-macos.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919

2020
- name: checkout repo & submodules
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
2222

2323
- name: install system packages
2424
run: |
@@ -55,3 +55,7 @@ jobs:
5555
- name: run example visit
5656
run: ./example/example_visit
5757
working-directory: build_dir
58+
59+
- name: run example sumstats
60+
run: ./example/example_sumstats
61+
working-directory: build_dir

.github/workflows/tests-examples-ubuntu.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919

2020
- name: checkout repo & submodules
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
2222

2323
- name: install system packages
2424
run: |
@@ -55,3 +55,7 @@ jobs:
5555
- name: run example visit
5656
run: ./example/example_visit
5757
working-directory: build_dir
58+
59+
- name: run example sumstats
60+
run: ./example/example_sumstats
61+
working-directory: build_dir

.github/workflows/tests-python.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
steps:
2222

2323
- name: checkout repo
24-
uses: actions/checkout@v4
25-
24+
uses: actions/checkout@v5
25+
2626
- name: set up Python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,6 @@ cython_debug/
193193
.idea/
194194

195195
cmake-build*/
196+
197+
# VSCode
198+
.vscode/

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ if (PYTHON_BINDINGS)
5353
pybind11
5454
GIT_REPOSITORY https://github.com/pybind/pybind11
5555
GIT_TAG 7c33cdc2d39c7b99a122579f53bc94c8eb3332ff # Version 2.13.5
56+
5657
)
5758
FetchContent_GetProperties(pybind11)
5859
if (NOT pybind11_POPULATED)
@@ -61,6 +62,26 @@ if (PYTHON_BINDINGS)
6162
endif ()
6263
endif ()
6364
65+
include(FetchContent)
66+
FetchContent_Declare(
67+
roaring
68+
GIT_REPOSITORY https://github.com/RoaringBitmap/CRoaring.git
69+
GIT_TAG v4.4.2
70+
GIT_SHALLOW TRUE
71+
)
72+
73+
set(ENABLE_ROARING_TESTS OFF CACHE INTERNAL "")
74+
set(ROARING_BUILD_STATIC ON CACHE INTERNAL "")
75+
set(ROARING_BUILD_LTO OFF CACHE INTERNAL "")
76+
FetchContent_GetProperties(roaring)
77+
78+
# Use FetchContent_Populate and add_subdirectory instead of FetchContent_MakeAvailable
79+
# to avoid copying roaring include headers and other install files into built wheel.
80+
FetchContent_Populate(roaring)
81+
add_subdirectory(${roaring_SOURCE_DIR} ${roaring_BINARY_DIR} EXCLUDE_FROM_ALL)
82+
target_compile_options(roaring PRIVATE -Wno-deprecated-declarations)
83+
set_target_properties(roaring PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
84+
6485
add_subdirectory(src)
6586
add_subdirectory(example)
6687

PyPI_README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
This repository contains arg-needle-lib, which implements an ARG data structure and ARG-based analyses such as genealogy-wide association.
44

5+
Prebuilt CPython wheels are available for Linux (compatible with glibc ≥ 2.28) and macOS (built on macOS 15 for x86_64 and macOS 14 for arm64).
6+
7+
| Platform \ CPython | ≤3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 |
8+
|-----------------------------| ---- | --- | ---- | ---- | ---- | ---- | ---- |
9+
| Linux x86_64 ||||||||
10+
| Linux aarch64 ||||||||
11+
| macOS Intel (x86_64) ||||||||
12+
| macOS Apple Silicon (arm64) ||||||||
13+
514
## Quickstart
615

716
### Install the Python module from PyPI

arg_needle_lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ target_link_libraries(example_node PRIVATE arg_needle_lib)
2727

2828
add_executable(example_visit example_visit.cpp)
2929
target_link_libraries(example_visit PRIVATE arg_needle_lib)
30+
31+
add_executable(example_sumstats example_sumstats.cpp)
32+
target_link_libraries(example_sumstats PRIVATE arg_needle_lib)

0 commit comments

Comments
 (0)