Skip to content

Commit 915a49a

Browse files
authored
Add CI, update README (#7)
* Set up CI with Azure Pipelines [skip ci] * Add ntroot --reads test * Activate conda env for compilation and test run * Add btllib to CI, dependencies * Ensure submodules checked out * Fix to mamba command * Add compilers to install * Add boost as dependency * Add ntCard dependency * Add ntHits dependency * Correction to demo script * Add genome test * Add genome demo file * Correction to run_ntroot_demo.sh * Add macOS tests * Add demo section to README
1 parent fbac2cc commit 915a49a

6 files changed

Lines changed: 125 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ ntRoot and all required scripts will be installed to: /path/to/install/directory
2525
- [meson](https://mesonbuild.com/)
2626
- [ninja](https://ninja-build.org/)
2727
- [snakemake](https://snakemake.readthedocs.io/en/stable/)
28+
- [btllib](https://github.com/bcgsc/btllib)
29+
- [boost](https://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html)
30+
- [ntCard](https://github.com/bcgsc/ntCard)
31+
- [ntHits](https://github.com/bcgsc/ntHits)
2832

2933
## Usage
3034
```
@@ -54,3 +58,11 @@ optional arguments:
5458
Note: please specify --reads OR --genome (not both)
5559
If you have any questions about ntRoot, please open an issue at https://github.com/bcgsc/ntRoot
5660
```
61+
62+
## ntRoot demo
63+
To test your installation:
64+
```
65+
cd demo
66+
./run_ntroot_demo.sh
67+
```
68+
Ensure that the ntRoot installation is available on your PATH.

azure-pipelines.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# See https://docs.microsoft.com/azure/devops/pipelines/languages/python
2+
3+
jobs:
4+
- job:
5+
displayName: ubuntu-latest
6+
pool:
7+
vmImage: 'ubuntu-latest'
8+
9+
steps:
10+
- checkout: self
11+
persistCredentials: true
12+
submodules: true
13+
14+
- script: echo "##vso[task.prependpath]$CONDA/bin"
15+
displayName: Add conda to PATH
16+
17+
- script: conda create --yes --quiet --name ntroot_CI
18+
displayName: Create Anaconda environment
19+
- script: |
20+
source activate ntroot_CI
21+
conda install --yes --name ntroot_CI -c conda-forge -c bioconda python=3.9 mamba
22+
mamba install --yes -c conda-forge -c bioconda meson ninja snakemake perl btllib compilers boost-cpp ntcard nthits
23+
displayName: Install Conda packages
24+
25+
- script: |
26+
source activate ntroot_CI
27+
meson setup build --prefix=$(pwd)/test_build
28+
cd build
29+
ninja install
30+
displayName: Compile ntRoot
31+
32+
- script: |
33+
source activate ntroot_CI
34+
export PATH=$(pwd)/test_build/bin:$PATH
35+
which ntroot
36+
cd demo
37+
./run_ntroot_demo.sh
38+
displayName: Run ntRoot test
39+
40+
- job:
41+
displayName: macOS-latest
42+
pool:
43+
vmImage: 'macOS-latest'
44+
45+
steps:
46+
- checkout: self
47+
persistCredentials: true
48+
submodules: true
49+
50+
- script: echo "##vso[task.prependpath]$CONDA/bin"
51+
displayName: Add conda to PATH
52+
53+
- script: conda create --yes --quiet --name ntroot_CI
54+
displayName: Create Anaconda environment
55+
- script: |
56+
source activate ntroot_CI
57+
conda install --yes --name ntroot_CI -c conda-forge -c bioconda python=3.9 mamba
58+
mamba install --yes -c conda-forge -c bioconda meson ninja snakemake perl btllib compilers boost-cpp ntcard nthits
59+
displayName: Install Conda packages
60+
61+
- script: |
62+
source activate ntroot_CI
63+
meson setup build --prefix=$(pwd)/test_build
64+
cd build
65+
ninja install
66+
displayName: Compile ntRoot
67+
68+
- script: |
69+
source activate ntroot_CI
70+
export PATH=$(pwd)/test_build/bin:$PATH
71+
which ntroot
72+
cd demo
73+
./run_ntroot_demo.sh
74+
displayName: Run ntRoot test

demo/HuRef.chr21.fa

Lines changed: 2 additions & 0 deletions
Large diffs are not rendered by default.

demo/chr21.fa

Lines changed: 2 additions & 0 deletions
Large diffs are not rendered by default.

demo/pop-spec-snp_chr21.vcf.gz

9.82 MB
Binary file not shown.

demo/run_ntroot_demo.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
echo "Running ntRoot demo..."
4+
echo "Please ensure that ntRoot is on your PATH"
5+
6+
set -eux -o pipefail
7+
8+
echo "Running ntRoot reads demo..."
9+
wget https://www.bcgsc.ca/downloads/btl/ntroot/reads_demo/ERR3239334.chr21_1.fq.gz
10+
wget https://www.bcgsc.ca/downloads/btl/ntroot/reads_demo/ERR3239334.chr21_2.fq.gz
11+
12+
ntroot --draft chr21.fa --reads ERR3239334.chr21_ -k 55 -l pop-spec-snp_chr21.vcf.gz
13+
14+
prediction=$(cat ERR3239334.chr21__ntedit_k55_variants.vcf_ancestry-predictions_tile5000000.tsv | awk '{print $1}' |head -n 2 |tail -n 1)
15+
16+
if [ ${prediction} == "EUR" ]; then
17+
echo "ntRoot reads test successful!"
18+
else
19+
echo "ntRoot reads test failed.. Please check your installation."
20+
exit 1
21+
fi
22+
23+
echo "Running ntRoot genome demo..."
24+
25+
ntroot --draft chr21.fa --genome HuRef.chr21.fa -k 55 -l pop-spec-snp_chr21.vcf.gz
26+
27+
prediction=$(cat HuRef.chr21_ntedit_k55_variants.vcf_ancestry-predictions_tile5000000.tsv | awk '{print $1}' |head -n 2 |tail -n 1)
28+
if [ ${prediction} == "EUR" ]; then
29+
echo "ntRoot genome test successful!"
30+
else
31+
echo "ntRoot genome test failed.. Please check your installation."
32+
exit 1
33+
fi
34+
35+
echo "Done ntRoot tests!"

0 commit comments

Comments
 (0)