-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from mrc-ide/develop
First draft of Tapestry including a basic IBD model and inference via PT-MCMC.
- Loading branch information
Showing
429 changed files
with
169,807 additions
and
323 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build-Test | ||
on: [push, pull_request] | ||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Tapestry | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout HTSlib | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true # HTSlib uses 'htscodecs' as a submodule | ||
repository: samtools/htslib | ||
path: htslib | ||
|
||
- name: Build and install HTSlib | ||
run: | | ||
cd htslib | ||
autoreconf -i | ||
./configure --prefix ${{github.workspace}}/htslib | ||
make | ||
make install | ||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -DHTSLIB_DIR=${{ github.workspace }}/htslib | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest -C ${{env.BUILD_TYPE}} -VV | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata | ||
ignore/ | ||
# macOS | ||
.DS_Store | ||
|
||
# VSCode | ||
.vscode | ||
|
||
# Compilation | ||
release/ | ||
build/ | ||
!build/cmake/modules/* | ||
|
||
# Python | ||
__pycache__ | ||
notebooks | ||
*.ipynb | ||
*.ipynb_checkpoints | ||
*.egg | ||
*.egg-info | ||
|
||
# Run outputs | ||
results | ||
|
||
# Personal | ||
src/dev* | ||
dev* | ||
images/*.ai | ||
TODO.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# ================================================================================ | ||
# Project Informationn | ||
# | ||
# =============================================================================== | ||
|
||
cmake_minimum_required(VERSION 3.14) | ||
project(apropos VERSION 0.0 | ||
DESCRIPTION "Tapestry: Inference from complex P.f. infections" | ||
LANGUAGES CXX | ||
) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/cmake/modules/") | ||
|
||
# Compilation flags | ||
set(COMPILE_TESTS ON) | ||
|
||
|
||
# ================================================================================ | ||
# Use C++17 | ||
# | ||
# ================================================================================ | ||
|
||
set(CMAKE_CXX_STANDARD 17) # required for <filesystem> | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# ================================================================================ | ||
# Install GoogleTest | ||
# | ||
# ================================================================================ | ||
|
||
if (COMPILE_TESTS) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip | ||
) | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
endif() | ||
|
||
# ================================================================================ | ||
# Compile `tapestry` | ||
# | ||
# ================================================================================ | ||
|
||
# Target executable | ||
set(TARGET tapestry) | ||
|
||
# Source files | ||
set(SOURCES | ||
src/bed.cpp | ||
src/betabin.cpp | ||
src/combinatorics.cpp | ||
src/data.cpp | ||
src/ibd.cpp | ||
src/io.cpp | ||
src/mcmcs.cpp | ||
src/model_compare.cpp | ||
src/model_fitting.cpp | ||
src/models.cpp | ||
src/parameters.cpp | ||
src/particle_writers.cpp | ||
src/particles.cpp | ||
src/proposals.cpp | ||
src/sampling.cpp | ||
src/vcf.cpp | ||
) | ||
|
||
# Add the executable | ||
add_executable(${TARGET} src/main.cpp ${SOURCES}) | ||
|
||
# -------------------------------------------------------------------------------- | ||
# Link htslib | ||
# -------------------------------------------------------------------------------- | ||
|
||
# Define htslib_FOUND, htslib_INCLUDE_DIRS, htslib_LIBRARIES | ||
find_package(HTSlib 1.4 REQUIRED) | ||
|
||
# Link include directories and library to the executable | ||
target_include_directories(${TARGET} PUBLIC ${HTSlib_INCLUDE_DIRS}) | ||
target_link_libraries(${TARGET} PUBLIC ${HTSlib_LIBRARIES}) | ||
|
||
|
||
# ================================================================================ | ||
# Compile tests | ||
# | ||
# ================================================================================ | ||
|
||
if (COMPILE_TESTS) | ||
enable_testing() | ||
set(TSOURCES | ||
tests/test_combinatorics.cpp | ||
tests/test_particle.cpp | ||
tests/test_random.cpp | ||
) | ||
add_executable(test_tapestry ${TSOURCES} ${SOURCES}) | ||
|
||
target_include_directories(test_tapestry PUBLIC ${HTSlib_INCLUDE_DIRS}) | ||
target_link_libraries(test_tapestry GTest::gtest_main ${HTSlib_LIBRARIES}) | ||
|
||
include(GoogleTest) | ||
gtest_discover_tests(test_tapestry) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
Package: Tapestry | ||
Type: Package | ||
Title: Software for deconvoluting unphased polyclonal genotypes | ||
Version: 0.1.0 | ||
Authors@R: as.person(c( | ||
"Jason Hendry <[email protected]> [aut, cre]", | ||
"Bob Verity <[email protected]> [aut]" | ||
)) | ||
Description: Malaria infections often contain multiple genotypes. When | ||
sequenced together, these produce a complex signal that is a mixture of the | ||
individual genotypes. Like earlier programs like DEploid, Tapestry | ||
attempts to pull these individual genotypes apart by exploiting allele | ||
frequency imbalances within a sample. The difference in Tapestry is that we | ||
assume a model of allele frequencies rather than a reference panel. We also | ||
implement parallel tempered MCMC to ensure good mixing, and produce a | ||
different set of outputs. | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.1.1 | ||
LinkingTo: | ||
Rcpp | ||
Imports: | ||
Rcpp | ||
SystemRequirements: C++11 | ||
BugReports: https://github.com/mrc-ide/tapestry/issues | ||
Package: Tapestry | ||
Type: Package | ||
Title: Software for deconvoluting unphased polyclonal genotypes | ||
Version: 0.1.0 | ||
Authors@R: as.person(c( | ||
"Jason Hendry <[email protected]> [aut, cre]", | ||
"Bob Verity <[email protected]> [aut]" | ||
)) | ||
Description: Malaria infections often contain multiple genotypes, and when | ||
sequenced together these produce a complex signal that is a mixture of the | ||
individual genotypes. Building on the framework of earlier programs like | ||
DEploid and DEploidIBD, Tapestry attempts to pull these individual genotypes | ||
apart by exploiting allele frequency imbalances within a sample, while | ||
simultaneously estimating segments of identity by descent (IBD) between | ||
sequences. Unlike previous programs, Tapestry uses advanced MCMC methods to | ||
ensure that results are robust even for high complexity of infection (COI). | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
SystemRequirements: C++17 | ||
BugReports: https://github.com/mrc-ide/tapestry/issues |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.