guillaumecharbonnier / mw-lib

Metaworkflow library of generalised Snakemake rules
MIT License
0 stars 3 forks source link

Need a way to protect underscore for a parameter in routine #20

Closed SebastienNin closed 3 years ago

SebastienNin commented 3 years ago

Hi Guillaume, I'm working on routine single-cell processing. I need to have a way to protect underscore for a parameter named --sample , but in routine. I mean that user must not enter the parameter values in protectedunderscores.tsv or create an id in argids.tsv.

I think that for now there is no way to do it right?

SebastienNin commented 3 years ago

I found a way to do it specifically for scRNA-seq in my mw-sst commit 0d05302.

It may be not the best way to do it, but it works.

guillaumecharbonnier commented 3 years ago

It looks ok to me. I do not like much the fact that a script write in the git-controlled src folder. Maybe we should write this kind of scripted protectedunderscore.tsv into out/mw/protectedunderscores/{scrna_or_other_name}.tsv and add a glob row to parse these locations too?

https://github.com/guillaumecharbonnier/mw-lib/blob/1b2ce37a6091f486bab12b37c9c2ace625e72a81/src/snakemake/functions/params_extra.py#L12

SebastienNin commented 3 years ago

I discovered that it doesn't work when putting multiple scRNA-seq on process = 'yes'. I'll find a way to do it. I think about using your idea out/mw/protectedunderscores/{scrna_or_other_name}.tsv and maybe put the run number or project number before the tsv.

guillaumecharbonnier commented 3 years ago

I think this is implemented in https://github.com/guillaumecharbonnier/mw-lib/commit/aeec426bcf797da55cb57a6f72f729b97a44278e