error when pulling a docker container using singularity in nextflow

208 views
Skip to first unread message

Behzad Moumbeini

unread,
Jan 29, 2022, 5:50:09 AM1/29/22
to Nextflow
I am making a very short workflow in which I use a tool for my analysis called salmon.
In the `hpc` that I am working in, I cannot install this tool so I decided to pull the container from `biocontainers`.
In the hoc we do not have `docker` installed (I also do not have permission to do so) but we have `singularity` instead.
So I have to pull docker container (`from: quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0)` using singularity.
The workflow management system that I am working with is `nextflow`.
This is the short workflow I made (`index.nf`):


    #!/usr/bin/env nextflow
    nextflow.preview.dsl=2
   
    container = 'quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0'
    shell = ['/bin/bash', '-euo', 'pipefail']
   
   
    process INDEX {
   
      script:
      """
      salmon index \
      -t /hpc/genome/gencode.v39.transcripts.fa \
      -i index \
      """
    }
   
   
    workflow {
      INDEX()
    }

I run it using this command:

    nextflow run index.nf -resume


But got this error:

    salmon: command not found

Do you know how I can fix the issue?

Alan Hoyle

unread,
Jan 29, 2022, 10:11:58 AM1/29/22
to next...@googlegroups.com
maybe add 

 -with-singularity 

on the nextflow run command line or 

singularity.enabled = true 

in your nextflow.config file

-- 

From: next...@googlegroups.com <next...@googlegroups.com> on behalf of Behzad Moumbeini <behzadm...@gmail.com>
Sent: Saturday, January 29, 2022 5:50:08 AM
To: Nextflow <next...@googlegroups.com>
Subject: error when pulling a docker container using singularity in nextflow
 
--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nextflow/cd57bcfa-4719-4da5-9d42-37e32383bdd3n%40googlegroups.com.

drhp...@gmail.com

unread,
Jan 31, 2022, 5:48:26 AM1/31/22
to Nextflow

Hi Behzad,

The "container" definition in your example is within the scope of the main script which is why I suspect things aren't working.

Either you can include the definition directly in the process itself like below:

 process INDEX {
   

      script:
      """
      salmon index \
      -t /hpc/genome/gencode.v39.transcripts.fa \
      -i index \
      """
}

Or you can define the container path in a config file within the process scope (docs here):

e.g. 

process {
    withName: 'INDEX' {
    }
}

Cheers,

Harshil

Reply all
Reply to author
Forward
0 new messages