@@ -13,10 +13,23 @@ Template Repo Combines:
1313- GitHub Actions for CI, Docker/Conda release, styling, and documentation
1414
1515
16- ## [ TODO] How to use this template
16+ ## How to use this template
17+ - Use this repo [ as a template] ( https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template ) .
18+ - Replace all occurrences of "Aligncount" with the name of your project in the relevant CMakeLists.txt under ` cpp/ ` .
19+ - Capitalization matters here: ` Aligncount ` means the name of the project, while ` aligncount ` is used in file names.
20+ - Remember to rename the ` include/aligncount ` directory to use your project's lowercase name and update all relevant ` #include ` s accordingly.
21+ - Replace instances of ALIGNCOUNT_VERSION with ` [YOUR_PROJECT_NAME]_VERSION `
22+ - Set the name of the C++ executable (e.g. aligncount_cpp) to your liking in ` cpp/standalone/CMakeLists.txt `
23+ - Replace the source files with your own
24+ - Set GitHub action secrets for:
25+ - ANACONDA_TOKEN
26+ - ANACONDA_USER
27+ - DOCKERHUB_TOKEN
28+ - DOCKERHUB_USERNAME
29+ - CODECOV_TOKEN (if making code coverage reports for the C++ tool)
1730
1831---
19- ## Tool Descriptions
32+ ## Example Tool Descriptions
2033### Python Wrapper (aligncount)
2134- Source: cli/entrypoint.py
2235- Entry point: aligncount console script (configured in setup.py)
@@ -26,11 +39,12 @@ Template Repo Combines:
2639 - Calls ` aligncount_cpp -a <path> ` and writes to count stdout
2740### C++ Executable (aligncount_cpp)
2841- Source: cpp/standalone/source/main.cpp
42+ - Statically links HTSlib
2943- Build system: CMake (CMakeLists.txt)
3044- Functionality: Counts the number of SAM records
3145---
3246## Installation
33- ### Build and install the Python Wrapper and the C++ tool
47+ ### Build and install the C++ tool and the Python Wrapper
3448To install in a virtualenv while at repo root:
3549
3650 python3 -m venv venv
@@ -55,6 +69,18 @@ install the Python Wrapper by itself do (does not install aligncount_cpp):
5569 cd cli
5670 pip install .
5771
72+ ### Manually build the C++ tool aligncount_cpp
73+ To build manually while at repo root:
74+
75+ mkdir build
76+ cd build
77+ cmake ../cpp/standalone -DCMAKE_BUILD_TYPE=Release
78+ cmake --build .
79+
80+ Now you have aligncount_cpp available in the build folder. Run the tool to counts SAM records:
81+
82+ ./aligncount_cpp -a sample.sam
83+
5884### Dockerfile
5985A multi-stage Dockerfile builds and tests everything, then produces a minimal runtime image:
60861 . Builder stage:
@@ -74,20 +100,6 @@ Build and test in one command:
74100Run:
75101
76102 docker run --rm aligncount:latest --help
77-
78-
79- ### Manually build the C++ tool aligncount_cpp
80- To build manually while at repo root:
81-
82- mkdir build
83- cd build
84- cmake ../cpp/standalone -DCMAKE_BUILD_TYPE=Release
85- cmake --build .
86-
87- Now you have aligncount_cpp available in the build folder. Run the tool to counts SAM records:
88-
89- ./aligncount -a sample.sam
90-
91103---
92104## Unit Tests
93105
@@ -118,27 +130,8 @@ The export command is required if the wrapper is not installed.
118130- ` .github/workflows/cpp_install.yml ` Builds, installs, and tests the C++ tool on ubuntu.
119131- ` .github/workflows/cpp_macos.yml ` Builds and tests the C++ tool on MacOS.
120132- ` .github/workflows/cpp_standalone.yml ` Builds the C++ tool on ubuntu.
121- - ` .github/workflows/cpp_ubuntu.yml ` Tests the C++ tool on ubuntu.
133+ - ` .github/workflows/cpp_ubuntu.yml ` Tests and creates codecov reports for the C++ tool on ubuntu.
122134- ` .github/workflows/cpp_style.yml ` Checks C++ and CMake source style.
123- ---
124- ### .github/workflows/docker_release.yml
125-
126- This workflow is triggered whenever a new tag for the repo is released. It builds the docker image for linux/amd64
127- and publishes it to the docker hub registry.
128-
129- The workflow assumes your docker hub username and token are stored as repository secrets under ` DOCKERHUB_USERNAME `
130- and ` DOCKERHUB_TOKEN ` .
131-
132- ### .github/workflows/conda_release.yml
133-
134- This workflow is triggered whenever a new tag for the repo is released. It uses the conda-build recipe to create and
135- publish conda packages to your personal conda channel. The workflow builds conda packages for linux and mac platforms
136- running on x86 and arm architecture. The workflow publishes the conda package under the repo name,
137- e.g. cpp-python-tool-template.
138-
139- The workflow assumes your anaconda username and token are stored as repository secrets under ` ANACONDA_USER `
140- and ` ANACONDA_TOKEN ` .
141-
142135---
143136## Conda-Build Recipe
144137
@@ -155,6 +148,17 @@ REPO_HOME # URL to the repo home, e.g. https://github.com/user/foo
155148```
156149---
157150## Miscellaneous Notes
151+ ### Template Sources
152+ - The development files for the C++ executable (under ` cpp/ ` ) were adapted from
153+ [ ModernCppStarter] ( https://github.com/TheLartians/ModernCppStarter ) after adding HTSlib support in
154+ a slim fork [ htslib-cpp-starter] ( https://github.com/vr1087/htslib-cpp-starter ) . The contents of htslib-cpp-starter
155+ were added to this repo under ` cpp/ ` via ` git subtree ` and further adapted.
156+ - The implementation pattern for HTSlib support was adapted from Yang Li’s blog post:
157+ [ Building Cpp Development in Bioinformatics] ( https://yangli.hashnode.dev/building-cpp-development-in-bioinformatics )
158+ ### Conda Release
159+ The conda release workflow publishes to your personal anacanda account. The workflow uses the repository name to name
160+ the conda package, which would equate to ` cpp-python-tool-template ` for this repo. Additionally, the workflow
161+ creates a conda package for the following platforms: linux-64, linux-aarch64, osx-64, and osx-arm64.
158162
159163---
160164## What’s Next
0 commit comments