From 79b7618b10453a237d47ebbe180d142d91023ebb Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 5 Mar 2019 14:33:02 +0100 Subject: [PATCH 1/5] Handle failures when trying to load remote config --- nextflow.config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nextflow.config b/nextflow.config index 08baa4cf..fe167b25 100755 --- a/nextflow.config +++ b/nextflow.config @@ -72,7 +72,11 @@ params { includeConfig 'conf/base.config' // Load nf-core custom profiles from different Institutions -includeConfig "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}/nfcore_custom.config" +try { + includeConfig "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}/nfcore_custom.config" +} catch (Exception e) { + // Do nothing. Trying to fire a log message here doesn't work +} profiles { awsbatch { includeConfig 'conf/awsbatch.config' } From 9f2bbac86d877ada1cfea3fa13b1f0609699efa8 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 5 Mar 2019 14:42:12 +0100 Subject: [PATCH 2/5] Figured out how to print a warning message to the terminal --- nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow.config b/nextflow.config index fe167b25..dbb71072 100755 --- a/nextflow.config +++ b/nextflow.config @@ -75,7 +75,7 @@ includeConfig 'conf/base.config' try { includeConfig "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}/nfcore_custom.config" } catch (Exception e) { - // Do nothing. Trying to fire a log message here doesn't work + System.err.println("WARNING: Could not download remote nf-core/config profiles") } profiles { From f4c63c701278360d881b9c23edf3f191ebab4dac Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 5 Mar 2019 16:01:25 +0100 Subject: [PATCH 3/5] New params.custom_config_base for running offline with nf-core/configs --- docs/usage.md | 16 ++++++++++++++++ nextflow.config | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 90f4ed7a..0ed11a10 100755 --- a/docs/usage.md +++ b/docs/usage.md @@ -371,6 +371,22 @@ Provide git commit id for custom Institutional configs hosted at `nf-core/config --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 unizp the config files +cd /path/to/my/configs +wget https://github.com/nf-core/configs/archive/master.zip +unzip master.zip + +## Run the pipeline +--custom_config_version d52db660777c4bf36546ddb188ec530c3ada1b96 +``` + ### `--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'` diff --git a/nextflow.config b/nextflow.config index dbb71072..6701419e 100755 --- a/nextflow.config +++ b/nextflow.config @@ -65,6 +65,7 @@ params { clusterOptions = false igenomesIgnore = false custom_config_version = 'master' + custom_config_base = { "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" } } @@ -73,7 +74,7 @@ includeConfig 'conf/base.config' // Load nf-core custom profiles from different Institutions try { - includeConfig "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}/nfcore_custom.config" + includeConfig "${params.custom_config_base}/nfcore_custom.config" } catch (Exception e) { System.err.println("WARNING: Could not download remote nf-core/config profiles") } From f72492ed68af4283b5afcef62e82d72afaf77d33 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 5 Mar 2019 16:15:29 +0100 Subject: [PATCH 4/5] Bugfix after testing new params.custom_config_base --- docs/usage.md | 3 ++- nextflow.config | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 0ed11a10..4c303fb2 100755 --- a/docs/usage.md +++ b/docs/usage.md @@ -384,7 +384,8 @@ wget https://github.com/nf-core/configs/archive/master.zip unzip master.zip ## Run the pipeline ---custom_config_version d52db660777c4bf36546ddb188ec530c3ada1b96 +cd /path/to/my/data +nextflow run /path/to/atacseq_pipeline/ --custom_config_base /path/to/my/configs/configs-master/ ``` ### `--max_memory` diff --git a/nextflow.config b/nextflow.config index 6701419e..d7fe8d20 100755 --- a/nextflow.config +++ b/nextflow.config @@ -65,7 +65,7 @@ params { clusterOptions = false igenomesIgnore = false custom_config_version = 'master' - custom_config_base = { "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" } + custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" } @@ -76,7 +76,7 @@ includeConfig 'conf/base.config' try { includeConfig "${params.custom_config_base}/nfcore_custom.config" } catch (Exception e) { - System.err.println("WARNING: Could not download remote nf-core/config profiles") + System.err.println("WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config") } profiles { From abafde5129b6ce549f111f929a63905470c5df77 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 5 Mar 2019 17:13:35 +0100 Subject: [PATCH 5/5] Fix typo --- docs/usage.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 4c303fb2..2fc26e97 100755 --- a/docs/usage.md +++ b/docs/usage.md @@ -378,7 +378,7 @@ you should download the files from the repo and tell nextflow where to find them `custom_config_base` option. For example: ```bash -## Download and unizp the config files +## Download and unzip the config files cd /path/to/my/configs wget https://github.com/nf-core/configs/archive/master.zip unzip master.zip @@ -388,6 +388,9 @@ cd /path/to/my/data nextflow run /path/to/atacseq_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'`