From 21a71b52862d1859bb6407e366d62c18808608d9 Mon Sep 17 00:00:00 2001 From: Travis CI User Date: Tue, 9 Apr 2019 11:45:11 +0000 Subject: [PATCH 01/11] Update nf-core pipeline template. --- .github/CONTRIBUTING.md | 34 ++- .github/ISSUE_TEMPLATE/bug_report.md | 31 +++ .github/ISSUE_TEMPLATE/feature_request.md | 16 ++ ...ll_request.md => PULL_REQUEST_TEMPLATE.md} | 2 +- .github/bug_report.md | 29 -- .github/feature_request.md | 16 -- .github/markdownlint.yml | 9 + .gitignore | 1 + .travis.yml | 34 +-- CHANGELOG.md | 3 +- CODE_OF_CONDUCT.md | 2 +- Dockerfile | 5 +- LICENSE | 2 + README.md | 29 +- Singularity | 17 -- assets/email_template.html | 2 +- assets/email_template.txt | 17 -- {conf => assets}/multiqc_config.yaml | 2 + assets/sendmail_template.txt | 31 ++- bin/scrape_software_versions.py | 15 +- bin/scrape_software_versions.pyc | Bin 1508 -> 0 bytes conf/awsbatch.config | 11 +- conf/base.config | 13 +- conf/igenomes.config | 1 + conf/test.config | 7 +- docs/README.md | 13 +- docs/configuration/adding_your_own.md | 86 ------ docs/configuration/reference_genomes.md | 49 ---- docs/installation.md | 115 -------- docs/output.md | 3 +- docs/troubleshooting.md | 28 -- docs/usage.md | 167 ++++++----- environment.yml | 11 +- main.nf | 263 ++++++++++++------ nextflow.config | 87 +++--- 35 files changed, 533 insertions(+), 618 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md rename .github/{pull_request.md => PULL_REQUEST_TEMPLATE.md} (94%) delete mode 100644 .github/bug_report.md delete mode 100644 .github/feature_request.md create mode 100644 .github/markdownlint.yml delete mode 100644 Singularity rename {conf => assets}/multiqc_config.yaml (95%) delete mode 100644 bin/scrape_software_versions.pyc delete mode 100644 docs/configuration/adding_your_own.md delete mode 100644 docs/configuration/reference_genomes.md delete mode 100644 docs/installation.md delete mode 100644 docs/troubleshooting.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0d9b7f8b..6a5ef862 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,12 +1,14 @@ -# nf-core/rnafusion Contributing Guidelines +# nf-core/rnafusion: Contributing Guidelines Hi there! Many thanks for taking an interest in improving nf-core/rnafusion. -We try to manage the required tasks for nf-core/rnafusion using GitHub issues, you probably came to this page when creating one. Please use the prefilled template to save time. +We try to manage the required tasks for nf-core/rnafusion using GitHub issues, you probably came to this page when creating one. Please use the pre-filled template to save time. 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 nf-core/rnafusion 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/rnafusion 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/rnafusion, the standard workflow @@ -15,11 +17,31 @@ is as follows: 1. Check that there isn't already an issue about your idea in the [nf-core/rnafusion issues](https://github.com/nf-core/rnafusion/issues) to avoid duplicating work. - * Feel free to add a new issue here for the same reason. + * If there isn't one already, please create one so that others know you're working on this 2. Fork the [nf-core/rnafusion repository](https://github.com/nf-core/rnafusion) to your GitHub account 3. Make the necessary changes / additions within your forked repository -4. Submit a Pull Request against the master branch and wait for the code to be reviewed and merged. +4. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged. 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/). -For further information/help, please consult the [nf-core/rnafusion documentation](https://github.com/nf-core/rnafusion#documentation) and don't hesitate to get in touch on [Gitter](https://gitter.im/nf-core/Lobby) + +## 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 ` 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/rnafusion documentation](https://github.com/nf-core/rnafusion#documentation) and don't hesitate to get in touch on the pipeline channel on [Slack](https://nf-core-invite.herokuapp.com/). diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..405f88fe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +Hi there! + +Thanks for telling us about a problem with the pipeline. Please delete this text and anything that's not relevant from the template below: + +#### Describe the bug +A clear and concise description of what the bug is. + +#### Steps to reproduce +Steps to reproduce the behaviour: +1. Command line: `nextflow run ...` +2. See error: _Please provide your error message_ + +#### Expected behaviour +A clear and concise description of what you expected to happen. + +#### System: + - Hardware: [e.g. HPC, Desktop, Cloud...] + - Executor: [e.g. slurm, local, awsbatch...] + - OS: [e.g. CentOS Linux, macOS, Linux Mint...] + - Version [e.g. 7, 10.13.6, 18.3...] + +#### Nextflow Installation: + - Version: [e.g. 0.31.0] + +#### Container engine: + - Engine: [e.g. Conda, Docker or Singularity] + - version: [e.g. 1.0.0] + - Image tag: [e.g. nfcore/rnafusion:1.0.0] + +#### Additional context +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..1f025b77 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,16 @@ +Hi there! + +Thanks for suggesting a new feature for the pipeline! Please delete this text and anything that's not relevant from the template below: + +#### Is your feature request related to a problem? Please describe. +A clear and concise description of what the problem is. +Ex. I'm always frustrated when [...] + +#### Describe the solution you'd like +A clear and concise description of what you want to happen. + +#### Describe alternatives you've considered +A clear and concise description of any alternative solutions or features you've considered. + +#### Additional context +Add any other context about the feature request here. diff --git a/.github/pull_request.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 94% rename from .github/pull_request.md rename to .github/PULL_REQUEST_TEMPLATE.md index 8f9f1202..2eb3f51f 100644 --- a/.github/pull_request.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,7 +5,7 @@ Please fill in the appropriate checklist below (delete whatever is not relevant) ## PR checklist - [ ] This comment contains a description of changes (with reason) - [ ] If you've fixed a bug or added code that should be tested, add tests! - - [ ] If necessary, also make a PR on the [nf-core/rnafusion branch on the nf-core/test-datasets repo]( https://github.com/nf-core/test-datasets/pull/newnf-core/rnafusion) + - [ ] If necessary, also make a PR on the [nf-core/rnafusion branch on the nf-core/test-datasets repo]( https://github.com/nf-core/test-datasets/pull/new/nf-core/rnafusion) - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`). - [ ] Make sure your code lints (`nf-core lint .`). - [ ] Documentation in `docs` is updated diff --git a/.github/bug_report.md b/.github/bug_report.md deleted file mode 100644 index d0405d12..00000000 --- a/.github/bug_report.md +++ /dev/null @@ -1,29 +0,0 @@ -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Command line '...' -2. See error **Please provide your error message** - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**System (please complete the following information):** - - Hardware: [e.g. HPC, Desktop, Cloud...] - - Executor: [e.g. slurm, local, awsbatch...] - - OS: [e.g. CentOS Linux, macOS, Linux Mint...] - - Version [e.g. 7, 10.13.6, 18.3...] - -**Nextflow (please complete the following information):** - - Version: [e.g. 0.31.0] - -**Container engine (please complete the following information):** - - Engine: [e.g. Conda, Docker or Singularity] - - version: [e.g. 1.0.0] - -**Container (please complete the following information):** - - tag: [e.g. 1.0.0] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/feature_request.md b/.github/feature_request.md deleted file mode 100644 index 3616d75c..00000000 --- a/.github/feature_request.md +++ /dev/null @@ -1,16 +0,0 @@ -**Is your feature request related to a problem? Please describe.** - -A clear and concise description of what the problem is. -Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** - -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** - -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** - -Add any other context about the feature request here. diff --git a/.github/markdownlint.yml b/.github/markdownlint.yml new file mode 100644 index 00000000..e052a635 --- /dev/null +++ b/.github/markdownlint.yml @@ -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 diff --git a/.gitignore b/.gitignore index 46f69e41..5b54e3e6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ data/ results/ .DS_Store tests/test_data +*.pyc diff --git a/.travis.yml b/.travis.yml index 8998acd1..0962986a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,42 +1,42 @@ sudo: required -language: java +language: python jdk: openjdk8 -services: - - docker -python: - - "2.7" +services: docker +python: '3.6' cache: pip matrix: fast_finish: true before_install: - # PRs made to 'master' branch should always orginate from another repo or the 'dev' branch + # 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/rnafusion + - docker pull nfcore/rnafusion:dev # Fake the tag locally so that the pipeline runs properly - - docker tag nfcore/rnafusion nfcore/rnafusion: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/rnafusion:dev nfcore/rnafusion:dev install: # Install Nextflow - - mkdir /tmp/nextflow - - cd /tmp/nextflow + - mkdir /tmp/nextflow && cd /tmp/nextflow - wget -qO- get.nextflow.io | bash - sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow # Install nf-core/tools - - git clone https://github.com/nf-core/tools.git /tmp/nf-core-tools - - cd /tmp/nf-core-tools - - pip install --user -e . + - pip install --upgrade pip + - pip install nf-core # Reset - - mkdir ${TRAVIS_BUILD_DIR}/tests - - cd ${TRAVIS_BUILD_DIR}/tests + - mkdir ${TRAVIS_BUILD_DIR}/tests && cd ${TRAVIS_BUILD_DIR}/tests + # Install markdownlint-cli + - sudo apt-get install npm && npm install -g markdownlint-cli env: - - NXF_VER=0.30.0 # Specify a minimum NF version that should be tested and work - - NXF_VER='' # Plus: get the latest NF version and check, that it works + - NXF_VER='0.32.0' # Specify a minimum NF version that should be tested and work + - NXF_VER='' # Plus: get the latest NF version and check that it works script: # Lint the pipeline code - nf-core lint ${TRAVIS_BUILD_DIR} + # 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e9ce8dd..3f3175b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +# nf-core/rnafusion: Changelog -## nf-core/rnafusion version 1.0dev - +## v1.0.1 - [date] Initial release of nf-core/rnafusion, created with the [nf-core](http://nf-co.re/) template. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 21096193..09226d0d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -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. diff --git a/Dockerfile b/Dockerfile index 147b780d..01fafa54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM nfcore/base -LABEL description="Docker image containing all requirements for nf-core/rnafusion pipeline" +LABEL authors="No author provided" \ + description="Docker image containing all requirements for nf-core/rnafusion pipeline" COPY environment.yml / RUN conda env create -f /environment.yml && conda clean -a -ENV PATH /opt/conda/envs/nf-core-rnafusion-1.0dev/bin:$PATH +ENV PATH /opt/conda/envs/nf-core-rnafusion-1.0.1/bin:$PATH diff --git a/LICENSE b/LICENSE index 9cf10627..fafd3dbf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,7 @@ MIT License +Copyright (c) No author provided + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/README.md b/README.md index 30b3a2a3..90babb0a 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,30 @@ # nf-core/rnafusion -**Attempt at setting up a pipeline for fusion detection as an addon to the previously existing NGI-RNAseq pipeline.** -[![Build Status](https://travis-ci.org/nf-core/rnafusion.svg?branch=master)](https://travis-ci.org/nf-core/rnafusion) -[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A50.30.0-brightgreen.svg)](https://www.nextflow.io/) +**Nextflow rnafusion analysis pipeline, part of the nf-core community.**. + +[![Build Status](https://travis-ci.com/nf-core/rnafusion.svg?branch=master)](https://travis-ci.com/nf-core/rnafusion) +[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A50.32.0-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/rnafusion.svg)](https://hub.docker.com/r/nfcore/rnafusion) -![Singularity Container available]( -https://img.shields.io/badge/singularity-available-7E4C74.svg) -### Introduction -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. +## Introduction +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/rnafusion 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) + * [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 +nf-core/rnafusion was originally written by No author provided. diff --git a/Singularity b/Singularity deleted file mode 100644 index 7077b9ba..00000000 --- a/Singularity +++ /dev/null @@ -1,17 +0,0 @@ -From:nfcore/base -Bootstrap:docker - -%labels - DESCRIPTION Singularity image containing all requirements for nf-core/rnafusion pipeline - VERSION 1.0dev - -%environment - PATH=/opt/conda/envs/nf-core-rnafusion-1.0dev/bin:$PATH - export PATH - -%files - environment.yml / - -%post - /opt/conda/bin/conda env create -f /environment.yml - /opt/conda/bin/conda clean -a diff --git a/assets/email_template.html b/assets/email_template.html index b1f8f613..af566215 100644 --- a/assets/email_template.html +++ b/assets/email_template.html @@ -5,7 +5,7 @@ - + nf-core/rnafusion Pipeline Report diff --git a/assets/email_template.txt b/assets/email_template.txt index fab10f4d..7efad5be 100644 --- a/assets/email_template.txt +++ b/assets/email_template.txt @@ -17,23 +17,6 @@ ${errorReport} } %> -<% if (!success){ - out << """#################################################### -## nf-core/rnafusion 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/rnafusion execution completed successfully! ##" -} -%> - - - - The workflow was completed at $dateComplete (duration: $duration) The command used to launch the workflow was as follows: diff --git a/conf/multiqc_config.yaml b/assets/multiqc_config.yaml similarity index 95% rename from conf/multiqc_config.yaml rename to assets/multiqc_config.yaml index 441bd13c..bdd59b85 100644 --- a/conf/multiqc_config.yaml +++ b/assets/multiqc_config.yaml @@ -5,3 +5,5 @@ report_comment: > report_section_order: nf-core/rnafusion-software-versions: order: -1000 + +export_plots: true diff --git a/assets/sendmail_template.txt b/assets/sendmail_template.txt index fd1cd739..2d671220 100644 --- a/assets/sendmail_template.txt +++ b/assets/sendmail_template.txt @@ -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: +Content-Disposition: attachment; filename=\"${mqcFileObj.getName()}\" + +${mqcFileObj. + bytes. + encodeBase64(). + toString(). + tokenize( '\n' )*. + toList()*. + collate( 76 )*. + collect { it.join() }. + flatten(). + join( '\n' )} +""" +}} +%> + +--nfcoremimeboundary-- diff --git a/bin/scrape_software_versions.py b/bin/scrape_software_versions.py index 8c853eb5..e1a24f40 100755 --- a/bin/scrape_software_versions.py +++ b/bin/scrape_software_versions.py @@ -3,6 +3,7 @@ from collections import OrderedDict import re +# TODO nf-core: Add additional regexes for new tools in process get_software_versions regexes = { 'nf-core/rnafusion': ['v_pipeline.txt', r"(\S+)"], 'Nextflow': ['v_nextflow.txt', r"(\S+)"], @@ -23,9 +24,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/rnafusion-software-versions' +id: 'software_versions' section_name: 'nf-core/rnafusion Software Versions' section_href: 'https://github.com/nf-core/rnafusion' plot_type: 'html' @@ -34,5 +40,10 @@
''') for k,v in results.items(): - print("
{}
{}
".format(k,v)) + print("
{}
{}
".format(k,v)) print ("
") + +# 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)) diff --git a/bin/scrape_software_versions.pyc b/bin/scrape_software_versions.pyc deleted file mode 100644 index 43668abfb88327032ff40b29b51535e465babdee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1508 zcmZ`&UvC>l5TErqiF3A7r-7pIfKKMYj#~Sg0zm}V0=4QJh9rn0Q*^rAj_q^ScbDC@ zW7qg89{@fCZ+sWN3?Bey*XOiS%id{rezP;P^KYGhs&4l8AHPJ9uM+Lw00R{;08T#x z0We|EXTS_DfGEJkfxffG4u~T3ix3xq)4v770`P4(;X4~pBCreGwI^i)72s71_TZ$y z1?a#nKz|$fJwT${(8;;d9ap~N_MkI=4Y&p49b@+VR{^gI&@VxM7tjTyn`&@)%i#AO z^vi%{7+0+SDqs=Ddsbr~4zUWiWJg!t1L-n;AI3GqkN1J^1KHD0(ICZ;0KDW5oc(LSaCTn?_k9o~Z`$9hHTNr}RSL(|VMORGxnNm0e%gyFLHg zj&BsYF{wgq%A*`2v*k*42)Qvo^&0O>vrUPiY#y~GW+IHR+3*^Vyhf{WLNsQU|6+|KpP^y^Gw^`)QrlTb3h<1F{@xovBmbAI5q#y=+J6#D8CaRB~6Qzyz zm8COXBtFeBv2bpo#E{$Z-1N%Mp2AQ@BkN@nYU0d54pK?L3WqYCW|p&0sY$2shN!;? z`gAf2HTttq`h!%^%ToU3v45F;!58B%lPA&f=f|I2UnPs|NiaUSc}#1V_&@se;#zT{ zsEnfZ;)nC$sOKkxR+LJlJ+S-cQMM>Unm@W^xqRm-21%-@H>1_czl;-~8XsmDY#JJD z@@;1en}27L@~ObCDXeM}sj(WX6dYEyU#+mq-1X-ivIACO57;(4a-7l*J7gcT{{Wbj Bg$4is diff --git a/conf/awsbatch.config b/conf/awsbatch.config index 79078c7b..14af5866 100644 --- a/conf/awsbatch.config +++ b/conf/awsbatch.config @@ -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' diff --git a/conf/base.config b/conf/base.config index 941529b6..7a2c4ee5 100644 --- a/conf/base.config +++ b/conf/base.config @@ -11,23 +11,18 @@ process { - container = params.container - + // TODO nf-core: Check the defaults for all processes cpus = { check_max( 1 * task.attempt, 'cpus' ) } memory = { check_max( 8.GB * task.attempt, 'memory' ) } time = { check_max( 2.h * task.attempt, 'time' ) } - errorStrategy = { task.exitStatus in [143,137] ? 'retry' : 'finish' } + errorStrategy = { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' } maxRetries = 1 maxErrors = '-1' // Process-specific resource requirements - withName: fastqc { - errorStrategy = { task.exitStatus in [143,137] ? 'retry' : 'ignore' } - } - withName: multiqc { - errorStrategy = { task.exitStatus in [143,137] ? 'retry' : 'ignore' } - } + // TODO nf-core: Customise requirements for specific processes. + // See https://www.nextflow.io/docs/latest/config.html#config-process-selectors } params { diff --git a/conf/igenomes.config b/conf/igenomes.config index 08154994..d19e61f4 100644 --- a/conf/igenomes.config +++ b/conf/igenomes.config @@ -9,6 +9,7 @@ params { // illumina iGenomes reference file paths + // TODO nf-core: Add new reference types and strip out those that are not needed genomes { 'GRCh37' { bed12 = "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Annotation/Genes/genes.bed" diff --git a/conf/test.config b/conf/test.config index f8ebeb64..5c1cbe72 100644 --- a/conf/test.config +++ b/conf/test.config @@ -4,14 +4,19 @@ * ------------------------------------------------- * Defines bundled input files and everything required * to run a fast and simple test. Use as follows: - * nextflow run nf-core/methylseq -profile test + * nextflow run nf-core/rnafusion -profile test */ params { + config_profile_name = 'Test profile' + config_profile_description = 'Minimal test dataset to check pipeline function' + // Limit resources so that this can run on Travis max_cpus = 2 max_memory = 6.GB max_time = 48.h // Input data + // TODO nf-core: Specify the paths to your test data on nf-core/test-datasets + // TODO nf-core: Give any required params for the test so that command line flags are not needed singleEnd = false readPaths = [ ['Testdata', ['https://github.com/nf-core/test-datasets/raw/exoseq/testdata/Testdata_R1.tiny.fastq.gz', 'https://github.com/nf-core/test-datasets/raw/exoseq/testdata/Testdata_R2.tiny.fastq.gz']], diff --git a/docs/README.md b/docs/README.md index 2a9226c1..62f94b57 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,10 +2,11 @@ The nf-core/rnafusion documentation is split into the following files: -1. [Installation](installation.md) -2. [Running the pipeline](usage.md) -3. Pipeline configuration - * [Adding your own system](configuration/adding_your_own.md) - * [Reference genomes](configuration/reference_genomes.md) +1. [Installation](https://nf-co.re/usage/installation) +2. Pipeline configuration + * [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](usage.md) 4. [Output and how to interpret the results](output.md) -5. [Troubleshooting](troubleshooting.md) +5. [Troubleshooting](https://nf-co.re/usage/troubleshooting) diff --git a/docs/configuration/adding_your_own.md b/docs/configuration/adding_your_own.md deleted file mode 100644 index c932484e..00000000 --- a/docs/configuration/adding_your_own.md +++ /dev/null @@ -1,86 +0,0 @@ -# nf-core/rnafusion: Configuration for other clusters - -It is entirely possible to run this pipeline on other clusters, though you will need to set up your own config file so that the pipeline knows how to work with your cluster. - -> If you think that there are other people using the pipeline who would benefit from your configuration (eg. other common cluster setups), please let us know. We can add a new configuration and profile which can used by specifying `-profile ` when running the pipeline. - -If you are the only person to be running this pipeline, you can create your config file as `~/.nextflow/config` and it will be applied every time you run Nextflow. Alternatively, save the file anywhere and reference it when running the pipeline with `-c path/to/config` (see the [Nextflow documentation](https://www.nextflow.io/docs/latest/config.html) for more). - -A basic configuration comes with the pipeline, which runs by default (the `standard` config profile - see [`conf/base.config`](../conf/base.config)). This means that you only need to configure the specifics for your system and overwrite any defaults that you want to change. - -## Cluster Environment -By default, pipeline uses the `local` Nextflow executor - in other words, all jobs are run in the login session. If you're using a simple server, this may be fine. If you're using a compute cluster, this is bad as all jobs will run on the head node. - -To specify your cluster environment, add the following line to your config file: - -```nextflow -process.executor = 'YOUR_SYSTEM_TYPE' -``` - -Many different cluster types are supported by Nextflow. For more information, please see the [Nextflow documentation](https://www.nextflow.io/docs/latest/executor.html). - -Note that you may need to specify cluster options, such as a project or queue. To do so, use the `clusterOptions` config option: - -```nextflow -process { - executor = 'SLURM' - clusterOptions = '-A myproject' -} -``` - - -## Software Requirements -To run the pipeline, several software packages are required. How you satisfy these requirements is essentially up to you and depends on your system. If possible, we _highly_ recommend using either Docker or Singularity. - -Please see the [`installation documentation`](../installation.md) for how to run using the below as a one-off. These instructions are about configuring a config file for repeated use. - -### Docker -Docker is a great way to run nf-core/rnafusion, as it manages all software installations and allows the pipeline to be run in an identical software environment across a range of systems. - -Nextflow has [excellent integration](https://www.nextflow.io/docs/latest/docker.html) with Docker, and beyond installing the two tools, not much else is required - nextflow will automatically fetch the [nfcore/rnafusion](https://hub.docker.com/r/nfcore/rnafusion/) image that we have created and is hosted at dockerhub at run time. - -To add docker support to your own config file, add the following: - -```nextflow -docker.enabled = true -process.container = "nfcore/rnafusion" -``` - -Note that the dockerhub organisation name annoyingly can't have a hyphen, so is `nfcore` and not `nf-core`. - - -### Singularity image -Many HPC environments are not able to run Docker due to security issues. -[Singularity](http://singularity.lbl.gov/) is a tool designed to run on such HPC systems which is very similar to Docker. - -To specify singularity usage in your pipeline config file, add the following: - -```nextflow -singularity.enabled = true -process.container = "shub://nf-core/rnafusion" -``` - -If you intend to run the pipeline offline, nextflow will not be able to automatically download the singularity image for you. -Instead, you'll have to do this yourself manually first, transfer the image file and then point to that. - -First, pull the image file where you have an internet connection: - -```bash -singularity pull --name nf-core-rnafusion.simg shub://nf-core/rnafusion -``` - -Then transfer this file and point the config file to the image: - -```nextflow -singularity.enabled = true -process.container = "/path/to/nf-core-rnafusion.simg" -``` - - -### Conda -If you're not able to use Docker or Singularity, you can instead use conda to manage the software requirements. -To use conda in your own config file, add the following: - -```nextflow -process.conda = "$baseDir/environment.yml" -``` diff --git a/docs/configuration/reference_genomes.md b/docs/configuration/reference_genomes.md deleted file mode 100644 index 41aeebc1..00000000 --- a/docs/configuration/reference_genomes.md +++ /dev/null @@ -1,49 +0,0 @@ -# nf-core/rnafusion: Reference Genomes Configuration - -The nf-core/rnafusion pipeline needs a reference genome for alignment and annotation. - -These paths can be supplied on the command line at run time (see the [usage docs](../usage.md)), -but for convenience it's often better to save these paths in a nextflow config file. -See below for instructions on how to do this. -Read [Adding your own system](adding_your_own.md) to find out how to set up custom config files. - -## Adding paths to a config file -Specifying long paths every time you run the pipeline is a pain. -To make this easier, the pipeline comes configured to understand reference genome keywords which correspond to preconfigured paths, meaning that you can just specify `--genome ID` when running the pipeline. - -Note that this genome key can also be specified in a config file if you always use the same genome. - -To use this system, add paths to your config file using the following template: - -```nextflow -params { - genomes { - 'YOUR-ID' { - fasta = '/genome.fa' - } - 'OTHER-GENOME' { - // [..] - } - } - // Optional - default genome. Ignored if --genome 'OTHER-GENOME' specified on command line - genome = 'YOUR-ID' -} -``` - -You can add as many genomes as you like as long as they have unique IDs. - -## illumina iGenomes -To make the use of reference genomes easier, illumina has developed a centralised resource called [iGenomes](https://support.illumina.com/sequencing/sequencing_software/igenome.html). -Multiple reference index types are held together with consistent structure for multiple genomes. - -We have put a copy of iGenomes up onto AWS S3 hosting and this pipeline is configured to use this by default. -The hosting fees for AWS iGenomes are currently kindly funded by a grant from Amazon. -The pipeline will automatically download the required reference files when you run the pipeline. -For more information about the AWS iGenomes, see https://ewels.github.io/AWS-iGenomes/ - -Downloading the files takes time and bandwidth, so we recommend making a local copy of the iGenomes resource. -Once downloaded, you can customise the variable `params.igenomes_base` in your custom configuration file to point to the reference location. -For example: -```nextflow -params.igenomes_base = '/path/to/data/igenomes/' -``` diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 6b41b98f..00000000 --- a/docs/installation.md +++ /dev/null @@ -1,115 +0,0 @@ -# nf-core/rnafusion: Installation - -To start using the nf-core/rnafusion pipeline, follow the steps below: - -1. [Install Nextflow](#1-install-nextflow) -2. [Install the pipeline](#2-install-the-pipeline) - * [Automatic](#21-automatic) - * [Offline](#22-offline) - * [Development](#23-development) -3. [Pipeline configuration](#3-pipeline-configuration) - * [Software deps: Docker and Singularity](#31-software-deps-docker-and-singularity) - * [Software deps: Bioconda](#32-software-deps-bioconda) - * [Configuration profiles](#33-configuration-profiles) -4. [Reference genomes](#4-reference-genomes) -5. [Appendices](#appendices) - * [Running on UPPMAX](#running-on-uppmax) - -## 1) Install NextFlow -Nextflow runs on most POSIX systems (Linux, Mac OSX etc). It can be installed by running the following commands: - -```bash -# Make sure that Java v8+ is installed: -java -version - -# Install Nextflow -curl -fsSL get.nextflow.io | bash - -# Add Nextflow binary to your PATH: -mv nextflow ~/bin/ -# OR system-wide installation: -# sudo mv nextflow /usr/local/bin -``` - -See [nextflow.io](https://www.nextflow.io/) for further instructions on how to install and configure Nextflow. - -## 2) Install the pipeline - -#### 2.1) Automatic -This pipeline itself needs no installation - NextFlow will automatically fetch it from GitHub if `nf-core/rnafusion` is specified as the pipeline name. - -#### 2.2) Offline -The above method requires an internet connection so that Nextflow can download the pipeline files. If you're running on a system that has no internet connection, you'll need to download and transfer the pipeline files manually: - -```bash -wget https://github.com/nf-core/rnafusion/archive/master.zip -mkdir -p ~/my-pipelines/nf-core/ -unzip master.zip -d ~/my-pipelines/nf-core/ -cd ~/my_data/ -nextflow run ~/my-pipelines/nf-core/rnafusion-master -``` - -To stop nextflow from looking for updates online, you can tell it to run in offline mode by specifying the following environment variable in your ~/.bashrc file: - -```bash -export NXF_OFFLINE='TRUE' -``` - -#### 2.3) Development - -If you would like to make changes to the pipeline, it's best to make a fork on GitHub and then clone the files. Once cloned you can run the pipeline directly as above. - - -## 3) Pipeline configuration -By default, the pipeline runs with the `standard` configuration profile. This uses a number of sensible defaults for process requirements and is suitable for running on a simple (if powerful!) basic server. You can see this configuration in [`conf/base.config`](../conf/base.config). - -Be warned of two important points about this default configuration: - -1. The default profile uses the `local` executor - * All jobs are run in the login session. If you're using a simple server, this may be fine. If you're using a compute cluster, this is bad as all jobs will run on the head node. - * See the [nextflow docs](https://www.nextflow.io/docs/latest/executor.html) for information about running with other hardware backends. Most job scheduler systems are natively supported. -2. Nextflow will expect all software to be installed and available on the `PATH` - -#### 3.1) Software deps: Docker -First, install docker on your system: [Docker Installation Instructions](https://docs.docker.com/engine/installation/) - -Then, running the pipeline with the option `-profile standard,docker` tells Nextflow to enable Docker for this run. An image containing all of the software requirements will be automatically fetched and used from dockerhub (https://hub.docker.com/r/nfcore/rnafusion). - -#### 3.1) Software deps: Singularity -If you're not able to use Docker then [Singularity](http://singularity.lbl.gov/) is a great alternative. -The process is very similar: running the pipeline with the option `-profile standard,singularity` tells Nextflow to enable singularity for this run. An image containing all of the software requirements will be automatically fetched and used from singularity hub. - -If running offline with Singularity, you'll need to download and transfer the Singularity image first: - -```bash -singularity pull --name nf-core-rnafusion.simg shub://nf-core/rnafusion -``` - -Once transferred, use `-with-singularity` and specify the path to the image file: - -```bash -nextflow run /path/to/nf-core-rnafusion -with-singularity nf-core-rnafusion.simg -``` - -Remember to pull updated versions of the singularity image if you update the pipeline. - - -#### 3.2) Software deps: conda -If you're not able to use Docker _or_ Singularity, you can instead use conda to manage the software requirements. -This is slower and less reproducible than the above, but is still better than having to install all requirements yourself! -The pipeline ships with a conda environment file and nextflow has built-in support for this. -To use it first ensure that you have conda installed (we recommend [miniconda](https://conda.io/miniconda.html)), then follow the same pattern as above and use the flag `-profile standard,conda` - - -## Appendices - -#### Running on UPPMAX -To run the pipeline on the [Swedish UPPMAX](https://www.uppmax.uu.se/) clusters (`rackham`, `irma`, `bianca` etc), use the command line flag `-profile uppmax`. This tells Nextflow to submit jobs using the SLURM job executor with Singularity for software dependencies. - -Note that you will need to specify your UPPMAX project ID when running a pipeline. To do this, use the command line flag `--project `. The pipeline will exit with an error message if you try to run it pipeline with the default UPPMAX config profile without a project. - -**Optional Extra:** To avoid having to specify your project every time you run Nextflow, you can add it to your personal Nextflow config file instead. Add this line to `~/.nextflow/config`: - -```nextflow -params.project = 'project_ID' // eg. b2017123 -``` diff --git a/docs/output.md b/docs/output.md index 46f9887b..130ba906 100644 --- a/docs/output.md +++ b/docs/output.md @@ -2,6 +2,7 @@ This document describes the output produced by the pipeline. Most of the plots are taken from the MultiQC report, which summarises results at the end of the pipeline. + ## Pipeline overview The pipeline is built using [Nextflow](https://www.nextflow.io/) @@ -37,4 +38,4 @@ The pipeline has special steps which allow the software versions used to be repo * `Project_multiqc_data/` * Directory containing parsed statistics from the different tools used in the pipeline -For more information about how to use MultiQC reports, see http://multiqc.info +For more information about how to use MultiQC reports, see [http://multiqc.info](http://multiqc.info) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md deleted file mode 100644 index 1f451510..00000000 --- a/docs/troubleshooting.md +++ /dev/null @@ -1,28 +0,0 @@ -# nf-core/rnafusion: Troubleshooting - -## Input files not found - -If only no file, only one input file , or only read one and not read two is picked up then something is wrong with your input file declaration - -1. The path must be enclosed in quotes (`'` or `"`) -2. The path must have at least one `*` wildcard character. This is even if you are only running one paired end sample. -3. When using the pipeline with paired end data, the path must use `{1,2}` or `{R1,R2}` notation to specify read pairs. -4. If you are running Single end data make sure to specify `--singleEnd` - -If the pipeline can't find your files then you will get the following error - -``` -ERROR ~ Cannot find any reads matching: *{1,2}.fastq.gz -``` - -Note that if your sample name is "messy" then you have to be very particular with your glob specification. A file name like `L1-1-D-2h_S1_L002_R1_001.fastq.gz` can be difficult enough for a human to read. Specifying `*{1,2}*.gz` wont work give you what you want Whilst `*{R1,R2}*.gz` will. - - -## Data organization -The pipeline can't take a list of multiple input files - it takes a glob expression. If your input files are scattered in different paths then we recommend that you generate a directory with symlinked files. If running in paired end mode please make sure that your files are sensibly named so that they can be properly paired. See the previous point. - -## Extra resources and getting help -If you still have an issue with running the pipeline then feel free to contact us. -Have a look at the [pipeline website](https://github.com/nf-core/rnafusion) to find out how. - -If you have problems that are related to Nextflow and not our pipeline then check out the [Nextflow gitter channel](https://gitter.im/nextflow-io/nextflow) or the [google group](https://groups.google.com/forum/#!forum/nextflow). diff --git a/docs/usage.md b/docs/usage.md index e4106275..4da47584 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -2,43 +2,45 @@ ## Table of contents -* [Introduction](#general-nextflow-info) + + +* [Table of contents](#table-of-contents) +* [Introduction](#introduction) * [Running the pipeline](#running-the-pipeline) -* [Updating the pipeline](#updating-the-pipeline) -* [Reproducibility](#reproducibility) + * [Updating the pipeline](#updating-the-pipeline) + * [Reproducibility](#reproducibility) * [Main arguments](#main-arguments) - * [`-profile`](#-profile-single-dash) - * [`docker`](#docker) - * [`awsbatch`](#awsbatch) - * [`standard`](#standard) - * [`none`](#none) - * [`--reads`](#--reads) - * [`--singleEnd`](#--singleend) -* [Reference Genomes](#reference-genomes) - * [`--genome`](#--genome) - * [`--fasta`](#--fasta) -* [Job Resources](#job-resources) -* [Automatic resubmission](#automatic-resubmission) -* [Custom resource requests](#custom-resource-requests) -* [AWS batch specific parameters](#aws-batch-specific-parameters) - * [`-awsbatch`](#-awsbatch) - * [`--awsqueue`](#--awsqueue) - * [`--awsregion`](#--awsregion) + * [`-profile`](#-profile) + * [`--reads`](#--reads) + * [`--singleEnd`](#--singleend) +* [Reference genomes](#reference-genomes) + * [`--genome` (using iGenomes)](#--genome-using-igenomes) + * [`--fasta`](#--fasta) + * [`--igenomesIgnore`](#--igenomesignore) +* [Job resources](#job-resources) + * [Automatic resubmission](#automatic-resubmission) + * [Custom resource requests](#custom-resource-requests) +* [AWS Batch specific parameters](#aws-batch-specific-parameters) + * [`--awsqueue`](#--awsqueue) + * [`--awsregion`](#--awsregion) * [Other command line parameters](#other-command-line-parameters) - * [`--outdir`](#--outdir) - * [`--email`](#--email) - * [`-name`](#-name-single-dash) - * [`-resume`](#-resume-single-dash) - * [`-c`](#-c-single-dash) - * [`--max_memory`](#--max_memory) - * [`--max_time`](#--max_time) - * [`--max_cpus`](#--max_cpus) - * [`--plaintext_emails`](#--plaintext_emails) - * [`--sampleLevel`](#--sampleLevel) - * [`--multiqc_config`](#--multiqc_config) - - -## General Nextflow info + * [`--outdir`](#--outdir) + * [`--email`](#--email) + * [`-name`](#-name) + * [`-resume`](#-resume) + * [`-c`](#-c) + * [`--custom_config_version`](#--custom_config_version) + * [`--custom_config_base`](#--custom_config_base) + * [`--max_memory`](#--max_memory) + * [`--max_time`](#--max_time) + * [`--max_cpus`](#--max_cpus) + * [`--plaintext_email`](#--plaintext_email) + * [`--monochrome_logs`](#--monochrome_logs) + * [`--multiqc_config`](#--multiqc_config) + + + +## Introduction Nextflow handles job submissions on SLURM or other environments, and supervises running the jobs. Thus the Nextflow process must run until the pipeline is finished. We recommend that you put the process running in the background through `screen` / `tmux` or similar tool. Alternatively you can run nextflow within a cluster job submitted your job scheduler. It is recommended to limit the Nextflow Java virtual machines memory. We recommend adding the following line to your environment (typically in `~/.bashrc` or `~./bash_profile`): @@ -47,10 +49,13 @@ It is recommended to limit the Nextflow Java virtual machines memory. We recomme NXF_OPTS='-Xms1g -Xmx4g' ``` + + ## Running the pipeline The typical command for running the pipeline is as follows: + ```bash -nextflow run nf-core/rnafusion --reads '*_R{1,2}.fastq.gz' -profile standard,docker +nextflow run nf-core/rnafusion --reads '*_R{1,2}.fastq.gz' -profile docker ``` This will launch the pipeline with the `docker` configuration profile. See below for more information about profiles. @@ -79,30 +84,29 @@ First, go to the [nf-core/rnafusion releases page](https://github.com/nf-core/rn This version number will be logged in reports when you run the pipeline, so that you'll know what you used when you look back in the future. -## Main Arguments +## Main arguments ### `-profile` -Use this parameter to choose a configuration profile. Profiles can give configuration presets for different compute environments. Note that multiple profiles can be loaded, for example: `-profile standard,docker` - the order of arguments is important! +Use this parameter to choose a configuration profile. Profiles can give configuration presets for different compute environments. Note that multiple profiles can be loaded, for example: `-profile docker` - the order of arguments is important! + +If `-profile` is not specified at all the pipeline will be run locally and expects all software to be installed and available on the `PATH`. -* `standard` - * The default profile, used if `-profile` is not specified at all. - * Runs locally and expects all software to be installed and available on the `PATH`. +* `awsbatch` + * A generic configuration profile to be used with AWS Batch. +* `conda` + * A generic configuration profile to be used with [conda](https://conda.io/docs/) + * Pulls most software from [Bioconda](https://bioconda.github.io/) * `docker` - * A generic configuration profile to be used with [Docker](http://docker.com/) - * Pulls software from dockerhub: [`nfcore/rnafusion`](http://hub.docker.com/r/nfcore/rnafusion/) + * A generic configuration profile to be used with [Docker](http://docker.com/) + * Pulls software from dockerhub: [`nfcore/rnafusion`](http://hub.docker.com/r/nfcore/rnafusion/) * `singularity` - * A generic configuration profile to be used with [Singularity](http://singularity.lbl.gov/) - * Pulls software from singularity-hub -* `conda` - * A generic configuration profile to be used with [conda](https://conda.io/docs/) - * Pulls most software from [Bioconda](https://bioconda.github.io/) -* `awsbatch` - * A generic configuration profile to be used with AWS Batch. + * A generic configuration profile to be used with [Singularity](http://singularity.lbl.gov/) + * Pulls software from DockerHub: [`nfcore/rnafusion`](http://hub.docker.com/r/nfcore/rnafusion/) * `test` - * A profile with a complete configuration for automated testing - * Includes links to test data so needs no other parameters -* `none` - * No configuration at all. Useful if you want to build your own config from scratch and want to avoid loading in the default `base` config profile (not recommended). + * A profile with a complete configuration for automated testing + * Includes links to test data so needs no other parameters + + ### `--reads` Use this to specify the location of your input FastQ files. For example: @@ -129,7 +133,7 @@ By default, the pipeline expects paired-end data. If you have single-end data, y It is not possible to run a mixture of single-end and paired-end files in one run. -## Reference Genomes +## Reference genomes The pipeline config files come bundled with paths to the illumina iGenomes reference index files. If running with docker or AWS, the configuration is set up to use the [AWS-iGenomes](https://ewels.github.io/AWS-iGenomes/) resource. @@ -153,6 +157,8 @@ Note that you can use the same configuration setup to save sets of reference fil The syntax for this reference configuration is as follows: + + ```nextflow params { genomes { @@ -164,6 +170,7 @@ params { } ``` + ### `--fasta` If you prefer, you can specify the full path to your reference genome when you run the pipeline: @@ -171,12 +178,19 @@ If you prefer, you can specify the full path to your reference genome when you r --fasta '[path to Fasta reference]' ``` -## Job Resources +### `--igenomesIgnore` +Do not load `igenomes.config` when running the pipeline. You may choose this option if you observe clashes between custom parameters and those supplied in `igenomes.config`. + +## Job resources ### Automatic resubmission Each step in the pipeline has a default set of requirements for number of CPUs, memory and time. For most of the steps in the pipeline, if the job exits with an error code of `143` (exceeded requested resources) it will automatically resubmit with higher requests (2 x original, then 3 x original). If it still fails after three times then the pipeline is stopped. ### Custom resource requests -Wherever process-specific requirements are set in the pipeline, the default value can be changed by creating a custom config file. See the files in [`conf`](../conf) for examples. +Wherever process-specific requirements are set in the pipeline, the default value can be changed by creating a custom config file. See the files hosted at [`nf-core/configs`](https://github.com/nf-core/configs/tree/master/conf) for examples. + +If you are likely to be running `nf-core` pipelines regularly it may be a good idea to request that your custom config file is uploaded to the `nf-core/configs` git repository. Before you do this please can you test that the config file works with your pipeline of choice using the `-c` parameter (see definition below). You can then create a pull request to the `nf-core/configs` repository with the addition of your config file, associated documentation file (see examples in [`nf-core/configs/docs`](https://github.com/nf-core/configs/tree/master/docs)), and amending [`nfcore_custom.config`](https://github.com/nf-core/configs/blob/master/nfcore_custom.config) to include your custom profile. + +If you have any questions or issues please send us a message on [Slack](https://nf-core-invite.herokuapp.com/). ## AWS Batch specific parameters Running the pipeline on AWS Batch requires a couple of specific parameters to be set according to your AWS Batch configuration. Please use the `-awsbatch` profile and then specify all of the following parameters. @@ -189,11 +203,13 @@ Please make sure to also set the `-w/--work-dir` and `--outdir` parameters to a ## Other command line parameters + + ### `--outdir` The output directory where the results will be saved. ### `--email` -Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits. If set in your user config file (`~/.nextflow/config`) then you don't need to speicfy this on the command line for every run. +Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits. If set in your user config file (`~/.nextflow/config`) then you don't need to specify this on the command line for every run. ### `-name` Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic. @@ -214,15 +230,39 @@ Specify the path to a specific config file (this is a core NextFlow command). **NB:** Single hyphen (core Nextflow option) -Note - you can use this to override defaults. For example, you can specify a config file using `-c` that contains the following: +Note - you can use this to override pipeline defaults. -```nextflow -process.$multiqc.module = [] +### `--custom_config_version` +Provide git commit id for custom Institutional configs hosted at `nf-core/configs`. This was implemented for reproducibility purposes. Default is set to `master`. + +```bash +## Download and use config file with following git commid id +--custom_config_version d52db660777c4bf36546ddb188ec530c3ada1b96 ``` +### `--custom_config_base` +If you're running offline, nextflow will not be able to fetch the institutional config files +from the internet. If you don't need them, then this is not a problem. If you do need them, +you should download the files from the repo and tell nextflow where to find them with the +`custom_config_base` option. For example: + +```bash +## Download and unzip the config files +cd /path/to/my/configs +wget https://github.com/nf-core/configs/archive/master.zip +unzip master.zip + +## Run the pipeline +cd /path/to/my/data +nextflow run /path/to/pipeline/ --custom_config_base /path/to/my/configs/configs-master/ +``` + +> Note that the nf-core/tools helper package has a `download` command to download all required pipeline +> files + singularity containers + institutional configs in one go for you, to make this process easier. + ### `--max_memory` Use to set a top-limit for the default memory requirement for each process. -Should be a string in the format integer-unit. eg. `--max_memory '8.GB'`` +Should be a string in the format integer-unit. eg. `--max_memory '8.GB'` ### `--max_time` Use to set a top-limit for the default time requirement for each process. @@ -235,5 +275,8 @@ Should be a string in the format integer-unit. eg. `--max_cpus 1` ### `--plaintext_email` Set to receive plain-text e-mails instead of HTML formatted. -### `--multiqc_config` +### `--monochrome_logs` +Set to disable colourful command line output and live life in monochrome. + +### `--multiqc_config` Specify a path to a custom MultiQC configuration file. diff --git a/environment.yml b/environment.yml index 379ba0ee..e5ecedae 100644 --- a/environment.yml +++ b/environment.yml @@ -1,8 +1,11 @@ -name: nf-core-rnafusion-1.0dev +# You can use this file to create a conda environment for this pipeline: +# conda env create -f environment.yml +name: nf-core-rnafusion-1.0.1 channels: - - bioconda - conda-forge + - bioconda - defaults dependencies: - - fastqc=0.11.7 - - multiqc=1.6 + # TODO nf-core: Add required software dependencies here + - fastqc=0.11.8 + - multiqc=1.7 diff --git a/main.nf b/main.nf index bd35809a..c011c986 100644 --- a/main.nf +++ b/main.nf @@ -11,23 +11,23 @@ def helpMessage() { + // TODO nf-core: Add to this help message with new command line parameters + log.info nfcoreHeader() log.info""" - ========================================= - nf-core/rnafusion v${manifest.pipelineVersion} - ========================================= + Usage: The typical command for running the pipeline is as follows: - nextflow run nf-core/rnafusion --reads '*_R{1,2}.fastq.gz' -profile standard,docker + nextflow run nf-core/rnafusion --reads '*_R{1,2}.fastq.gz' -profile docker Mandatory arguments: --reads Path to input data (must be surrounded with quotes) - --genome Name of iGenomes reference -profile Configuration profile to use. Can use multiple (comma separated) - Available: standard, conda, docker, singularity, awsbatch, test + Available: conda, docker, singularity, awsbatch, test and more. Options: + --genome Name of iGenomes reference --singleEnd Specifies that the input is single end reads References If not specified in the configuration file or you wish to overwrite any of the references. @@ -36,6 +36,7 @@ def helpMessage() { Other options: --outdir The output directory where the results will be saved --email Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits + --maxMultiqcEmailFileSize Theshold size for MultiQC report to be attached in notification email. If file generated by pipeline exceeds the threshold, it will not be attached (Default: 25MB) -name Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic. AWSBatch options: @@ -54,26 +55,18 @@ if (params.help){ exit 0 } -// Configurable variables -params.name = false -params.fasta = params.genome ? params.genomes[ params.genome ].fasta ?: false : false -params.multiqc_config = "$baseDir/conf/multiqc_config.yaml" -params.email = false -params.plaintext_email = false - -multiqc_config = file(params.multiqc_config) -output_docs = file("$baseDir/docs/output.md") +// Check if genome exists in the config file +if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) { + exit 1, "The provided genome '${params.genome}' is not available in the iGenomes file. Currently the available genomes are ${params.genomes.keySet().join(", ")}" +} -// Validate inputs +// TODO nf-core: Add any reference files that are needed +// Configurable reference genomes +fasta = params.genome ? params.genomes[ params.genome ].fasta ?: false : false if ( params.fasta ){ fasta = file(params.fasta) if( !fasta.exists() ) exit 1, "Fasta file not found: ${params.fasta}" } -// AWSBatch sanity checking -if(workflow.profile == 'awsbatch'){ - if (!params.awsqueue || !params.awsregion) exit 1, "Specify correct --awsqueue and --awsregion parameters on AWSBatch!" - if (!workflow.workDir.startsWith('s3') || !params.outdir.startsWith('s3')) exit 1, "Specify S3 URLs for workDir and outdir parameters on AWSBatch!" -} // // NOTE - THIS IS NOT USED IN THIS PIPELINE, EXAMPLE ONLY // If you want to use the above in a process, define the following: @@ -89,79 +82,81 @@ if( !(workflow.runName ==~ /[a-z]+_[a-z]+/) ){ custom_runName = workflow.runName } -// Check workDir/outdir paths to be S3 buckets if running on AWSBatch -// related: https://github.com/nextflow-io/nextflow/issues/813 + if( workflow.profile == 'awsbatch') { - if(!workflow.workDir.startsWith('s3:') || !params.outdir.startsWith('s3:')) exit 1, "Workdir or Outdir not on S3 - specify S3 Buckets for each to run on AWSBatch!" + // AWSBatch sanity checking + if (!params.awsqueue || !params.awsregion) exit 1, "Specify correct --awsqueue and --awsregion parameters on AWSBatch!" + // Check outdir paths to be S3 buckets if running on AWSBatch + // related: https://github.com/nextflow-io/nextflow/issues/813 + if (!params.outdir.startsWith('s3:')) exit 1, "Outdir not on S3 - specify S3 Bucket to run on AWSBatch!" + // Prevent trace files to be stored on S3 since S3 does not support rolling files. + if (workflow.tracedir.startsWith('s3:')) exit 1, "Specify a local tracedir or run without trace! S3 cannot be used for tracefiles." } +// Stage config files +ch_multiqc_config = Channel.fromPath(params.multiqc_config) +ch_output_docs = Channel.fromPath("$baseDir/docs/output.md") + /* * Create a channel for input read files */ - if(params.readPaths){ - if(params.singleEnd){ - Channel - .from(params.readPaths) - .map { row -> [ row[0], [file(row[1][0])]] } - .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } - .into { read_files_fastqc; read_files_trimming } - } else { - Channel - .from(params.readPaths) - .map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] } - .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } - .into { read_files_fastqc; read_files_trimming } - } - } else { - Channel - .fromFilePairs( params.reads, size: params.singleEnd ? 1 : 2 ) - .ifEmpty { exit 1, "Cannot find any reads matching: ${params.reads}\nNB: Path needs to be enclosed in quotes!\nIf this is single-end data, please specify --singleEnd on the command line." } - .into { read_files_fastqc; read_files_trimming } - } +if(params.readPaths){ + if(params.singleEnd){ + Channel + .from(params.readPaths) + .map { row -> [ row[0], [file(row[1][0])]] } + .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } + .into { read_files_fastqc; read_files_trimming } + } else { + Channel + .from(params.readPaths) + .map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] } + .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } + .into { read_files_fastqc; read_files_trimming } + } +} else { + Channel + .fromFilePairs( params.reads, size: params.singleEnd ? 1 : 2 ) + .ifEmpty { exit 1, "Cannot find any reads matching: ${params.reads}\nNB: Path needs to be enclosed in quotes!\nIf this is single-end data, please specify --singleEnd on the command line." } + .into { read_files_fastqc; read_files_trimming } +} // Header log info -log.info """======================================================= - ,--./,-. - ___ __ __ __ ___ /,-._.--~\' - |\\ | |__ __ / ` / \\ |__) |__ } { - | \\| | \\__, \\__/ | \\ |___ \\`-._,-`-, - `._,._,\' - -nf-core/rnafusion v${manifest.pipelineVersion}" -=======================================================""" +log.info nfcoreHeader() def summary = [:] -summary['Pipeline Name'] = 'nf-core/rnafusion' -summary['Pipeline Version'] = manifest.pipelineVersion -summary['Run Name'] = custom_runName ?: workflow.runName -summary['Reads'] = params.reads -summary['Fasta Ref'] = params.fasta -summary['Data Type'] = params.singleEnd ? 'Single-End' : 'Paired-End' -summary['Max Memory'] = params.max_memory -summary['Max CPUs'] = params.max_cpus -summary['Max Time'] = params.max_time -summary['Output dir'] = params.outdir -summary['Working dir'] = workflow.workDir -summary['Container Engine'] = workflow.containerEngine -if(workflow.containerEngine) summary['Container'] = workflow.container -summary['Current home'] = "$HOME" -summary['Current user'] = "$USER" -summary['Current path'] = "$PWD" -summary['Working dir'] = workflow.workDir -summary['Output dir'] = params.outdir -summary['Script dir'] = workflow.projectDir -summary['Config Profile'] = workflow.profile +if(workflow.revision) summary['Pipeline Release'] = workflow.revision +summary['Run Name'] = custom_runName ?: workflow.runName +// TODO nf-core: Report custom parameters here +summary['Reads'] = params.reads +summary['Fasta Ref'] = params.fasta +summary['Data Type'] = params.singleEnd ? 'Single-End' : 'Paired-End' +summary['Max Resources'] = "$params.max_memory memory, $params.max_cpus cpus, $params.max_time time per job" +if(workflow.containerEngine) summary['Container'] = "$workflow.containerEngine - $workflow.container" +summary['Output dir'] = params.outdir +summary['Launch dir'] = workflow.launchDir +summary['Working dir'] = workflow.workDir +summary['Script dir'] = workflow.projectDir +summary['User'] = workflow.userName if(workflow.profile == 'awsbatch'){ - summary['AWS Region'] = params.awsregion - summary['AWS Queue'] = params.awsqueue + summary['AWS Region'] = params.awsregion + summary['AWS Queue'] = params.awsqueue } -if(params.email) summary['E-mail Address'] = params.email -log.info summary.collect { k,v -> "${k.padRight(15)}: $v" }.join("\n") -log.info "=========================================" +summary['Config Profile'] = workflow.profile +if(params.config_profile_description) summary['Config Description'] = params.config_profile_description +if(params.config_profile_contact) summary['Config Contact'] = params.config_profile_contact +if(params.config_profile_url) summary['Config URL'] = params.config_profile_url +if(params.email) { + summary['E-mail Address'] = params.email + summary['MultiQC maxsize'] = params.maxMultiqcEmailFileSize +} +log.info summary.collect { k,v -> "${k.padRight(18)}: $v" }.join("\n") +log.info "\033[2m----------------------------------------------------\033[0m" +// Check the hostnames against configured profiles +checkHostname() def create_workflow_summary(summary) { - def yaml_file = workDir.resolve('workflow_summary_mqc.yaml') yaml_file.text = """ id: 'nf-core-rnafusion-summary' @@ -183,17 +178,24 @@ ${summary.collect { k,v -> "
$k
${v ?: ' + if (filename.indexOf(".csv") > 0) filename + else null + } output: file 'software_versions_mqc.yaml' into software_versions_yaml + file "software_versions.csv" script: + // TODO nf-core: Get all tools to print their version number here """ - echo $manifest.pipelineVersion > v_pipeline.txt + echo $workflow.manifest.version > v_pipeline.txt echo $workflow.nextflow.version > v_nextflow.txt fastqc --version > v_fastqc.txt multiqc --version > v_multiqc.txt - scrape_software_versions.py > software_versions_mqc.yaml + scrape_software_versions.py &> software_versions_mqc.yaml """ } @@ -228,18 +230,21 @@ process multiqc { publishDir "${params.outdir}/MultiQC", mode: 'copy' input: - file multiqc_config - file ('fastqc/*') from fastqc_results.collect() - file ('software_versions/*') from software_versions_yaml + file multiqc_config from ch_multiqc_config + // TODO nf-core: Add in log files from your new processes for MultiQC to find! + file ('fastqc/*') from fastqc_results.collect().ifEmpty([]) + file ('software_versions/*') from software_versions_yaml.collect() file workflow_summary from create_workflow_summary(summary) output: file "*multiqc_report.html" into multiqc_report file "*_data" + file "multiqc_plots" script: rtitle = custom_runName ? "--title \"$custom_runName\"" : '' rfilename = custom_runName ? "--filename " + custom_runName.replaceAll('\\W','_').replaceAll('_+','_') + "_multiqc_report" : '' + // TODO nf-core: Specify which MultiQC modules to use with -m for a faster run time """ multiqc -f $rtitle $rfilename --config $multiqc_config . """ @@ -251,11 +256,10 @@ process multiqc { * STEP 3 - Output Description HTML */ process output_documentation { - tag "$prefix" - publishDir "${params.outdir}/Documentation", mode: 'copy' + publishDir "${params.outdir}/pipeline_info", mode: 'copy' input: - file output_docs + file output_docs from ch_output_docs output: file "results_description.html" @@ -279,7 +283,7 @@ workflow.onComplete { subject = "[nf-core/rnafusion] FAILED: $workflow.runName" } def email_fields = [:] - email_fields['version'] = manifest.pipelineVersion + email_fields['version'] = workflow.manifest.version email_fields['runName'] = custom_runName ?: workflow.runName email_fields['success'] = workflow.success email_fields['dateComplete'] = workflow.complete @@ -297,10 +301,26 @@ workflow.onComplete { if(workflow.repository) email_fields['summary']['Pipeline repository Git URL'] = workflow.repository if(workflow.commitId) email_fields['summary']['Pipeline repository Git Commit'] = workflow.commitId if(workflow.revision) email_fields['summary']['Pipeline Git branch/tag'] = workflow.revision + if(workflow.container) email_fields['summary']['Docker image'] = workflow.container email_fields['summary']['Nextflow Version'] = workflow.nextflow.version email_fields['summary']['Nextflow Build'] = workflow.nextflow.build email_fields['summary']['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp + // TODO nf-core: If not using MultiQC, strip out this code (including params.maxMultiqcEmailFileSize) + // On success try attach the multiqc report + def mqc_report = null + try { + if (workflow.success) { + mqc_report = multiqc_report.getVal() + if (mqc_report.getClass() == ArrayList){ + log.warn "[nf-core/rnafusion] Found multiple reports from process 'multiqc', will use only one" + mqc_report = mqc_report[0] + } + } + } catch (all) { + log.warn "[nf-core/rnafusion] Could not attach MultiQC report to summary email" + } + // Render the TXT template def engine = new groovy.text.GStringTemplateEngine() def tf = new File("$baseDir/assets/email_template.txt") @@ -313,7 +333,7 @@ workflow.onComplete { def email_html = html_template.toString() // Render the sendmail template - def smail_fields = [ email: params.email, subject: subject, email_txt: email_txt, email_html: email_html, baseDir: "$baseDir" ] + def smail_fields = [ email: params.email, subject: subject, email_txt: email_txt, email_html: email_html, baseDir: "$baseDir", mqcFile: mqc_report, mqcMaxSize: params.maxMultiqcEmailFileSize.toBytes() ] def sf = new File("$baseDir/assets/sendmail_template.txt") def sendmail_template = engine.createTemplate(sf).make(smail_fields) def sendmail_html = sendmail_template.toString() @@ -333,7 +353,7 @@ workflow.onComplete { } // Write summary e-mail HTML to a file - def output_d = new File( "${params.outdir}/Documentation/" ) + def output_d = new File( "${params.outdir}/pipeline_info/" ) if( !output_d.exists() ) { output_d.mkdirs() } @@ -342,6 +362,67 @@ workflow.onComplete { def output_tf = new File( output_d, "pipeline_report.txt" ) output_tf.withWriter { w -> w << email_txt } - log.info "[nf-core/rnafusion] Pipeline Complete" + c_reset = params.monochrome_logs ? '' : "\033[0m"; + c_purple = params.monochrome_logs ? '' : "\033[0;35m"; + c_green = params.monochrome_logs ? '' : "\033[0;32m"; + c_red = params.monochrome_logs ? '' : "\033[0;31m"; + + if (workflow.stats.ignoredCountFmt > 0 && workflow.success) { + log.info "${c_purple}Warning, pipeline completed, but with errored process(es) ${c_reset}" + log.info "${c_red}Number of ignored errored process(es) : ${workflow.stats.ignoredCountFmt} ${c_reset}" + log.info "${c_green}Number of successfully ran process(es) : ${workflow.stats.succeedCountFmt} ${c_reset}" + } + + if(workflow.success){ + log.info "${c_purple}[nf-core/rnafusion]${c_green} Pipeline completed successfully${c_reset}" + } else { + checkHostname() + log.info "${c_purple}[nf-core/rnafusion]${c_red} Pipeline completed with errors${c_reset}" + } } + + +def nfcoreHeader(){ + // Log colors ANSI codes + c_reset = params.monochrome_logs ? '' : "\033[0m"; + c_dim = params.monochrome_logs ? '' : "\033[2m"; + c_black = params.monochrome_logs ? '' : "\033[0;30m"; + c_green = params.monochrome_logs ? '' : "\033[0;32m"; + c_yellow = params.monochrome_logs ? '' : "\033[0;33m"; + c_blue = params.monochrome_logs ? '' : "\033[0;34m"; + c_purple = params.monochrome_logs ? '' : "\033[0;35m"; + c_cyan = params.monochrome_logs ? '' : "\033[0;36m"; + c_white = params.monochrome_logs ? '' : "\033[0;37m"; + + return """ ${c_dim}----------------------------------------------------${c_reset} + ${c_green},--.${c_black}/${c_green},-.${c_reset} + ${c_blue} ___ __ __ __ ___ ${c_green}/,-._.--~\'${c_reset} + ${c_blue} |\\ | |__ __ / ` / \\ |__) |__ ${c_yellow}} {${c_reset} + ${c_blue} | \\| | \\__, \\__/ | \\ |___ ${c_green}\\`-._,-`-,${c_reset} + ${c_green}`._,._,\'${c_reset} + ${c_purple} nf-core/rnafusion v${workflow.manifest.version}${c_reset} + ${c_dim}----------------------------------------------------${c_reset} + """.stripIndent() +} + +def checkHostname(){ + def c_reset = params.monochrome_logs ? '' : "\033[0m" + def c_white = params.monochrome_logs ? '' : "\033[0;37m" + def c_red = params.monochrome_logs ? '' : "\033[1;91m" + def c_yellow_bold = params.monochrome_logs ? '' : "\033[1;93m" + if(params.hostnames){ + def hostname = "hostname".execute().text.trim() + params.hostnames.each { prof, hnames -> + hnames.each { hname -> + if(hostname.contains(hname) && !workflow.profile.contains(prof)){ + log.error "====================================================\n" + + " ${c_red}WARNING!${c_reset} You are running with `-profile $workflow.profile`\n" + + " but your machine hostname is ${c_white}'$hostname'${c_reset}\n" + + " ${c_yellow_bold}It's highly recommended that you use `-profile $prof${c_reset}`\n" + + "============================================================" + } + } + } + } +} diff --git a/nextflow.config b/nextflow.config index cb606757..e66ac9c3 100644 --- a/nextflow.config +++ b/nextflow.config @@ -3,54 +3,64 @@ * nf-core/rnafusion Nextflow config file * ------------------------------------------------- * Default config options for all environments. - * Cluster-specific config options should be saved - * in the conf folder and imported under a profile - * name here. */ // Global default params, used in configs params { - container = 'nfcore/rnafusion:latest' // Container slug. Stable releases should specify release tag! - - help = false + // Workflow flags + // TODO nf-core: Specify your pipeline's command line flags reads = "data/*{1,2}.fastq.gz" singleEnd = false outdir = './results' + + // Boilerplate options + name = false + multiqc_config = "$baseDir/assets/multiqc_config.yaml" + email = false + maxMultiqcEmailFileSize = 25.MB + plaintext_email = false + monochrome_logs = false + help = false igenomes_base = "./iGenomes" tracedir = "${params.outdir}/pipeline_info" - clusterOptions = false awsqueue = false awsregion = 'eu-west-1' + igenomesIgnore = false + custom_config_version = 'master' + custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" + hostnames = false + config_profile_description = false + config_profile_contact = false + config_profile_url = false } -profiles { +// Container slug. Stable releases should specify release tag! +// Developmental code should specify :dev +process.container = 'nfcore/rnafusion:dev' - standard { - includeConfig 'conf/base.config' - } +// Load base.config by default for all pipelines +includeConfig 'conf/base.config' + +// Load nf-core custom profiles from different Institutions +try { + includeConfig "${params.custom_config_base}/nfcore_custom.config" +} catch (Exception e) { + System.err.println("WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config") +} + +profiles { + awsbatch { includeConfig 'conf/awsbatch.config' } conda { process.conda = "$baseDir/environment.yml" } - docker { - docker.enabled = true - process.container = params.container - } - singularity { - singularity.enabled = true - process.container = {"shub://${params.container.replace('nfcore', 'nf-core')}"} - } - awsbatch { - includeConfig 'conf/base.config' - includeConfig 'conf/awsbatch.config' - includeConfig 'conf/igenomes.config' - } - test { - includeConfig 'conf/base.config' - includeConfig 'conf/test.config' - } - none { - // Don't load any config (for use with custom home configs) - } + debug { process.beforeScript = 'echo $HOSTNAME' } + docker { docker.enabled = true } + singularity { singularity.enabled = true } + test { includeConfig 'conf/test.config' } +} +// Load igenomes.config if required +if(!params.igenomesIgnore){ + includeConfig 'conf/igenomes.config' } // Capture exit codes from upstream processes when piping @@ -58,28 +68,29 @@ process.shell = ['/bin/bash', '-euo', 'pipefail'] timeline { enabled = true - file = "${params.tracedir}/pipeline_info/nf-core/rnafusion_timeline.html" + file = "${params.tracedir}/execution_timeline.html" } report { enabled = true - file = "${params.tracedir}/pipeline_info/nf-core/rnafusion_report.html" + file = "${params.tracedir}/execution_report.html" } trace { enabled = true - file = "${params.tracedir}/pipeline_info/nf-core/rnafusion_trace.txt" + file = "${params.tracedir}/execution_trace.txt" } dag { enabled = true - file = "${params.tracedir}/pipeline_info/nf-core/rnafusion_dag.svg" + file = "${params.tracedir}/pipeline_dag.svg" } manifest { name = 'nf-core/rnafusion' - description = 'Attempt at setting up a pipeline for fusion detection as an addon to the previously existing NGI-RNAseq pipeline.' + author = 'No author provided' homePage = 'https://github.com/nf-core/rnafusion' - pipelineVersion = '1.0dev' + description = 'Nextflow rnafusion analysis pipeline, part of the nf-core community.' mainScript = 'main.nf' - nextflowVersion = '>=0.30.0' + nextflowVersion = '>=0.32.0' + version = '1.0.1' } // Function to ensure that resource requirements don't go beyond From d41861e605af50632b279a35e1b053788c2d6b69 Mon Sep 17 00:00:00 2001 From: Chadi Saad Date: Sat, 11 May 2019 22:02:44 +0200 Subject: [PATCH 02/11] docs: updated usage.md (#70) --- docs/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 4ab31a7d..60f8e044 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -116,7 +116,7 @@ nextflow run nf-core/rnafusion First start by downloading singularity images. Sometimes the pipeline can crash if you are not using downloaded images (might be some network issues). ```bash -nextflow run nf-core/rnafusion/download-singularity-img.nf --all --outdir /path +nextflow run nf-core/rnafusion/download-singularity-img.nf --download_all --outdir /path # or From cf9ec3991ab55a2f0447f0f87d8ce790365c9e3c Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Sat, 11 May 2019 22:42:55 +0200 Subject: [PATCH 03/11] test: updated Travis CI testing --- .travis.yml | 20 +++++++++----------- README.md | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9913cb2..95b81bb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - docker pull nfcore/rnafusion:dev # Fake the tag locally so that the pipeline runs properly # 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/rnafusion:dev nfcore/rnafusion:dev + - docker tag nfcore/rnafusion:dev nfcore/rnafusion:1.0.1 install: # Install Nextflow @@ -24,25 +24,23 @@ install: # Install nf-core/tools - pip install --upgrade pip - pip install nf-core - # Reset - - mkdir ${TRAVIS_BUILD_DIR}/tests && cd ${TRAVIS_BUILD_DIR}/tests # Install markdownlint-cli - sudo apt-get install npm && npm install -g markdownlint-cli + # Reset + - mkdir ${TRAVIS_BUILD_DIR}/tests && cd ${TRAVIS_BUILD_DIR}/tests env: - NXF_VER='0.32.0' # Specify a minimum NF version that should be tested and work - NXF_VER='' # Plus: get the latest NF version and check that it works script: - # Create and download test data - - | - touch tests/genome.fa tests/genes.gtf - mkdir tests/star_index tests/databases - wget http://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_1.fq.gz -O tests/reads_1.fq.gz - wget http://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_2.fq.gz -O tests/reads_2.fq.gz # Lint the pipeline code - nf-core lint ${TRAVIS_BUILD_DIR} # 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 + # Test pipeline help page + - nextflow run ${TRAVIS_BUILD_DIR} --help + # Test downloading references help page + - nextflow run ${TRAVIS_BUILD_DIR}/download-references.nf --help + # Test downloading singularity images help page + - nextflow run ${TRAVIS_BUILD_DIR}/download-singularity-img.nf --help \ No newline at end of file diff --git a/README.md b/README.md index bf25230a..c275193e 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ bioRxiv 120295; doi: [https://doi.org/10.1101/120295](https://doi.org/10.1101/12 Páll Melsted, Shannon Hateley, Isaac Charles Joseph, Harold Pimentel, Nicolas L Bray, Lior Pachter, bioRxiv 166322; doi: [https://doi.org/10.1101/166322](https://doi.org/10.1101/166322) * **SQUID: transcriptomic structural variation detection from RNA-seq** Cong Ma, Mingfu Shao and Carl Kingsford, Genome Biology, 2018, doi: [https://doi.org/10.1186/s13059-018-1421-5](https://doi.org/10.1186/s13059-018-1421-5) * **Fusion-Inspector** download: [https://github.com/FusionInspector](https://github.com/FusionInspector) -* Martin Proks. (2019, March 26). matq007/fusion-report: **fusion-report:1.0** (Version 1.0). Zenodo. http://doi.org/10.5281/zenodo.2609227 +* Martin Proks. (2019, March 26). matq007/fusion-report: **fusion-report:1.0** (Version 1.0). Zenodo. [http://doi.org/10.5281/zenodo.2609227](http://doi.org/10.5281/zenodo.2609227) * **FastQC** download: [https://www.bioinformatics.babraham.ac.uk/projects/fastqc/](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/) * **MultiQC** Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. [https://doi.org/10.1093/bioinformatics/btw354](https://doi.org/10.1093/bioinformatics/btw354) Download: [https://multiqc.info/](https://multiqc.info/) From fa1929033e3d9bc4f420d39ce469ead8b0df92b8 Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Sat, 11 May 2019 22:57:51 +0200 Subject: [PATCH 04/11] fix: fixed download path for STAR-Fusion (#71) --- download-references.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download-references.nf b/download-references.nf index bb647bc7..cbf2b968 100644 --- a/download-references.nf +++ b/download-references.nf @@ -111,7 +111,7 @@ process download_star_fusion { script: """ - wget -N https://data.broadinstitute.org/Trinity/CTAT_RESOURCE_LIB/GRCh38_v27_CTAT_lib_Feb092018.plug-n-play.tar.gz -O GRCh38_v27_CTAT_lib_Feb092018.plug-n-play.tar.gz + wget -N https://data.broadinstitute.org/Trinity/CTAT_RESOURCE_LIB/__genome_libs_StarFv1.3/GRCh38_v27_CTAT_lib_Feb092018.plug-n-play.tar.gz -O GRCh38_v27_CTAT_lib_Feb092018.plug-n-play.tar.gz tar -xvzf GRCh38_v27_CTAT_lib_Feb092018.plug-n-play.tar.gz && rm GRCh38_v27_CTAT_lib_Feb092018.plug-n-play.tar.gz """ } From bbb2cf7ad79ff85938bb4bf1f1d0b600cb09bdc1 Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Sat, 11 May 2019 23:15:01 +0200 Subject: [PATCH 05/11] fix: wrapped COSMIC parameters into quotes (#75) --- download-references.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download-references.nf b/download-references.nf index cbf2b968..4f5b14b0 100644 --- a/download-references.nf +++ b/download-references.nf @@ -207,7 +207,7 @@ process download_databases { script: """ - fusion_report download --cosmic_usr ${params.cosmic_usr} --cosmic_passwd ${params.cosmic_passwd} . + fusion_report download --cosmic_usr "${params.cosmic_usr}" --cosmic_passwd "${params.cosmic_passwd}" . """ } From a31197a5f19b15912f99153c3ce9c15673f93586 Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Sun, 12 May 2019 18:43:45 +0200 Subject: [PATCH 06/11] fix: implemented optional output for fusion tools (#72) --- main.nf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.nf b/main.nf index bffd5147..a6a2302a 100644 --- a/main.nf +++ b/main.nf @@ -337,7 +337,7 @@ process star_fusion { file reference from star_fusion_ref output: - file '*fusion_predictions.tsv' into star_fusion_fusions + file '*fusion_predictions.tsv' optional true into star_fusion_fusions file '*.{tsv,txt}' into star_fusion_output script: @@ -387,7 +387,7 @@ process fusioncatcher { file data_dir from fusioncatcher_ref output: - file 'final-list_candidate-fusion-genes.txt' into fusioncatcher_fusions + file 'final-list_candidate-fusion-genes.txt' optional true into fusioncatcher_fusions file '*.{txt,zip,log}' into fusioncatcher_output script: @@ -418,8 +418,8 @@ process ericscript { file reference from ericscript_ref output: - file './tmp/fusions.results.filtered.tsv' into ericscript_fusions - file './tmp/fusions.results.total.tsv' into ericscript_output + file './tmp/fusions.results.filtered.tsv' optional true into ericscript_fusions + file './tmp/fusions.results.total.tsv' optional true into ericscript_output script: """ @@ -449,7 +449,7 @@ process pizzly { file gtf from pizzly_gtf output: - file 'pizzly_fusions.txt' into pizzly_fusions + file 'pizzly_fusions.txt' optional true into pizzly_fusions file '*.{json,txt}' into pizzly_output script: @@ -483,7 +483,7 @@ process squid { file gtf from gtf_squid output: - file '*_annotated.txt' into squid_fusions + file '*_annotated.txt' optional true into squid_fusions file '*.txt' into squid_output script: @@ -530,11 +530,11 @@ process summary { script: def extra_params = params.fusion_report_opt ? "${params.fusion_report_opt}" : '' - def tools = params.fusioncatcher ? "--fusioncatcher ${fusioncatcher} " : '' - tools += params.star_fusion ? "--starfusion ${starfusion} " : '' - tools += params.ericscript ? "--ericscript ${ericscript} " : '' - tools += params.pizzly ? "--pizzly ${pizzly} " : '' - tools += params.squid ? "--squid ${squid} " : '' + def tools = !fusioncatcher.empty() ? "--fusioncatcher ${fusioncatcher} " : '' + tools += !starfusion.empty() ? "--starfusion ${starfusion} " : '' + tools += !ericscript.empty() ? "--ericscript ${ericscript} " : '' + tools += !pizzly.empty() ? "--pizzly ${pizzly} " : '' + tools += !squid.empty() ? "--squid ${squid} " : '' """ fusion_report run ${name} . ${params.databases} \\ ${tools} ${extra_params} From 70bc729239f7a93351ccd760909021f9a67152f8 Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Sun, 12 May 2019 18:51:21 +0200 Subject: [PATCH 07/11] docs: markdownlint requires a new line at the end of file --- docs/configuration/local.md | 2 +- docs/configuration/uppmax.md | 2 +- docs/references.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/configuration/local.md b/docs/configuration/local.md index 744febf5..fad35bc0 100644 --- a/docs/configuration/local.md +++ b/docs/configuration/local.md @@ -46,4 +46,4 @@ Then transfer this file and run the pipeline with this path: ```bash nextflow run /path/to/nfcore-rnafusion -with-singularity /path/to/nfcore-rnafusion-1.0.1.img -``` \ No newline at end of file +``` diff --git a/docs/configuration/uppmax.md b/docs/configuration/uppmax.md index dbf8a4c2..1feeefc1 100644 --- a/docs/configuration/uppmax.md +++ b/docs/configuration/uppmax.md @@ -59,4 +59,4 @@ nextflow run /path/to/nfcore-rnafusion-1.0.1 -with-singularity /path/to/singular If you would prefer to use environment modules instead of singularity, you can use the old version of the configuration by specifying `-profile uppmax_modules` (we don't recommend this). -For pipeline development work on `milou`, use `-profile uppmax_devel` - this uses the milou [devel partition](http://www.uppmax.uu.se/support/user-guides/slurm-user-guide/#tocjump_030509106905141747_8) for testing the pipeline quickly. Please note that this is _not_ suitable for proper analysis runs - only tiny test datasets. \ No newline at end of file +For pipeline development work on `milou`, use `-profile uppmax_devel` - this uses the milou [devel partition](http://www.uppmax.uu.se/support/user-guides/slurm-user-guide/#tocjump_030509106905141747_8) for testing the pipeline quickly. Please note that this is _not_ suitable for proper analysis runs - only tiny test datasets. diff --git a/docs/references.md b/docs/references.md index b2c2de02..a6e0bffc 100644 --- a/docs/references.md +++ b/docs/references.md @@ -151,4 +151,4 @@ aws s3 --no-sign-request --region eu-west-1 sync s3://ngi-igenomes/igenomes/Homo ```bash fusion_report download --cosmic_usr --cosmic_passwd /output/databases -``` \ No newline at end of file +``` From 32906da1891bdf48a9415e3ab1b7451beab54313 Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Mon, 13 May 2019 09:31:59 +0200 Subject: [PATCH 08/11] chore: preparation for 1.0.2 release --- .travis.yml | 2 +- Dockerfile | 2 +- environment.yml | 2 +- nextflow.config | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95b81bb2..176e3505 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - docker pull nfcore/rnafusion:dev # Fake the tag locally so that the pipeline runs properly # 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/rnafusion:dev nfcore/rnafusion:1.0.1 + - docker tag nfcore/rnafusion:dev nfcore/rnafusion:1.0.2 install: # Install Nextflow diff --git a/Dockerfile b/Dockerfile index 5f4de26b..a8967ec0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,4 @@ LABEL authors="Martin Proks " \ COPY environment.yml / RUN conda env create -f /environment.yml && conda clean -a -ENV PATH /opt/conda/envs/nf-core-rnafusion-1.0.1/bin:$PATH +ENV PATH /opt/conda/envs/nf-core-rnafusion-1.0.2/bin:$PATH diff --git a/environment.yml b/environment.yml index 8191f0cb..6a8fa42b 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ # You can use this file to create a conda environment for this pipeline: # conda env create -f environment.yml -name: nf-core-rnafusion-1.0.1 +name: nf-core-rnafusion-1.0.2 channels: - conda-forge - bioconda diff --git a/nextflow.config b/nextflow.config index fc03ffc7..a5a23c62 100644 --- a/nextflow.config +++ b/nextflow.config @@ -81,7 +81,7 @@ params { // Container slug. Stable releases should specify release tag! // Developmental code should specify :dev -process.container = 'nfcore/rnafusion:1.0.1' +process.container = 'nfcore/rnafusion:1.0.2' // Load base.config by default for all pipelines includeConfig 'conf/base.config' @@ -134,7 +134,7 @@ manifest { description = 'Nextflow rnafusion analysis pipeline, part of the nf-core community.' mainScript = 'main.nf' nextflowVersion = '>=0.32.0' - version = '1.0.1' + version = '1.0.2' } // Function to ensure that resource requirements don't go beyond From 2cbbc3eda06a450ae446419a145db072fdc072ce Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Mon, 13 May 2019 09:51:51 +0200 Subject: [PATCH 09/11] chore: CHANGELOG 1.0.2 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4dcc23..a771fce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # nfcore/rnafusion +## nfcore/rnafusion version 1.0.2 - 2018/05/13 + +### Changed + +* Bumped nf-core template to 1.6 [#69](https://github.com/nf-core/rnafusion/pull/69) + +### Fixed + +* Fixed COSMIC parameters not wrapped in quotes [#75](https://github.com/nf-core/rnafusion/issues/75) +* Implemented output output for fusion tools [#72](https://github.com/nf-core/rnafusion/issues/72) +* Fixed reference download link for STAR-Fusion [#71](https://github.com/nf-core/rnafusion/issues/71) + ## nfcore/rnafusion version 1.0.1 - 2018/04/06 ### Added From a2e8464fc0a34c8d97564e5362dc1a512a0c0ca2 Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Mon, 13 May 2019 10:35:14 +0200 Subject: [PATCH 10/11] test: updated Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 399b83c7..931ca1eb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,8 +10,7 @@ pipeline { stage('Setup environment') { steps { sh "pip install nf-core" - sh "docker pull nfcore/rnafusion:dev" - sh "docker tag nfcore/rnafusion:dev nfcore/rnafusion:1.0.1" + sh "docker pull nfcore/rnafusion:1.0.2" } } stage('Lint markdown') { From eca7b537e4f11e0bf05cd48db0e7716177d8f7cc Mon Sep 17 00:00:00 2001 From: Martin Proks Date: Mon, 13 May 2019 10:35:56 +0200 Subject: [PATCH 11/11] test: updated Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 931ca1eb..45bf6d3b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,9 +21,9 @@ pipeline { stage('Build') { steps { // sh "nextflow run kraken,jenkins nf-core/rnafusion" - sh "nextflow run nf-core/rnafusion -r dev --help" - sh "nextflow run nf-core/rnafusion/download-references.nf -r dev --help" - sh "nextflow run nf-core/rnafusion/download-singularity-img.nf -r dev --help" + sh "nextflow run nf-core/rnafusion --help" + sh "nextflow run nf-core/rnafusion/download-references.nf --help" + sh "nextflow run nf-core/rnafusion/download-singularity-img.nf --help" } } }