Skip to content

Commit

Permalink
Merge pull request #15 from PMCC-BioinformaticsCore/tests/wgsgermline…
Browse files Browse the repository at this point in the history
…gatk

Tests/wgsgermlinegatk
  • Loading branch information
junyk authored Mar 31, 2021
2 parents c1aeec7 + 326fef8 commit 5d5c01e
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 47 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload Python Package

on:
push:
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -e .[ci]
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
22 changes: 22 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Unit Tests

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- uses: codecov/codecov-action@v1
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ repos:
rev: stable
hooks:
- id: black
language_version: python3.7
#- repo: local
# hooks:
# - id: nosetests
# name: nosetests
# entry: sh -ec 'nosetests -w janis'
# language: system
- repo: local
hooks:
- id: nosetests
name: nosetests
entry: sh -ec 'nosetests -w janis_pipelines'
language: system
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion janis_pipelines/__meta__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "v0.11.0"
__version__ = "v0.11.1"
description = "Bioinformatics tools for Janis; the Pipeline creation helper"
30 changes: 16 additions & 14 deletions janis_pipelines/wgs_germline/wgsgermline.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,35 +110,37 @@ def bind_metadata(self):

def tests(self) -> Optional[List[TTestCase]]:
bioinf_base = "https://swift.rc.nectar.org.au/v1/AUTH_4df6e734a509497692be237549bbe9af/janis-test-data/bioinformatics"
chr17 = f"{bioinf_base}/petermac_testdata"
hg38 = f"{bioinf_base}/hg38"

