Skip to content

Commit fbc62f9

Browse files
authored
Manuscript update (#17)
* unit tests with sample data * update readme with conda and docker installation * fix error with singleton clusters
1 parent a723bc9 commit fbc62f9

26 files changed

+285
-784
lines changed

.github/workflows/build-tests.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
with:
1818
repo: 'WGLab/ContextSV'
1919
version: 'tags/v0.1.0'
20-
file: 'TestData.zip'
20+
file: 'SampleData.zip'
2121

2222
- name: Unzip assets
2323
shell: bash --login {0}
24-
run: unzip TestData.zip
24+
run: unzip SampleData.zip -d tests
2525

2626
- name: Set up conda (Miniconda only)
2727
uses: conda-incubator/setup-miniconda@v2
@@ -47,14 +47,22 @@ jobs:
4747
ls -l $CONDA_PREFIX/include/htslib
4848
make CONDA_PREFIX=$CONDA_PREFIX
4949
50-
- name: Run unit tests
50+
- name: Test installation
5151
shell: bash --login {0}
5252
run: |
5353
source $(conda info --base)/etc/profile.d/conda.sh
5454
conda activate contextsv
5555
./build/contextsv --version
5656
./build/contextsv --help
5757
58+
- name: Run tests
59+
shell: bash --login {0}
60+
run: |
61+
source $(conda info --base)/etc/profile.d/conda.sh
62+
conda activate contextsv
63+
mkdir -p output
64+
python -m pytest -s -v
65+
5866
# run: |
5967
# source $(conda info --base)/etc/profile.d/conda.sh
6068
# conda activate contextsv

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Use the miniconda container
2+
FROM continuumio/miniconda3:main
3+
4+
# Version argument (set during build)
5+
ARG CONTEXTSV_VERSION
6+
7+
WORKDIR /app
8+
9+
RUN apt-get update
10+
RUN conda update conda
11+
12+
# Install ContextSV
13+
RUN conda config --add channels wglab
14+
RUN conda config --add channels conda-forge
15+
RUN conda config --add channels bioconda
16+
RUN conda create -n contextsv python=3.9
17+
RUN echo "conda activate contextsv" >> ~/.bashrc
18+
SHELL ["/bin/bash", "--login", "-c"]
19+
RUN conda install -n contextsv -c wglab -c conda-forge -c bioconda contextsv=${CONTEXTSV_VERSION} && conda clean -afy
20+
21+
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "contextsv", "contextsv"]

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ SRC_DIR := $(CURDIR)/src
44
BUILD_DIR := $(CURDIR)/build
55
LIB_DIR := $(CURDIR)/lib
66

7-
# Version header
8-
VERSION := $(shell git describe --tags --always)
9-
VERSION_HEADER := $(INCL_DIR)/version.h
10-
.PHONY: $(VERSION_HEADER)
11-
@echo "#pragma once" > $@
12-
@echo "#define VERSION \"$(VERSION)\"" >> $@
13-
147
# Conda environment directories
158
CONDA_PREFIX := $(shell echo $$CONDA_PREFIX)
169
CONDA_INCL_DIR := $(CONDA_PREFIX)/include
@@ -50,4 +43,3 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
5043
# Clean the build directory
5144
clean:
5245
rm -rf $(BUILD_DIR)
53-

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,32 @@ Class documentation is available at <a href="https://wglab.openbioinformatics.or
1313
</p>
1414

1515
## Installation
16+
### Anaconda
17+
First, install [Anaconda](https://www.anaconda.com/).
1618

17-
### Building from source (for testing/development)
19+
Next, create a new environment. This installation has been tested with Python 3.9, Linux 64-bit.
20+
21+
```
22+
conda create -n contextsv python=3.9
23+
conda activate contextsv
24+
```
25+
26+
ContextSV and its dependencies can then be installed using the following command:
27+
28+
```
29+
conda install -c wglab -c conda-forge -c bioconda contextsv
30+
```
31+
32+
### Docker
33+
First, install [Docker](https://docs.docker.com/engine/install/).
34+
Pull the latest image from Docker hub, which contains the latest release and its dependencies.
35+
36+
```
37+
docker pull genomicslab/contextsv
38+
```
39+
40+
41+
## Building from source (for testing/development)
1842
ContextSV requires HTSLib as a dependency that can be installed using [Anaconda](https://www.anaconda.com/). Create an environment
1943
containing HTSLib:
2044

@@ -42,7 +66,6 @@ Options:
4266
-s, --snp <vcf_file> SNPs VCF file (required)
4367
-o, --outdir <output_dir> Output directory (required)
4468
-c, --chr <chromosome> Chromosome
45-
-r, --region <region> Region (start-end)
4669
-t, --threads <thread_count> Number of threads
4770
-h, --hmm <hmm_file> HMM file
4871
-n, --sample-size <size> Sample size for HMM predictions

0 commit comments

Comments
 (0)