Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
with:
repo: 'WGLab/ContextSV'
version: 'tags/v0.1.0'
file: 'TestData.zip'
file: 'SampleData.zip'

- name: Unzip assets
shell: bash --login {0}
run: unzip TestData.zip
run: unzip SampleData.zip -d tests

- name: Set up conda (Miniconda only)
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -47,14 +47,22 @@ jobs:
ls -l $CONDA_PREFIX/include/htslib
make CONDA_PREFIX=$CONDA_PREFIX

- name: Run unit tests
- name: Test installation
shell: bash --login {0}
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate contextsv
./build/contextsv --version
./build/contextsv --help

- name: Run tests
shell: bash --login {0}
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate contextsv
mkdir -p output
python -m pytest -s -v

# run: |
# source $(conda info --base)/etc/profile.d/conda.sh
# conda activate contextsv
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use the miniconda container
FROM continuumio/miniconda3:main

# Version argument (set during build)
ARG CONTEXTSV_VERSION

WORKDIR /app

RUN apt-get update
RUN conda update conda

# Install ContextSV
RUN conda config --add channels wglab
RUN conda config --add channels conda-forge
RUN conda config --add channels bioconda
RUN conda create -n contextsv python=3.9
RUN echo "conda activate contextsv" >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]
RUN conda install -n contextsv -c wglab -c conda-forge -c bioconda contextsv=${CONTEXTSV_VERSION} && conda clean -afy

ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "contextsv", "contextsv"]
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ SRC_DIR := $(CURDIR)/src
BUILD_DIR := $(CURDIR)/build
LIB_DIR := $(CURDIR)/lib

# Version header
VERSION := $(shell git describe --tags --always)
VERSION_HEADER := $(INCL_DIR)/version.h
.PHONY: $(VERSION_HEADER)
@echo "#pragma once" > $@
@echo "#define VERSION \"$(VERSION)\"" >> $@

# Conda environment directories
CONDA_PREFIX := $(shell echo $$CONDA_PREFIX)
CONDA_INCL_DIR := $(CONDA_PREFIX)/include
Expand Down Expand Up @@ -50,4 +43,3 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
# Clean the build directory
clean:
rm -rf $(BUILD_DIR)

27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,32 @@ Class documentation is available at <a href="https://wglab.openbioinformatics.or
</p>

## Installation
### Anaconda
First, install [Anaconda](https://www.anaconda.com/).

### Building from source (for testing/development)
Next, create a new environment. This installation has been tested with Python 3.9, Linux 64-bit.

```
conda create -n contextsv python=3.9
conda activate contextsv
```

ContextSV and its dependencies can then be installed using the following command:

```
conda install -c wglab -c conda-forge -c bioconda contextsv
```

### Docker
First, install [Docker](https://docs.docker.com/engine/install/).
Pull the latest image from Docker hub, which contains the latest release and its dependencies.

```
docker pull genomicslab/contextsv
```


## Building from source (for testing/development)
ContextSV requires HTSLib as a dependency that can be installed using [Anaconda](https://www.anaconda.com/). Create an environment
containing HTSLib:

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