Hi every, is there a good way to tell publishDir s...
# modules
d
Hi every, is there a good way to tell publishDir saveAs to ignore one file in a output folder? say in a process I defined
output: path "dir_name"
, how can I in the modules.config file saying
publishDir = [saveAs: Don't publish file "dir_name/some_file"]
? (edited)
g
saveAs can take a callback function. You can make it return
null
(= don't publish) or a path otherwise. This is prominently used to exclude
versions.yml
files, e.g. https://github.com/nf-core/scrnaseq/blob/89a7986916703f7e4fb1961ce78351bae50bf2ba/conf/modules.config#L38
d
Yes I tried it, but because the output path is a directory, for some reason it could not identify a specific file within this directory
g
I see... Would it work to change the module output channel to
path("directory/**")
to return a list of files instead?
d
Faruk from #nostupidquestions suggested
publishDir path: 'outputdir', pattern:'!some_file_pattern'
but it is not working
Because this is a nf-core module, I am not sure if doing is good tho, cuz the folder contain many other stuffs?
g
I guess that has the same limitation as the callback function...
d
i tried
dir/**
, but other modules that take this output channel as the input got all files in
af_map
in the working directory, making the working directory very messy
g
probably the other modules could be changed to stage the files into a separate directory, but it doesn't sound like a clean solution either
d
right that's exactly what I am worrying about. is there any chance that we can do a feature request so that nextflow will go into the dir and check all matched files if we say ` pattern:
"**/*.map"
, or exposing a parameter called
recursive
for
pattern
or
saveAs
?
g
You can always try! At the very least it might be read by someone who knows a workaround.
In any case it doesn't seem like we're gonna solve it for the oncoming scrnaseq release
d
OK No worries. At least I can use saveAs to ignore
af_map
.
👍 1