Skip to content

Commit 7c14951

Browse files
authoredSep 13, 2021
Merge pull request #1 from delocalizer/20210913_crl_packaging
* modernize packaging & create stub for tests
2 parents ab8e41f + 74a10c2 commit 7c14951

12 files changed

+86
-54
lines changed
 

‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.tox
2+
*.egg-info
3+
**/__pycache__
4+
**/*.pyc

‎MANIFEST.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include README.rst
2-
#include docs/*.txt
1+
include VERSION

‎README.md

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
# Somatic base substitution caller for LRS
22

3-
Python tool that calls somatic base substitutions from matched tumour normal whole genome pileups.
3+
Python tool that calls somatic base substitutions from matched tumour-normal whole genome pileups.
44

5-
## Getting Started
6-
7-
Pip install
5+
#### Required
86

9-
### Prerequisites
7+
Python 3.6+
108

11-
samtools/1.10
12-
htslib/1.10.2
13-
tabix/0.2.6
9+
## Install
1410

15-
Pileups from samtools
16-
bgzip pileup_name
17-
tabix -b 2 -e 2 pileup_name.gz
11+
Install into a virtualenv is recommended, _e.g._:
1812

19-
#### Required
13+
python3 -m venv SBSC
14+
source SBSC/bin/activate
15+
tempdir=$(mktemp -d)
16+
git clone https://github.com/shimbalama/SBSC $tempdir
17+
cd $tempdir
18+
pip3 install -r requirements.txt .
2019

21-
Python 3
22-
23-
#### Optional
20+
### Prerequisites
2421

25-
NA
22+
Tabix-indexed pileups from samtools
2623

27-
### Installing
24+
bgzip pileup_name
25+
tabix -b 2 -e 2 pileup_name.gz
2826

29-
pip install SBSC
27+
When the tool runs `.tbi` index files are presumed to exist adjacent to input pileup files.
3028

3129
## Running the program
3230

33-
SBSC.py -h
31+
# help
32+
SBSCall.py --help
33+
34+
# basic example
35+
SBSCall.py \
36+
-r /path/to/reference \
37+
-o /path/to/output \
38+
-c /path/to/cancer_pileup.gz \
39+
-n /path/to/normal_pileup.gz
3440

3541
## Authors
3642

@@ -42,4 +48,4 @@ This project is licensed under the MIT License. See LICENSE
4248

4349
## Acknowledgments
4450

45-
QMIR medical genomics team
51+
QIMR Berghofer medical genomics team

‎SBSC/output/__init__.py

Whitespace-only changes.

‎VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.12

‎pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build-system]
2+
requires = [
3+
"pip",
4+
"setuptools>=42",
5+
"wheel"
6+
]
7+
build-backend = "setuptools.build_meta"

‎requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
biopython==1.79
2+
pandas==1.3.3
3+
pysam==0.16.0.1
4+
scipy==1.7.1

‎setup.cfg

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[metadata]
2+
name = SBSC
3+
version = file: VERSION
4+
description = A simple somatic SNV and MNV caller
5+
long_description = file: README.md, LICENSE
6+
author = Liam McIntyre
7+
author_email = shimbalama@gmail.com
8+
license = MIT License
9+
classifiers:
10+
Programming Language :: Python :: 3.6
11+
License :: OSI Approved :: MIT License
12+
Operating System :: OS Independent
13+
14+
[options]
15+
include_package_data = True
16+
packages = find:
17+
python_requires = >=3.6
18+
scripts =
19+
bin/SBSCall.py
20+
zip_safe = False

‎setup.py

-32
This file was deleted.

‎tests/__init__.py

Whitespace-only changes.

‎tests/test_main.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from unittest import TestCase
2+
import shlex
3+
import subprocess
4+
5+
6+
class TestMain(TestCase):
7+
"""
8+
Integration tests
9+
"""
10+
def test_help(self):
11+
"""
12+
Test that the script can be called by the documented name
13+
"""
14+
result = subprocess.run(shlex.split('python3 bin/SBSCall.py --help'),
15+
capture_output=True, text=True)
16+
self.assertTrue(result.stdout.startswith('usage: SBSCall.py'))

‎tox.ini

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tox]
2+
envlist = py39
3+
isolated_build = True
4+
5+
[testenv]
6+
commands = python3 -m unittest discover tests
7+
deps = -rrequirements.txt

0 commit comments

Comments
 (0)
Please sign in to comment.