Changing nextflow work directory

Hi Nextflow community,

i am running nextflow pipeline which is actually running process based on the apptainer image. i am getting this error regarding the read only file system. (it seems nextflow trying to create work directory inside $HOME wich is read only. or maybe im wrong? ). appreciate any helps regarding this iisue.

OSError: [Errno 30] Read-only file system: ‘/home/in1f24’

pipeline:
process pre_process1 {

    cache false
    input:
    file(p11)

    output:
    file("*")

    script:
    """
   
    CADD.sh -o ${params.output} ${p11} 
    
    """
}

// Define workflow
workflow {

 data = channel.fromPath(params.p11)

// Pass the VCF file directly to the splitVCF process

 pre_process1(data)

config file

dag.enabled = true
dag.overwrite = true
apptainer.enabled = true
apptainer.autoMounts = true
apptainer.runOptions = “–bind /private”

params {

p11 = “chr22.p11.vcf”
vcf = “jcjan24.merged.vcf.gz”
output = “results”

cadd_ = “genepy2_cadd1.6_vep111.sif”

}

process {
withName:pre_process1 {

    clusterOptions = '--nodes=1'
    cpus = 4
    memory = "4 GB"
    container = params.cadd_
    
}

}

}

Your example seems to be incomplete, could you share the full contents of the full workflow and configuration?

Nextflow uses a directory for storing assets at NXF_HOME, which is by default $NXF_HOME/.nextflow/, but it looks like your error is occurring within the process instead of where Nextflow is running, but I can’t tell from the example you have provided. It’s possible CADD writes to somewhere on the home directory while running, in which case we can reset the HOME variable to a different location while running. Here’s the configuration file:

env {
    HOME='$PWD'
}

And then your workflow, assuming it looks like this:

process pre_process1 {
    container "genepy2_cadd1.6_vep111.sif”

    cache false
    input:
    file(p11)

    output:
    file("output")

    script:
    """
    CADD.sh -o output ${p11} 
    """
}

workflow {
    data = channel.fromPath(params.p11)
    // Pass the VCF file directly to the splitVCF process
    pre_process1(data)
}

Of course this may not be the issue but it’s worth checking.

Yeap , solved. Thank you adam , that was the problem

1 Like