Skip to content

Commit

Permalink
Merge pull request #29 from matt-sd-watson/rename_to_spora
Browse files Browse the repository at this point in the history
Rename to spora
  • Loading branch information
matt-sd-watson authored Jun 15, 2022
2 parents 09877eb + 3139f3a commit c65717e
Show file tree
Hide file tree
Showing 22 changed files with 160 additions and 110 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: outbreaker
name: spora

# Controls when the workflow will run
on:
Expand All @@ -12,7 +12,7 @@ on:

jobs:
build:
name: Outbreaker test on ${{ matrix.os }}
name: spora test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -22,20 +22,20 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environments/environment.yml
activate-environment: ncov_outbreaker
activate-environment: ncov_spora
channels: conda-forge,bioconda,defaults,r
mamba-version: "*"
- name: Install outbreaker
- name: Install spora
run: pip install .
- name: Check outbreaker version
- name: Check spora version
shell: bash -l {0}
run: outbreaker -v
- name: Run outbreaker test via CLI
run: spora -v
- name: Run spora test via CLI
shell: bash -l {0}
run: outbreaker -f data/tests/focal_seqs.fa -b data/tests/background_seqs.fa -r data/reference/ncov_reference.gb -o outbreaker_test -p test --snps-only --report --rename --names-csv data/tests/names.csv
- name: Run outbreaker test via config
run: spora -f data/tests/focal_seqs.fa -b data/tests/background_seqs.fa -r data/reference/ncov_reference.gb -o outbreaker_test -p test --snps-only --report --rename --names-csv data/tests/names.csv
- name: Run spora test via config
shell: bash -l {0}
run: outbreaker -c data/test_config.yaml
- name: Run pytest for outbreaker
run: spora -c data/test_config.yaml
- name: Run pytest for spora
shell: bash -l {0}
run: pytest tests/
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish spora to PyPI on release tag

on:
release:
types:
- "published"
jobs:
pypi_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/[email protected]
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install pandas>=1.1.5 numpy>=1.19 biopython>=1.79 pytest>=7.1.2 snakemake>=7.0.0 pypandoc>=1.8
- name: build package
run: |
pip install pandoc>=2.2
python setup.py sdist bdist_wheel
- name: publish to PyPI
# only create relases from tagged commits to master:
if: startsWith(github.ref, 'refs/tags')
uses: pypa/[email protected]
with:
# if no "user:" specified use pypi token instead of username/password
password: ${{ secrets.PUBLISH_PYPI_SPORA }} # use secret from github secrets
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# outbreaker Changelog
# spora Changelog

## Version 0.1.0, 06-10-21
- Initial workflow
Expand Down Expand Up @@ -66,3 +66,9 @@
- Above fix changes fixes the error in the SNP distance plot in the HTML report when rename is used but no names CSV is supplied
- Addition of pytests in the CI/CD workflow

## Version 0.7.0, 15-06-22

- outbreaker is renamed to spora to be compatible with PyPi
- version change to dplyr dependency for conda env
- Addition of CD GA workflow to pudblish to PyPi on release

37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# outbreaker
# spora: Streamlined Phylogenomic Outbreak Report Analysis

