Sateesh_Peri
11/19/2024, 4:11 PMv2.7.1 where the bismark align step is not getting cached and is being re-run upon resume.
I ran the test,debug profile, and noticed that the hashes for the bismark Index folder input seems to vary, which I believe is invalidating the cache and causing a re-run.
Q is - why is the bismark index folder getting a diff hash each time even with the path to the stage folder being the same ?
run-1 hash
e0e6778c9d458895209ee2555180d687 [nextflow.util.ArrayBag] [FileHolder(sourceObj:/workspace/methylseq/work/48/07893206ffcec48f5d0061c928db23/BismarkIndex, storePath:/workspace/methylseq/work/48/07893206ffcec48f5d0061c928db23/BismarkIndex, stageName:BismarkIndex)]
resume-1 hash
2d2d4fcf2bffcae17ace858866c308ee [nextflow.util.ArrayBag] [FileHolder(sourceObj:/workspace/methylseq/work/48/07893206ffcec48f5d0061c928db23/BismarkIndex, storePath:/workspace/methylseq/work/48/07893206ffcec48f5d0061c928db23/BismarkIndex, stageName:BismarkIndex)]
resume-2 hash
b6b7a8001ea430230fd4d49bddab8521 [nextflow.util.ArrayBag] [FileHolder(sourceObj:/workspace/methylseq/work/48/07893206ffcec48f5d0061c928db23/BismarkIndex, storePath:/workspace/methylseq/work/48/07893206ffcec48f5d0061c928db23/BismarkIndex, stageName:BismarkIndex)]
anybody have ideas on where should I be looking to pinpoint ?
one change we introduced in 2.7.1 was this force soft-linking of fasta file into the index folder to avoid the issues with nextflow nested-symlinks
ln -sf \$(readlink $fasta) $index/$fasta
but, still that doesn't explain why the BismarkIndex is getting a diff hash each time 🤷Louis Le Nézet
11/19/2024, 4:39 PMcache = lenient on the config file of my processes.
Does this help ?Louis Le Nézet
11/19/2024, 4:40 PMSateesh_Peri
11/19/2024, 5:18 PMln -sf be modifying the task hash then ?
checking...Sateesh_Peri
11/19/2024, 5:41 PMcache = 'lenient' seems to be working... good point @Louis Le Nézet.....thank you!Sateesh_Peri
11/19/2024, 5:42 PMexecutor > local (2)
[06/bfa9b9] NFCORE_METHYLSEQ:PREPARE_GENOME:BWAMETH_INDEX (BwamethIndex/genome.fa) [100%] 1 of 1, cached: 1 ✔
[- ] NFCORE_METHYLSEQ:METHYLSEQ:CAT_FASTQ -
[8c/12b486] NFCORE_METHYLSEQ:METHYLSEQ:FASTQC (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[96/8668f5] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:BWAMETH_ALIGN (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[d5/24c043] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:SAMTOOLS_SORT (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[39/efcafa] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:SAMTOOLS_INDEX_ALIGNMENTS (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[0f/cbd892] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:SAMTOOLS_FLAGSTAT (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[e5/1b6fa4] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:SAMTOOLS_STATS (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[ab/c64095] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:METHYLDACKEL_EXTRACT (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[5b/854227] NFCORE_METHYLSEQ:METHYLSEQ:BWAMETH:METHYLDACKEL_MBIAS (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[15/f8a48b] NFCORE_METHYLSEQ:METHYLSEQ:QUALIMAP_BAMQC (Ecoli_10K_methylated) [100%] 1 of 1, cached: 1 ✔
[7e/528289] NFCORE_METHYLSEQ:METHYLSEQ:PRESEQ_LCEXTRAP (Ecoli_10K_methylated) [100%] 1 of 1, failed: 1 ✔
[e5/5ee0f5] NFCORE_METHYLSEQ:METHYLSEQ:MULTIQC [ 0%] 0 of 1Simon Pearce
11/19/2024, 7:24 PMSateesh_Peri
11/20/2024, 3:51 AMSateesh_Peri
11/20/2024, 4:35 AMSateesh_Peri
11/20/2024, 4:39 AMcache = 'lenient' an acceptable solution or should I dig deeper to find out exactly what is modifying the hash of the index folder ?Mahesh Binzer-Panchal
11/20/2024, 7:52 AMArrayBag (nextflow version) always has a different hash because it doesn't hash like a normal Groovy collection. You need to make it a Groovy collection so it hashes properly for resume.Sateesh_Peri
11/20/2024, 7:56 AMMahesh Binzer-Panchal
11/20/2024, 7:56 AMMahesh Binzer-Panchal
11/20/2024, 7:56 AMSateesh_Peri
11/20/2024, 7:58 AMSateesh_Peri
11/20/2024, 8:00 AMMahesh Binzer-Panchal
11/20/2024, 8:17 AMSateesh_Peri
11/20/2024, 8:21 AMMahesh Binzer-Panchal
11/20/2024, 8:24 AMSateesh_Peri
11/20/2024, 8:25 AMMahesh Binzer-Panchal
11/20/2024, 8:27 AM*.nf. It only finds the process declaration then on masterSateesh_Peri
11/20/2024, 8:28 AMsubworkflows/local/prepare_genome/main.nfMahesh Binzer-Panchal
11/20/2024, 8:28 AMsubworkflows/local folder on <http://github.dev|github.dev>Sateesh_Peri
11/20/2024, 8:29 AMMahesh Binzer-Panchal
11/20/2024, 8:29 AMmodules/local for that matter eitherSateesh_Peri
11/20/2024, 8:29 AMMahesh Binzer-Panchal
11/20/2024, 8:29 AM<http://github.dev|github.dev>Mahesh Binzer-Panchal
11/20/2024, 8:34 AMArrayBag object is coming from.Mahesh Binzer-Panchal
11/20/2024, 8:38 AMBISMARK_GENOMEPREPARATION or are you supplying a value to params.bismark_index ?Sateesh_Peri
11/20/2024, 8:39 AMBISMARK_GENOMEPREPARATION even if it is supplied as paramMahesh Binzer-Panchal
11/20/2024, 8:40 AMif (bismark_index) {
if (bismark_index.endsWith('.gz')) {
ch_bismark_index = UNTAR ([ [:], file(bismark_index) ]).untar
ch_bismark_index.dump(tag: 'PREPARE_GENOME/UNTAR: ch_bismark_index')
ch_versions = ch_versions.mix(UNTAR.out.versions)
} else {
ch_bismark_index = Channel.value([[:], file(bismark_index, checkIfExists: true)])
ch_bismark_index.dump(tag: 'PREPARE_GENOME: ch_bismark_index')
}
} else {
BISMARK_GENOMEPREPARATION(ch_fasta)
Is what I seeSateesh_Peri
11/20/2024, 8:40 AMMahesh Binzer-Panchal
11/20/2024, 8:41 AMparams.bismark_index has a value then BISMARK_GENOMEPREPARATION shouldn't runSateesh_Peri
11/20/2024, 8:42 AMBISMARK_GENOMEPREPARATION and this is set and emitted to next steps
ch_bismark_index = Channel.value([[:], file(bismark_index, checkIfExists: true)])Sateesh_Peri
11/20/2024, 8:42 AMSateesh_Peri
11/20/2024, 8:43 AMMahesh Binzer-Panchal
11/20/2024, 8:43 AMBISMARK_GENOMEPREPARATION. That should only be run if params.bismark_index is nullSateesh_Peri
11/20/2024, 8:44 AMSateesh_Peri
11/20/2024, 8:45 AMBISMARK_GENOMEPREPARATION is run to create indexMahesh Binzer-Panchal
11/20/2024, 8:49 AMBISMARK_GENOMEPREPARATION.out.index is an implicit value channel because the input is a value channel which is why there's no combine with the reads in the BISMARK subworkflowSateesh_Peri
11/20/2024, 8:52 AMMahesh Binzer-Panchal
11/20/2024, 8:53 AMcombineMahesh Binzer-Panchal
11/20/2024, 8:53 AMMahesh Binzer-Panchal
11/20/2024, 8:55 AMfromPath and then using collect on the indexMahesh Binzer-Panchal
11/20/2024, 8:55 AMcollect is might do it even if it is a value channelSateesh_Peri
11/20/2024, 8:59 AMSateesh_Peri
11/20/2024, 9:33 AMMahesh Binzer-Panchal
11/20/2024, 9:34 AMMahesh Binzer-Panchal
11/20/2024, 2:47 PMSateesh_Peri
11/20/2024, 3:08 PMMahesh Binzer-Panchal
11/21/2024, 12:43 AMSateesh_Peri
11/21/2024, 3:44 AMMahesh Binzer-Panchal
11/21/2024, 8:07 AMSateesh_Peri
11/21/2024, 8:09 AMIf you need a certain folder structure, you should remake ithow? mv/cp is not encouraged from my previous attempts
Mahesh Binzer-Panchal
11/21/2024, 8:09 AMMahesh Binzer-Panchal
11/21/2024, 8:10 AMmkdir index
cp -r $index/* index
cp $fasta index
biskmark \
--genome index
rm index
I thinkSateesh_Peri
11/21/2024, 8:11 AMSateesh_Peri
11/21/2024, 8:12 AMSateesh_Peri
11/21/2024, 8:12 AMSateesh_Peri
11/21/2024, 8:14 AMMahesh Binzer-Panchal
11/21/2024, 8:16 AMSimon Pearce
11/21/2024, 8:16 AMSimon Pearce
11/21/2024, 8:16 AMSateesh_Peri
11/21/2024, 8:16 AMSimon Pearce
11/21/2024, 8:17 AMSateesh_Peri
11/21/2024, 8:18 AMSimon Pearce
11/21/2024, 8:19 AMmkdir index2
ln -s index index2/
ln -s fasta index2/Sateesh_Peri
11/21/2024, 8:19 AMmake a new folder that has symlinks to those symlinks?Sateesh_Peri
11/21/2024, 8:19 AMSateesh_Peri
11/21/2024, 8:20 AMln -s was working in all cases before and had to ln- sf to make it work. see that thread hereSateesh_Peri
11/21/2024, 8:23 AMcp the fasta or make align cache lenient ? which one would you recommend ?Mahesh Binzer-Panchal
11/21/2024, 8:25 AMSateesh_Peri
11/21/2024, 12:23 PMMaxime Garcia
11/21/2024, 1:25 PMAdam Talbot
11/21/2024, 4:37 PM@Adam Talbot what do you think?pigs are much bigger than you expect.
Adam Talbot
11/21/2024, 4:38 PMAdam Talbot
11/21/2024, 4:38 PMEdmund
11/21/2024, 5:06 PMlemme read the threadAnd he was never seen again
Edmund
11/21/2024, 5:08 PMstageAs doesn't work, right?
2. We just build the index correctly in #C073ZDLNC92Edmund
11/21/2024, 5:09 PM--fasta flag added...Edmund
11/21/2024, 5:12 PMEdmund
11/21/2024, 5:21 PM#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
// Parameters
params.genome_folder = null
params.verbose = false
params.path_to_aligner = null
params.parallel = 1
params.single_fasta = false
params.bowtie2 = true
params.hisat2 = false
params.mm2 = false
params.slam = false
params.large_index = false
params.genomic_composition = false
params.outdir = 'results'
// Import modules
include { PREPARE_GENOME_FOLDERS } from './modules/prepare_genome_folders'
include { BISULFITE_CONVERT_GENOME } from './modules/bisulfite_convert_genome'
include { INDEX_GENOME } from './modules/index_genome'
include { CALCULATE_GENOMIC_FREQUENCIES } from './modules/calculate_genomic_frequencies'
// Main workflow
workflow {
// Validate input
if (!params.genome_folder) {
error "Please provide a genome folder with --genome_folder"
}
// Step 1: Prepare genome folders
PREPARE_GENOME_FOLDERS(params.genome_folder)
// Step 2: Bisulfite convert genome
BISULFITE_CONVERT_GENOME(PREPARE_GENOME_FOLDERS.out.genome_files)
// Step 3: Index genome
INDEX_GENOME(BISULFITE_CONVERT_GENOME.out.ct_converted, BISULFITE_CONVERT_GENOME.out.ga_converted)
// Optional: Calculate genomic frequencies
if (params.genomic_composition) {
CALCULATE_GENOMIC_FREQUENCIES(params.genome_folder)
}
}
// Print help message
def printHelp() {
<http://log.info|log.info>"""
Bismark Genome Preparation - Nextflow Version
=============================================
Usage:
nextflow run <http://bismark_genome_preparation.nf|bismark_genome_preparation.nf> --genome_folder /path/to/genome
Mandatory arguments:
--genome_folder Path to the folder containing the genome to be bisulfite converted
Optional arguments:
--verbose Print verbose output for more details or debugging
--path_to_aligner The full path to the Bowtie 2, HISAT2 or minimap2 installation folder
--parallel Use several threads for each indexing process (default: 1)
--single_fasta Write converted genomes into single-entry FastA files
--bowtie2 Create bisulfite indexes for Bowtie 2 (default: true)
--hisat2 Create bisulfite indexes for HISAT2
--mm2 Create bisulfite indexes for minimap2
--slam Transform T to C (forward strand) or A to G (reverse strand)
--large_index Force generated index to be 'large'
--genomic_composition Calculate and extract the genomic sequence composition
"""
}
// Print help message if --help is used
if (<http://params.help|params.help>) {
printHelp()
exit 0
}
// Print version information if --version is used
if (params.version) {
println "Bismark Genome Preparation - Nextflow Version ${workflow.manifest.version}"
exit 0
}Sateesh_Peri
11/22/2024, 4:15 AMSateesh_Peri
11/22/2024, 4:16 AMcache = lenient for bismark align process ? (that way there will be no code change and can easily be removed in future)Phil Ewels
11/22/2024, 6:43 AMPhil Ewels
11/22/2024, 6:44 AMMahesh Binzer-Panchal
11/22/2024, 7:34 AMAdam Talbot
11/22/2024, 8:08 AMSateesh_Peri
11/22/2024, 8:14 AM2.7.1 was this force soft-linking of fasta file into the index folder to avoid the issues with nextflow nested-symlinks
ln -sf \$(readlink $fasta) $index/$fasta
then, we found out that the force linking above is resulting a diff hash for the index folder each time in the align process thereby breaking nextflow resumeSateesh_Peri
11/22/2024, 8:15 AMFelix Krueger
11/22/2024, 3:03 PM--fasta to Bismark what would allow one to specify the path to the FastA file (or files) separately, but default to the same folder as the index if not specified explicitly? Shouldn’t that ensure backwards compatibility while making staging easier within a Nextflow setting?Mahesh Binzer-Panchal
11/22/2024, 3:09 PMch_fasta needed in BISMARK_ALIGN? Isn't it already part of the BISMARK_GENOMEPREPARATION?Felix Krueger
11/22/2024, 3:13 PM.
├── Bisulfite_Genome
│ ├── CT_conversion
│ │ ├── BS_CT.1.bt2
│ │ ├── BS_CT.2.bt2
│ │ ├── BS_CT.3.bt2
│ │ ├── BS_CT.4.bt2
│ │ ├── BS_CT.rev.1.bt2
│ │ ├── BS_CT.rev.2.bt2
│ │ └── genome_mfa.CT_conversion.fa
│ └── GA_conversion
│ ├── BS_GA.1.bt2
│ ├── BS_GA.2.bt2
│ ├── BS_GA.3.bt2
│ ├── BS_GA.4.bt2
│ ├── BS_GA.rev.1.bt2
│ ├── BS_GA.rev.2.bt2
│ └── genome_mfa.GA_conversion.fa
└── E_coli_K12.fa
If the .fa file could come from anywhere then it would circumvent the requirementMahesh Binzer-Panchal
11/22/2024, 3:15 PMBISMARK_GENOMEPREPARATION already place it there since it's input is the fasta?Felix Krueger
11/22/2024, 3:16 PMMaxime Garcia
11/22/2024, 3:29 PMMahesh Binzer-Panchal
11/22/2024, 8:47 PMMahesh Binzer-Panchal
11/22/2024, 8:48 PMSateesh_Peri
11/23/2024, 7:41 AMwget <https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa>
and run with --fasta genome.fa and see if it worksMahesh Binzer-Panchal
11/25/2024, 8:31 AMgenome.fa is there and readable but Bismark doesn't see it?Sateesh_Peri
11/25/2024, 8:31 AMMahesh Binzer-Panchal
11/25/2024, 8:33 AMMaxime Garcia
11/25/2024, 8:34 AMMaxime Garcia
11/25/2024, 8:34 AMSateesh_Peri
11/25/2024, 8:35 AMcp the fasta into the index folder ? (the lenient cache was also not working all the time when i tested last friday)Mahesh Binzer-Panchal
11/25/2024, 8:36 AMMaxime Garcia
11/25/2024, 8:37 AMMaxime Garcia
11/25/2024, 8:38 AMSateesh_Peri
11/25/2024, 8:38 AMMahesh Binzer-Panchal
11/25/2024, 8:43 AMMahesh Binzer-Panchal
11/25/2024, 8:51 AMSateesh_Peri
11/25/2024, 8:55 AMpath(fasta, stageAs: 'tmp/*'), how is it linked into the index folder ?Mahesh Binzer-Panchal
11/25/2024, 8:59 AMMahesh Binzer-Panchal
11/25/2024, 8:59 AMSateesh_Peri
11/25/2024, 8:59 AMMaxime Garcia
11/25/2024, 9:03 AMMaxime Garcia
11/25/2024, 9:04 AMMahesh Binzer-Panchal
11/25/2024, 9:04 AMSateesh_Peri
11/25/2024, 9:16 AMSateesh_Peri
11/25/2024, 9:58 AMSateesh_Peri
11/25/2024, 9:58 AMMahesh Binzer-Panchal
11/25/2024, 10:01 AMcp or whatever else was discussed here?Sateesh_Peri
11/25/2024, 10:02 AMMaxime Garcia
11/25/2024, 10:24 AMSateesh_Peri
11/25/2024, 1:52 PMMaxime Garcia
11/25/2024, 3:53 PMPhil Ewels
11/25/2024, 3:57 PMPhil Ewels
11/25/2024, 3:57 PMPhil Ewels
11/25/2024, 4:01 PMSateesh_Peri
11/25/2024, 4:02 PMPhil Ewels
11/25/2024, 4:03 PMSateesh_Peri
11/25/2024, 4:03 PMSateesh_Peri
11/25/2024, 4:04 PMSimon Pearce
11/25/2024, 4:05 PMconfig option ? wouldn't it have to be commented out in the script ? then maintaining a separate container ?I mean, you can do things like: copy the python file out of the container into the working directory, edit the copy and then run it
Simon Pearce
11/25/2024, 4:06 PMSateesh_Peri
11/25/2024, 4:07 PMEdmund
11/25/2024, 4:07 PMSimon Pearce
11/25/2024, 4:07 PMPhil Ewels
11/25/2024, 4:08 PMYou could probably just do a patch file with wave at that point, or edit the python file and build a container with it.Sux for non-container users tho
Simon Pearce
11/25/2024, 4:09 PMPhil Ewels
11/25/2024, 4:09 PMor non-wave usersNope as we're using Wave to build regular containers
Phil Ewels
11/25/2024, 4:10 PMEdmund
11/25/2024, 4:10 PMSux for non-container users thoYou know what they say about that? Don't do that.
Phil Ewels
11/25/2024, 4:11 PMSateesh_Peri
11/25/2024, 4:11 PMPhil Ewels
11/25/2024, 4:11 PMSateesh_Peri
11/25/2024, 4:12 PMPhil Ewels
11/25/2024, 4:12 PMSateesh_Peri
11/25/2024, 4:13 PMSimon Pearce
11/25/2024, 4:29 PMPhil Ewels
11/25/2024, 4:48 PMPhil Ewels
11/25/2024, 4:48 PMPhil Ewels
11/25/2024, 4:48 PMSateesh_Peri
11/25/2024, 4:49 PM