nf-core / methylseq

Methylation (Bisulfite-Sequencing) analysis pipeline using Bismark or bwa-meth + MethylDackel
https://nf-co.re/methylseq
MIT License
137 stars 136 forks source link

bwameth pipeline skipping all bwameth steps when --fasta, --fasta_index, and --bwa_meth_index are provided. #396

Open drothen15 opened 5 months ago

drothen15 commented 5 months ago

Description of the bug

I have previously processed the GRCh38 genome with bwameth for a different pipeline that I'm trying to compare with the nf-core. So I provide the following with the input command: --fasta --fasta_index --bwa_meth_index

However, everytime I do this the pipeline just skips all the bwameth steps in the pipeline and then completes without error (screenshot).

Screenshot 2024-04-05 at 12 15 39 PM

Command used and terminal output

nextflow run /shared-storage/data/ngs/methylseq-test --input SampleSheet.csv --outdir /shared-storage/home/drothenheber/meth_testing/20240404_nf-core_bwameth --em_seq --comprehensive --aligner bwameth -profile apptainer --fasta test.fa --fasta_index test.fa.fai --bwa_meth_index /path/to/bwameth/indices/

Relevant files

nextflow.log

System information

Nextflow version: 23.10.1 Hardware: HPC Executor: slurm Container engine: apptainer OS: Linux MethylSeq version: 2.6.0

npatel-ah commented 4 months ago

I created the bismark index and kept the reference file within the folder ( not soft link), then re-ran it using --bismark_index and that seems to solve it for now.

maxulysse commented 3 months ago

should have been fixed by #403

JihedC commented 2 weeks ago

I created the bismark index and kept the reference file within the folder ( not soft link), then re-ran it using --bismark_index and that seems to solve it for now.

Hi,

I am having the same issue and am not sure that #403 fixed it. What do you mean with adding the bismark index, do you provide the path to the bismark index after --bismark_index or do you have to place the index somewhere specific?

thanks in advance for your help!

yinyeya commented 1 week ago

I have the exact same issue and when going through the codes, I notice the following scripts in the local module "prepare_genome.nf",

    // Aligner: bwameth
    else if ( params.aligner == 'bwameth' ){

        /*
         * Generate bwameth index if not supplied
         */
        if (params.bwa_meth_index) {
            if (params.bwa_meth_index.endsWith('.tar.gz')) {
                ch_bismark_index = UNTAR ( [ [:], file(params.bwa_meth_index) ] ).untar.map { it[1] }
            } else {
                ch_bismark_index = Channel.value(file(params.bwa_meth_index))
            }
        } else {
            BWAMETH_INDEX(ch_fasta)
            ch_bwameth_index = BWAMETH_INDEX.out.index
            ch_versions = ch_versions.mix(BWAMETH_INDEX.out.versions)
        }

When providing bwameth index, either compressed or uncompressed format, it will pass to ch_bismark_index, while if providing only the fasta for indexing by the module BWAMETH_INDEX, it will pass to ch_bwameth_index. I suppose ch_bismark_index here should be ch_bwameth_index, and this probably explains why using iGenome fasta or providing --bismark_index make the pipeline works. I changed all ch_bismark_index to ch_bwameth_index and it works well now.