Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 09:50
    pditommaso assigned #2230
  • 09:50
    pditommaso assigned #2150
  • 09:16
    pditommaso labeled #2815
  • 08:58
    pditommaso assigned #2905
  • 08:57
    pditommaso edited #2905
  • 08:57
    pditommaso opened #2905
  • 08:30

    pditommaso on master

    Update readme [ci skip] Signed… Dump scm content when trace is … (compare)

  • 05:55
    ewels commented #640
  • 05:49

    pditommaso on STREAMS-IO

    Add support for K8s Job resourc… Fix resolve azure devops reposi… Fix missing err message on subm… and 11 more (compare)

  • 01:20
    liuyangzzu commented #2901
  • 01:19
    liuyangzzu commented #2901
  • May 25 21:27
    pditommaso milestoned #2823
  • May 25 21:24
    syousry6 closed #2823
  • May 25 21:24
    syousry6 commented #2823
  • May 25 20:26
    syousry6 opened #2904
  • May 25 20:23
    bentsherman synchronize #2903
  • May 25 20:23

    bentsherman on issue-640_resource-min-max

    Cleanup AcceleratorResource Si… (compare)

  • May 25 20:17
    bentsherman commented #640
  • May 25 20:09
    bentsherman synchronize #2903
  • May 25 20:09

    bentsherman on issue-640_resource-min-max

    Cleanup AcceleratorResource Si… (compare)

Arijit Panda
Is there any example/usage available of publishDir in DSL2 ?
5 replies
Arijit Panda
Also, is it possible to set the publishDir in the configuration file?
Arijit Panda

is there any usage example for this. nextflow-io/nextflow#524

I did

