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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ binder/*.html linguist-documentation
notebook/*/*.ipynb linguist-documentation
microhapulator/data/template.html linguist-documentation
microhapulator/data/fancyTable.js linguist-vendored
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
33 changes: 16 additions & 17 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,29 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12"]
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: Check out code
uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Set up pixi package manager
uses: prefix-dev/setup-pixi@v0.8.10
with:
pixi-version: v0.48.2
cache: true
- name: Install
run: |
sudo apt-get update
sudo apt-get install minimap2 samtools fastqc tabix
curl -L -O http://ccb.jhu.edu/software/FLASH/FLASH-1.2.11-Linux-x86_64.tar.gz && tar -xzf FLASH-1.2.11-Linux-x86_64.tar.gz && sudo cp FLASH-1.2.11-Linux-x86_64/flash /usr/local/bin/ && rm -r FLASH-1.2.11*
python -m pip install --upgrade pip
pip install .
mhpl8r getrefr
make devdeps
pixi install
pixi install -e test
pixi run mhpl8r getrefr
- name: Test with pytest
run: |
# Move the source code so the tests run on the *installed* code (which is where the
# reference genome index is placed) rather than the source code
mv microhapulator mhpl8r_src
make test
# Move the code back for style check
mv mhpl8r_src microhapulator
- name: Style check
run: make style
pixi run test
- name: Style and documentation check
run: |
pixi run style
pixi run docs
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ __pycache__/
.pytest_cache/
.*.swp
*.swo
microhapulator.egg-info/
hg38.fasta
hg38.fasta.fai
.coverage.*
Expand All @@ -18,3 +17,5 @@ microhapulator/data/hg38.fasta.gz*
.snakemake/
.vscode/
microhapulator/data/hg38.mmi
.pixi
*.egg-info
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Updated working directory organization to provide additional structure (#194).
- Snakemake is now invoked using its new Python API, requiring a minimum version of 8.0 and Python 3.11+ (#195).
- FASTQ intake is now handled by a dedicated package ezfastq, which was based on MicroHapulator code (#196).
- Switched from conda to pixi for project and dependency management (#197).

### Fixed
- Bug with handling marker vs. locus identifiers when running `mhpl8r seq` (#190).
Expand Down
44 changes: 0 additions & 44 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion docs/devel.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The documentation for MicroHapulator's [command line interface](cli.md) and [Pyt

## Automated test suite

- Invoke test suite with `make test`
- Invoke test suite with `pixi run test`
- Most tests reside in `microhapulator/tests/test_*.py`
- Some tests (doctests) reside in docstrings in module implementations in `microhapulator/*.py`

Expand Down
22 changes: 5 additions & 17 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,15 @@ pytest --pyargs microhapulator
```


## Dependencies

MicroHapulator depends on several Python packages.
These are listed in `setup.py` in the main source code distribution.
If performing a non-standard installation with `pip`, these dependencies will automatically be installed from the Python Package Index (PyPI).

Preparing Illumina reads for analysis and interpretation with MicroHapulator also depends on several bioinformatics tools, including [FLASH](https://ccb.jhu.edu/software/FLASH/), [Minimap2](https://lh3.github.io/minimap2/minimap2.html) (or an alternative short read aligner), [SAMtools](http://www.htslib.org/), and [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/).
These software tools are installed automatically when performing a standard installation with Conda.
Otherwise, they must be installed manually.


## Development quick start

If you're setting up an environment for developing MicroHapulator, you may want to skip the procedure outlined above and use the following instead.
If you're setting up an environment for developing MicroHapulator, you probably want to skip the procedure outlined above and use the following instead, after [installing pixi](https://pixi.sh/latest/installation/).

```bash
conda create --name microhapulator python=3.11 flash minimap2 samtools fastqc
conda activate microhapulator
git clone https://github.com/bioforensics/MicroHapulator.git
cd MicroHapulator/
pip install -e . # Install the package and its Python dependencies
make devdeps # Install development packages
make devhooks # Register pre-commit hooks for development
pixi install
pixi install -e test
pixi task list
pixi run hooks
```
16 changes: 8 additions & 8 deletions microhapulator/workflows/analysis.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# Development Center.
# -------------------------------------------------------------------------------------------------

from importlib.resources import files
from microhapulator import api as mhapi
from microhapulator.pipe import OverviewReporter, DetailReporter
from microhapulator.profile import TypingResult
from microhapulator.thresholds import ThresholdIndex
from pkg_resources import resource_filename
import shutil


Expand Down Expand Up @@ -55,12 +55,12 @@ rule report:
expand("analysis/{sample}/03typing/{sample}-typing-rate.tsv", sample=config["samples"]),
expand("analysis/{sample}/03typing/{sample}-discard-rate.tsv", sample=config["samples"]),
expand("analysis/{sample}/03typing/{sample}-gapped-rate.tsv", sample=config["samples"]),
resource_filename("microhapulator", "data/template.html"),
resource_filename("microhapulator", "data/marker_details_template.html"),
resource_filename("microhapulator", "data/third-party/bootstrap.min.css"),
resource_filename("microhapulator", "data/third-party/fancyTable.js"),
resource_filename("microhapulator", "data/third-party/jquery-ui.min.js"),
resource_filename("microhapulator", "data/third-party/jquery.min.js"),
files("microhapulator") / "data" / "template.html",
files("microhapulator") / "data" / "marker_details_template.html",
files("microhapulator") / "data" / "third-party" / "bootstrap.min.css",
files("microhapulator") / "data" / "third-party" / "fancyTable.js",
files("microhapulator") / "data" / "third-party" / "jquery-ui.min.js",
files("microhapulator") / "data" / "third-party" / "jquery.min.js",
output:
main="report/report.html",
detail="report/marker-detail-report.html",
Expand All @@ -82,7 +82,7 @@ rule report:
reporter = DetailReporter(config["samples"])
with open(output.detail, "w") as fh:
print(reporter.render(), file=fh, end="")
tpdir = resource_filename("microhapulator", "data/third-party/")
tpdir = files("microhapulator") / "data" / "third-party"
shell("mkdir -p report/img/")
shell("cp -r {tpdir} report/assets")
for sample in config["samples"]:
Expand Down
Loading
Loading