py-gbcms 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_gbcms-2.0.0/.gitbook.yaml +8 -0
- py_gbcms-2.0.0/.github/workflows/release.yml +130 -0
- py_gbcms-2.0.0/.github/workflows/test.yml +150 -0
- py_gbcms-2.0.0/.gitignore +65 -0
- py_gbcms-2.0.0/.pre-commit-config.yaml +31 -0
- py_gbcms-2.0.0/CONTRIBUTING.md +154 -0
- py_gbcms-2.0.0/Dockerfile +55 -0
- py_gbcms-2.0.0/Dockerfile.test +39 -0
- py_gbcms-2.0.0/LICENSE +664 -0
- py_gbcms-2.0.0/Makefile +104 -0
- py_gbcms-2.0.0/PKG-INFO +506 -0
- py_gbcms-2.0.0/README.md +462 -0
- py_gbcms-2.0.0/docker-compose.yml +26 -0
- py_gbcms-2.0.0/docs/ADVANCED_FEATURES.md +747 -0
- py_gbcms-2.0.0/docs/ARCHITECTURE.md +631 -0
- py_gbcms-2.0.0/docs/CLI_FEATURES.md +393 -0
- py_gbcms-2.0.0/docs/COMPLETE_FEATURES_SUMMARY.md +600 -0
- py_gbcms-2.0.0/docs/CPP_FEATURE_COMPARISON.md +334 -0
- py_gbcms-2.0.0/docs/CYVCF2_SUPPORT.md +406 -0
- py_gbcms-2.0.0/docs/DOCKER_GUIDE.md +589 -0
- py_gbcms-2.0.0/docs/DOCKER_SUMMARY.md +394 -0
- py_gbcms-2.0.0/docs/FAQ.md +476 -0
- py_gbcms-2.0.0/docs/INPUT_OUTPUT.md +469 -0
- py_gbcms-2.0.0/docs/INSTALLATION.md +124 -0
- py_gbcms-2.0.0/docs/PACKAGE_STRUCTURE.md +299 -0
- py_gbcms-2.0.0/docs/PARALLELIZATION_GUIDE.md +185 -0
- py_gbcms-2.0.0/docs/QUICKSTART.md +329 -0
- py_gbcms-2.0.0/docs/README.md +100 -0
- py_gbcms-2.0.0/docs/SUMMARY.md +40 -0
- py_gbcms-2.0.0/docs/TESTING_GUIDE.md +261 -0
- py_gbcms-2.0.0/git-flow-helper.sh +118 -0
- py_gbcms-2.0.0/pyproject.toml +161 -0
- py_gbcms-2.0.0/scripts/setup_and_test.sh +145 -0
- py_gbcms-2.0.0/scripts/test_docker.sh +156 -0
- py_gbcms-2.0.0/scripts/test_maf_workflow.sh +164 -0
- py_gbcms-2.0.0/scripts/test_vcf_workflow.sh +116 -0
- py_gbcms-2.0.0/scripts/validate_against_cpp.sh +272 -0
- py_gbcms-2.0.0/scripts/verify_installation.py +147 -0
- py_gbcms-2.0.0/src/gbcms/__init__.py +13 -0
- py_gbcms-2.0.0/src/gbcms/cli.py +745 -0
- py_gbcms-2.0.0/src/gbcms/config.py +98 -0
- py_gbcms-2.0.0/src/gbcms/counter.py +1074 -0
- py_gbcms-2.0.0/src/gbcms/models.py +295 -0
- py_gbcms-2.0.0/src/gbcms/numba_counter.py +394 -0
- py_gbcms-2.0.0/src/gbcms/output.py +573 -0
- py_gbcms-2.0.0/src/gbcms/parallel.py +129 -0
- py_gbcms-2.0.0/src/gbcms/processor.py +293 -0
- py_gbcms-2.0.0/src/gbcms/reference.py +86 -0
- py_gbcms-2.0.0/src/gbcms/variant.py +390 -0
- py_gbcms-2.0.0/tests/__init__.py +1 -0
- py_gbcms-2.0.0/tests/conftest.py +117 -0
- py_gbcms-2.0.0/tests/test_cli.py +235 -0
- py_gbcms-2.0.0/tests/test_config.py +142 -0
- py_gbcms-2.0.0/tests/test_counter.py +188 -0
- py_gbcms-2.0.0/tests/test_output.py +191 -0
- py_gbcms-2.0.0/tests/test_reference.py +84 -0
- py_gbcms-2.0.0/tests/test_variant.py +159 -0
- py_gbcms-2.0.0/uv.lock +1237 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '[0-9]+.[0-9]+.[0-9]+' # Matches 1.0.0, 2.3.4, etc. (semantic versioning)
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'Version to release (e.g., 1.0.0)'
|
|
11
|
+
required: false
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
PYTHON_VERSION: '3.11'
|
|
15
|
+
REGISTRY: ghcr.io
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release:
|
|
19
|
+
name: Build, Test, and Release
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
id-token: write # Required for PyPI Trusted Publisher OIDC
|
|
23
|
+
contents: read # Required for checkout and metadata
|
|
24
|
+
packages: write # Required for Docker registry access
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout repository
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0 # Full history for proper version detection
|
|
31
|
+
|
|
32
|
+
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
|
33
|
+
uses: actions/setup-python@v5
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
run: pip install uv
|
|
39
|
+
|
|
40
|
+
- name: Setup and test package
|
|
41
|
+
run: |
|
|
42
|
+
# Create virtual environment and install package in development mode
|
|
43
|
+
uv venv .venv
|
|
44
|
+
source .venv/bin/activate
|
|
45
|
+
|
|
46
|
+
# Install the package with all dependencies
|
|
47
|
+
uv pip install -e ".[dev]"
|
|
48
|
+
|
|
49
|
+
# Run tests to ensure everything works
|
|
50
|
+
uv run pytest -v
|
|
51
|
+
|
|
52
|
+
# Verify package can be imported
|
|
53
|
+
uv run python -c "import gbcms; print(f'gbcms version: {gbcms.__version__}')"
|
|
54
|
+
|
|
55
|
+
- name: Build Python package
|
|
56
|
+
run: |
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
uv pip install build
|
|
59
|
+
python -m build --sdist --wheel --outdir dist/
|
|
60
|
+
|
|
61
|
+
- name: Verify package
|
|
62
|
+
run: |
|
|
63
|
+
source .venv/bin/activate
|
|
64
|
+
uv pip install twine
|
|
65
|
+
twine check dist/*
|
|
66
|
+
|
|
67
|
+
- name: Publish to PyPI
|
|
68
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
69
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
70
|
+
with:
|
|
71
|
+
skip-existing: true
|
|
72
|
+
verbose: true
|
|
73
|
+
print-hash: true
|
|
74
|
+
|
|
75
|
+
- name: Log in to GitHub Container Registry
|
|
76
|
+
uses: docker/login-action@v3
|
|
77
|
+
with:
|
|
78
|
+
registry: ${{ env.REGISTRY }}
|
|
79
|
+
username: ${{ github.actor }}
|
|
80
|
+
password: ${{ secrets.RS_PAT }}
|
|
81
|
+
|
|
82
|
+
- name: Extract metadata for Docker
|
|
83
|
+
id: meta
|
|
84
|
+
uses: docker/metadata-action@v5
|
|
85
|
+
with:
|
|
86
|
+
images: ${{ env.REGISTRY }}/${{ github.repository }}
|
|
87
|
+
tags: |
|
|
88
|
+
type=ref,event=tag
|
|
89
|
+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
|
90
|
+
|
|
91
|
+
- name: Build and push Docker image
|
|
92
|
+
uses: docker/build-push-action@v5
|
|
93
|
+
with:
|
|
94
|
+
context: .
|
|
95
|
+
push: true
|
|
96
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
97
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
98
|
+
cache-from: type=gha
|
|
99
|
+
cache-to: type=gha,mode=max
|
|
100
|
+
|
|
101
|
+
- name: Generate release notes
|
|
102
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
103
|
+
run: |
|
|
104
|
+
echo "## 🚀 gbcms v${{ github.ref_name }}" >> release_notes.md
|
|
105
|
+
echo "" >> release_notes.md
|
|
106
|
+
echo "### Changes" >> release_notes.md
|
|
107
|
+
echo "- Published to PyPI" >> release_notes.md
|
|
108
|
+
echo "- Published Docker image to GitHub Container Registry" >> release_notes.md
|
|
109
|
+
echo "" >> release_notes.md
|
|
110
|
+
echo "### Installation" >> release_notes.md
|
|
111
|
+
echo "\`\`\`bash" >> release_notes.md
|
|
112
|
+
echo "# PyPI" >> release_notes.md
|
|
113
|
+
echo "pip install gbcms==${{ github.ref_name }}" >> release_notes.md
|
|
114
|
+
echo "" >> release_notes.md
|
|
115
|
+
echo "# Docker" >> release_notes.md
|
|
116
|
+
echo "docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}" >> release_notes.md
|
|
117
|
+
echo "\`\`\`" >> release_notes.md
|
|
118
|
+
echo "" >> release_notes.md
|
|
119
|
+
echo "### Usage" >> release_notes.md
|
|
120
|
+
echo "\`\`\`bash" >> release_notes.md
|
|
121
|
+
echo "gbcms count run --fasta reference.fa --bam sample:sample.bam --vcf variants.vcf --output counts.txt" >> release_notes.md
|
|
122
|
+
echo "\`\`\`" >> release_notes.md
|
|
123
|
+
|
|
124
|
+
- name: Show release summary
|
|
125
|
+
run: |
|
|
126
|
+
echo "✅ Release completed successfully!"
|
|
127
|
+
echo "📦 PyPI package: https://pypi.org/project/gbcms/${{ github.ref_name }}/"
|
|
128
|
+
echo "🐳 Docker image: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}"
|
|
129
|
+
echo "📋 Package contents:"
|
|
130
|
+
ls -la dist/ || echo "No dist directory found"
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, macos-latest]
|
|
17
|
+
python-version: ['3.11', '3.12']
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install system dependencies (Ubuntu)
|
|
29
|
+
if: runner.os == 'Linux'
|
|
30
|
+
run: |
|
|
31
|
+
sudo apt-get update
|
|
32
|
+
sudo apt-get install -y \
|
|
33
|
+
build-essential \
|
|
34
|
+
zlib1g-dev \
|
|
35
|
+
libbz2-dev \
|
|
36
|
+
liblzma-dev \
|
|
37
|
+
libcurl4-openssl-dev \
|
|
38
|
+
libssl-dev \
|
|
39
|
+
libncurses5-dev \
|
|
40
|
+
libncursesw5-dev \
|
|
41
|
+
libsqlite3-dev \
|
|
42
|
+
libgdbm-dev \
|
|
43
|
+
libreadline-dev \
|
|
44
|
+
libxml2-dev \
|
|
45
|
+
libxslt1-dev \
|
|
46
|
+
gfortran \
|
|
47
|
+
libopenblas-dev \
|
|
48
|
+
liblapack-dev \
|
|
49
|
+
git \
|
|
50
|
+
autoconf \
|
|
51
|
+
samtools
|
|
52
|
+
|
|
53
|
+
- name: Install system dependencies (macOS)
|
|
54
|
+
if: runner.os == 'macOS'
|
|
55
|
+
run: |
|
|
56
|
+
brew install htslib samtools autoconf automake
|
|
57
|
+
|
|
58
|
+
- name: Install uv
|
|
59
|
+
run: |
|
|
60
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
61
|
+
|
|
62
|
+
- name: Install package and test basic functionality
|
|
63
|
+
run: |
|
|
64
|
+
# Install without fast dependencies on Ubuntu due to htslib issues
|
|
65
|
+
if [ "$RUNNER_OS" = "Linux" ]; then
|
|
66
|
+
uv pip install --system -e ".[dev]"
|
|
67
|
+
else
|
|
68
|
+
uv pip install --system -e ".[dev,all]"
|
|
69
|
+
fi
|
|
70
|
+
gbcms --help
|
|
71
|
+
|
|
72
|
+
- name: Run tests with coverage
|
|
73
|
+
run: |
|
|
74
|
+
pytest --cov=gbcms --cov-report=xml --cov-report=term-missing -v
|
|
75
|
+
|
|
76
|
+
- name: Upload coverage to Codecov
|
|
77
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
78
|
+
uses: codecov/codecov-action@v4
|
|
79
|
+
with:
|
|
80
|
+
file: ./coverage.xml
|
|
81
|
+
flags: unittests
|
|
82
|
+
name: codecov-umbrella
|
|
83
|
+
fail_ci_if_error: false
|
|
84
|
+
|
|
85
|
+
- name: Run integration tests (Ubuntu only)
|
|
86
|
+
if: matrix.os == 'Linux'
|
|
87
|
+
run: |
|
|
88
|
+
chmod +x scripts/test_vcf_workflow.sh scripts/test_maf_workflow.sh scripts/test_docker.sh
|
|
89
|
+
# Skip integration tests that require cyvcf2 on Ubuntu
|
|
90
|
+
echo "⚠️ Skipping integration tests on Ubuntu due to htslib dependency issues"
|
|
91
|
+
# bash scripts/test_docker.sh # Only run Docker test
|
|
92
|
+
|
|
93
|
+
lint:
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
|
|
96
|
+
steps:
|
|
97
|
+
- name: Checkout code
|
|
98
|
+
uses: actions/checkout@v4
|
|
99
|
+
|
|
100
|
+
- name: Set up Python
|
|
101
|
+
uses: actions/setup-python@v5
|
|
102
|
+
with:
|
|
103
|
+
python-version: '3.11'
|
|
104
|
+
|
|
105
|
+
- name: Install uv
|
|
106
|
+
run: |
|
|
107
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
108
|
+
|
|
109
|
+
- name: Install dependencies
|
|
110
|
+
run: |
|
|
111
|
+
uv pip install --system scipy-stubs
|
|
112
|
+
uv pip install --system -e ".[dev]"
|
|
113
|
+
|
|
114
|
+
- name: Run black
|
|
115
|
+
run: |
|
|
116
|
+
black --check src/ tests/
|
|
117
|
+
|
|
118
|
+
- name: Run ruff
|
|
119
|
+
run: |
|
|
120
|
+
ruff check src/ tests/
|
|
121
|
+
|
|
122
|
+
- name: Run mypy
|
|
123
|
+
run: |
|
|
124
|
+
mypy src/
|
|
125
|
+
|
|
126
|
+
docker-test:
|
|
127
|
+
runs-on: ubuntu-latest
|
|
128
|
+
|
|
129
|
+
steps:
|
|
130
|
+
- name: Checkout code
|
|
131
|
+
uses: actions/checkout@v4
|
|
132
|
+
|
|
133
|
+
- name: Set up Docker Buildx
|
|
134
|
+
uses: docker/setup-buildx-action@v3
|
|
135
|
+
|
|
136
|
+
- name: Build Docker image
|
|
137
|
+
uses: docker/build-push-action@v5
|
|
138
|
+
with:
|
|
139
|
+
context: .
|
|
140
|
+
push: false
|
|
141
|
+
tags: gbcms:test
|
|
142
|
+
cache-from: type=gha,scope=test
|
|
143
|
+
cache-to: type=gha,mode=max,scope=test
|
|
144
|
+
|
|
145
|
+
- name: Verify Docker build success
|
|
146
|
+
run: |
|
|
147
|
+
# Check that the image was built successfully
|
|
148
|
+
docker images gbcms:test --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"
|
|
149
|
+
echo "✅ Docker image gbcms:test built successfully"
|
|
150
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
env/
|
|
26
|
+
ENV/
|
|
27
|
+
.venv
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.tox/
|
|
34
|
+
coverage.xml
|
|
35
|
+
*.cover
|
|
36
|
+
|
|
37
|
+
# IDEs
|
|
38
|
+
.vscode/
|
|
39
|
+
.idea/
|
|
40
|
+
*.swp
|
|
41
|
+
*.swo
|
|
42
|
+
*~
|
|
43
|
+
|
|
44
|
+
# OS
|
|
45
|
+
.DS_Store
|
|
46
|
+
Thumbs.db
|
|
47
|
+
|
|
48
|
+
# Project specific
|
|
49
|
+
data/
|
|
50
|
+
test_data/
|
|
51
|
+
*.bam
|
|
52
|
+
*.bam.bai
|
|
53
|
+
*.fa
|
|
54
|
+
*.fa.fai
|
|
55
|
+
*.vcf
|
|
56
|
+
*.maf
|
|
57
|
+
output/
|
|
58
|
+
results/
|
|
59
|
+
|
|
60
|
+
# Logs
|
|
61
|
+
*.log
|
|
62
|
+
|
|
63
|
+
# Temporary files
|
|
64
|
+
tmp/
|
|
65
|
+
temp/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.5.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- id: check-json
|
|
10
|
+
- id: check-toml
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: debug-statements
|
|
13
|
+
|
|
14
|
+
- repo: https://github.com/psf/black
|
|
15
|
+
rev: 23.12.1
|
|
16
|
+
hooks:
|
|
17
|
+
- id: black
|
|
18
|
+
language_version: python3.11
|
|
19
|
+
|
|
20
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
21
|
+
rev: v0.1.9
|
|
22
|
+
hooks:
|
|
23
|
+
- id: ruff
|
|
24
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
25
|
+
|
|
26
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
27
|
+
rev: v1.8.0
|
|
28
|
+
hooks:
|
|
29
|
+
- id: mypy
|
|
30
|
+
additional_dependencies: [types-all]
|
|
31
|
+
args: [--ignore-missing-imports]
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Contributing to GetBaseCounts
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to GetBaseCounts! This document provides guidelines and instructions for contributing.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. **Clone the repository**
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/msk-access/py-gbcms.git
|
|
10
|
+
cd py-gbcms
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. **Install uv** (if not already installed)
|
|
14
|
+
```bash
|
|
15
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
3. **Install development dependencies**
|
|
19
|
+
```bash
|
|
20
|
+
uv pip install -e ".[dev]"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
4. **Install pre-commit hooks**
|
|
24
|
+
```bash
|
|
25
|
+
pre-commit install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Development Workflow
|
|
29
|
+
|
|
30
|
+
### Running Tests
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Run all tests
|
|
34
|
+
pytest
|
|
35
|
+
|
|
36
|
+
# Run with coverage
|
|
37
|
+
pytest --cov=gbcms --cov-report=html
|
|
38
|
+
|
|
39
|
+
# Run specific test file
|
|
40
|
+
pytest tests/test_counter.py
|
|
41
|
+
|
|
42
|
+
# Run with verbose output
|
|
43
|
+
pytest -v
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Code Quality
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Format code
|
|
50
|
+
black src/ tests/
|
|
51
|
+
|
|
52
|
+
# Lint code
|
|
53
|
+
ruff check src/ tests/
|
|
54
|
+
|
|
55
|
+
# Fix linting issues automatically
|
|
56
|
+
ruff check --fix src/ tests/
|
|
57
|
+
|
|
58
|
+
# Type checking
|
|
59
|
+
mypy src/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Building and Testing Docker
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Build Docker image
|
|
66
|
+
docker build -t gbcms:latest .
|
|
67
|
+
|
|
68
|
+
# Run tests in Docker
|
|
69
|
+
docker build -f Dockerfile.test -t gbcms:test .
|
|
70
|
+
docker run --rm gbcms:test
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Code Style
|
|
74
|
+
|
|
75
|
+
- Follow PEP 8 style guidelines
|
|
76
|
+
- Use type hints for all function signatures
|
|
77
|
+
- Write docstrings for all public functions and classes
|
|
78
|
+
- Keep functions focused and single-purpose
|
|
79
|
+
- Maximum line length: 100 characters
|
|
80
|
+
|
|
81
|
+
## Testing Guidelines
|
|
82
|
+
|
|
83
|
+
- Write tests for all new features
|
|
84
|
+
- Maintain or improve code coverage
|
|
85
|
+
- Use descriptive test names
|
|
86
|
+
- Use fixtures for common test setup
|
|
87
|
+
- Test edge cases and error conditions
|
|
88
|
+
|
|
89
|
+
## Pull Request Process
|
|
90
|
+
|
|
91
|
+
1. **Create a feature branch**
|
|
92
|
+
```bash
|
|
93
|
+
git checkout -b feature/your-feature-name
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
2. **Make your changes**
|
|
97
|
+
- Write code following the style guidelines
|
|
98
|
+
- Add tests for new functionality
|
|
99
|
+
- Update documentation as needed
|
|
100
|
+
|
|
101
|
+
3. **Run tests and linters**
|
|
102
|
+
```bash
|
|
103
|
+
make test
|
|
104
|
+
make lint
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
4. **Commit your changes**
|
|
108
|
+
```bash
|
|
109
|
+
git add .
|
|
110
|
+
git commit -m "Description of your changes"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
5. **Push to your fork**
|
|
114
|
+
```bash
|
|
115
|
+
git push origin feature/your-feature-name
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
6. **Create a Pull Request**
|
|
119
|
+
- Provide a clear description of the changes
|
|
120
|
+
- Reference any related issues
|
|
121
|
+
- Ensure all CI checks pass
|
|
122
|
+
|
|
123
|
+
## Reporting Issues
|
|
124
|
+
|
|
125
|
+
When reporting issues, please include:
|
|
126
|
+
|
|
127
|
+
- Python version
|
|
128
|
+
- Operating system
|
|
129
|
+
- Steps to reproduce
|
|
130
|
+
- Expected behavior
|
|
131
|
+
- Actual behavior
|
|
132
|
+
- Error messages or logs
|
|
133
|
+
|
|
134
|
+
## Feature Requests
|
|
135
|
+
|
|
136
|
+
We welcome feature requests! Please:
|
|
137
|
+
|
|
138
|
+
- Check if the feature already exists
|
|
139
|
+
- Provide a clear use case
|
|
140
|
+
- Describe the expected behavior
|
|
141
|
+
- Consider submitting a PR if you can implement it
|
|
142
|
+
|
|
143
|
+
## Code of Conduct
|
|
144
|
+
|
|
145
|
+
- Be respectful and inclusive
|
|
146
|
+
- Welcome newcomers
|
|
147
|
+
- Focus on constructive feedback
|
|
148
|
+
- Help others learn and grow
|
|
149
|
+
|
|
150
|
+
## Questions?
|
|
151
|
+
|
|
152
|
+
Feel free to open an issue for questions or reach out to the maintainers.
|
|
153
|
+
|
|
154
|
+
Thank you for contributing!
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
FROM python:3.11-slim
|
|
3
|
+
|
|
4
|
+
# Install OS-level build dependencies commonly needed for cyvcf2, pysam, numpy, etc.
|
|
5
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
6
|
+
build-essential \
|
|
7
|
+
zlib1g-dev \
|
|
8
|
+
libbz2-dev \
|
|
9
|
+
liblzma-dev \
|
|
10
|
+
libcurl4-openssl-dev \
|
|
11
|
+
libssl-dev \
|
|
12
|
+
libncurses5-dev \
|
|
13
|
+
libncursesw5-dev \
|
|
14
|
+
libsqlite3-dev \
|
|
15
|
+
libgdbm-dev \
|
|
16
|
+
libreadline-dev \
|
|
17
|
+
libffi-dev \
|
|
18
|
+
libxml2-dev \
|
|
19
|
+
libxslt1-dev \
|
|
20
|
+
gfortran \
|
|
21
|
+
libopenblas-dev \
|
|
22
|
+
liblapack-dev \
|
|
23
|
+
git \
|
|
24
|
+
autoconf \
|
|
25
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
26
|
+
|
|
27
|
+
# Install uv (optional helper) — you can remove if you prefer pip directly
|
|
28
|
+
RUN pip install --no-cache-dir uv
|
|
29
|
+
|
|
30
|
+
WORKDIR /app
|
|
31
|
+
|
|
32
|
+
# Copy only the files needed for installation first to leverage Docker cache
|
|
33
|
+
COPY pyproject.toml pyproject.lock* README.md LICENSE* /app/
|
|
34
|
+
COPY src/ /app/src/
|
|
35
|
+
|
|
36
|
+
# Create a virtualenv, activate it and install the package with extras
|
|
37
|
+
RUN uv venv .venv && \
|
|
38
|
+
/bin/bash -lc "source .venv/bin/activate && uv pip install --no-cache-dir '.[all]'"
|
|
39
|
+
|
|
40
|
+
# Ensure the venv bin is first in PATH
|
|
41
|
+
ENV PATH="/app/.venv/bin:${PATH}"
|
|
42
|
+
|
|
43
|
+
# Working directory for running
|
|
44
|
+
WORKDIR /data
|
|
45
|
+
|
|
46
|
+
# Entrypoint/command defaults
|
|
47
|
+
ENTRYPOINT ["gbcms"]
|
|
48
|
+
CMD ["--help"]
|
|
49
|
+
|
|
50
|
+
LABEL maintainer="MSK-ACCESS <access@mskcc.org>"
|
|
51
|
+
LABEL description="Python implementation of GetBaseCountsMultiSample (gbcms) for calculating base counts in BAM files"
|
|
52
|
+
LABEL org.opencontainers.image.source="https://github.com/msk-access/py-gbcms"
|
|
53
|
+
LABEL org.opencontainers.image.documentation="https://github.com/msk-access/py-gbcms/blob/main/README.md"
|
|
54
|
+
LABEL org.opencontainers.image.licenses="AGPL-3.0"
|
|
55
|
+
LABEL org.opencontainers.image.base.image="python:3.11-slim"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Dockerfile for testing py-gbcms
|
|
2
|
+
FROM ubuntu:22.04
|
|
3
|
+
|
|
4
|
+
# Install system dependencies
|
|
5
|
+
RUN apt-get update && apt-get install -y \
|
|
6
|
+
build-essential \
|
|
7
|
+
gcc \
|
|
8
|
+
g++ \
|
|
9
|
+
make \
|
|
10
|
+
zlib1g-dev \
|
|
11
|
+
libbz2-dev \
|
|
12
|
+
liblzma-dev \
|
|
13
|
+
libcurl4-openssl-dev \
|
|
14
|
+
libssl-dev \
|
|
15
|
+
libhts-dev \
|
|
16
|
+
samtools \
|
|
17
|
+
git \
|
|
18
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
19
|
+
|
|
20
|
+
# Install uv
|
|
21
|
+
RUN pip install --no-cache-dir uv
|
|
22
|
+
|
|
23
|
+
# Set working directory
|
|
24
|
+
WORKDIR /app
|
|
25
|
+
|
|
26
|
+
# Copy project files
|
|
27
|
+
COPY pyproject.toml README.md LICENSE ./
|
|
28
|
+
COPY src/ ./src/
|
|
29
|
+
COPY tests/ ./tests/
|
|
30
|
+
|
|
31
|
+
# Install package with dev and all dependencies
|
|
32
|
+
# This includes cyvcf2 and all dev tools
|
|
33
|
+
RUN uv pip install --system --no-cache ".[dev,all]"
|
|
34
|
+
|
|
35
|
+
# Verify installation
|
|
36
|
+
RUN gbcms version
|
|
37
|
+
|
|
38
|
+
# Run tests by default
|
|
39
|
+
CMD ["pytest", "-v", "--cov=gbcms", "--cov-report=term-missing"]
|