Skip to content
Closed
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
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
51 changes: 17 additions & 34 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
name: CI

on: [push,pull_request]
on: [push, pull_request]

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
name: "Tests (${{ matrix.os }})"
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -el {0}

strategy:
matrix:
os: [macos-13, ubuntu-latest]
python-version: ["3.9"]

steps:
- uses: "actions/checkout@v3"
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup env
- uses: conda-incubator/setup-miniconda@v3
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
activate-environment: dnaapler
environment-file: build/environment.yaml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
channels: conda-forge,bioconda,defaults
channel-priority: strict
auto-update-conda: true
- name: Install project
shell: bash -l {0}
run: |
conda install python=${{ matrix.python-version }}
python -m pip install --upgrade pip
pip install -e .
pip install black
pip install isort
pip install pytest
pip install pytest-cov
pixi-version: v0.70.2
cache: true
environments: dev

- name: Check formatting
shell: bash -l {0}
run: just check-fmt
- name: Test and generate coverage report with pytest
shell: bash -l {0}
run: just test-ci
run: pixi run check-fmt

- name: Lint
run: pixi run lint

- name: Run unit tests
run: pixi run coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4


30 changes: 10 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v3
- uses: actions/checkout@v4

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
python-version: 3.9
activate-environment: dnaapler
environment-file: build/environment.yaml
auto-activate-base: false
channels: conda-forge,bioconda,defaults
channel-priority: strict
auto-update-conda: true
- name: Install project
shell: bash -l {0}
run: |
python -m pip install -U pip
pip install -e .
pip install black
pip install isort
pip install pytest
pip install pytest-cov
pixi-version: v0.70.2
cache: true
environments: dev

- name: Build a binary wheel and a source tarball
shell: bash -l {0}
run: just build
run: pixi run build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ ENV/
.DS_Store
*/.DS_Store
*/*/.DS_Store
# pixi environments
.pixi/*
!.pixi/config.toml
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,22 @@ Dnaapler is a simple tool that reorients complete circular microbial genomes.

## Quick Start

For local development or running directly in the cloned repository:
```
# creates empty conda environment
conda create -n dnaapler_env
# install dependencies and setup the environment
pixi install

# activates conda environment
conda activate dnaapler_env
# run dnaapler all
pixi run dnaapler all -i input_mixed_contigs.fasta -o output_directory_path -p my_bacteria_name -t 8

# installs dnaapler
conda install -c bioconda dnaapler

# runs dnaapler all
dnaapler all -i input_mixed_contigs.fasta -o output_directory_path -p my_bacteria_name -t 8

# runs dnaapler all with a gfa file from e.g. Flye, Unicycler or Autocycler
dnaapler all -i assembly.gfa -o output_directory_path -p my_bacteria_name -t 8
# run dnaapler all with a gfa file
pixi run dnaapler all -i assembly.gfa -o output_directory_path -p my_bacteria_name -t 8
```

* If you have a MacOS machine with Apple Silicon (M1/M2/M3/M4) and are having installation issues, please try

For general usage, you can also install it globally:
```
conda create --platform osx-64 -n dnaapler_env dnaapler

conda activate dnaapler_env

dnaapler all -i input_mixed_contigs.fasta -o output_directory_path -p my_bacteria_name -t 8
# installs dnaapler globally
pixi global install dnaapler
```

## Paper
Expand Down Expand Up @@ -93,7 +84,7 @@ Hyatt, D., Chen, GL., LoCascio, P.F. et al. Prodigal: prokaryotic gene recogniti

# v1.0

* **BREAKING CHANGE** - `dnaapler` now uses `MMSeqs2 v13.45111` rather than `BLAST`. You will need to install [MMSeqs2](https://github.com/soedinglab/MMseqs2) if you upgrade (if you use conda, it should be handled for you). The CLI is identical.
* **BREAKING CHANGE** - `dnaapler` now uses `MMSeqs2 v13.45111` rather than `BLAST`. You will need to install [MMSeqs2](https://github.com/soedinglab/MMseqs2) if you upgrade (if you use pixi or conda, it should be handled for you). The CLI is identical.
* There are 2 reasons for this:
1. Users reported problems installing BLAST on MacOS with Apple Silicon (see e.g. [here](https://github.com/gbouras13/pharokka/issues/368)). MMseqs2 works on all platforms and is dilligently maintained.
2. MMSeqs2 is much much faster than BLAST (what took BLAST a few minutes takes MMSeqs2 seconds). We probably should have written `dnaapler` with `MMseqs2` to begin with. `MMSeqs2 v13.45111` was chosen to ensure interoperability with [pharokka](https://github.com/gbouras13/pharokka)
Expand Down Expand Up @@ -121,7 +112,7 @@ If you don't want to install `dnaapler` locally, you can run `dnaapler all` with
- [Documentation](#documentation)
- [Commands](#commands)
- [Installation](#installation)
- [Conda](#conda)
- [Pixi](#pixi)
- [Pip](#pip)
- [Usage](#usage)
- [Example Usage](#example-usage)
Expand Down Expand Up @@ -177,14 +168,14 @@ The full documentation for `dnaapler` can be found [here](https://dnaapler.readt

`dnaapler` requires only `MMseqs2 v13.45111` as an external dependency.

Installation from conda is highly recommended as this will install `MMseqs2` automatically.
Installation using `pixi` is highly recommended as this will install `MMseqs2` automatically.

### Conda
### Pixi

`dnaapler` is available on bioconda.
`dnaapler` is available on bioconda and can be installed globally using `pixi`:

```
conda install -c bioconda dnaapler
pixi global install dnaapler
```

### Pip
Expand Down
11 changes: 0 additions & 11 deletions build/environment.yaml

This file was deleted.

22 changes: 10 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
PROJECT := "dnaapler"
OPEN := if os() == "macos" { "open" } else { "xdg-open" }
VERSION := `poetry version | rg -o '\d+\.\d+\.\d+'`
VERSION := `pixi workspace version get`

# format code with black and isort
fmt:
poetry run black .
poetry run isort .
pixi run fmt

# check format of code with black and isort
check-fmt:
poetry run black --check .
poetry run isort --check .
pixi run check-fmt

# lint code with flake8
lint:
poetry run flake8 .
pixi run lint

# install latest version with poetry
# install environment with pixi
install:
poetry install --no-interaction
pixi install

# run all tests
test opts="":
poetry run pytest -vv {{opts}} tests/
pixi run test {{opts}}

# run tests with coverage report
coverage:
poetry run pytest --cov-report term --cov-report html --cov={{ PROJECT }} --cov-branch tests/
pixi run coverage
{{ OPEN }} htmlcov/index.html

# run tests on the CI
test-ci:
poetry run pytest --cov={{ PROJECT }} --cov-report=xml --cov-branch tests/
pixi run pytest --cov={{ PROJECT }} --cov-report=xml --cov-branch tests/

# prints out the commands to run to tag the release and push it
tag:
Expand All @@ -40,4 +38,4 @@ tag:

# build a python release
build:
poetry build --no-interaction
pixi run build
Loading
Loading