return [
TTestCase(
name="brca1",
input={
"sample_name": "NA12878",
"reference": f"{hg38}/reference/Homo_sapiens_assembly38.fasta",
"reference": f"{chr17}/Homo_sapiens_assembly38.chr17.fasta",
"fastqs": [
[
f"{bioinf_base}/BRCA1_R1.fastq.gz",
f"{bioinf_base}/BRCA1_R2.fastq.gz",
f"{chr17}/NA12878-BRCA1_R1.fastq.gz",
f"{chr17}/NA12878-BRCA1_R2.fastq.gz",
]
],
"gatk_intervals": [f"{hg38}/NA12878/BRCA1.bed"],
"gatk_intervals": [f"{chr17}/BRCA1.hg38.bed"],
"vardict_intervals": [f"{hg38}/NA12878/BRCA1.intersect.bed"],
"strelka_intervals": f"{hg38}/hg38.bed.gz",
"known_indels": f"{hg38}/known_indels/Homo_sapiens_assembly38.known_indels.vcf.gz",
"mills_indels": f"{hg38}/mills_indels/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz",
"snps_1000gp": f"{hg38}/snps_1000GP/1000G_phase1.snps.high_confidence.hg38.vcf.gz",
"snps_dbsnp": f"{hg38}/snps_dbsnp/Homo_sapiens_assembly38.dbsnp138.vcf.gz",
"cutadapt_adapters": "https://raw.githubusercontent.com/csf-ngs/fastqc/master/Contaminants/contaminant_list.txt",
"gridss_blacklist": f"{hg38}/NA12878/BRCA1.bed",
"strelka_intervals": f"{chr17}/BRCA1.hg38.bed.gz",
"known_indels": f"{chr17}/Homo_sapiens_assembly38.known_indels.BRCA1.vcf.gz",
"mills_indels": f"{chr17}/Mills_and_1000G_gold_standard.indels.hg38.BRCA1.vcf.gz",
"snps_1000gp": f"{chr17}/1000G_phase1.snps.high_confidence.hg38.BRCA1.vcf.gz",
"snps_dbsnp": f"{chr17}/Homo_sapiens_assembly38.dbsnp138.BRCA1.vcf.gz",
"cutadapt_adapters": f"{chr17}/contaminant_list.txt",
"gridss_blacklist": f"{chr17}/consensusBlacklist.hg38.chr17.bed",
"MINIMUM_PCT": f""
},
output=[
TTestExpectedOutput(
tag="out_variants",
preprocessor=TTestPreprocessor.LinesDiff,
file_diff_source=f"{hg38}/NA12878/brca1.germline.combined.vcf",
file_diff_source=f"{chr17}/NA12878/brca1.germline.combined.vcf",
operator=lambda actual, expected: all(
a <= b for a, b in zip(actual, expected)
),
Expand All @@ -148,13 +150,13 @@ def tests(self) -> Optional[List[TTestCase]]:
"out_variants_gridss",
preprocessor=TTestPreprocessor.FileContent,
operator=operator.eq,
expected_file=f"{hg38}/NA12878/brca1.germline.gridss.vcf",
expected_file=f"{chr17}/NA12878/brca1.germline.gridss.vcf",
),
TTestExpectedOutput(
tag="out_bam",
preprocessor=TTestPreprocessor.Value,
operator=Bam.equal,
expected_value=f"{hg38}/NA12878/NA12878.bam",
expected_value=f"{chr17}/NA12878/NA12878.bam",
),
TTestExpectedOutput(
tag="out_gridss_assembly",
Expand Down
19 changes: 10 additions & 9 deletions janis_pipelines/wgs_germline_gatk/wgsgermlinegatk.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,26 @@ def tests(self) -> Optional[List[TTestCase]]:

bioinf_base = "https://swift.rc.nectar.org.au/v1/AUTH_4df6e734a509497692be237549bbe9af/janis-test-data/bioinformatics"
hg38 = f"{bioinf_base}/hg38"
chr17 = f"{bioinf_base}/petermac_testdata"

return [
TTestCase(
name="brca1",
input={
"sample_name": "NA12878",
"reference": f"{hg38}/reference/Homo_sapiens_assembly38.fasta",
"reference": f"{chr17}/Homo_sapiens_assembly38.chr17.fasta",
"fastqs": [
[
f"{bioinf_base}/BRCA1_R1.fastq.gz",
f"{bioinf_base}/BRCA1_R2.fastq.gz",
f"{chr17}/NA12878-BRCA1_R1.fastq.gz",
f"{chr17}/NA12878-BRCA1_R2.fastq.gz",
]
],
"gatk_intervals": [f"{hg38}/NA12878/BRCA1.bed"],
"known_indels": f"{hg38}/known_indels/Homo_sapiens_assembly38.known_indels.vcf.gz",
"mills_indels": f"{hg38}/mills_indels/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz",
"snps_1000gp": f"{hg38}/snps_1000GP/1000G_phase1.snps.high_confidence.hg38.vcf.gz",
"snps_dbsnp": f"{hg38}/snps_dbsnp/Homo_sapiens_assembly38.dbsnp138.vcf.gz",
"cutadapt_adapters": "https://raw.githubusercontent.com/csf-ngs/fastqc/master/Contaminants/contaminant_list.txt",
"gatk_intervals": [f"{chr17}/BRCA1.hg38.bed"],
"known_indels": f"{chr17}/Homo_sapiens_assembly38.known_indels.BRCA1.vcf.gz",
"mills_indels": f"{chr17}/Mills_and_1000G_gold_standard.indels.hg38.BRCA1.vcf.gz",
"snps_1000gp": f"{chr17}/1000G_phase1.snps.high_confidence.hg38.BRCA1.vcf.gz",
"snps_dbsnp": f"{chr17}/Homo_sapiens_assembly38.dbsnp138.BRCA1.vcf.gz",
"cutadapt_adapters": f"{chr17}/contaminant_list.txt",
},
output=[
TTestExpectedOutput(
Expand Down
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
"janis-pipelines.bioinformatics>=0.10.0",
"janis-pipelines.unix>=0.10.0",
],
extras_require={
"ci": [
"keyring==21.4.0",
"setuptools",
"wheel",
"twine",
],
},
zip_safe=False,
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 5d5c01e

Please sign in to comment.