`cleanup = true` in a NF config!!!!!! Cleans up th...
# random
h
cleanup = true
in a NF config!!!!!! Cleans up the intermediate files in the
work
directory if the pipeline finishes successfully.
πŸ•Ί 1
rainbow puke 2
βœ”οΈ 1
😱 2
j
@Maxime Borry should we add to shh profile?
h
Would double-check what its doing first! Paolo wasnt 100% sure πŸ€”
j
Oh πŸ˜†
h
Be interested to know what you find.
j
NOted
Will try after this meeting πŸ‘
h
How the hell did you know this @Chelsea Sawyer πŸ˜† Youve been digging into the NF code base?
And does it do what it says on the tin?
c
@hpatel basically digging through a billion forums as I need it for my automated pipeline so I don't store a million massive files πŸ˜‚ It will delete the files (not the directories) when completed successfully and leave them if not successful.
h
Genius πŸ‘πŸ½
party parrot 1
j
Does nothing for me πŸ˜•
Do you have an example @Chelsea Sawyer?
p
Maybe this is a good case for a PR to improve the Nextflow docs? If it does indeed work and we fully understand it!
c
@James Fellows Yates did you put it in your config file?
j
Yup, in a 'custom' one for offline
I also tried putting it directly in nextflow.config for the pipeline
Ah, it worked if it went into a profile (ping @Junjun Zhang
Note it does not remove e.g. conda environments pulled and stored in the work directory of a specific run
h
Thats not strictly speaking an intermediate file though? Does it clean those up? Have you got a code snippet?
j
I guess depends what is considered intermediate. You wouldn't normally have the environments to be generated each run (but host it somewhere generalised). Maybe just something to note in documentations
h
Yep πŸ‘πŸ½
j
Copy code
profiles {
  awsbatch { includeConfig 'conf/awsbatch.config' }
  conda { 
	process.conda = "$baseDir/environment.yml" 
	cleanup = true
	}
  debug { process.beforeScript = 'echo $HOSTNAME' }
  docker {
    docker.enabled = true
    process.container = params.container
  }
For a hacky little test I just added to the 'conda' profile in the nextflow.config for EAGER
Will make a PR into the SHH one and get @maxibor to do a real life test πŸ˜‰
p
So what files does it delete? Anything that's not listed in an input or output channel?
This vaguely sounds familiar if so..
j
It deleted anything in a 'hash' directory within work/, so I guess yes?. I think that would include the source of symlinks that are used in the publishDir directive (but we don't have any of those in eager).
p
Oh ok, that’s different. So it breaks
-resume
then?
j
I'm assuming so, but I haven't tried. I'll have a look tomorrow if I have time.
πŸ‘πŸ» 1
h
Yep. I'd imagine it will definitely break
-resume
j
Yes, confirmed resume gets broken. https://github.com/nf-core/configs/blob/master/conf/shh.config <- now integrated here. Where would the best place for documenting this go?
p
The main Nextflow docs I think!
Nextflow repo, docs subfolder
h
@p will you be deprecating this feature anytime soon! Seems to be something that could be quite useful for alot of people! dusty stick
j
OK. I don't mind writing something, but suggestion which section it would go in would be helpful - looking through the config file NF docs, AFAICT it doesn't fall in a 'scope' per se so there isn't a clean place...