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
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/other.md

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/condabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Condabot

on:
schedule:
- cron: '0 2 * * 1'
workflow_dispatch:

jobs:
run-condabot:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: sunbeam-labs/condabot@v1
14 changes: 0 additions & 14 deletions .github/workflows/pr.yml

This file was deleted.

61 changes: 9 additions & 52 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,31 @@
name: Tests

on:
workflow_dispatch:

pull_request:
branches: [ master, main ]
branches: [ main, master ]
push:
branches: [ master, main ]
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 13 * * 1"
branches: [ main, master ]

jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Dependencies
run: pip install black snakefmt

- name: Run Linter
run: |
black --check .
snakefmt --check *.smk

test-unit:
name: Run Extension Unit Tests
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Dependencies
run: pip install pytest pandas

- name: Run Unit Tests
run: pytest .tests/unit/

test-e2e:
name: Test Extension with Sunbeam
runs-on: ubuntu-latest
needs:
- test-unit
- lint

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Test with Sunbeam
- name: Sunbeam tests
uses: sunbeam-labs/sbx_test_action@v1

- name: Dump Logs
shell: bash
if: always()
run: tail -n +1 logs/*
run: tail -n +1 logs/* || true

- name: Dump Stats
shell: bash
if: always()
run: cat stats/*
run: cat stats/* || true
26 changes: 8 additions & 18 deletions .tests/e2e/test_dry_run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pytest
import shutil
import subprocess as sp
Expand All @@ -6,14 +7,8 @@


@pytest.fixture
def setup(monkeypatch):
def setup():
temp_dir = Path(tempfile.mkdtemp())
monkeypatch.setenv(
"SUNBEAM_EXTENSIONS", str(Path(__file__).parent.parent.parent.parent.resolve())
)
print(
"SUNBEAM_EXTENSIONS:", str(Path(__file__).parent.parent.parent.parent.resolve())
)

reads_fp = Path(".tests/data/reads/").resolve()

Expand All @@ -22,8 +17,6 @@ def setup(monkeypatch):
sp.check_output(["sunbeam", "init", "--data_fp", reads_fp, project_dir])

config_fp = project_dir / "sunbeam_config.yml"
with open(config_fp, "r") as f:
print("Initial config file content:", f.read())

config_str = f"sbx_sga: {{mash_ref: '{temp_dir}/dummy.msh'}}"
Path(temp_dir / "dummy.msh").touch()
Expand Down Expand Up @@ -94,15 +87,12 @@ def run_sunbeam(setup):
print("STDOUT: ", sbx_proc.stdout)
print("STDERR: ", sbx_proc.stderr)

try:
shutil.copytree(log_fp, "logs/")
shutil.copytree(stats_fp, "stats/")
except FileNotFoundError:
print("No logs or stats directory found.")
Path("logs/").mkdir(parents=True, exist_ok=True)
Path("stats/").mkdir(parents=True, exist_ok=True)
Path("logs/file").touch()
Path("stats/file").touch()
if os.getenv("GITHUB_ACTIONS") == "true":
try:
shutil.copytree(log_fp, "logs/")
shutil.copytree(stats_fp, "stats/")
except FileNotFoundError:
print("No logs or stats directory found.")

output_fp = project_dir / "sunbeam_output"
benchmarks_fp = project_dir / "stats/"
Expand Down
32 changes: 4 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,20 @@

<!-- Badges start -->
[![Tests](https://github.com/sunbeam-labs/sbx_sga/actions/workflows/tests.yml/badge.svg)](https://github.com/sunbeam-labs/sbx_sga/actions/workflows/tests.yml)
![Condabot](https://img.shields.io/badge/condabot-active-purple)
[![DockerHub](https://img.shields.io/docker/pulls/sunbeamlabs/sbx_sga)](https://hub.docker.com/repository/docker/sunbeamlabs/sbx_sga/)
<!-- Badges end -->

## Introduction

sbx_sga (Single Genome Assembly) is a [sunbeam](https://github.com/sunbeam-labs/sunbeam) extension for isolate QC, assembly, and classification. This pipeline uses [Mash](https://github.com/marbl/mash) for quality control, [Shovill](https://github.com/tseemann/shovill) for bacterial isolate assembly, [CheckM2](https://github.com/chklovski/CheckM2) and [QUAST](https://github.com/ablab/quast) for assembly QC, [MLST](https://github.com/tseemann/mlst) for typing, [Bakta](https://github.com/oschwengers/bakta) for annotation, [abriTAMR](https://github.com/MDU-PHL/abritamr) for AMR profiling, and [Sylph](https://github.com/bluenote-1577/sylph) for taxonomic classification.

## Installation

Extension install is as simple as passing the extension's URL on GitHub to `sunbeam extend`:

sunbeam extend https://github.com/sunbeam-labs/sbx_sga

Any user-modifiable parameters specified in `config.yml` are automatically added on `sunbeam init`. If you're installing an extension in a project where you already have a config file, run the following to add the options for your newly added extension to your config (the `-i` flag means in-place config file modification; remove the `-i` flag to see the new config in stdout):

sunbeam config update -i /path/to/project/sunbeam_config.yml

Installation instructions for older versions of Sunbeam are included at the end of this README.

## Running

To run an extension, simply run Sunbeam as usual with your extension's target rule specified:

sunbeam run --profile /path/to/project/ example_rule

### Options for config.yml
## Config

- mash_ref: the reference file for running Mash (should be a file ending in `.msh`)
- checkm_ref: the diamond database for running CheckM2 (should be a file ending in `.dmnd`)
- bakta_ref: the bakta reference database (should be a directory similar to `.../bakta_db/db/`)

## Installing an extension (legacy instructions for sunbeam <3.0)

Installing an extension is as simple as cloning (or moving) your extension directory into the sunbeam/extensions/ folder, installing requirements through Conda, and adding the new options to your existing configuration file:

git clone https://github.com/sunbeam-labs/sbx_sga/ sunbeam/extensions/sbx_sga
cat sunbeam/extensions/sbx_sga/config.yml >> sunbeam_config.yml

## Issues with pipeline
## Docs

Please post any issues with this extension [here](https://github.com/sunbeam-labs/sbx_sga/issues).
More [docs](https://sunbeam.readthedocs.io/en/stable/extensions.html).
88 changes: 1 addition & 87 deletions envs/abritamr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,5 @@ name: sga_abritamr
channels:
- conda-forge
- bioconda
- defaults
- r
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- abritamr=1.0.11
- blast=2.15.0
- bzip2=1.0.8
- c-ares=1.28.1
- ca-certificates=2024.2.2
- curl=7.88.1
- entrez-direct=21.6
- gettext=0.22.5
- gettext-tools=0.22.5
- hmmer=3.4
- keyutils=1.6.1
- krb5=1.20.1
- ld_impl_linux-64=2.40
- libasprintf=0.22.5
- libasprintf-devel=0.22.5
- libblas=3.9.0
- libcblas=3.9.0
- libcurl=7.88.1
- libedit=3.1.20191231
- libev=4.33
- libffi=3.4.2
- libgcc-ng=13.2.0
- libgettextpo=0.22.5
- libgettextpo-devel=0.22.5
- libgfortran-ng=13.2.0
- libgfortran5=13.2.0
- libgomp=13.2.0
- libidn2=2.3.7
- liblapack=3.9.0
- libnghttp2=1.58.0
- libnsl=2.0.1
- libopenblas=0.3.27
- libsqlite=3.45.3
- libssh2=1.11.0
- libstdcxx-ng=13.2.0
- libunistring=0.9.10
- libxcrypt=4.4.36
- libzlib=1.2.13
- ncbi-amrfinderplus=3.10.16
- ncbi-vdb=3.1.1
- ncurses=6.5
- numpy=1.21.6
- openssl=3.3.0
- pandas=1.3.5
- pcre=8.45
- perl=5.32.1
- perl-archive-tar=2.40
- perl-carp=1.50
- perl-common-sense=3.75
- perl-compress-raw-bzip2=2.201
- perl-compress-raw-zlib=2.202
- perl-encode=3.21
- perl-exporter=5.74
- perl-exporter-tiny=1.002002
- perl-extutils-makemaker=7.70
- perl-io-compress=2.201
- perl-io-zlib=1.14
- perl-json=4.10
- perl-json-xs=2.34
- perl-list-moreutils=0.430
- perl-list-moreutils-xs=0.430
- perl-parent=0.241
- perl-pathtools=3.75
- perl-scalar-list-utils=1.63
- perl-storable=3.15
- perl-types-serialiser=1.01
- pip=24.0
- python=3.7.12
- python-dateutil=2.9.0
- python_abi=3.7
- pytz=2024.1
- readline=8.2
- setuptools=59.8.0
- six=1.16.0
- sqlite=3.45.3
- tk=8.6.13
- wget=1.21.4
- wheel=0.34.2
- xlsxwriter=3.1.9
- xz=5.2.6
- zlib=1.2.13
- zstd=1.5.6

- abritamr
Loading