Sateesh_Peri
10/03/2024, 1:57 PMparams.fasta is set via the config (like in test.config, pulled from test-datasets) BISMARK_ALIGN is able to find the genome.fa files, and it works as expected:
lrwxrwxrwx 1 gitpod gitpod 112 Oct 3 09:10 genome.fa -> /workspace/methylseq/work/stage-5bb8a185-99f1-4ef1-8483-b3b1b5e9d899/f8/feea95df595ec597193ef59e555b56/genome.fa
However, if params.fasta is set via the CLI (downloaded local copy), BISMARK_ALIGN complains that it canβt find the genome.fa file:
lrwxrwxrwx 1 gitpod gitpod 30 Oct 3 09:12 genome.fa -> /workspace/methylseq/genome.fa
I tested Bismark locally with both work directories, and Bismark doesnβt have any issues in that environment.
Something about the Nextflow logic is causing Bismark to think the symlinked file is missing.
Hey rubber duck, why is that?Maxime Garcia
10/03/2024, 2:17 PMSateesh_Peri
10/03/2024, 2:18 PMSateesh_Peri
10/03/2024, 2:19 PMMaxime Garcia
10/03/2024, 2:23 PMSateesh_Peri
10/03/2024, 2:25 PM-dump-channelsMaxime Garcia
10/03/2024, 2:25 PMSateesh_Peri
10/03/2024, 2:26 PMMaxime Garcia
10/03/2024, 2:26 PMMaxime Garcia
10/03/2024, 2:26 PMMaxime Garcia
10/03/2024, 2:26 PMMaxime Garcia
10/03/2024, 2:34 PMnextflow run . profile test,docker --outdir and the same command with fasta from a local path?Sateesh_Peri
10/03/2024, 2:34 PMMaxime Garcia
10/03/2024, 2:54 PMMaxime Garcia
10/03/2024, 2:55 PMls -lh work/3a/beb80c045664c65edded8ec661db9f/BismarkIndex/genome.fa
lrwxrwxrwx 1 max max 121 Oct 3 16:45 work/3a/beb80c045664c65edded8ec661db9f/BismarkIndex/genome.fa -> /home/max/workspace/methylseq/work/stage-cbce4bf6-570f-4892-a970-a0331e256283/ec/96d70fa57743bbf529718869c43adf/genome.faMaxime Garcia
10/03/2024, 2:57 PMSateesh_Peri
10/03/2024, 3:00 PMMaxime Garcia
10/03/2024, 3:04 PMMaxime Garcia
10/03/2024, 3:05 PMls -lh /home/max/workspace/methylseq/work/59/bda5c1e6b43654736f56c832f647af/BismarkIndex
total 8,0K
drwxr-xr-x 4 max max 4,0K Oct 3 16:45 Bisulfite_Genome
lrwxrwxrwx 1 max max 121 Oct 3 16:45 genome.fa -> /home/max/workspace/methylseq/work/stage-cbce4bf6-570f-4892-a970-a0331e256283/ec/96d70fa57743bbf529718869c43adf/genome.fa
is different than:
ls -lh /home/max/workspace/methylseq/work/2c/dc70a2a289d5b3bc5be9ebe427666a/BismarkIndex
total 4,0K
drwxr-xr-x 4 max max 4,0K Oct 3 16:37 Bisulfite_Genome
lrwxrwxrwx 1 max max 39 Oct 3 16:37 genome.fa -> /home/max/workspace/methylseq/genome.faSateesh_Peri
10/03/2024, 3:10 PMMaxime Garcia
10/03/2024, 3:11 PMSateesh_Peri
10/03/2024, 3:12 PMMaxime Garcia
10/03/2024, 3:13 PMnextflow run . -profile test,docker --outdir results --fasta /home/max/workspace/methylseq/work/stage-cbce4bf6-570f-4892-a970-a0331e256283/ec/96d70fa57743bbf529718869c43adf/genome
.faMaxime Garcia
10/03/2024, 3:15 PMMaxime Garcia
10/03/2024, 3:16 PMSateesh_Peri
10/03/2024, 3:16 PMSateesh_Peri
10/03/2024, 3:17 PMMaxime Garcia
10/03/2024, 3:18 PMSateesh_Peri
10/03/2024, 3:18 PMSateesh_Peri
10/03/2024, 3:26 PMnextflow run . -profile test,docker --outdir results --fasta /workspace/methylseq/work/stage-21f21e94-fe28-4b3d-bfe6-71a31d2ff9cb/3c/1f065fedf8bcce6cdb6f92f0b13148/genome.fa
Completed at: 03-Oct-2024 15:23:53
Duration : 1m 33s
CPU hours : (a few seconds)
Succeeded : 13
Ignored : 1
Failed : 1
fails with absolute path
nextflow run . -profile test,docker --outdir results --fasta /workspace/methylseq/genome.fa
Now reading in and storing sequence information of the genome specified in: /workspace/methylseq/work/4d/83eee480c8e29bebdf8ed613549761/BismarkIndex/
Failed to read from sequence file genome.fa No such file or directorySateesh_Peri
10/03/2024, 3:26 PMMaxime Garcia
10/03/2024, 3:27 PMMaxime Garcia
10/03/2024, 3:28 PMSateesh_Peri
10/03/2024, 3:29 PMSateesh_Peri
10/03/2024, 3:29 PMchmod 644 genome.fa too....didn't workMaxime Garcia
10/03/2024, 3:33 PM328 β nxf_stage() {
329 β true
330 β # stage input files
331 β rm -f BismarkIndex/genome.fa
332 β mkdir -p BismarkIndex && ln -s /home/max/workspace/methylseq/genome.fa BismarkIndex/genome.fa
333 β }
328 β nxf_stage() {
329 β true
330 β # stage input files
331 β rm -f BismarkIndex/genome.fa
332 β mkdir -p BismarkIndex && ln -s /home/max/workspace/methylseq/work/stage-cbce4bf6-570f-4892-a970-a0331e256283/ec/96d70fa57743bbf529718869c43adf/genome.fa BismarkIndex/genome.fa
333 β }Sateesh_Peri
10/04/2024, 7:04 AMMaxime Garcia
10/04/2024, 7:06 AMMaxime Garcia
10/04/2024, 7:07 AMMaxime Garcia
10/04/2024, 7:07 AMSateesh_Peri
10/04/2024, 7:10 AMMaxime Garcia
10/04/2024, 7:10 AMSateesh_Peri
10/04/2024, 7:37 AMparams.fasta is set via the config (as in test.config, pulled from test-datasets), BISMARK_ALIGN is able to locate the genome.fa file, and it works as expected:
lrwxrwxrwx 1 gitpod gitpod 112 Oct 3 09:10 genome.fa -> /workspace/methylseq/work/stage-5bb8a185-99f1-4ef1-8483-b3b1b5e9d899/f8/feea95df595ec597193ef59e555b56/genome.fa
β’ However, if params.fasta is set via the CLI (using a downloaded local copy), BISMARK_ALIGN throws an error, stating it canβt find the genome.fa file:
lrwxrwxrwx 1 gitpod gitpod 30 Oct 3 09:12 genome.fa -> /workspace/methylseq/genome.fa
β’ Setting process.stageInMode to copy works.
β’ Using the staged version of the file also works.
So, essentially, we would like to know: is there something specific that Nextflow does during staging that allows it to work, as opposed to simply downloading and using a local copy of the file?Ben Sherman
10/04/2024, 12:59 PMMaxime Garcia
10/04/2024, 1:00 PMBen Sherman
10/04/2024, 1:00 PMBen Sherman
10/04/2024, 1:01 PMgenome.fa symlinkRob Syme
10/04/2024, 1:01 PMRob Syme
10/04/2024, 1:17 PMworkDir is included in the list of container mounts by default. Any remote files get copied into $workDir/stage-foo-bar-baz/lo/nghashdigest/genome.fa which is a subdir of workDir so it will be available without issue.
If you symlink in a local /workspace/methylseq/genome.fa from , you may need to process.containerOptions = '--volume /workspace/methylseq'Maxime Garcia
10/04/2024, 1:23 PMPhil Ewels
10/04/2024, 1:38 PMMaxime Garcia
10/04/2024, 2:04 PMRob Syme
10/04/2024, 2:13 PMparams.input = "data/foo.txt"
workflow {
Channel.fromPath(params.input) | Example
}
process Example {
debug true
input: path(input)
script: "head $input"
}
Using the default input parameter, the .command.run docker run command mounts the grandparent directory of foo.txt
-v /Users/robsyme/dev/scratch/20241004_symlink_local_files_in_container:/Users/robsyme/dev/scratch/20241004_symlink_local_files_in_container
If I change to --input /Users/robsyme/tmpdata/data/foo.txt, Nextflow mounts the great-grandparent directory of foo.txt
-v /Users/robsyme:/Users/robsyme
Either way, Nextflow doesn't need any extra containerOptions to do the right thing.
Sateesh or Maxime - are your local genome.fa references on the same filesytem? I know that symlinks don't work across heterogenous filesystems.Sateesh_Peri
10/04/2024, 2:14 PMgenome.fa to gitpod so, yes same fsRob Syme
10/04/2024, 2:17 PMRob Syme
10/04/2024, 2:17 PM.command.run file include the mounts you expect?Sateesh_Peri
10/04/2024, 2:18 PMnextflow run . -profile test,docker --outdir results
local-file:
wget <https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa>
nextflow run . -profile test,docker --outdir results --fasta genome.faSateesh_Peri
10/04/2024, 2:18 PMMaxime Garcia
10/04/2024, 2:21 PMRob Syme
10/04/2024, 2:23 PMRob Syme
10/04/2024, 2:25 PMRob Syme
10/04/2024, 2:26 PMRob Syme
10/04/2024, 2:27 PMMaxime Garcia
10/04/2024, 2:27 PMMaxime Garcia
10/04/2024, 2:28 PMMaxime Garcia
10/04/2024, 2:28 PMRob Syme
10/04/2024, 2:28 PMBismarkIndex
βββ 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
βββ genome.fa -> /workspace/methylseq/genome.faRob Syme
10/04/2024, 2:29 PMSateesh_Peri
10/04/2024, 2:29 PMSateesh_Peri
10/04/2024, 2:29 PMMaxime Garcia
10/04/2024, 2:30 PMRob Syme
10/04/2024, 2:30 PMSateesh_Peri
10/04/2024, 2:31 PMSateesh_Peri
10/04/2024, 2:31 PMRob Syme
10/04/2024, 2:36 PMBen Sherman
10/04/2024, 3:02 PMrecord BismarkIndex {
Path genome
// ...
}
and you could have nested record types within that. then you pass the record type into a process and it can see from the record type all of the relevant files and handle them properlySateesh_Peri
10/04/2024, 3:11 PMBen Sherman
10/04/2024, 3:20 PMrecord BismarkIndex {
BisulfiteGenome genome
Path fa
}
record BisulfiteGenome {
ConversionThingy ct_conversion
ConversionThingy ga_conversion
}
record ConversionThingy {
List<Path> bt2
Path fa
}
I have no idea what any of these parts mean, but I think I've captured the basic structure. Maybe one of you can come up with something more specific and meaningfulSateesh_Peri
10/04/2024, 3:29 PMBismarkIndex
βββ 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
βββ genome.fa -> /workspace/methylseq/genome.fa
something like this
record BismarkIndex {
Path genome
BisulfiteGenome bisulfite_genome
}
record BisulfiteGenome {
CTConversion ct_conversion
GAConversion ga_conversion
}
record CTConversion {
Path bt2_1
Path bt2_2
Path bt2_3
Path bt2_4
Path bt2_rev_1
Path bt2_rev_2
Path genome_mfa_ct_conversion_fa
}
record GAConversion {
Path bt2_1
Path bt2_2
Path bt2_3
Path bt2_4
Path bt2_rev_1
Path bt2_rev_2
Path genome_mfa_ga_conversion_fa
}Rob Syme
10/04/2024, 3:44 PMrecord GAConversion {
Path[] btfiles
Path genome_mfa_ga_conversion_fa
}Ben Sherman
10/04/2024, 5:03 PMList<Path> bt2 because I didn't know if there are always four files + 2 rev files or if it's variable. but you can do either one, enumerate them as individual fields or have a collectionBen Sherman
10/04/2024, 11:26 PMSateesh_Peri
10/05/2024, 1:55 AMrecord BismarkIndex {
Path genome
BisulfiteGenome bisulfite_genome
}
record BisulfiteGenome {
Conversion ct_conversion
Conversion ga_conversion
}
record Conversion {
List<Path> bt2
Path genome_mfa_conversion_fa
}James Fellows Yates
10/17/2024, 6:17 PMkraken2-add.
I've not had a chance to test the stageAs: copy workaround, but reading the discussion it sounds almost like the exact behaviour as @Sateesh_Peri has.
I'm not familiar with the record types yet so I can't say if that would help, but I do know the kraken2 database directory is a) quite complicated and very variable in the number of files it may have in there (and iirc with naming), so if this solution requires prior definition/specification of every object in the directory coming through a channel, this might be very difficultBen Sherman
10/17/2024, 6:22 PMJames Fellows Yates
10/17/2024, 6:22 PMJames Fellows Yates
10/17/2024, 6:24 PMBen Sherman
10/17/2024, 7:10 PMJames Fellows Yates
10/18/2024, 2:25 PM.
βββ accmap_file.tmp
βββ library
β βββ added
β βββ dfArnMPK6W.fna
β βββ dfArnMPK6W.fna.masked
β βββ prelim_map_LPFBAbnMNN.txt
β βββ prelim_map.txt
βββ seqid2taxid_acc.tmp
βββ seqid2taxid.map.tmp
βββ taxonomy
βββ names.dmp -> /home/james/git/nf-core/createtaxdb/tutorial/names_reduced.dmp
βββ nodes.dmp -> /home/james/git/nf-core/createtaxdb/tutorial/nodes_reduced.dmp
βββ nucl_gb.accession2taxid -> /home/james/git/nf-core/createtaxdb/tutorial/nucl_gb.accession2taxid
βββ prelim_map.txt
This is a very simply example, but basically the <randomhash.fna> corresponds to different input genomes into building the database, the more genomes there are (normally hundreds of thousands), the more random hash filesJames Fellows Yates
10/18/2024, 2:25 PMJames Fellows Yates
10/18/2024, 2:25 PMJames Fellows Yates
10/18/2024, 2:27 PMSateesh_Peri
10/18/2024, 2:29 PMrecord Root {
Path accmap_file_tmp
Library library
Path seqid2taxid_acc_tmp
Path seqid2taxid_map_tmp
Taxonomy taxonomy
}
record Library {
Added added
}
record Added {
Path dfArnMPK6W_fna
Path dfArnMPK6W_fna_masked
Path prelim_map_LPFBAbnMNN_txt
Path prelim_map_txt
}
record Taxonomy {
Path names_dmp
Path nodes_dmp
Path nucl_gb_accession2taxid
Path prelim_map_txt
}
correct Ben ?James Fellows Yates
10/18/2024, 2:29 PMAdded?James Fellows Yates
10/18/2024, 2:30 PMSateesh_Peri
10/18/2024, 2:30 PMSateesh_Peri
10/18/2024, 2:31 PMJames Fellows Yates
10/18/2024, 2:31 PMJames Fellows Yates
10/18/2024, 2:31 PMSateesh_Peri
10/18/2024, 2:32 PMSateesh_Peri
10/18/2024, 2:36 PMMaxime Garcia
10/18/2024, 2:47 PMMaxime Garcia
10/18/2024, 2:48 PMJames Fellows Yates
10/18/2024, 2:48 PMSateesh_Peri
10/18/2024, 2:51 PMBen Sherman
10/18/2024, 2:54 PMThe files that the docker/singulariy image couldn't access was the names.dmp, nodes.dmp, and nucl_gb.accession2taxidI'm guessing it's because they are symlinks into directories that are not mounted into the container. And no I don't know why it only started breaking recently π€·
Ben Sherman
10/18/2024, 2:58 PMadded directory I assume you wouldn't hard-code the hashes in the record type. It depends on the "arity" of a file: (1) is it required or optional? (2) is there only one or can there be many?
same for the added directory itself, is it always present or can there be other directories? and so on
it's not supported yet but I'm in the process of designing the syntax. eventually I would write some best practices on how to model directory structures with records and collectionsBen Sherman
10/18/2024, 2:59 PMAdam Talbot
10/18/2024, 3:08 PMMaxime Garcia
10/18/2024, 3:26 PMMaxime Garcia
10/18/2024, 3:28 PMBismarkIndex/, and my index which is already BismarkIndex/
And I know this is exactly what @Sateesh_Peri struggle with already for a while.
So any smart idea @Ben Sherman here?Ben Sherman
10/18/2024, 8:46 PMMaxime Garcia
10/20/2024, 11:48 AMMaxime Garcia
10/20/2024, 11:49 AMMaxime Garcia
10/20/2024, 11:49 AMJames Fellows Yates
10/20/2024, 11:55 AMSateesh_Peri
10/20/2024, 1:24 PMmv fasta workaround I have for this, like why is using mv a bad idea ?Adam Talbot
10/20/2024, 2:29 PMmv.Adam Talbot
10/20/2024, 2:34 PMSateesh_Peri
10/20/2024, 2:36 PMAdam Talbot
10/20/2024, 2:38 PMSateesh_Peri
10/21/2024, 5:24 AMPhil Ewels
10/21/2024, 6:43 AMPhil Ewels
10/21/2024, 6:44 AMPhil Ewels
10/21/2024, 6:44 AMPhil Ewels
10/21/2024, 6:44 AMPhil Ewels
10/21/2024, 6:46 AMPhil Ewels
10/21/2024, 6:46 AMJames Fellows Yates
10/21/2024, 7:11 AMSateesh_Peri
10/21/2024, 7:22 AMERROR ~ Failed to load the meta schema. lemme see if I can find another reproducible exampleSateesh_Peri
10/21/2024, 7:56 AMNXF_VER=23.10.0 and the issue persists. now trying with an even older version but,
Failed requirement - Plugin nf-schema@2.1.1 requires Nextflow version >=23.10.0 (current 21.10.6)
any tips on how I can bypass this ?Adam Talbot
10/21/2024, 7:58 AMSateesh_Peri
10/21/2024, 9:19 AMwget <https://raw.githubusercontent.com/nf-core/test-datasets/methylseq/reference/genome.fa>
β’ first run the test with current NXF_VER= 24.04.4
nf-test test /workspace/nf-core_modules/modules/nf-core/bismark/genomepreparation/tests/main.nf.test --profile docker --verbose
β’ Then in the main.nf.test change the output to local file:
file('$baseDir/genome.fasta', checkIfExists: true)
β’ Run, the test and observe failure to find genome.fa
N E X T F L O W ~ version 24.04.4
Launching `/workspace/nf-core_modules/.nf-test-6a5e80b0f824a0ed737bdfd9876957b1.nf` [festering_engelbart] DSL2 - revision: f33aedfc4e
ERROR ~ No such file or directory: /workspace/nf-core_modules/genome.fasta
Next, change NXF_VER
export NXF_VER=23.04.4
same failure:
N E X T F L O W ~ version 23.04.4
Launching `/workspace/nf-core_modules/.nf-test-6a5e80b0f824a0ed737bdfd9876957b1.nf` [friendly_hoover] DSL2 - revision: f33aedfc4e
ERROR ~ No such file or directory: /workspace/nf-core_modules/genome.fasta
22.04.0
N E X T F L O W ~ version 22.04.4
Launching `/workspace/nf-core_modules/.nf-test-6a5e80b0f824a0ed737bdfd9876957b1.nf` [desperate_bartik] DSL2 - revision: f33aedfc4e
Nextflow stderr:
NXF_VER=20.04.1
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)Maxime Garcia
10/21/2024, 9:28 AMBen Sherman
10/21/2024, 12:47 PMSateesh_Peri
10/21/2024, 12:49 PMMaxime Garcia
10/21/2024, 12:50 PMSateesh_Peri
10/21/2024, 12:51 PMBen Sherman
10/21/2024, 12:57 PMSateesh_Peri
10/21/2024, 12:57 PMSateesh_Peri
10/21/2024, 12:58 PMmv commandMaxime Garcia
10/21/2024, 12:59 PM