# This scenario is templated with YTE (https://yte-template-engine.github.io)
# and rendered for each group (see sample sheet).
# A variable `samples` is available, holding the dataframe of
# the sample sheet, filtered to those samples contained in the group to be rendered.
# For example, this can be used to pass arbitrary column values (like the purity below),
# to the sample definitions.
# Note that sample names here must correspond to the alias column in the sample sheet.
# In addition, a variable `group_annotation` is available, which holds the row of the group
# from the group annotation table (if specified in the config) as a pandas Series.

__definitions__:
  - samples = params.samples.set_index("alias")
  - |
    def contamination():
      return 1.0 - float(samples.loc["tumor", "purity"])

samples:
  tumor:
    resolution: 0.01
    universe: "[0.0,1.0]"
    contamination:
      by: normal
      fraction: ?contamination()
  normal:
    resolution: 0.1
    universe: "0.0 | 0.5 | 1.0 | ]0.0,0.5["

events:
  somatic_tumor_low: "tumor:]0.0,0.1[ & normal:0.0"
  somatic_tumor_medium: "tumor:[0.1,0.3[ & normal:0.0"
  somatic_tumor_high: "tumor:[0.3,1.0] & normal:0.0"
  somatic_normal: "normal:]0.0,0.5["
  germline_hom: "normal:1.0"
  germline_het: "normal:0.5"
