Entering edit mode
21 months ago
Eliveri
▴
350
I have a nextflow workflow which I get the following error:
(I tried the path /path/genomes/human.fa
and the path to bwa index files exists.)
Command error:
[E::bwa_idx_load_from_disk] fail to locate the index files
The nextflow.config looks like this:
I think the error may be due to the way the path variable is written in the nextflow.config
or main.nf
?
params {
refdir = "./genomes"
ref = "${params.refdir}/human.fa"
And main.nf looks like this for the bwa process:
ref = file(params.ref)
refdir = file(params.refdir)
...
process bwa_align {
tag "align ${pair_id}"
publishDir "${params.outdir}/$pair_id"
input:
tuple val(pair_id), path(paired_reads), path(unpaired_reads)
output:
tuple val(pair_id), path("${pair_id}.sam")
script:
"""
bwa mem -t ${params.max_threads} -M $ref ${paired_reads} > ${pair_id}.sam
"""
}
It looks like the bwa index files are not being loaded into the environment. If you are in a container, are you sure the bind path is appropriate? You may need to use
export SINGULARITY_BIND="/path/to/project/directory"
in thebeforeScript
nextflow argument. Additionally, maybe it's unnecessary to add value channels to your input declaration, but I always put all necessary files and paths there including the index files. It makes checking logically checking for errors easier. So, if I needed theref.dict
andref.fasta.fai
index files, I would do something like this:what do you specify in your apptainer profile? I'm guessing you might be missing for it. This is an example that is used in the nf-core/configs for a specific HPC with singularity: https://github.com/nf-core/configs/blob/550f4745b61449cd2a57ac7ee5f232a87dd6450a/conf/abims.config#L10-L11 But it might give you some ideas
Hi the apptainer in nextflow.config looks like this