-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow closure type as input in PublishDir.setMode() #4024
Comments
I just realised that void apply( Set<Path> files, TaskRun task ) {
if( !files || !enabled )
return
if( !path )
throw new IllegalStateException("Target path for directive publishDir cannot be null")
if( nullPathWarn )
log.warn "Process `$task.processor.name` publishDir path contains a variable with a null value"
this.sourceDir = task.targetDir
this.sourceFileSystem = sourceDir.fileSystem
this.stageInMode = task.config.stageInMode
this.taskName = task.name
apply0(files)
} But it could be replaced by this in order to work, if there is not particular reason why the void apply( Set<Path> files, TaskRun task ) {
if( !files || !enabled || !path)
return
if( nullPathWarn )
log.warn "Process `$task.processor.name` publishDir path contains a variable with a null value"
this.sourceDir = task.targetDir
this.sourceFileSystem = sourceDir.fileSystem
this.stageInMode = task.config.stageInMode
this.taskName = task.name
apply0(files)
} I was wondering: is there any reason for the |
Thanks for the suggestion. No plan to support this in the short term. We are working to a better why to define publishDir defaults #4186 |
Hi everyone !
First of all, a big THANK YOU for nextflow, it is very handy :)
Some context on my feature request
I am using nextflow with configuration files to customize processes.
This mean, among other things, that I DO NOT define the
publishDir
directive for each process, like what is done in the nextflow documentation, I rather define thepublishDir {}
one and one time only for all processes (in aprocess {}
directive) using aclosure
for thepublisDir.path
.This is very handy and it works very well!
But recently, I wanted to add the possibility to copy the published files instead of doing symlinks (the default). In theory, this is very easy to do, I just have to set
publishDir.mode
with the wantedclosure
.But I get this error:
Invalid method invocation 'setMode' with arguments: (Script989C00012DEDEFE63A87A761299AE910$_run_closure6$_closure56) on PublishDir type
Indeed, in the code,
PublishDir.setMode()
can take either anextflow.processor.PublishDir.Mode
or aString
, but not aclosure
.New feature
Add a
setMode(def value)
method for thePublishDir class
.Usage scenario
I do not know if other individuals are using closure to set their
publishDir.path
, but it would be very helpfull for me if this feature is added in Nextflow :)Suggest implementation
I THINK this should work:
Best,
Audric
The text was updated successfully, but these errors were encountered: