https://github.com/beardymcjohnface/nektool

Cookiecutter profile for making a NextFlow-based bioinformatics tool

https://github.com/beardymcjohnface/nektool

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Cookiecutter profile for making a NextFlow-based bioinformatics tool

Basic Info
  • Host: GitHub
  • Owner: beardymcjohnface
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 68.4 KB
Statistics
  • Stars: 16
  • Watchers: 1
  • Forks: 5
  • Open Issues: 1
  • Releases: 0
Created almost 4 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

Nektool

License: MIT Generic badge CI GitHub last commit

Cookiecutter profile for making a Nextflow-based bioinformatics tool

See Snaketool for a Snakemake-based template

Motivation

Writing reliable command line tools requires a lot of boilerplate to ensure input and generated files are valid, catch errors with subprocesses, log stderr messages etc. It's very time-consuming and annoying. Nextflow does a lot of heavy lifting in this regard and is an obvious alternative to a command line tool.

Building a Nextflow pipeline with a convenience launcher offers many advantages: - Developing command line applications is quicker and easier - Installing, running, and rerunning is easier and more convenient - You can have subcommands for utility scripts and Nextflow workflows - You can trick Snakemake users into running Nextflow - Your pipelines have a proper command line interface and help message!

Who is this for?

People who are already familiar with Nextflow and want to create either a Nextflow-powered command line tool or fancier Nextflow pipelines.

Citation

This template is published in Plos Computational Biology:

https://doi.org/10.1371/journal.pcbi.1010705

Usage

Install Cookiecutter if you don't already have it.

shell conda create -n cookiecutter -c conda-forge cookiecutter conda activate cookiecutter

To create a new tool from this template, use Cookiecutter and follow the prompts.

shell cookiecutter https://github.com/beardymcjohnface/Nektool.git

and here's what you get:

text my_nektool/ ├── MANIFEST.in ├── my_nektool │   ├── __init__.py │   ├── __main__.py │   ├── util.py │   ├── my_nektool.CITATION │   ├── my_nektool.LICENSE │   ├── my_nektool.VERSION │   └── workflow │   ├── nextflow.config │   ├── params.yaml │   └── workflow.nf └── setup.py

The file __main__.py is the entry point. Once installed with pip it will be accessible on command line, in this example as my_nektool. Customise this file to add your own commandline options, help message etc. If you only have one Snakefile you wish to run then this file will need very little customisation.

The directory workflow/ contains an example Nextflow pipeline that will work with the example launcher.

How the launcher works

The launcher first copies the default parameters and config files to the working directory which will allow the user to cusomise them if they wish. The launcher reads in these files and combines it with command-line arguments to pass on to Snakemake. In this example it only has one option to pass: --input. The Launcher updates the config files in the working directory which will be passed to Nextflow. The launcher uses the rest of the command line arguments to launch Nextflow. Most of the command line arguments are boilerplate for running Nextflow and do not require much if any customisation.

Customising your tool

Check out the wiki page for a detailed example on customising your Nektool.

Installing and testing your tool

For development, cd to your Snaketool directory and install with pip:

shell cd my_nektool/ pip install -e . my_nektool --help my_nektool run --help

Test run the template:

shell my_nektool run --input yeet

A slightly more interesting test using any2fasta (in a conda environment) to convert a tiny FASTQ file to FASTA.

sh my_nektool run --use-conda --input my_nektool/workflow/tiny.fastq -entry convert2fasta

Publishing your tool

Check out the wiki page for a detailed look at publishing your tool to PyPI and Conda

Owner

  • Name: Michael Roach
  • Login: beardymcjohnface
  • Kind: user
  • Company: Flinders University

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 3
  • Average time to close issues: 3 days
  • Average time to close pull requests: 3 days
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 2.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: 3 days
  • Average time to close pull requests: 3 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 5.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • beardymcjohnface (1)
  • cpauvert (1)
Pull Request Authors
  • cpauvert (2)
  • Vini2 (1)
  • rsuchecki (1)
Top Labels
Issue Labels
bug (1) documentation (1) enhancement (1)
Pull Request Labels