Skip to content
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 a task file to only include a subset of fields and use default values for missing fields #10

Open
ShaiberAlon opened this issue Jan 24, 2022 · 0 comments

Comments

@ShaiberAlon
Copy link
Collaborator

I am listing it here since I think this would be useful and I am outlining two potential solutions below

Template task file

The idea would be to have a template task file that includes default values for all required fields.
Then, each task file can point to that template and only include the subset of the fields which we want to update with values to override the default values from the template task file.

So for example, we can have a template task file for JaBbA ~/tasks/JaBbA.task:

~/modules/JaBbA
input   CovFile cov_rds path
input   RAfile  junctionFilePath        path
input   CovField        field   value   "ratio"
input   RAsupp  junctionUnfiltered      path    /dev/null
input   TierFieldName   tfield  value   "tier"
input   NormalSegFile   cbs_nseg_rds    path    /dev/null
input   SegFile cbs_seg_rds     path    /dev/null
input   SlackPenalty    slack   value   100
input   OptionalHetPileupOutput het_pileups_wgs path    /dev/null
input   Purity  purity  value   NA
input   Ploidy  ploidy  value   NA
input   tilim   tilim   value   6000
input   epgap   epgap   value   1e-6
input   ppmethod        pp.method       value   "sequenza"
input   maxna   maxna   value   -1
input   flags   flags   value   ""
input   blacklist.coverage      blacklist.coverage      path    /dev/null
input   blacklist.junctions     blacklist.junctions     path    /dev/null
input   NumIterations   iter    value   0
input   TumorName       pair    value   "tumor"
input   job.spec.memory 15      value
input   indel           indel   value   "exclude"
input   cnsignif        cnsignif        value   0.00001
input   lp      lp      value   "TRUE"
input   ism     ism     value   "TRUE"
input   mem     treemem value   16
input   fix.thres       fix.thres       value   5
input   max.threads     "Inf"   value
output  jabba_rds       jabba.simple.rds$
output  jabba_gg        jabba.simple.gg.rds$
output  jabba_vcf       jabba.simple.vcf$
output  jabba_raw_rds   jabba.raw.rds$
output  opti    opt.report.rds$
output  jabba_seg       jabba.seg$

And then another task file ~/tasks/JaBbA.hg38.task:

~/modules/JaBbA
~/tasks/JaBbA.task
input   blacklist.coverage      blacklist.coverage      path    '/path/to/hg38.coverage.mask.rds'

This way if we want to update the default values for a module, we don't need to do this for every flavor of the tasks of a certain module.

Optional vs. required parameters

An alternative solution could be to loose the requirement that every parameter expected by the flow.deploy file will be listed in the task file. Instead we can have required and optional parameters so that if a parameter is optional then the task file can omit it, and then the default value listed in the module itself will prevail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant