Hi Guys! How are you? I managed to put the pipelin...
# genomeassembler
m
Hi Guys! How are you? I managed to put the pipeline to run, and I thank @Niklas Schandry for all the tips and help. However I am currently struggling to run the assembly step due to "lack of memory". Despite my data is really heavy, I have more than enough computational resources and I tried several configurations for FLYE or process high / high memory, but it does not work even when setting --exclusive use of nodes through SLURM inside my HPC system. The assembly runs normally If I try with the same parameters outside nextflow as normal sbatch/slurm script. I am running it on AMD 512GB RAM with 128 cores partitions (I can allocate like 4-5 nodes exclusively, if available). This is an example (of thousands hahaha) of how I tried to set my .nextflow/config:
Copy code
singularity{
  autoMounts = true
}

process {
  executor = 'slurm' 
  queue = 'amd-512'
  queueSize = 30
  submitRateLimit = '10/1min'
  clusterOptions = '--qos=preempt'
  errorStrategy = 'retry'
  maxRetries = 3
  time = '24h'
  errorStrategy = { task.exitStatus in [125,139] ? 'retry' : 'finish' }
  containerEngine = 'singularity'
  nextflow.enable.virtualThreads = true
}

process {
  withName: FLYE {
    executor = 'slurm'
    queue = 'amd-512'
    clusterOptions = '--qos=preempt --exclusive'
    memory = { 500.GB }
    cpus = { 120 }
  }
}
If anyone has a suggestion, or noticed if I am doing anything wrong, I would appreciate the help! Good sunday to all of you
n
I dont think you are doing anything wrong, you seem to have a large genome, and maybe you sequenced at a high coverage? "To reduce memory consumption for large genome assemblies, you can use a subset of the longest reads for initial disjointig assembly by specifying
--asm-coverage
and
--genome-size
options. Typically, 40x coverage is enough to produce good disjointigs." Is a suggestion from the flye docs https://github.com/mikolmogorov/Flye/blob/flye/docs/USAGE.md; you can pass this using for example:
Copy code
process {
  withName: FLYE {
    executor = 'slurm'
    queue = 'amd-512'
    clusterOptions = '--qos=preempt --exclusive'
    memory = { 500.GB }
    cpus = { 120 }
    ext.args = "--asm-coverage 40"
  }
}
👍 1
I am also not sure if your config is acutally going into flye. you sepecify 120 cpus, but flye gets
--threads 24
and not 120?
You can go into the
work
directory for this process, and take a look at
.command.run
for that task, It contains the
SBATCH
header and you can see if it actually request the correct amount of resources. If it somehow does not do what you want, maybe it is an issue regarding config priorities? https://www.nextflow.io/docs/latest/config.html#configuration-file
m
Thanks for the Args suggestion! Well, the estimated genome size is 3 billion bp at maximum. Files are indeed big, though.
About cpus, cores and threads, they can be different concepts and often confused. For example, “cpus” can refer or be equivalent to cores, but we can have 2 cpus each with 60 cores, but in the case of my system we refer cpus-per-task as cores. And threads is another parameter inside of cpus or cores. I am currently running flye as a normal sbatch/slurm script, and I can set cpus-per-task=120 threads=80. For what I remember if I am not wrong, if I set cpus on nextflow config, it will be passed as cores for my system: like 120 cores / cpus-per-task with threads 24. But I can check that to be sure
n
Yes, this is confusing, but the general approach most people seem to take is to basically to use cpu refer to "threads"
m
hmmm
Well I can test that for sure
n
the main thing that I was trying to get at; if you set 120 cpus in your nextflow config, the
--threads
for flye should also be 120
maybe the log you posted is not from the same run, idk
m
I got this same exact error for all runs hahaha But I will make a new run with these modifications later and see what happens
Thanks
n
This is a problem with assembling large genomes in general, if you have ONT reads that are >=10.4 you can also try using
hifiasm
in
--ont
mode
❤️ 1
m
Yeah, I am also testing it outside nextflow
n
If it is fine outside nextflow then it is some configuration problem
m
Or some limitation inside my HPC system
n
I strongly recommend taking a look at the
.command.sh
and also
.command.run
files in the work directories of the failed tasks and see if they are as expected
nextflow essentially submits
sbatch
scripts; named
.command.run
👍 1
m
Okay, thanks a lot Niklas! I am very new to Nextflow
n
Sure, nextflow is also pretty confusing sometimes
m
Yeah hahaha I even tried multiple configurations suggested by Seqera AI after explaining how my system works
And all other details, but got into the same problems over and over again
So I just quit, and now I am trying to analyze better what can be going wrong
Anyways, thank you! Have a good day
n
Thanks, you too