![example workflow](https://github.com/matt-sd-watson/outbreaker/actions/workflows/main.yml/badge.svg)
![example workflow](https://github.com/matt-sd-watson/spora/actions/workflows/main.yml/badge.svg)

snakemake and Python integrated workflow for intermediate file generation for COVID outbreak analysis

## Installation

```
git clone https://github.com/matt-sd-watson/outbreaker.git
conda env create -f ncov_outbreaker/environments/environment.yml
conda activate ncov_outbreaker
cd outbreaker
git clone https://github.com/matt-sd-watson/spora.git
conda env create -f ncov_spora/environments/environment.yml
conda activate ncov_spora
cd spora
pip install .
```

## Updating

```
conda activate ncov_outbreaker
cd ~/outbreaker
conda activate ncov_spora
cd ~/spora
git checkout main
git pull
pip install .
Expand All @@ -27,11 +27,11 @@ pip install .
## Usage
```
usage:
outbreaker -c <config.yaml>
spora -c <config.yaml>
OR
outbreaker --focal_list ...<input args>
spora --focal_list ...<input args>
Outbreaker: Python and snakemake outbreak workflow for COVID-19
spora: Streamlined Phylogenomic Outbreak Report Analysis
optional arguments:
-h, --help Show the help output and exit.
Expand All @@ -42,16 +42,15 @@ optional arguments:
-b BACKGROUND_SEQS, --background-sequences BACKGROUND_SEQS
Optional input .txt list or multi-FASTA background samples to add to analysis
-m MASTER_FASTA, --master-fasta MASTER_FASTA
Master FASTA of genomic sequences to select from. Required if either --focal-sequences or --background-sequences are not supplied in
FASTA format
Master FASTA of genomic sequences to select from. Required if either --focal-sequences or --background-sequences are not supplied in FASTA format
-o OUTDIR, --output-directory OUTDIR
Path to the desired output directory. If none is provided, a new folder named outbreaker will be created in the current directory
Path to the desired output directory. If none is provided, a new folder named spora will be created in the current directory
-r REFERENCE, --reference REFERENCE
.gb file containing the desired COVID-19 reference sequence. Required
-p PREFIX, --prefix PREFIX
Prefix string to label all output files. Default: outbreak
-t NTHREADS, --nthreads NTHREADS
Number of threads to use for processing. Default: 4
Number of threads to use for processing. Default: 2
-s, --snps-only Generate a snps-only FASTA from the input FASTA. Default: False
-rn, --rename Rename the FASTA headers to be compatible with NML standards. Default: False
-nc NAMES_CSV, --names-csv NAMES_CSV
Expand All @@ -63,16 +62,16 @@ optional arguments:
Integer for the minimum genome completeness percentage for filtering. Default: 90
-gl GENOME_LENGTH, --genome-length GENOME_LENGTH
Integer for the minimum genome length for filtering. Default: 29500
-rp, --report Generate a summary output report for the outbreaker run. Default: Not enabled
-v, --version Show the current outbreaker version then exit.
-rp, --report Generate a summary output report for the spora run. Default: Not enabled
-v, --version Show the current spora version then exit.
```

## Documentation

More detailed documentation for outbreaker usage and functionality can be found [here](docs/0-OVERVIEW.md)
More detailed documentation for spora usage and functionality can be found [here](docs/0-OVERVIEW.md)

## Acknowledgments

Inspiration for code structure and design for outbreaker was inspired by [pangolin](https://github.com/cov-lineages/pangolin) and [civet](https://github.com/artic-network/civet), and minor code blocks were adopted from these software.
Inspiration for code structure and design for spora was inspired by [pangolin](https://github.com/cov-lineages/pangolin) and [civet](https://github.com/artic-network/civet), and minor code blocks were adopted from these software.

The **Background** section in the documentation describing outbreak definitions was written by Mark Horsman.
2 changes: 1 addition & 1 deletion data/test_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ background_seqs: tests/background_seqs.fa

reference: reference/ncov_reference.gb

outdir: outbreaker_test_config
outdir: spora_test_config

snps_only: True

Expand Down
8 changes: 4 additions & 4 deletions docs/0-OVERVIEW.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# outbreaker
# spora

## Overview
outbreaker is a workflow written in snakemake and Python that aims to facilitate rapid generation of intermediate input files that are required for outbreak analysis for COVID-19 at PHO. The workflow is designed to be flexible with command line inputs, providing users with options that can be toggled depending on the nature of the outbreak request and the input files required for downstream outbreak analysis tools.
At its core, outbreaker is designed to accept only a small number of mandatory inputs from the user, and will use a standard set of bioinformatics tools to produce a number of output files such as alignments, trees, SNP matrices, etc., that are often the required inputs for downstream outbreak tools such as [ggtree](https://github.com/YuLab-SMU/ggtree) and/or [civet/civet3](https://github.com/snake-flu/civet3).
spora is a workflow written in snakemake and Python that aims to facilitate rapid generation of intermediate input files that are required for outbreak analysis for COVID-19 at PHO. The workflow is designed to be flexible with command line inputs, providing users with options that can be toggled depending on the nature of the outbreak request and the input files required for downstream outbreak analysis tools.
At its core, spora is designed to accept only a small number of mandatory inputs from the user, and will use a standard set of bioinformatics tools to produce a number of output files such as alignments, trees, SNP matrices, etc., that are often the required inputs for downstream outbreak tools such as [ggtree](https://github.com/YuLab-SMU/ggtree) and/or [civet/civet3](https://github.com/snake-flu/civet3).


## Background
Expand All @@ -13,7 +13,7 @@ At the same time, WGS data from COVID-19 cases known to not be involved in the s
## Workflow

<p align="center">
<img src="images/outbreaker_workflow.png">
<img src="images/spora_workflow.png">
</p>


Expand Down
26 changes: 13 additions & 13 deletions docs/1-INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ The following tools/packages are required: \

## Basic installation from source

The basic installation instructions for outbreaker are as follows:
The basic installation instructions for spora are as follows:

```
git clone https://github.com/matt-sd-watson/outbreaker.git
conda env create -f outbreaker/environments/environment.yml
conda activate ncov_outbreaker
cd outbreaker
git clone https://github.com/matt-sd-watson/spora.git
conda env create -f spora/environments/environment.yml
conda activate ncov_spora
cd spora
pip install .
```

## Usage

Test that the installation was successful using the following commands:
```
outbreaker
spora
#OR
outbreaker --help
spora --help
```

which should result in the following output:

```
usage:
outbreaker -c <config.yaml>
spora -c <config.yaml>
OR
outbreaker --focal_list ...<input args>
spora --focal_list ...<input args>
Outbreaker: Python and snakemake outbreak workflow for COVID-19
spora: Python and snakemake outbreak workflow for COVID-19
optional arguments:
-h, --help Show the help output and exit.
Expand All @@ -49,7 +49,7 @@ optional arguments:
Master FASTA of genomic sequences to select from. Required if either --focal-sequences or --background-sequences are not supplied in
FASTA format
-o OUTDIR, --output-directory OUTDIR
Path to the desired output directory. If none is provided, a new folder named outbreaker will be created in the current directory
Path to the desired output directory. If none is provided, a new folder named spora will be created in the current directory
-r REFERENCE, --reference REFERENCE
.gb file containing the desired COVID-19 reference sequence. Required
-p PREFIX, --prefix PREFIX
Expand All @@ -67,8 +67,8 @@ optional arguments:
Integer for the minimum genome completeness percentage for filtering. Default: 90
-gl GENOME_LENGTH, --genome-length GENOME_LENGTH
Integer for the minimum genome length for filtering. Default: 29500
-rp, --report Generate a summary output report for the outbreaker run. Default: Not enabled
-v, --version Show the current outbreaker version then exit.
-rp, --report Generate a summary output report for the spora run. Default: Not enabled
-v, --version Show the current spora version then exit.
```

Expand Down
Loading

0 comments on commit c65717e

Please sign in to comment.