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
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
49 changes: 15 additions & 34 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,33 @@
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-latest, 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 }} pip
python -m pip install --upgrade pip
pip install -e .
pip install ruff
pip install pytest
pip install pytest-cov
- 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
pixi-version: v0.71.2
cache: true
environments: dev

- name: Check formatting and lint
run: pixi run check-fmt

- name: Run unit tests
run: pixi run test-ci

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


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

steps:
- uses: actions/checkout@v3
- 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 ruff
pixi-version: v0.71.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:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
password: ${{ secrets.PYPI_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@ ENV/
.DS_Store
*/.DS_Store
*/*/.DS_Store

# pixi environments
.pixi/*
!.pixi/config.toml
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# 1.4.0

* Adds support for gzip-, bzip2- and xz-compressed input ([#98](https://github.com/gbouras13/dnaapler/issues/98)). `dnaapler` now transparently decompresses `.gz`, `.bz2` and `.xz` input files (detected from the file's contents, regardless of extension), so compressed FASTA or GFA files can be passed directly to any subcommand.
* Fixes [#102](https://github.com/gbouras13/dnaapler/issues/102). `dnaapler largest`, `mystery` and `nearest` could reorient to the wrong coordinate when the chosen CDS was on the negative strand, as the lowest coordinate of the CDS was used instead of its actual start codon. The reoriented sequence now correctly begins at the start codon. A related latent bug in the negative-strand fallback of the MMseqs2-based reorientation was also fixed.
* If you run `dnaapler` with GFA input, it now also writes a `{prefix}_reoriented.fasta` alongside the `{prefix}_reoriented.gfa`. This FASTA contains all contigs from the GFA (circular contigs reoriented with overlap trimmed, non-circular contigs passed through unchanged), so it can be fed directly to downstream tools such as polishers.
* If a GFA input contains no circular sequences, `dnaapler` no longer exits with an error. Instead it warns, copies the input GFA to the output, and writes all sequences out as a linear `{prefix}_reoriented.fasta`. For `dnaapler all` and `dnaapler bulk`, a reorientation summary is also written with every contig marked as not reoriented.
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ If you don't want to install `dnaapler` locally, you can run `dnaapler all` with
- [Documentation](#documentation)
- [Commands](#commands)
- [Installation](#installation)
- [Pixi](#pixi)
- [Conda](#conda)
- [Pip](#pip)
- [Usage](#usage)
Expand Down Expand Up @@ -177,7 +178,15 @@ 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` or `conda` is highly recommended as this will install `MMseqs2` automatically.

### Pixi

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

```
pixi global install dnaapler
```

### Conda

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

This file was deleted.

2 changes: 1 addition & 1 deletion docs/run.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Running `dnaapler`

For all subcommands, `dnaapler` requires an input FASTA file using the `-i` or `--input` parameters.
For all subcommands, `dnaapler` requires an input FASTA file using the `-i` or `--input` parameters. The input may be in FASTA or GFA format, and may be gzip (`.gz`), bzip2 (`.bz2`) or xz (`.xz`) compressed (this is detected automatically, regardless of the file extension).

It is also highly recommended to specify an output directory using the `-o` or `--output` parameters, otherwise `dnaapler` will write the output to a directory named `output.dnaapler` by default.

Expand Down
20 changes: 9 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
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 ruff
fmt:
poetry run ruff format .
poetry run ruff check --fix .
pixi run fmt

# check formatting and lint with ruff
check-fmt:
poetry run ruff format --check .
poetry run ruff check .
pixi run check-fmt

# 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 test-ci

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

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