process {
    cpus = 4
    withLabel:test2 {
        publish_dir = 'result_data'

And got the following warning

WARN: Access to undefined parameter `publish_dir` -- Initialise it to a default value eg. `params.publish_dir = some_value`
WARN: Process `test2` publishDir path contains a variable with a null value
WARN: Process `test2` publishDir path contains a variable with a null value
WARN: Process `test2` publishDir path contains a variable with a null value
WARN: Process `test2` publishDir path contains a variable with a null value
WARN: Process `test2` publishDir path contains a variable with a null value
Cameron Reid
Within the 'workflow' on DSL2, is it possible to simply assert that one process does not begin until another is complete? My first process downloads databases that are required by later processes but cannot be practically used as channels to control the order of execution.
6 replies

Hi all,

My challenge of my code is to create input for pairwise comparison. Based on the comparison list, I would like to select the samples that are in that group. I have tried the following but not with complete success as I receive a DataflowBroadcast around DataflowStream[?]

bams = Channel.from(["sampleX_1", "groupX", "bamX_1", "baiX_1"], 
                            ["sampleX_2", "groupX", "bamX_2", "baiX_2"], 
                            ["sampleY_1", "groupY", "bamY_1", "baiY_1"], 
                            ["sampleY_2", "groupY", "bamY_2", "baiY_2"],
                            ["sampleZ_1", "groupZ", "bamZ_1", "baiZ_1"], 
                            ["sampleZ_2", "groupZ", "bamZ_2", "baiZ_2"])

 comparison_list = Channel.from(["groupX", "groupY"],["groupX", "groupZ"])

 group_input = comparison_list_file.map{ it ->
                                                    def bam_by_group = bam.groupTuple(by:1)
                                                    def compare1 = it[0]
                                                    def compare2 = it[1]
                                                    def group_ctrl = bam_by_group.first{ it[1] == compare1}
                                                    def group_case = bam_by_group.first{ it[1] == compare2}
                                                    def group_input = group_ctrl.combine(group_case)

                                                    return group_input.view() // - desired outcome, see below
                                                    }.view() // results into - DataflowBroadcast around DataflowStream[?]

I like the result to have it in this format:

        // [[sampleX_1, sampleX_2], groupX, [bamX_1, bamX_2], [baiX_1, baiX_2], [sampleY_1, sampleY_2], groupY, [bamY_1, bamY_2], [baiY_1, baiY_2]]
        // [[sampleX_1, sampleX_2], groupX, [bamX_1, bamX_2], [baiX_1, baiX_2], [sampleZ_1, sampleZ_2], groupZ, [bamZ_1, bamZ_2], [baiZ_1, baiZ_2]]

Of which group_input.view() does but how can I use that?


I modified map_join function created by multimeric (nextflow-io/nextflow#559). I extended to function to "loop over" the keys and it worked!

Hi all,
Is there a way to specify a custom path for the .nextflow.log file in the nextflow.config file? I know it's possible on the command-line using the -log option but I would like to specify it in the nextflow.config so I can modify the path based on our params.outdir parameter.
Arijit Panda

How to specify the thread value in nextflow script for sge jobs?

For local jobs, cpu information is provided using the following configuration settings.

process {
    cpus = 12

And after that that value is used in $task.cpus variable. But in can of SGE executor, the cpus variable is not allowed. So I provided threads using -pe option. But unable to access that value in the script.
Here is my configuration setup.

process {
    executor = 'sge'
    clusterOptions = '-V -pe threaded 13'


So, can someone suggest a solution for this. Thanks in advance.

Christopher Hartl

Is there a practical difference (in DSL2) between

   val sample
  path file


  tuple val(sample), path(file)


4 replies

hi, all. I am brand-new to nextflow. Just recently installed nextflow on my local computer and ran into the follow error. Here is my code,

num = Channel.from( 1, 2, 3 )

process test {
   val num

   println "echo process test $num"


Here is my error: N E X T F L O W ~ version 21.10.0
Launching process.nf [irreverent_feynman] - revision: 386318b60a
executor > local (3)
executor > local (3)
[b7/c314a2] process > test (1) [100%] 3 of 3, failed: 3 ✘
echo process test 2
echo process test 1
echo process test 3
Error executing process > 'test (3)'

Caused by:
Process test (3) terminated with an error exit status (127)

Command executed:


Command exit status:

Command output:

Command error:
.command.sh: line 2: null: command not found

Work dir:

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named .command.sh

Can anyone help me understand what does the error message mean? How should I correct my codes?

5 replies
Jemma Nelson
I've got some Best-Practices questions about composing dynamic directives.
We're currently using the basic strategy described in the docs like memory { 2.GB * task.attempt }, with separate labels that use the same retry-with-increased-resources strategy (like low_mem and high_mem) to coarsely indicate the size of the job. The label definitions are specified in the configuration file, and the labels are applied in the process file.
Is there a way to keep the "strategy" in the config file (x.GB * task.attempt), while the actual amount (2.GB, etc) varies based on some calculation done by the process directive?
Or is the strategy something I should be writing a function for, and then applying to the closure that calculates the value? Like memory (retryFunc { inputfile.size * 3 })
Dennis Hendriksen

after upgrading Nextflow 21.04.3 to 21.10.3 my workflow fails with the following error:

groovy.lang.MissingMethodException: No signature of method: nextflow.script.WorkflowDef.nr_records() is applicable for argument types: ([Ljava.lang.Object;) values: [[/gro
        at nextflow.script.WorkflowParamsResolver.invokeMethod(WorkflowDef.groovy:217)
def nr_records(statsFilePath) {
  channel.fromPath(params.input) \
      | prepare \
      | branch {
          small: nr_records(it.last()) <= params.chunk_size
          large: true
process prepare {
    tuple ..., path("${vcfOutputPath}.stats")

I've tried updating in the caller and callee in various ways without success. does anyone have a clue what changed between Nextflow versions?

2 replies
Marcello Salvi
Dear Nextflow team, I have a question related with GCP usage. Is it possible to use the service account to crosstalk beetween different project? (aka I have my file in a bucket in a project and I want to use the VM GCP life sciences in an other one)
How to change the Singularity PATH with SINGULARITYENV_PREPEND_PATH=/good/stuff/at/beginning in nextflow?

Hello, I installed next flow in the computing cluster but I am not able to use the docker files required for running deep variant analysis. I used the following command: nextflow run nf-core/deepvariant -profile test,docker

N E X T F L O W ~ version 21.10.4
Launching nf-core/deepvariant [lethal_tesla] - revision: 2b5486356c [master]

Downloading plugin nf-amazon@1.3.4

      ___     __   __   __   ___     /,-._.--~'
|\ | |__  __ /  ` /  \ |__) |__         }  {
| \| |       \__, \__/ |  \ |___     \`-._,-`-,

nf-core/deepvariant v1.0"

Pipeline Name : nf-core/deepvariant
Pipeline Version: 1.0
Bam file : https://github.com/nf-core/test-datasets/raw/deepvariant/testdata/NA12878_S1.chr20.10_10p1mb.bam
Bed file : https://github.com/nf-core/test-datasets/raw/deepvariant/testdata/test_nist.b37_chr20_100kbp_at_10mb.bed
Reference genome: hg19chr20
Fasta Ref : s3://deepvariant-data/genomes/hg19chr20/chr20.fa
Fasta Index : s3://deepvariant-data/genomes/hg19chr20/chr20.fa.fai
Fasta gzipped : s3://deepvariant-data/genomes/hg19chr20/chr20.fa.gz
Fasta gzipped Index: s3://deepvariant-data/genomes/hg19chr20/chr20.fa.gz.fai
Fasta bgzip Index: s3://deepvariant-data/genomes/hg19chr20/chr20.fa.gz.gzi
Max Memory : 6 GB
Max CPUs : 2
Max Time : 2d
Model : wgs
Output dir : results
Working dir : /scicore/home/cichon/thirun0000/my-pipelines/nf-core/deepvariant-master/work
Container Engine: docker
Container : nfcore/deepvariant:1.0
Current home : /scicore/home/cichon/thirun0000
Current user : thirun0000
Current path : /scicore/home/cichon/thirun0000/my-pipelines/nf-core/deepvariant-master
Script dir : /scicore/home/cichon/thirun0000/.nextflow/assets/nf-core/deepvariant

Config Profile : test,docker

executor > local (1)
[- ] process > preprocess_bam -
[- ] process > make_examples -
[- ] process > call_variants -
[- ] process > postprocess_variants -
[e7/dec5cb] process > get_software_versions [100%] 1 of 1, failed: 1 ✘
Execution cancelled -- Finishing pending tasks before exit
Error executing process > 'get_software_versions'

Caused by:
Process get_software_versions terminated with an error exit status (127)

Command executed:

echo 1.0 &> v_nf_deepvariant.txt
echo 21.10.4 &> v_nextflow.txt
ls /opt/conda/pkgs/ &> v_deepvariant.txt
python --version &> v_python.txt
pip --version &> v_pip.txt
samtools --version &> v_samtools.txt
lbzip2 --version &> v_lbzip2.txt
bzip2 --version &> v_bzip2.txt
scrape_software_versions.py &> software_versions_mqc.yaml

Command exit status:

Command output:

Command error:
.command.run: line 279: docker: command not found

Work dir:

Tip: you can replicate the issue by changing to the process work dir and entering the command bash .command.run

Fastagz file not found: s3://deepvariant-data/genomes/hg19chr20/chr20.fa.gz

Fai file not found: s3://deepvariant-data/genomes/hg19chr20/chr20.fa.fai

gzfai file not found: s3://deepvariant-data/genomes/hg19chr20/chr20.fa.gz.fai

please specify --bed option (--bed bedfile)

https://github.com/nf-core/test-datasets/raw/deepvariant/testdata/NA12878_S1.chr20.10_10p1mb.bam not found

gzi file not found: s3://deepvariant-data/genomes/hg19chr20/chr20.fa.gz.gzi


is it possible to make iteration over processes in dsl2 ?, as in https://github.com/nextflow-io/patterns/blob/master/docs/feedback-loop.adoc
what I tried doesn't work
(to annotate vcf with several databases)

    entrees_vcf // tuple [info1, info2, info3, vcf]
    bdds // collection of collections: [ [bdd1,index1,tag1,fields1], [bdd2,index2,tag2,fields2], ...]

input_ch = input_vcf
            .concat( bdds.map{it[0]}, Channel.of(0) ).flatten().toList()
                    .concat( bdds )
                    .map { ch_tuple, bdds ->
                        if ( ch_tuple[4] < bdds.size() ) { //(bdds[iteration]) {
                            return [ ch_tuple[0], ch_tuple[1], ch_tuple[2], ch_tuple[3], bdds[iteration], ch_tuple[4] ].flatten()
Annotation_bdd_vcf( input_ch )

in Annotation_bdd_vcf input, the last variable (coming from Channel.of(0)) is incremented each time the process is executed

4 replies
azurebatch after completetion, pools terminated succesfully, but the Jobs still active
I put this two in the azure batch config
deletePoolsOnCompletion = true
deleteJobsOnCompletion = true
Konstantinos Servis
Hi folks. I have been reading through the issues in order to find a good way to configure nextflow for my use-case. It involves running all tasks using the slurm executor, however I need to run different tasks on different clusters. It seems like clusters in not supported (slurm commands -M option) and the only thing that is mentioned in the documentation and the issues is using env.SLURM_CLUSTERS. Unfortunately as I am reading in another issue (and I have confirmed by trying) that is not valid in a process { withLabel: xxx {cant put env here}} selector block. Is my only option a PR?
Konstantinos Servis
I submitted an issue here nextflow-io/nextflow#2473 I hope it makes sense
Pierre Lindenbaum

hi all, in DSL2 is it possible to use a publishDir directive using a variable from input: ? I tried

publishDir meta.publishDir, mode: 'copy', saveAs: {filename -> meta.publishDir?filename:null}

        tuple val(meta),val(L)

but got

No such variable: meta
1 reply
Pierre Lindenbaum
@Midnighter that worked ! thanks ! :-)
1 reply
Luca Cozzuto
Dear all, I got this error when running my pipeline in AWS and resuming
and for this the resume is not working
have you faced something similar?
nextflow.file.FileHelper - Can't check if speci
fied path is NFS (1): /mop2-bucket-1/scratch
Luca Cozzuto
@pditommaso no help? :(
1 reply
Tim Dudgeon
I'm not clear on the use of publishDir with DSL2. This announcement suggested that there would be improvements here, and I found this that seems to provide some mechanism, but I was assuming that you should be able to define a process that does not need to worry about publishDir and let the workflow choose which outputs to publish? Is this possible? Any examples?
Steven P. Vensko II

Is it possible to use a .count() channel as the size parameter for GroupTuples?

I currently have:

bcftools_index_somatic.out.vcfs_w_csis.groupTuple(by: [0, 1, 2, 3], size: extract_chroms_from_bed.out.chroms_list.count()).set{ vcfs_by_patient }

But I get the error:

Value 'DataflowVariable(value=null)' cannot be used in in parameter 'size' for operator 'groupTuple' -- Value don't match: class java.lang.Integer

Is it possible to convert the .count() channel into something consumable by size:?

1 reply
Does anybody know of resources with more in-depth details on implementation patterns of the sql plugin (https://github.com/nextflow-io/nf-sqldb). I've got it working for basic functionality, but it would be very useful to expand on the documentation a bit or add some examples of how to push/pull to/from a database within a process for example.
3 replies
Alexander Toenges
I remember there was an inbuilt nf way to display all params in a tabular output. Not $params because this gives a comma-separates map, but something that returns a table. Any ideas?
Haruka Ozaki
Hi! I sometimes get a "file not found" error when using Channel.fromFilePairs with URLs.
Is there any way to set a timeout duration?
Vlad Kiselev
What is a common way of making a process optional? (e.g. the process execution depends on a boolean parameter). So far I've only come up with an idea of using an empty channel for this. Any other ideas?
And of course I found it after posting: https://nextflow-io.github.io/patterns/index.html#_solution_18
Reed Bell
Does Nextflow support pulling images from a private register for the google-lifesciences executor? I keep getting a pull access denied errorhere (running docker pull separately works fine).
Reed Bell
Update: Totally supported. It appears you need to have docker.fixOwnership = true (and install procps in your image otherwise Nextflow will complain that you don't have ps installed). Best guess is that the mismatch in the ids for the owner of the image manifest file was preventing it from being accessed. Haven't tried it but a quick peek at the source code suggests that setting NXF_OWNER will also make things work.
2 replies
Dennis Hendriksen
We are running a Nextflow workflow with Singularity containers and the SLURM executor. Conceptually I am struggling:
  • the overhead for starting and stopping a job in SLURM is very high
  • I can only use one container per process / looking at nf-core modules Nextflow seems to prefer small processes
Dennis Hendriksen
In my use case I have a elegant workflow with parallelization that in practice performs horribly.
3 replies
I was wondering if anyone else recognizes this struggle. How do you deal with this issue?
Hello, anyone knows if it is possible to apply "resume" only for certain processes instead of all of them??
1 reply
Moritz E. Beber
Does anyone know if nextflow uses log4j? There is a security vulnerability https://www.lunasec.io/docs/blog/log4j-zero-day/
hi! Im trying to run some processes with Singularity containers, is it possible to bind internal container directories to the outside dirs on the host?
Brandon Cazander
Is there a way to specify a timeout for how long processes stay in a pending state? For example, I want to optimistically use one queue that has unused capacity, but if jobs are pending for x minutes, I would like them to fail and retry on another queue.
Paolo Di Tommaso
@Midnighter nextflow uses logback
4 replies
Jeremy Leipzig
I'm having trouble with google life sciences.
Command error:
  Execution failed: generic::failed_precondition: while running "nf-2f69f94540149df9eda94c49022f51cc-main": unexpected exit status 1 was not ignored
the bucket is being used as a work directory but there is something not producing .command.out .command.err ..command.trace
i'm using nextflow-21.10.5 - any workflow does this including hello-world
Jeremy Leipzig
one clue might be
gsutil cat gs://mygcpbucket/nextflow/f4/72c513e7a923fb0c80b30fc74c669d/google/logs/output
/bin/bash: /nextflow/f4/72c513e7a923fb0c80b30fc74c669d/.command.log: Permission denied
+ trap 'err=$?; exec 1>&2; gsutil -m -q cp -R /nextflow/f4/72c513e7a923fb0c80b30fc74c669d/.command.log gs://truwl-internal-inputs/nextflow/f4/72c513e7a923fb0c80b30fc74c669d/.command.log || true; [[ $err -gt 0 || $GOOGLE_LAST_EXIT_STATUS -gt 0 || $NXF_DEBUG -gt 0 ]] && { ls -lah /nextflow/f4/72c513e7a923fb0c80b30fc74c669d || true; gsutil -m -q cp -R /google/ gs://truwl-internal-inputs/nextflow/f4/72c513e7a923fb0c80b30fc74c669d; } || rm -rf /nextflow/f4/72c513e7a923fb0c80b30fc74c669d; exit $err' EXIT
+ err=1
+ exec
+ gsutil -m -q cp -R /nextflow/f4/72c513e7a923fb0c80b30fc74c669d/.command.log gs://truwl-internal-inputs/nextflow/f4/72c513e7a923fb0c80b30fc74c669d/.command.log
+ [[ 1 -gt 0 ]]
+ ls -lah /nextflow/f4/72c513e7a923fb0c80b30fc74c669d
total 40K
drwxr-xr-x 3 root root 4.0K Dec 10 23:51 .
drwxr-xr-x 3 root root 4.0K Dec 10 23:51 ..
-rw-r--r-- 1 root root 3.3K Dec 10 23:51 .command.log
-rw-r--r-- 1 root root 5.3K Dec 10 23:51 .command.run
-rw-r--r-- 1 root root   36 Dec 10 23:51 .command.sh
drwx------ 2 root root  16K Dec 10 23:50 lost+found
+ gsutil -m -q cp -R /google/ gs://mygcpbucket/nextflow/f4/72c513e7a923fb0c80b30fc74c669d
1 reply
seems weird to see that generic permissions error