From 681ba8356db454e8a5141adc0e5cd513a647fe5d Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 14 Feb 2020 18:03:06 +0000 Subject: [PATCH 01/21] Remove title --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c4fb15e3..54e09f39 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # ![nfcore/nanoseq](docs/images/nf-core-nanoseq_logo.png) -**A pipeline to demultiplex, QC and map Nanopore data**. - [![GitHub Actions CI Status](https://github.com/nf-core/nanoseq/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/nanoseq/actions) [![GitHub Actions Linting Status](https://github.com/nf-core/nanoseq/workflows/nf-core%20linting/badge.svg)](https://github.com/nf-core/nanoseq/actions) [![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A519.10.0-brightgreen.svg)](https://www.nextflow.io/) From 048c15f4d00ca81d04c43cd64d389be7f05387a4 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 14 Feb 2020 18:07:57 +0000 Subject: [PATCH 02/21] Update contributors --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 54e09f39..65e3193d 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ The nf-core/nanoseq pipeline comes with documentation about the pipeline, found ## Credits -nf-core/nanoseq was originally written by [Chelsea Sawyer](https://github.com/csawye01) and [Harshil Patel](https://github.com/drpatelh) from [The Bioinformatics & Biostatistics Group](https://www.crick.ac.uk/research/science-technology-platforms/bioinformatics-and-biostatistics/) for use at [The Francis Crick Institute](https://www.crick.ac.uk/), London. [Laura Wratten](https://github.com/lwratten) from the [Genome Institute of Singapore](https://www.a-star.edu.sg/gis) is one of the primary contributors along with [Johannes Alneberg](https://github.com/alneberg) and [Franziska Bonath](https://github.com/FranBonath) from [SciLifeLab](https://www.scilifelab.se/), Sweden. +nf-core/nanoseq was originally written by [Chelsea Sawyer](https://github.com/csawye01) and [Harshil Patel](https://github.com/drpatelh) from [The Bioinformatics & Biostatistics Group](https://www.crick.ac.uk/research/science-technology-platforms/bioinformatics-and-biostatistics/) for use at [The Francis Crick Institute](https://www.crick.ac.uk/), London. Other primary contributors include [Laura Wratten](https://github.com/lwratten), [Chen Ying](https://github.com/cying111) and [Jonathan Goeke](https://github.com/jonathangoeke) from the [Genome Institute of Singapore](https://www.a-star.edu.sg/gis), [Johannes Alneberg](https://github.com/alneberg) and [Franziska Bonath](https://github.com/FranBonath) from [SciLifeLab](https://www.scilifelab.se/), Sweden. Many thanks to others who have helped out along the way too, including (but not limited to): [@crickbabs](https://github.com/crickbabs), [@AnnaSyme](https://github.com/AnnaSyme). From 1447b24a6021a251c3392a97547632b8b79d3184 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 20 Feb 2020 15:32:40 +0000 Subject: [PATCH 03/21] Template update for nf-core/tools version 1.9 --- .github/workflows/ci.yml | 3 +- .github/workflows/linting.yml | 39 ++++++++----- .gitignore | 3 +- .travis.yml | 47 ---------------- Dockerfile | 2 +- README.md | 14 +++-- assets/multiqc_config.yaml | 4 +- bin/markdown_to_html.py | 100 ++++++++++++++++++++++++++++++++++ bin/markdown_to_html.r | 51 ----------------- conf/test.config | 2 +- docs/usage.md | 9 ++- environment.yml | 5 +- main.nf | 30 +++++----- nextflow.config | 2 +- 14 files changed, 168 insertions(+), 143 deletions(-) delete mode 100644 .travis.yml create mode 100755 bin/markdown_to_html.py delete mode 100755 bin/markdown_to_html.r diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63a92ee4..49c48064 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,8 @@ jobs: sudo mv nextflow /usr/local/bin/ - name: Pull docker image run: | - docker pull nfcore/nanoseq:dev && docker tag nfcore/nanoseq:dev nfcore/nanoseq:dev + docker pull nfcore/nanoseq:dev + docker tag nfcore/nanoseq:dev nfcore/nanoseq:dev - name: Run pipeline with test data run: | # TODO nf-core: You can customise CI pipeline run tests as required diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 7354dc74..1e0827a8 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,26 +1,39 @@ name: nf-core linting # This workflow is triggered on pushes and PRs to the repository. # It runs the `nf-core lint` and markdown lint tests to ensure that the code meets the nf-core guidelines -on: [push, pull_request] +on: + push: + pull_request: + release: + types: [published] jobs: Markdown: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: '10' - name: Install markdownlint - run: | - npm install -g markdownlint-cli + run: npm install -g markdownlint-cli - name: Run Markdownlint - run: | - markdownlint ${GITHUB_WORKSPACE} -c ${GITHUB_WORKSPACE}/.github/markdownlint.yml - nf-core: + run: markdownlint ${GITHUB_WORKSPACE} -c ${GITHUB_WORKSPACE}/.github/markdownlint.yml + YAML: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '10' + - name: Install yaml-lint + run: npm install -g yaml-lint + - name: Run yaml-lint + run: yamllint $(find ${GITHUB_WORKSPACE} -type f -name "*.yml") + nf-core: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 - name: Install Nextflow run: | wget -qO- get.nextflow.io | bash @@ -29,13 +42,9 @@ jobs: with: python-version: '3.6' architecture: 'x64' - - name: Install pip - run: | - sudo apt install python3-pip - pip install --upgrade pip - - name: Install nf-core tools + - name: Install dependencies run: | + python -m pip install --upgrade pip pip install nf-core - name: Run nf-core lint - run: | - nf-core lint ${GITHUB_WORKSPACE} + run: nf-core lint ${GITHUB_WORKSPACE} diff --git a/.gitignore b/.gitignore index 0189a444..6354f370 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ work/ data/ results/ .DS_Store -test* +tests/ +testing/ *.pyc diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f51bfba4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -sudo: required -language: python -jdk: openjdk8 -services: docker -python: '3.6' -cache: pip -matrix: - fast_finish: true - -before_install: - # PRs to master are only ok if coming from dev branch - - '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ]) || [ $TRAVIS_PULL_REQUEST_BRANCH = "patch" ]' - # Pull the docker image first so the test doesn't wait for this - - docker pull nfcore/nanoseq: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/nanoseq:dev nfcore/nanoseq:dev - -install: - # Install 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 - - 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 - -env: - # Tower token is to inspect runs on https://tower.nf - # Use public mailbox nf-core@mailinator.com to log in: https://www.mailinator.com/v3/index.jsp?zone=public&query=nf-core - # Specify a minimum NF version that should be tested and work - - NXF_VER='19.10.0' TOWER_ACCESS_TOKEN="1c1f493bc2703472d6f1b9f6fb9e9d117abab7b1" - # Plus: get the latest NF version and check that it works - - NXF_VER='' TOWER_ACCESS_TOKEN="1c1f493bc2703472d6f1b9f6fb9e9d117abab7b1" - - -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 -ansi-log false -name nanoseq-${TRAVIS_EVENT_TYPE}-${TRAVIS_PULL_REQUEST}-${TRAVIS_COMMIT:0:6}-test-description diff --git a/Dockerfile b/Dockerfile index ff74a7f2..829bcda2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nfcore/base:1.8 +FROM nfcore/base:1.9 LABEL authors="Chelsea Sawyer" \ description="Docker image containing all software requirements for the nf-core/nanoseq pipeline" diff --git a/README.md b/README.md index a917655e..e5846723 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ **A pipeline to demultiplex, QC and map Nanopore data**. -[![Build Status](https://travis-ci.com/nf-core/nanoseq.svg?branch=master)](https://travis-ci.com/nf-core/nanoseq) [![GitHub Actions CI Status](https://github.com/nf-core/nanoseq/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/nanoseq/actions) [![GitHub Actions Linting Status](https://github.com/nf-core/nanoseq/workflows/nf-core%20linting/badge.svg)](https://github.com/nf-core/nanoseq/actions) [![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A519.10.0-brightgreen.svg)](https://www.nextflow.io/) @@ -18,7 +17,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool i. Install [`nextflow`](https://nf-co.re/usage/installation) -ii. Install one of [`docker`](https://docs.docker.com/engine/installation/), [`singularity`](https://www.sylabs.io/guides/3.0/user-guide/) or [`conda`](https://conda.io/miniconda.html) +ii. Install either [`Docker`](https://docs.docker.com/engine/installation/) or [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/) for full pipeline reproducibility (please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles)) iii. Download the pipeline and test it on a minimal dataset with a single command @@ -26,7 +25,7 @@ iii. Download the pipeline and test it on a minimal dataset with a single comman nextflow run nf-core/nanoseq -profile test, ``` -> Please check [nf-core/configs](https://github.com/nf-core/configs#documentation) to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use `-profile institute` in your command. This will enable either `docker` or `singularity` and set the appropriate execution settings for your local compute environment. +> Please check [nf-core/configs](https://github.com/nf-core/configs#documentation) to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use `-profile ` in your command. This will enable either `docker` or `singularity` and set the appropriate execution settings for your local compute environment. iv. Start running your own analysis! @@ -68,6 +67,11 @@ For further information or help, don't hesitate to get in touch on [Slack](https -You can cite the `nf-core` pre-print as follows: +You can cite the `nf-core` publication as follows: -> Ewels PA, Peltzer A, Fillinger S, Alneberg JA, Patel H, Wilm A, Garcia MU, Di Tommaso P, Nahnsen S. **nf-core: Community curated bioinformatics pipelines**. *bioRxiv*. 2019. p. 610741. [doi: 10.1101/610741](https://www.biorxiv.org/content/10.1101/610741v1). +> **The nf-core framework for community-curated bioinformatics pipelines.** +> +> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen. +> +> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x). +> ReadCube: [Full Access Link](https://rdcu.be/b1GjZ) diff --git a/assets/multiqc_config.yaml b/assets/multiqc_config.yaml index afb9da1f..35b33cc7 100644 --- a/assets/multiqc_config.yaml +++ b/assets/multiqc_config.yaml @@ -3,7 +3,9 @@ report_comment: > analysis pipeline. For information about how to interpret these results, please see the documentation. report_section_order: - nf-core/nanoseq-software-versions: + software_versions: order: -1000 + nf-core-nanoseq-summary: + order: -1001 export_plots: true diff --git a/bin/markdown_to_html.py b/bin/markdown_to_html.py new file mode 100755 index 00000000..57cc4263 --- /dev/null +++ b/bin/markdown_to_html.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +from __future__ import print_function +import argparse +import markdown +import os +import sys + +def convert_markdown(in_fn): + input_md = open(in_fn, mode="r", encoding="utf-8").read() + html = markdown.markdown( + "[TOC]\n" + input_md, + extensions = [ + 'pymdownx.extra', + 'pymdownx.b64', + 'pymdownx.highlight', + 'pymdownx.emoji', + 'pymdownx.tilde', + 'toc' + ], + extension_configs = { + 'pymdownx.b64': { + 'base_path': os.path.dirname(in_fn) + }, + 'pymdownx.highlight': { + 'noclasses': True + }, + 'toc': { + 'title': 'Table of Contents' + } + } + ) + return html + +def wrap_html(contents): + header = """ + + + + + +
+ """ + footer = """ +
+ + + """ + return header + contents + footer + + +def parse_args(args=None): + parser = argparse.ArgumentParser() + parser.add_argument('mdfile', type=argparse.FileType('r'), nargs='?', + help='File to convert. Defaults to stdin.') + parser.add_argument('-o', '--out', type=argparse.FileType('w'), + default=sys.stdout, + help='Output file name. Defaults to stdout.') + return parser.parse_args(args) + +def main(args=None): + args = parse_args(args) + converted_md = convert_markdown(args.mdfile.name) + html = wrap_html(converted_md) + args.out.write(html) + +if __name__ == '__main__': + sys.exit(main()) diff --git a/bin/markdown_to_html.r b/bin/markdown_to_html.r deleted file mode 100755 index abe13350..00000000 --- a/bin/markdown_to_html.r +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env Rscript - -# Command line argument processing -args = commandArgs(trailingOnly=TRUE) -if (length(args) < 2) { - stop("Usage: markdown_to_html.r ", call.=FALSE) -} -markdown_fn <- args[1] -output_fn <- args[2] - -# Load / install packages -if (!require("markdown")) { - install.packages("markdown", dependencies=TRUE, repos='http://cloud.r-project.org/') - library("markdown") -} - -base_css_fn <- getOption("markdown.HTML.stylesheet") -base_css <- readChar(base_css_fn, file.info(base_css_fn)$size) -custom_css <- paste(base_css, " -body { - padding: 3em; - margin-right: 350px; - max-width: 100%; -} -#toc { - position: fixed; - right: 20px; - width: 300px; - padding-top: 20px; - overflow: scroll; - height: calc(100% - 3em - 20px); -} -#toc_header { - font-size: 1.8em; - font-weight: bold; -} -#toc > ul { - padding-left: 0; - list-style-type: none; -} -#toc > ul ul { padding-left: 20px; } -#toc > ul > li > a { display: none; } -img { max-width: 800px; } -") - -markdownToHTML( - file = markdown_fn, - output = output_fn, - stylesheet = custom_css, - options = c('toc', 'base64_images', 'highlight_code') -) diff --git a/conf/test.config b/conf/test.config index 3d2de036..68817aa6 100644 --- a/conf/test.config +++ b/conf/test.config @@ -10,7 +10,7 @@ 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 + // Limit resources so that this can run on GitHub Actions max_cpus = 2 max_memory = 6.GB max_time = 48.h diff --git a/docs/usage.md b/docs/usage.md index 0838b965..30060ce9 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -94,6 +94,8 @@ Use this parameter to choose a configuration profile. Profiles can give configur Several generic profiles are bundled with the pipeline which instruct the pipeline to use software packaged using different methods (Docker, Singularity, Conda) - see below. +> We highly recommend the use of Docker or Singularity containers for full pipeline reproducibility, however when this is not possible, Conda is also supported. + The pipeline also dynamically loads configurations from [https://github.com/nf-core/configs](https://github.com/nf-core/configs) when it runs, making multiple config profiles for various institutional clusters available at run time. For more information and to see if your system is available in these configs please see the [nf-core/configs documentation](https://github.com/nf-core/configs#documentation). Note that multiple profiles can be loaded, for example: `-profile test,docker` - the order of arguments is important! @@ -101,15 +103,16 @@ They are loaded in sequence, so later profiles can overwrite earlier profiles. If `-profile` is not specified, the pipeline will run locally and expect all software to be installed and available on the `PATH`. This is _not_ recommended. -* `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/nanoseq`](http://hub.docker.com/r/nfcore/nanoseq/) * `singularity` * A generic configuration profile to be used with [Singularity](http://singularity.lbl.gov/) * Pulls software from DockerHub: [`nfcore/nanoseq`](http://hub.docker.com/r/nfcore/nanoseq/) +* `conda` + * Please only use Conda as a last resort i.e. when it's not possible to run the pipeline with Docker or Singularity. + * A generic configuration profile to be used with [Conda](https://conda.io/docs/) + * Pulls most software from [Bioconda](https://bioconda.github.io/) * `test` * A profile with a complete configuration for automated testing * Includes links to test data so needs no other parameters diff --git a/environment.yml b/environment.yml index 2aa2e6ec..cbbd5139 100644 --- a/environment.yml +++ b/environment.yml @@ -7,8 +7,9 @@ channels: - defaults dependencies: - conda-forge::python=3.7.3 + - conda-forge::markdown=3.1.1 + - conda-forge::pymdown-extensions=6.0 + - conda-forge::pygments=2.5.2 # TODO nf-core: Add required software dependencies here - bioconda::fastqc=0.11.8 - bioconda::multiqc=1.7 - - conda-forge::r-markdown=1.1 - - conda-forge::r-base=3.6.1 diff --git a/main.nf b/main.nf index 8600a959..e9b886ee 100644 --- a/main.nf +++ b/main.nf @@ -23,7 +23,7 @@ def helpMessage() { Mandatory arguments: --reads [file] Path to input data (must be surrounded with quotes) -profile [str] Configuration profile to use. Can use multiple (comma separated) - Available: conda, docker, singularity, test, awsbatch and more + Available: conda, docker, singularity, test, awsbatch, and more Options: --genome [str] Name of iGenomes reference @@ -90,7 +90,8 @@ if (workflow.profile.contains('awsbatch')) { } // Stage config files -ch_multiqc_config = file(params.multiqc_config, checkIfExists: true) +ch_multiqc_config = file("$baseDir/assets/multiqc_config.yaml", checkIfExists: true) +ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty() ch_output_docs = file("$baseDir/docs/output.md", checkIfExists: true) /* @@ -153,9 +154,10 @@ 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 = """ +Channel.from(summary.collect{ [it.key, it.value] }) + .map { k,v -> "
$k
${v ?: 'N/A'}
" } + .reduce { a, b -> return [a, b].join("\n ") } + .map { x -> """ id: 'nf-core-nanoseq-summary' description: " - this information is collected when the pipeline is started." section_name: 'nf-core/nanoseq Workflow Summary' @@ -163,12 +165,10 @@ def create_workflow_summary(summary) { plot_type: 'html' data: |
-${summary.collect { k,v -> "
$k
${v ?: 'N/A'}
" }.join("\n")} + $x
- """.stripIndent() - - return yaml_file -} + """.stripIndent() } + .set { ch_workflow_summary } /* * Parse software version numbers @@ -225,11 +225,12 @@ process multiqc { publishDir "${params.outdir}/MultiQC", mode: 'copy' input: - file multiqc_config from ch_multiqc_config + file (multiqc_config) from ch_multiqc_config + file (mqc_custom_config) from ch_multiqc_custom_config.collect().ifEmpty([]) // TODO nf-core: Add in log files from your new processes for MultiQC to find! file ('fastqc/*') from ch_fastqc_results.collect().ifEmpty([]) file ('software_versions/*') from ch_software_versions_yaml.collect() - file workflow_summary from create_workflow_summary(summary) + file workflow_summary from ch_workflow_summary.collectFile(name: "workflow_summary_mqc.yaml") output: file "*multiqc_report.html" into ch_multiqc_report @@ -239,9 +240,10 @@ process multiqc { script: rtitle = custom_runName ? "--title \"$custom_runName\"" : '' rfilename = custom_runName ? "--filename " + custom_runName.replaceAll('\\W','_').replaceAll('_+','_') + "_multiqc_report" : '' + custom_config_file = params.multiqc_config ? "--config $mqc_custom_config" : '' // TODO nf-core: Specify which MultiQC modules to use with -m for a faster run time """ - multiqc -f $rtitle $rfilename --config $multiqc_config . + multiqc -f $rtitle $rfilename $custom_config_file . """ } @@ -259,7 +261,7 @@ process output_documentation { script: """ - markdown_to_html.r $output_docs results_description.html + markdown_to_html.py $output_docs -o results_description.html """ } diff --git a/nextflow.config b/nextflow.config index c16015c6..a97da245 100644 --- a/nextflow.config +++ b/nextflow.config @@ -17,7 +17,7 @@ params { // Boilerplate options name = false - multiqc_config = "$baseDir/assets/multiqc_config.yaml" + multiqc_config = false email = false email_on_fail = false max_multiqc_email_size = 25.MB From 84c2fcd338bade56d201b2e622aa0011f4d6dcc3 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 14:44:53 +0000 Subject: [PATCH 04/21] Add RNA/DNA to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5739fc37..4d12d707 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## Introduction -**nfcore/nanoseq** is a bioinformatics analysis pipeline that can be used to perform basecalling, demultiplexing, mapping and QC of Nanopore data. +**nfcore/nanoseq** is a bioinformatics analysis pipeline that can be used to perform basecalling, demultiplexing, mapping and QC of Nanopore DNA/RNA sequencing data. 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. From e9dd781d34dfa699822c7ac66af5146d861d15c0 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 14:56:31 +0000 Subject: [PATCH 05/21] Add description about spliced alignment --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4d12d707..7fb9ce95 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool 2. Sequencing QC ([`pycoQC`](https://github.com/a-slide/pycoQC), [`NanoPlot`](https://github.com/wdecoster/NanoPlot)) 3. Raw read QC ([`NanoPlot`](https://github.com/wdecoster/NanoPlot), [`FastQC`](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/)) 4. Alignment ([`GraphMap2`](https://github.com/lbcb-sci/graphmap2) or [`minimap2`](https://github.com/lh3/minimap2)) + * Sensible defaults will be applied automatically for un-spliced and spliced alignments based on a combination of the input data and user-specified parameters * Each sample can be mapped to its own reference genome if multiplexed in this way * Convert SAM to co-ordinate sorted BAM and obtain mapping metrics ([`SAMtools`](http://www.htslib.org/doc/samtools.html)) 5. Create bigWig ([`BEDTools`](https://github.com/arq5x/bedtools2/), [`bedGraphToBigWig`](http://hgdownload.soe.ucsc.edu/admin/exe/)) and bigBed ([`BEDTools`](https://github.com/arq5x/bedtools2/), [`bedToBigBed`](http://hgdownload.soe.ucsc.edu/admin/exe/)) coverage tracks for visualisation From 4da582994d2a40f817d32084cd6e8de073e27df3 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 15:10:28 +0000 Subject: [PATCH 06/21] Add splice details to main description --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index abd91a01..2ef606dc 100644 --- a/main.nf +++ b/main.nf @@ -50,7 +50,7 @@ def helpMessage() { --skip_demultiplexing [bool] Skip demultiplexing with Guppy (Default: false) Alignment - --aligner [str] Specifies the aligner to use (available are: minimap2 or graphmap2) (Default: 'minimap2') + --aligner [str] Specifies the aligner to use (available are: minimap2 or graphmap2). Both are capable of performing unspliced/spliced alignment (Default: 'minimap2') --stranded [bool] Specifies if the data is strand-specific. Automatically activated when using '--protocol directRNA' (Default: false) --save_align_intermeds [bool] Save the '.sam' files from the alignment step (Default: false) --skip_alignment [bool] Skip alignment and subsequent process (Default: false) From abe52d30a1582ddf4f8699e184cdcb0e3f6c97d1 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 15:14:04 +0000 Subject: [PATCH 07/21] Add samplesheet --- assets/samplesheet.csv | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 assets/samplesheet.csv diff --git a/assets/samplesheet.csv b/assets/samplesheet.csv new file mode 100644 index 00000000..645bd36e --- /dev/null +++ b/assets/samplesheet.csv @@ -0,0 +1,7 @@ +sample,fastq,barcode,genome,transcriptome +Sample1,,1,mm10, +Sample2,,2,hg19, +Sample3,,3,/path/to/local/genome.fa, +Sample4,,4,,/path/to/local/transcriptome.fa +Sample5,,5,/path/to/local/genome.fa,/path/to/local/transcriptome.gtf +Sample6,,6,, From cd00c1a0e7098d774b86e5761b8c9d1c15db5591 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 15:15:23 +0000 Subject: [PATCH 08/21] Add example samplesheet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fb9ce95..0bfb7882 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ nextflow run nf-core/nanoseq \ -profile ``` -See [usage docs](docs/usage.md) for all of the available options when running the pipeline. +See [usage docs](docs/usage.md) for all of the available options when running the pipeline. An example input samplesheet for performing basecalling and demultiplexing can be found [here](assets/samplesheet.csv). ## Documentation From 8504b7e987116b19ccaf3463c709c5093b1d3572 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 15:16:26 +0000 Subject: [PATCH 09/21] Change language --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bfb7882..0ba213f5 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ nextflow run nf-core/nanoseq \ -profile ``` -See [usage docs](docs/usage.md) for all of the available options when running the pipeline. An example input samplesheet for performing basecalling and demultiplexing can be found [here](assets/samplesheet.csv). +See [usage docs](docs/usage.md) for all of the available options when running the pipeline. An example input samplesheet for performing both basecalling and demultiplexing can be found [here](assets/samplesheet.csv). ## Documentation From 94c20f6cc6fed690158e4123e1cd8d298c42bd24 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 15:23:52 +0000 Subject: [PATCH 10/21] Fix nitpick --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index 2ef606dc..14ade83e 100644 --- a/main.nf +++ b/main.nf @@ -777,7 +777,7 @@ process BAMToBedGraph { script: split = (params.protocol == 'DNA' || is_transcripts) ? "" : "-split" """ - genomeCoverageBed $split -ibam ${bam[0]} -bg | sort -k1,1 -k2,2n > ${sample}.bedGraph + bedtools genomecov $split -ibam ${bam[0]} -bg | sort -k1,1 -k2,2n > ${sample}.bedGraph """ } From b071e603ad6d2ba39c6da92c68ac9d51f48bc14d Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 15:29:10 +0000 Subject: [PATCH 11/21] Reword description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ba213f5..7ce2b2cd 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool 2. Sequencing QC ([`pycoQC`](https://github.com/a-slide/pycoQC), [`NanoPlot`](https://github.com/wdecoster/NanoPlot)) 3. Raw read QC ([`NanoPlot`](https://github.com/wdecoster/NanoPlot), [`FastQC`](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/)) 4. Alignment ([`GraphMap2`](https://github.com/lbcb-sci/graphmap2) or [`minimap2`](https://github.com/lh3/minimap2)) - * Sensible defaults will be applied automatically for un-spliced and spliced alignments based on a combination of the input data and user-specified parameters + * Both aligners are capable of performing unspliced and spliced alignment. Sensible defaults will be applied automatically based on a combination of the input data and user-specified parameters * Each sample can be mapped to its own reference genome if multiplexed in this way * Convert SAM to co-ordinate sorted BAM and obtain mapping metrics ([`SAMtools`](http://www.htslib.org/doc/samtools.html)) 5. Create bigWig ([`BEDTools`](https://github.com/arq5x/bedtools2/), [`bedGraphToBigWig`](http://hgdownload.soe.ucsc.edu/admin/exe/)) and bigBed ([`BEDTools`](https://github.com/arq5x/bedtools2/), [`bedToBigBed`](http://hgdownload.soe.ucsc.edu/admin/exe/)) coverage tracks for visualisation From d73077d6553375053bea11325ce053c0656b7591 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 16:25:52 +0000 Subject: [PATCH 12/21] Rewrite check_samplesheet.py script --- bin/check_samplesheet.py | 210 +++++++++++++++++++-------------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py index 2cdedad5..8d7cd53f 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -1,124 +1,124 @@ #!/usr/bin/env python -####################################################################### -####################################################################### -## Created on August 28th 2019 to check nf-core/nanoseq design file -####################################################################### -####################################################################### +########################################################################### +########################################################################### +## Created on August 28th 2019 to check nf-core/nanoseq samplesheet file +########################################################################### +########################################################################### import os import sys import argparse -############################################ -############################################ -## PARSE ARGUMENTS -############################################ -############################################ - -Description = 'Reformat nf-core/nanoseq design file and check its contents.' -Epilog = """Example usage: python check_samplesheet.py """ - -argParser = argparse.ArgumentParser(description=Description, epilog=Epilog) - -## REQUIRED PARAMETERS -argParser.add_argument('DESIGN_FILE_IN', help="Input design file.") -argParser.add_argument('DESIGN_FILE_OUT', help="Output design file.") -args = argParser.parse_args() - -############################################ -############################################ -## MAIN SCRIPT -############################################ -############################################ - -ERROR_STR = 'ERROR: Please check samplesheet' -HEADER = ['sample', 'fastq', 'barcode', 'genome', 'transcriptome'] - -## CHECK HEADER -fin = open(args.DESIGN_FILE_IN,'r') -header = fin.readline().strip().split(',') -if header != HEADER: - print("{} header: {} != {}".format(ERROR_STR,','.join(header),','.join(HEADER))) - sys.exit(1) - -outLines = [] -while True: - line = fin.readline() - if line: - lspl = [x.strip() for x in line.strip().split(',')] - sample,fastq,barcode,genome,transcriptome = lspl - - ## CHECK VALID NUMBER OF COLUMNS PER SAMPLE - numCols = len([x for x in lspl if x]) - if numCols < 2: - print("{}: Invalid number of columns (minimum of 2)!\nLine: '{}'".format(ERROR_STR,line.strip())) - sys.exit(1) - - ## CHECK SAMPLE ID ENTRIES - if sample: - if sample.find(' ') != -1: - print("{}: Sample ID contains spaces!\nLine: '{}'".format(ERROR_STR,line.strip())) - sys.exit(1) - else: - print("{}: Sample ID not specified!\nLine: '{}'".format(ERROR_STR,line.strip())) - sys.exit(1) +def parse_args(args=None): + Description = 'Reformat nf-core/nanoseq samplesheet file and check its contents.' + Epilog = """Example usage: python check_samplesheet.py """ - ## CHECK BARCODE ENTRIES - if barcode: - if not barcode.isdigit(): - print("{}: Barcode not an integer!\nLine: '{}'".format(ERROR_STR,line.strip())) - sys.exit(1) - else: - barcode = 'barcode%s' % (barcode.zfill(2)) + parser = argparse.ArgumentParser(description=Description, epilog=Epilog) + parser.add_argument('FILE_IN', help="Input samplesheet file.") + parser.add_argument('FILE_OUT', help="Output samplesheet file.") + + return parser.parse_args(args) + +def print_error(error,line): + print("ERROR: Please check samplesheet -> {}\nLine: '{}'".format(error,line.strip())) + +def check_samplesheet(FileIn,FileOut): + HEADER = ['sample', 'fastq', 'barcode', 'genome', 'transcriptome'] - ## CHECK FASTQ ENTRIES - if fastq: - if fastq[-9:] != '.fastq.gz' and fastq[-6:] != '.fq.gz': - print("{}: FastQ file has incorrect extension (has to be '.fastq.gz' or '.fq.gz')!\nLine: '{}'".format(ERROR_STR,line.strip())) + ## CHECK HEADER + fin = open(FileIn,'r') + header = fin.readline().strip().split(',') + if header != HEADER: + print("ERROR: Please check samplesheet header -> {} != {}".format(','.join(header),','.join(HEADER))) + sys.exit(1) + + outLines = [] + while True: + line = fin.readline() + if line: + lspl = [x.strip() for x in line.strip().split(',')] + + ## CHECK VALID NUMBER OF COLUMNS PER SAMPLE + numCols = len([x for x in lspl[:3] if x]) + if numCols < 2: + print_error("Please specify 'sample' entry along with either 'fastq' or 'barcode'!",line) sys.exit(1) - ## CHECK GENOME ENTRIES - if genome: - if genome.find(' ') != -1: - print("{}: Genome field contains spaces!\nLine: '{}'".format(ERROR_STR,line.strip())) + ## CHECK SAMPLE ID ENTRIES + sample,fastq,barcode,genome,transcriptome = lspl + if sample: + if sample.find(' ') != -1: + print_error("Sample entry contains spaces!",line) + sys.exit(1) + else: + print_error("Sample entry has not been specified!",line) sys.exit(1) - if len(genome.split('.')) > 1: - if genome[-6:] != '.fasta' and genome[-3:] != '.fa' and genome[-9:] != '.fasta.gz' and genome[-6:] != '.fa.gz': - print("{}: Genome field incorrect extension (has to be '.fasta', '.fa', '.fasta.gz' or '.fa.gz')!\nLine: '{}'".format(ERROR_STR,line.strip())) + ## CHECK BARCODE ENTRIES + if barcode: + if not barcode.isdigit(): + print_error("Barcode entry is not an integer!",line) sys.exit(1) + else: + barcode = 'barcode%s' % (barcode.zfill(2)) - ## CHECK TRANSCRIPTOME ENTRIES - gtf = '' - is_transcripts = '0' - if transcriptome: + ## CHECK FASTQ ENTRIES + if fastq: + if fastq[-9:] != '.fastq.gz' and fastq[-6:] != '.fq.gz': + print_error("FastQ file does not have extension '.fastq.gz' or '.fq.gz'!",line) + sys.exit(1) - if transcriptome.find(' ') != -1: - print("{}: Transcriptome field contains spaces!\nLine: '{}'".format(ERROR_STR,line.strip())) - sys.exit(1) + ## CHECK GENOME ENTRIES + if genome: + if genome.find(' ') != -1: + print_error("Genome entry contains spaces!",line) + sys.exit(1) - if transcriptome[-6:] != '.fasta' and transcriptome[-3:] != '.fa' and transcriptome[-9:] != '.fasta.gz' and transcriptome[-6:] != '.fa.gz' and transcriptome[-4:] != '.gtf' and transcriptome[-7:] != '.gtf.gz': - print("{}: Transcriptome field incorrect extension (has to be '.fasta', '.fa', '.fasta.gz', '.fa.gz', '.gtf' or '.gtf.gz')!\nLine: '{}'".format(ERROR_STR,line.strip())) - sys.exit(1) + if len(genome.split('.')) > 1: + if genome[-6:] != '.fasta' and genome[-3:] != '.fa' and genome[-9:] != '.fasta.gz' and genome[-6:] != '.fa.gz': + print_error("Genome entry does not have extension '.fasta', '.fa', '.fasta.gz' or '.fa.gz'!",line) + sys.exit(1) + + ## CHECK TRANSCRIPTOME ENTRIES + gtf = '' + is_transcripts = '0' + if transcriptome: - if transcriptome[-4:] == '.gtf' or transcriptome[-7:] == '.gtf.gz': - gtf = transcriptome - if not genome: - print("{}: If genome isn't provided, transcriptome must be in fasta format for mapping!\nLine: '{}'".format(ERROR_STR,line.strip())) + if transcriptome.find(' ') != -1: + print_error("Transcriptome entry contains spaces!",line) sys.exit(1) - else: - is_transcripts = '1' - genome = transcriptome - - outLines.append([sample,fastq,barcode,genome,gtf,is_transcripts]) - else: - fin.close() - break - -## WRITE TO FILE -fout = open(args.DESIGN_FILE_OUT,'w') -fout.write(','.join(['sample', 'fastq', 'barcode', 'genome', 'gtf', 'is_transcripts']) + '\n') -for line in outLines: - fout.write(','.join(line) + '\n') -fout.close() + + if transcriptome[-6:] != '.fasta' and transcriptome[-3:] != '.fa' and transcriptome[-9:] != '.fasta.gz' and transcriptome[-6:] != '.fa.gz' and transcriptome[-4:] != '.gtf' and transcriptome[-7:] != '.gtf.gz': + print_error("Transcriptome entry does not have extension '.fasta', '.fa', '.fasta.gz', '.fa.gz', '.gtf' or '.gtf.gz'!",line) + sys.exit(1) + + if transcriptome[-4:] == '.gtf' or transcriptome[-7:] == '.gtf.gz': + gtf = transcriptome + if not genome: + print_error("If genome isn't provided, transcriptome must be in fasta format for mapping!",line) + sys.exit(1) + else: + is_transcripts = '1' + genome = transcriptome + + outLines.append([sample,fastq,barcode,genome,gtf,is_transcripts]) + else: + fin.close() + break + + ## WRITE TO FILE + fout = open(FileOut,'w') + fout.write(','.join(['sample', 'fastq', 'barcode', 'genome', 'gtf', 'is_transcripts']) + '\n') + for line in outLines: + fout.write(','.join(line) + '\n') + fout.close() + + +def main(args=None): + args = parse_args(args) + check_samplesheet(args.FILE_IN,args.FILE_OUT) + + +if __name__ == '__main__': + sys.exit(main()) From 3aca6ff2a03c6dd71c048331e9057b798301858a Mon Sep 17 00:00:00 2001 From: drpatelh Date: Fri, 28 Feb 2020 16:30:42 +0000 Subject: [PATCH 13/21] Tidy up --- bin/check_samplesheet.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py index 8d7cd53f..886ed464 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -1,11 +1,5 @@ #!/usr/bin/env python -########################################################################### -########################################################################### -## Created on August 28th 2019 to check nf-core/nanoseq samplesheet file -########################################################################### -########################################################################### - import os import sys import argparse @@ -20,9 +14,11 @@ def parse_args(args=None): return parser.parse_args(args) + def print_error(error,line): print("ERROR: Please check samplesheet -> {}\nLine: '{}'".format(error,line.strip())) + def check_samplesheet(FileIn,FileOut): HEADER = ['sample', 'fastq', 'barcode', 'genome', 'transcriptome'] From 135f7c169701269d4617d89b6bc208f7d2623a39 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Sun, 1 Mar 2020 17:32:21 +0000 Subject: [PATCH 14/21] Change FastQ QC --- docs/output.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/output.md b/docs/output.md index 86ad66c4..fe989be3 100644 --- a/docs/output.md +++ b/docs/output.md @@ -58,7 +58,7 @@ If you have a pre-basecalled fastq file then *qcat* will be used to perform the * `nanoplot/summary/` `*.html` files for QC metrics and individual `*.png` image files for plots. -## FastQ QC +## Read QC *Documentation*: [NanoPlot](https://github.com/wdecoster/NanoPlot), [FastQC](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/) From f6aea83a7040e846d9e60176476bb84d355ec7b8 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Sun, 1 Mar 2020 17:46:16 +0000 Subject: [PATCH 15/21] Update AWS string --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index 14ade83e..a8ccc96c 100644 --- a/main.nf +++ b/main.nf @@ -168,7 +168,7 @@ if (!(workflow.runName ==~ /[a-z]+_[a-z]+/)) { custom_runName = workflow.runName } -// AWS batch settings +// Check AWS batch settings if (workflow.profile.contains('awsbatch')) { // AWSBatch sanity checking if (!params.awsqueue || !params.awsregion) exit 1, "Specify correct --awsqueue and --awsregion parameters on AWSBatch!" From 198c95471514c45219c53cb4a5c5b5c049880f3f Mon Sep 17 00:00:00 2001 From: drpatelh Date: Sun, 1 Mar 2020 19:18:46 +0000 Subject: [PATCH 16/21] Update guppy container --- conf/base.config | 4 ++-- environment.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/base.config b/conf/base.config index 7a980ed9..191525c0 100644 --- a/conf/base.config +++ b/conf/base.config @@ -47,10 +47,10 @@ process { // Process-specific requirements withName:Guppy { if (params.guppy_gpu) { - container = 'nanozoo/guppy_gpu:3.2.2-1--e90fbfe' + container = 'genomicpariscentre/guppy-gpu:3.4.4' clusterOptions = params.gpu_cluster_options } else { - container = 'genomicpariscentre/guppy:3.2.2' + container = 'genomicpariscentre/guppy:3.4.4' } } withName:BedGraphToBigWig { diff --git a/environment.yml b/environment.yml index 4681d068..45faf3b2 100644 --- a/environment.yml +++ b/environment.yml @@ -11,13 +11,13 @@ dependencies: - conda-forge::pymdown-extensions=6.0 - conda-forge::pygments=2.5.2 - conda-forge::pigz=2.3.4 - - conda-forge::psutil=5.6.7 + - conda-forge::psutil=5.7.0 - bioconda::fastqc=0.11.9 - bioconda::multiqc=1.8 - bioconda::qcat=1.1.0 - bioconda::pycoqc=2.5.0.3 - - bioconda::nanoplot=1.28.2 + - bioconda::nanoplot=1.28.4 - bioconda::samtools=1.9 - bioconda::minimap2=2.17 - bioconda::graphmap=0.6.3 From 08b3c55dd8f68fdbd8ea17771283d91f58b1d0f3 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Mon, 2 Mar 2020 10:48:01 +0000 Subject: [PATCH 17/21] Add NXF_OFFLINE for test-data --- main.nf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.nf b/main.nf index a8ccc96c..a04ce4fd 100644 --- a/main.nf +++ b/main.nf @@ -95,10 +95,9 @@ def ch_guppy_model = Channel.empty() def ch_guppy_config = Channel.empty() if (!params.skip_basecalling) { - // TODO pipeline: Add in a check to see if running offline // Pre-download test-dataset to get files for '--input_path' parameter // Nextflow is unable to recursively download directories via HTTPS - if (workflow.profile.contains('test')) { + if (workflow.profile.contains('test') && !NXF_OFFLINE) { process GetTestData { output: From f7d59001e3103d0fce0c186685ae64d713a152c1 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 4 Mar 2020 15:51:47 +0000 Subject: [PATCH 18/21] Check if offline --- main.nf | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/main.nf b/main.nf index a04ce4fd..d581eaf5 100644 --- a/main.nf +++ b/main.nf @@ -91,23 +91,37 @@ if (params.help) { */ if (params.input) { ch_input = file(params.input, checkIfExists: true) } else { exit 1, "Samplesheet file not specified!" } +// Function to check if running offline +def isOffline() { + try { + return NXF_OFFLINE as Boolean + } + catch( Exception e ) { + return false + } +} + def ch_guppy_model = Channel.empty() def ch_guppy_config = Channel.empty() if (!params.skip_basecalling) { // Pre-download test-dataset to get files for '--input_path' parameter // Nextflow is unable to recursively download directories via HTTPS - if (workflow.profile.contains('test') && !NXF_OFFLINE) { - process GetTestData { - - output: - file "test-datasets/fast5/$barcoded/" into ch_input_path - - script: - barcoded = workflow.profile.contains('test_nonbc') ? "nonbarcoded" : "barcoded" - """ - git clone https://github.com/nf-core/test-datasets.git --branch nanoseq --single-branch - """ + if (workflow.profile.contains('test')) { + if (!isOffline()) { + process GetTestData { + + output: + file "test-datasets/fast5/$barcoded/" into ch_input_path + + script: + barcoded = workflow.profile.contains('test_nonbc') ? "nonbarcoded" : "barcoded" + """ + git clone https://github.com/nf-core/test-datasets.git --branch nanoseq --single-branch + """ + } + } else { + exit 1, "NXF_OFFLINE=true or -offline has been set so cannot download and run any test dataset!" } } else { if (params.input_path) { ch_input_path = Channel.fromPath(params.input_path, checkIfExists: true) } else { exit 1, "Please specify a valid run directory to perform basecalling!" } From 86f1fd2be92746de2cb1544c75bdfc2242876d4a Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 4 Mar 2020 15:58:31 +0000 Subject: [PATCH 19/21] Update CHANGELOG --- CHANGELOG.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a73f80a..bfb43005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## v1.0dev - [date] +## [1.0.0] - 2020-03-04 Initial release of nf-core/nanoseq, created with the [nf-core](http://nf-co.re/) template. - -### `Added` - -### `Fixed` - -### `Dependencies` - -### `Deprecated` From 0ceee7cc0734d9be07ad4750c17d6e080cedb857 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 4 Mar 2020 16:40:48 +0000 Subject: [PATCH 20/21] Bump version --- .github/workflows/ci.yml | 2 +- Dockerfile | 4 ++-- environment.yml | 2 +- nextflow.config | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 649705a0..a4927b3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Pull docker image run: | docker pull nfcore/nanoseq:dev - docker tag nfcore/nanoseq:dev nfcore/nanoseq:dev + docker tag nfcore/nanoseq:dev nfcore/nanoseq:1.0.0 - name: Basecall and demultiplex (minimap2) run: | nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner minimap2 diff --git a/Dockerfile b/Dockerfile index 829bcda2..ed4fd658 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY environment.yml / RUN conda env create -f /environment.yml && conda clean -a # Add conda installation dir to PATH (instead of doing 'conda activate') -ENV PATH /opt/conda/envs/nf-core-nanoseq-1.0dev/bin:$PATH +ENV PATH /opt/conda/envs/nf-core-nanoseq-1.0.0/bin:$PATH # Dump the details of the installed packages to a file for posterity -RUN conda env export --name nf-core-nanoseq-1.0dev > nf-core-nanoseq-1.0dev.yml +RUN conda env export --name nf-core-nanoseq-1.0.0 > nf-core-nanoseq-1.0.0.yml diff --git a/environment.yml b/environment.yml index 45faf3b2..bb8afa84 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-nanoseq-1.0dev +name: nf-core-nanoseq-1.0.0 channels: - conda-forge - bioconda diff --git a/nextflow.config b/nextflow.config index c2f41858..6e32262c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -79,7 +79,7 @@ params { // Container slug. Stable releases should specify release tag! // Developmental code should specify :dev -process.container = 'nfcore/nanoseq:dev' +process.container = 'nfcore/nanoseq:1.0.0' // Load base.config by default for all pipelines includeConfig 'conf/base.config' @@ -148,7 +148,7 @@ manifest { description = 'A pipeline to demultiplex, QC and map Nanopore data' mainScript = 'main.nf' nextflowVersion = '>=19.10.0' - version = '1.0dev' + version = '1.0.0' } // Function to ensure that resource requirements don't go beyond From f54bc483335ab1ce91b6caddb6e2c7e33fe3327e Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Thu, 5 Mar 2020 11:48:02 +0000 Subject: [PATCH 21/21] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb43005..c8b997b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [1.0.0] - 2020-03-04 +## [1.0.0] - 2020-03-05 Initial release of nf-core/nanoseq, created with the [nf-core](http://nf-co.re/) template.