Unverified Commit 1497c0be authored by van den Berg's avatar van den Berg Committed by GitHub
Browse files

Merge pull request #8 from LUMC/testing

Add github workflow testing
parents ab72c170 6cfcec38
### Checklist
- [ ] Pull request details were added to CHANGELOG.md.
- [ ] New tests have been added to the matrix section of the
.github/workflows/ci.yml file.
name: Continuous Integration
on: [push, pull_request]
defaults:
run:
# This is needed for miniconda, see:
# https://github.com/marketplace/actions/setup-miniconda#important.
shell: bash -l {0}
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
test:
- sanity-snakemake
- sanity-snakemake-lint
- sanity-singularity
- sanity-no-reference
- sanity-reference-does-not-exist
- sanity-baits-only
- sanity-targets-only
- sanity-samples-overlapping-name
- sanity-multisample
- dry-run-vanilla
- dry-run-target-baits
- dry-run-bed-coverage
- dry-run-multisample
- integration-vanilla
- integration-small-scatter
- integration-refflat
- integration-all-on-target
- integration-gene-bedfile
- integration-two-known-sites
- integration-two-readgroups
- integration-two-samples
- integration-target-baits
- integration-bed-coverage
- integration-restrict-BQSR
- integration-targets-only
- integration-multisample
steps:
- uses: actions/checkout@v2
- name: Install singularity
uses: eWaterCycle/setup-singularity@v6
with:
singularity-version: 3.6.4
- name: Cache conda environment
uses: actions/cache@v2
env:
cache-name: cache-conda-environment
# Increase this value to reset the cache without changing
# environment.yml
cache-number: 0
with:
path: ~/conda_pkgs_dir
key: build-${{ env.cache-name }}-${{ env.cache-number }}-${{ hashFiles('environment.yml') }}
- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2.0.1
# https://github.com/conda-incubator/setup-miniconda.
# https://github.com/marketplace/actions/setup-miniconda
with:
activate-environment: hutspot
environment-file: environment.yml
auto-activate-base: false
use-only-tar-bz2: true
- name: Run test in conda evironment
# Use --symlink to limit disk usage.
run: >-
pytest --keep-workflow-wd-on-fail --tag ${{ matrix.test }} tests/
- name: Check pipeline stderr messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp/pytest_workflow_* -name log.err); do
echo $file; cat $file
done
'
- name: Check pipeline stdout messages in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp/pytest_workflow_* -name log.out); do
echo $file; cat $file
done
'
- name: Check all job log files in case of failure
if: ${{ failure() }}
run: >-
bash -c '
for file in $(find /tmp/pytest_workflow_*/${{ matrix.test}}/log/ -type f); do
echo $file; cat $file
done
'
Changelog
==========
<!--
Newest changes should be on top.
This document is user facing. Please word the changes in such a way
that users understand how the changes affect the new version.
-->
v2.0.1
---------------------------
+ Switch to using chunked-scatter
v2.0.0
---------------------------
+ Add an environment.yml file for conda.
+ Greatly simplified the snakemake workflow.
+ All statistics are now calculated using existing tools.
+ Add option `multisample_vcf` to enable joint variantcalling.
......@@ -24,25 +24,14 @@ conda environments are no long available.
# Installation
To run this pipeline you will need the following at minimum:
* python 3.6
* snakemake 5.2.0 or newer
This repository contains a [conda](https://conda.io/docs/)
environment file that you can use to install all minimum dependencies in a
environment file that you can use to install all dependencies in a
conda environment:
```bash
conda env create -f environment.yml
```
Alternatively, you can set up a python virtualenv and run
```bash
pip install -r requirements.txt
```
## Singularity
We highly recommend the user of the containerized rules through
......
......@@ -179,7 +179,7 @@ rule baserecal:
checkpoint scatterregions:
"""Scatter the reference genome"""
input:
ref = config["reference"],
ref = config["reference"] + '.fai',
output:
directory("scatter")
params:
......@@ -187,14 +187,16 @@ checkpoint scatterregions:
log:
"log/scatterregions.log"
container:
containers["biopet-scatterregions"]
containers["chunked-scatter"]
resources:
mem_mb = lambda wildcards, attempt: attempt * 10000
shell:
"mkdir -p {output} && "
"biopet-scatterregions -Xmx24G "
"--referenceFasta {input.ref} --scatterSize {params.size} "
"--outputDir scatter 2> {log}"
"scatter-regions "
"--scatter-size {params.size} "
"--split-contigs "
"--prefix {output}/scatter- "
"{input.ref} 2> {log}"
rule gvcf_scatter:
"""Run HaplotypeCaller in GVCF mode by chunk"""
......
......@@ -6,8 +6,8 @@ import os
containers = {
'bcftools': 'docker://quay.io/biocontainers/bcftools:1.9--ha228f0b_4',
'bedtools-2.26-python-2.7': 'docker://quay.io/biocontainers/mulled-v2-3251e6c49d800268f0bc575f28045ab4e69475a6:4ce073b219b6dabb79d154762a9b67728c357edb-0',
'biopet-scatterregions': 'docker://quay.io/biocontainers/biopet-scatterregions:0.2--0',
'bwa-0.7.17-samtools-1.10': 'docker://quay.io/biocontainers/mulled-v2-ad317f19f5881324e963f6a6d464d696a2825ab6:c59b7a73c87a9fe81737d5d628e10a3b5807f453-0',
'chunked-scatter': 'docker://quay.io/biocontainers/chunked-scatter:1.0.0--py_0',
'cutadapt': 'docker://quay.io/biocontainers/cutadapt:2.9--py37h516909a_0',
'debian': 'docker://debian:buster-slim',
'fastqc': 'docker://quay.io/biocontainers/fastqc:0.11.7--4',
......
# This file may be used to create an environment using:
# $ conda env create --file environment.yml
# platform: linux-64
name: hutspot
channels:
- bioconda
- conda-forge
dependencies:
- pytest-workflow>=1.4.0
- snakemake-minimal
- boto3
- smart_open
pytest
pytest-workflow>=1.4.0
......@@ -71,14 +71,14 @@
- 'chrM\t263\t.\tA\tG\t323.*GT:AD:DP:GQ:PL\t1/1:0,108:108:99:3267,323,0'
- 'chrM\t4745\t.\tA\tG\t56.*GT:AD:DP:GQ:PGT:PID:PL\t1/1:1,134:135:99:1|1:4745_A_G:5718,407,0'
- 'chrM\t4769\t.\tA\tG\t5182.*GT:AD:DP:GQ:PGT:PID:PL\t1/1:1,120:121:99:1|1:4745_A_G:5211,363,0'
- 'chrM\t16023\t.\tG\tA\t1906.*GT:AD:DP:GQ:PL\t0/1:74,74:148:99:1935,0,1903'
- 'chrM\t16023\t.\tG\tA\t.*GT:AD:DP:GQ:PL\t0/1:75,74:'
- path: micro/vcf/micro.g.vcf.gz
contains:
- "chrM\t1\t.\tG\t<NON_REF>\t.\t.\tEND=151\tGT:DP:GQ:MIN_DP:PL\t0/0:164:99:137:0,120,1800"
- "chrM\t16560\t.\tC\t<NON_REF>\t.\t.\tEND=16569\tGT:DP:GQ:MIN_DP:PL\t0/0:195:0:187:0,0,0"
contains_regex:
- 'chrM\t152\t.\tT\tC,<NON_REF>\t3960.*GT:AD:DP:GQ:PL:SB\t1/1:0,130,0:130:99:3989,388,0,3989,388,3989:0,0,47,83'
- 'chrM\t16023\t.\tG\tA,<NON_REF>\t1906.*GT:AD:DP:GQ:PL:SB\t0/1:74,74,0:148:99:1935,0,1903,2157,2123,4280:36,38,37,37'
- 'chrM\t16023\t.\tG\tA,<NON_REF>\t.*GT:AD:DP:GQ:PL:SB\t0/1:75,74,0:'
- path: micro/vcf/micro.g.vcf.gz.tbi
- path: micro/vcf/micro.0.vcf.gz
should_exist: false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment