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

CWL implementation #39

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cwl/clt/generate.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
nevents: int
outputfile: File
type: string
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/generantuple.py $(inputs.type) $(inputs.nevents) $(inputs.outputfile)
outputs:
outputfile:
outputBinding:
glob: $(inputs.outputfile)
type: File
21 changes: 21 additions & 0 deletions cwl/clt/hepdata.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
combined_model: File
hepdata_data1_yaml: string
hepdata_submission_yaml: string
hepdata_submission_zip: string
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/hepdata_export.py $(inputs.combined_model) $(inputs.hepdata_submission_yaml) $(inputs.hepdata_data1_yaml)
zip $(inputs.hepdata_submission_zip) $(inputs.hepdata_submission_yaml) $(inputs.hepdata_data1_yaml)
outputs:
hepdata_submission_zip:
outputBinding:
glob: $(inputs.hepdata_submission_zip)
type: File
23 changes: 23 additions & 0 deletions cwl/clt/histogram.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
inputfile: File
outputfile: File
variations:
inputBinding:
itemSeparator: ','
type: string[]
weight: float
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/histogram.py $(inputs.inputfile) $(inputs.outputfile) $(inputs.name) $(inputs.weight) $(inputs.variations)
outputs:
outputfile:
outputBinding:
glob: $(inputs.outputfile)
type: File
25 changes: 25 additions & 0 deletions cwl/clt/histogram_shape.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
inputfile: File
outputfile: File
name: string
shapevar: string[]
variations:
inputBinding:
itemSeparator: ','
type: string[]
weight: float
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/histogram.py $(inputs.inputfile) $(inputs.outputfile) $(inputs.name)_$(inputs.shapevar) $(inputs.weight) $(inputs.variations) '{{name}}'
outputs:
outputfile:
outputBinding:
glob: $(inputs.outputfile)
type: File
19 changes: 19 additions & 0 deletions cwl/clt/makews.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
data_bkg_hists: File
workspace_prefix: string
xml_dir: string
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/makews.py $(inputs.data_bkg_hists) $(inputs.workspace_prefix) $(inputs.xml_dir)
outputs:
workspace:
outputBinding:
glob: $(inputs.workspace_prefix)*combined*model.root
type: File
18 changes: 18 additions & 0 deletions cwl/clt/merge_root.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-env-root6:6.18.04
inputs:
mergedfile: string
inputs: File[]
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
hadd $(inputs.mergedfile) $(inputs.inputs)
outputs:
mergedfile:
outputBinding:
glob: $(inputs.mergedfile)
type: File
20 changes: 20 additions & 0 deletions cwl/clt/merge_root_allpars.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-env-root6:6.18.04
inputs:
background: string
data: string
mergedfile: string
signal: File[]
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
hadd $(inputs.mergedfile) $(inputs.signal) $(inputs.data) $(inputs.background)
outputs:
mergedfile:
outputBinding:
glob: $(inputs.mergedfile)
type: File
28 changes: 28 additions & 0 deletions cwl/clt/plot.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
combined_model: File
fit_results: string
nominal_vals: string
postfit_plot: string
prefit_plot: string
baseCommand: [bash, select.sh]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
hfquickplot write-vardef $(inputs.combined_model) combined $(inputs.nominal_vals)
hfquickplot plot-channel 4(inputs.combined_model) combined channel1 x $(inputs.nominal_vals) -c qcd,mc2,mc1,signal -o $(inputs.prefit_plot)
hfquickplot fit $(inputs.combined_model) combined $(inputs.fit_results)
hfquickplot plot-channel $(inputs.combined_model) combined channel1 x $(inputs.fit_results) -c qcd,mc2,mc1,signal -o $(inputs.postfit_plot)
outputs:
postfit:
outputBinding:
glob: $(inputs.postfit_plot)
type: File
prefit:
outputBinding:
glob: $(inputs.prefit_plot)
type: File
20 changes: 20 additions & 0 deletions cwl/clt/select.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
inputfile: File
outputfile: File
region: string
variations: string
baseCommand: [bash, select.sh]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/select.py $(inputs.inputfile) $(inputs.outputfile) $(inputs.region) nominal
outputs:
outputfile:
outputBinding:
glob: $(inputs.outputfile)
type: File
23 changes: 23 additions & 0 deletions cwl/clt/select_mc.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cwlVersion: v1.2
class: CommandLineTool
requirements:
DockerRequirement:
dockerPull: docker.io/reanahub/reana-demo-bsm-search:1.0.0
inputs:
inputfile: File
outputfile: File
region: string
variations:
inputBinding:
itemSeparator: ","
type: string[]
baseCommand: [bash, -c]
arguments:
- valueFrom: |
source /usr/local/bin/thisroot.sh
python /code/select.py $(inputs.inputfile) $(inputs.outputfile) $(inputs.region) $(inputs.variations)
outputs:
outputfile:
outputBinding:
glob: $(inputs.outputfile)
type: File
79 changes: 79 additions & 0 deletions cwl/databkgmc.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
cwlVersion: v1.2
class: Workflow
requirements:
SubworkflowFeatureRequirement: {}
inputs: {}
outputs:
postfit:
outputSource: plot/postfit
type: File
prefit:
outputSource: plot/prefit
type: File
steps:
all_bkg_mc:
run: wflow_all_mc.cwl
in:
mcname:
default: ['mc1', 'mc2']
mcweight:
default: [0.01875, 0.0125]
nevents:
default: [40000,40000,40000,4000]
out: [mergedfile]
data:
run: workflow_data.cwl
in:
nevents:
default: [20000,20000,20000,20000,20000]
out: [mergedfile]
signal:
run: workflow_sig.cwl
in:
nevents:
default: [40000,40000]
mcweight:
default: 0.0025
out: [mergedfile]
merge:
run: clt/merge_root_allpars.cwl
in:
backgorund: all_bkg_mc/mergedfile
data: data/mergedfile
mergedfile:
valueFrom: 'merged.root'
signal: signal/mergedfile
out: [mergedfile]
makews:
run: clt/makews.cwl
in:
data_bkg_hists: merge/mergedfile
workspace_prefix:
default: 'results/workspace'
xml_dir:
default: 'xmldir'
out: [workspace]
plot:
run: clt/plot.cwl
in:
combined_model: makews/workspace
nominal_vals:
default: 'nominal_vals.yml'
fit_results:
default: 'fit_results.yml'
prefit_plot:
default: 'prefit.pdf'
postfit_plot:
default: 'postfit.pdf'
out: [postfit, prefit]
hepdata:
run: clt/hepdata.cwl
in:
combined_model: makews/workspace
hepdata_submission_zip:
default: 'submission.zip'
hepdata_submission_yaml:
default: 'submission.yaml'
hepdata_data1_yaml:
default: 'data1.yaml'
out: [hepdata_submission_zip]
40 changes: 40 additions & 0 deletions cwl/wflow_all_mc.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cwlVersion: v1.2
class: Workflow
requirements:
ScatterFeatureRequirement: {}
SubworkflowFeatureRequirement: {}
inputs:
nevents: int[]
mcname: string[]
mcweight: float[]
outputs:
mergedfile:
outputSource: merge/mergedfile
type: File[]
steps:
run_mc:
run: workflow_mc.cwl
in:
nevents: nevents
mcname: mcname
mcweight: mcweight
shapevars:
default:
- - shape_conv_up
- - shape_conv_dn
weightvariations:
default:
- 'nominal'
- 'weight_var1_up'
- 'weight_var1_dn'
scatter:
- mcname
- mcweight
out: [mergeallvars]
merge:
run: clt/merge_root.cwl
in:
inputs: run_mc/mergeallvars
mergedfile:
default: 'merged.root'
out: [mergedfile]
Loading