Skip to content

Commit

Permalink
Merge pull request #2 from nf-core/dev
Browse files Browse the repository at this point in the history
PR for 1.0.0
  • Loading branch information
apeltzer authored May 6, 2019
2 parents 7a53f23 + 780e751 commit ae7f903
Show file tree
Hide file tree
Showing 32 changed files with 764 additions and 578 deletions.
10 changes: 7 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ We try to manage the required tasks for nf-core/bacass using GitHub issues, you

However, don't be put off by this template - other more general issues and suggestions are welcome! Contributions to the code are even more welcome ;)

> If you need help using or modifying nf-core/bacass then the best place to go is the Gitter chatroom where you can ask us questions directly: https://gitter.im/nf-core/Lobby
> If you need help using or modifying nf-core/bacass then the best place to ask is on the pipeline channel on [Slack](https://nf-core-invite.herokuapp.com/).
## Contribution workflow

If you'd like to write some code for nf-core/bacass, the standard workflow
is as follows:

Expand All @@ -22,24 +23,27 @@ is as follows:

If you're not used to this workflow with git, you can start with some [basic docs from GitHub](https://help.github.com/articles/fork-a-repo/) or even their [excellent interactive tutorial](https://try.github.io/).


## Tests

When you create a pull request with changes, [Travis CI](https://travis-ci.org/) will run automatic tests.
Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then.

There are typically two types of tests that run:

### Lint Tests

The nf-core has a [set of guidelines](http://nf-co.re/guidelines) which all pipelines must adhere to.
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core lint <pipeline-directory>` command.

If any failures or warnings are encountered, please follow the listed URL for more documentation.

### Pipeline Tests

Each nf-core pipeline should be set up with a minimal set of test-data.
Travis CI then runs the pipeline on this data to ensure that it exists successfully.
If there are any failures then the automated tests fail.
These tests are run both with the latest available version of Nextflow and also the minimum required version that is stated in the pipeline code.

## Getting help
For further information/help, please consult the [nf-core/bacass documentation](https://github.com/nf-core/bacass#documentation) and don't hesitate to get in touch on [Gitter](https://gitter.im/nf-core/Lobby)

For further information/help, please consult the [nf-core/bacass documentation](https://github.com/nf-core/bacass#documentation) and don't hesitate to get in touch on the pipeline channel on [Slack](https://nf-core-invite.herokuapp.com/).
9 changes: 9 additions & 0 deletions .github/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Markdownlint configuration file
default: true,
line-length: false
no-multiple-blanks: 0
blanks-around-headers: false
blanks-around-lists: false
header-increment: false
no-duplicate-header:
siblings_only: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ tests/test_data
nohup.out
tmp/
._.DS_Store
*.pyc
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ before_install:
# PRs to master are only ok if coming from dev branch
- '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ])'
# Pull the docker image first so the test doesn't wait for this
#- docker pull nfcore/bacass:dev
- docker pull andreaswilm/bacass:dev
- docker pull nfcore/bacass:dev
# Fake the tag locally so that the pipeline runs properly
- docker tag andreaswilm/bacass:dev andreaswilm/bacass:latest
# Looks weird when this is :dev to :dev, but makes sense when testing code for a release (:dev to :1.0.1)
- docker tag nfcore/bacass:dev nfcore/bacass:1.0.0

install:
# Install Nextflow
Expand All @@ -24,6 +24,8 @@ install:
# Install nf-core/tools
- pip install --upgrade pip
- pip install nf-core
# Install markdownlint-cli
- sudo apt-get install npm && npm install -g markdownlint-cli
# Reset
- mkdir ${TRAVIS_BUILD_DIR}/tests && cd ${TRAVIS_BUILD_DIR}/tests

Expand All @@ -34,8 +36,8 @@ env:
script:
# Lint the pipeline code
- nf-core lint ${TRAVIS_BUILD_DIR}
# poor man's syntax check
- nextflow run ${TRAVIS_BUILD_DIR} -test
# Lint the documentation
- markdownlint ${TRAVIS_BUILD_DIR} -c ${TRAVIS_BUILD_DIR}/.github/markdownlint.yml
# Run the pipeline with the test profile
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker

7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# nf-core/bacass: Changelog

## v1.0dev - <date>
## v1.0.0 nf-core/bacass: "Green Tin Ant"

Initial release of nf-core/bacass, created with the [nf-core](http://nf-co.re/) template.

This pipeline is for bacterial assembly of next-generation sequencing reads. It can be used to quality trim your reads using [Skewer](https://github.com/relipmoc/skewer) and performs basic QC using [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/). Afterwards, the pipeline performs read assembly using [Unicycler](https://github.com/rrwick/Unicycler) and assesses assembly quality using [QUAST](http://bioinf.spbau.ru/quast). Contamination of the assembly is checked using [Kraken2](https://ccb.jhu.edu/software/kraken2/) to verify sample purity. The resulting bacterial assembly is annotated using [Prokka](https://github.com/tseemann/prokka).

Furthermore, the pipeline creates various reports in the `results` directory specified, including a [MultiQC](https://multiqc.info) report summarizing some of the findings and software versions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team on the [Gitter channel](https://gitter.im/nf-core/Lobby). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team on [Slack](https://nf-core-invite.herokuapp.com/). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY environment.yml /
RUN conda env create -f /environment.yml && conda clean -a
# for bandage :/ otherwise it complains about missing libGL.so.1
RUN apt-get install -y libgl1-mesa-glx && apt-get clean -y
ENV PATH /opt/conda/envs/nf-core-bacass-latest/bin:$PATH
ENV PATH /opt/conda/envs/nf-core-bacass-1.0.0/bin:$PATH
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Andreas Wilm <[email protected]>
Copyright (c) Andreas Wilm

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
# nf-core/bacass
**Simple bacterial assembly and annotation pipeline**
# ![nf-core/bacass](docs/images/nfcore-bacass_logo.png)

[![Build Status](https://travis-ci.org/nf-core/bacass.svg?branch=master)](https://travis-ci.org/nf-core/bacass)
A simple bacterial assembly and annotation pipeline

[![Build Status](https://travis-ci.com/nf-core/bacass.svg?branch=master)](https://travis-ci.com/nf-core/bacass)
[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A518.10.1-brightgreen.svg)](https://www.nextflow.io/)

[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](http://bioconda.github.io/)
[![Docker](https://img.shields.io/docker/automated/nfcore/bacass.svg)](https://hub.docker.com/r/nfcore/bacass)
![Singularity Container available](
https://img.shields.io/badge/singularity-available-7E4C74.svg)

### Introduction
## Introduction

This pipeline is for bacterial assembly of next-generation sequencing reads. It can be used to quality trim your reads using [Skewer](https://github.com/relipmoc/skewer) and performs basic QC using [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/). Afterwards, the pipeline performs read assembly using [Unicycler](https://github.com/rrwick/Unicycler) and assesses assembly quality using [QUAST](http://bioinf.spbau.ru/quast). Contamination of the assembly is checked using [Kraken2](https://ccb.jhu.edu/software/kraken2/) to verify sample purity. The resulting bacterial assembly is annotated using [Prokka](https://github.com/tseemann/prokka).

This pipeline is for bacterial assembly of next-gen sequencing reads. It quality-trims your reads, runs QC, including a
metagenomics classifier on your reads to check for purity, assembles the reads with
Unicycler, annotates the assembly with Prokka and runs Quast on the assembly for quality check.
Furthermore, the pipeline creates various reports in the `results` directory specified, including a [MultiQC](https://multiqc.info) report summarizing some of the findings and software versions.

The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker / singularity containers making installation trivial and results highly reproducible.
The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker containers making installation trivial and results highly reproducible.

## Documentation

### Documentation
The nf-core/bacass pipeline comes with documentation about the pipeline, found in the `docs/` directory:

1. [Installation](docs/installation.md)
1. [Installation](https://nf-co.re/usage/installation)
2. Pipeline configuration
* [Local installation](docs/configuration/local.md)
* [Adding your own system](docs/configuration/adding_your_own.md)
* [Reference genomes](docs/configuration/reference_genomes.md)
* [Local installation](https://nf-co.re/usage/local_installation)
* [Adding your own system config](https://nf-co.re/usage/adding_own_config)
* [Reference genomes](https://nf-co.re/usage/reference_genomes)
3. [Running the pipeline](docs/usage.md)
4. [Output and how to interpret the results](docs/output.md)
5. [Troubleshooting](docs/troubleshooting.md)
5. [Troubleshooting](https://nf-co.re/usage/troubleshooting)


## Credits

### Credits
nf-core/bacass was originally written by Andreas Wilm.
nf-core/bacass was originally written by [Andreas Wilm](https://github.com/andreas-wilm) and is currently maintained by [Alexander Peltzer](https://github.com/apeltzer).
18 changes: 0 additions & 18 deletions Singularity

This file was deleted.

2 changes: 1 addition & 1 deletion assets/email_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="description" content="nf-core/bacass: Simple bacterial assembly and annotation pipeline">
<meta name="description" content="nf-core/bacass: Simple bacterial assembly and annotation pipeline.">
<title>nf-core/bacass Pipeline Report</title>
</head>
<body>
Expand Down
17 changes: 0 additions & 17 deletions assets/email_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ ${errorReport}
} %>


<% if (!success){
out << """####################################################
## nf-core/bacass execution completed unsuccessfully! ##
####################################################
The exit status of the task that caused the workflow execution to fail was: $exitStatus.
The full error message was:

${errorReport}
"""
} else {
out << "## nf-core/bacass execution completed successfully! ##"
}
%>




The workflow was completed at $dateComplete (duration: $duration)

The command used to launch the workflow was as follows:
Expand Down
2 changes: 2 additions & 0 deletions conf/multiqc_config.yaml → assets/multiqc_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ report_comment: >
report_section_order:
nf-core/bacass-software-versions:
order: -1000

export_plots: true
31 changes: 28 additions & 3 deletions assets/sendmail_template.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
To: $email
Subject: $subject
Mime-Version: 1.0
Content-Type: multipart/related;boundary="nfmimeboundary"
Content-Type: multipart/related;boundary="nfcoremimeboundary"

--nfmimeboundary
--nfcoremimeboundary
Content-Type: text/html; charset=utf-8

$email_html

--nfmimeboundary--
<%
if (mqcFile){
def mqcFileObj = new File("$mqcFile")
if (mqcFileObj.length() < mqcMaxSize){
out << """
--nfcoremimeboundary
Content-Type: text/html; name=\"multiqc_report\"
Content-Transfer-Encoding: base64
Content-ID: <mqcreport>
Content-Disposition: attachment; filename=\"${mqcFileObj.getName()}\"

${mqcFileObj.
bytes.
encodeBase64().
toString().
tokenize( '\n' )*.
toList()*.
collate( 76 )*.
collect { it.join() }.
flatten().
join( '\n' )}
"""
}}
%>

--nfcoremimeboundary--
26 changes: 23 additions & 3 deletions bin/scrape_software_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
from collections import OrderedDict
import re

# TODO nf-core: Add additional regexes for new tools in process get_software_versions
regexes = {
'nf-core/bacass': ['v_pipeline.txt', r"(\S+)"],
'Nextflow': ['v_nextflow.txt', r"(\S+)"],
'FastQC': ['v_fastqc.txt', r"FastQC v(\S+)"],
'MultiQC': ['v_multiqc.txt', r"multiqc, version (\S+)"],
'Skewer': ['v_skewer.txt', r"version: (\S+)"],
'Kraken2': ['v_kraken2.txt', r"([\d\.]+)-beta"],
'Quast': ['v_quast.txt', r"QUAST v(\S+)"],
'Prokka': ['v_prokka.txt', r"prokka (\S+)"],
'Bandage': ['v_bandage.txt', r"Version: (\S+)"],
}

results = OrderedDict()
results['nf-core/bacass'] = '<span style="color:#999999;\">N/A</span>'
results['Nextflow'] = '<span style="color:#999999;\">N/A</span>'
results['FastQC'] = '<span style="color:#999999;\">N/A</span>'
results['MultiQC'] = '<span style="color:#999999;\">N/A</span>'
results['Skewer'] = '<span style="color:#999999;\">N/A</span>'
results['Kraken2'] = '<span style="color:#999999;\">N/A</span>'
results['Quast'] = '<span style="color:#999999;\">N/A</span>'
results['Prokka'] = '<span style="color:#999999;\">N/A</span>'
results['Bandage'] = '<span style="color:#999999;\">N/A</span>'

# Search each file using its regex
for k, v in regexes.items():
Expand All @@ -24,9 +34,14 @@
if match:
results[k] = "v{}".format(match.group(1))

# Remove software set to false in results
for k in results:
if not results[k]:
del(results[k])

# Dump to YAML
print ('''
id: 'nf-core/bacass-software-versions'
id: 'software_versions'
section_name: 'nf-core/bacass Software Versions'
section_href: 'https://github.com/nf-core/bacass'
plot_type: 'html'
Expand All @@ -35,5 +50,10 @@
<dl class="dl-horizontal">
''')
for k,v in results.items():
print(" <dt>{}</dt><dd>{}</dd>".format(k,v))
print(" <dt>{}</dt><dd><samp>{}</samp></dd>".format(k,v))
print (" </dl>")

# Write out regexes as csv file:
with open('software_versions.csv', 'w') as f:
for k,v in results.items():
f.write("{}\t{}\n".format(k,v))
11 changes: 0 additions & 11 deletions conf/aquila.config

This file was deleted.

11 changes: 8 additions & 3 deletions conf/awsbatch.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/*
* -------------------------------------------------
* Nextflow config file for AWS Batch
* Nextflow config file for running on AWS batch
* -------------------------------------------------
* Imported under the 'awsbatch' Nextflow profile in nextflow.config
* Uses docker for software depedencies automagically, so not specified here.
* Base config needed for running with -profile awsbatch
*/
params {
config_profile_name = 'AWSBATCH'
config_profile_description = 'AWSBATCH Cloud Profile'
config_profile_contact = 'Alexander Peltzer (@apeltzer)'
config_profile_url = 'https://aws.amazon.com/de/batch/'
}

aws.region = params.awsregion
process.executor = 'awsbatch'
Expand Down
Loading

0 comments on commit ae7f903

Please sign in to comment.