{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aptatlas.org/data/combine_engine_spec.schema.json",
  "title": "Help Me Combine engine specification",
  "description": "Axes, weights and pair values the Help Me Combine engine uses.",
  "type": "object",
  "required": [
    "schema",
    "name",
    "title",
    "version",
    "last_updated",
    "licence",
    "licence_url",
    "citation",
    "archive_doi",
    "third_party",
    "data"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "type": "string",
      "description": "URL of this schema for this release"
    },
    "name": {
      "const": "combine_engine_spec"
    },
    "title": {
      "type": "string"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+$",
      "description": "APT release"
    },
    "last_updated": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "licence": {
      "const": "CC-BY-4.0"
    },
    "licence_url": {
      "type": "string"
    },
    "citation": {
      "type": "string"
    },
    "archive_doi": {
      "type": "string"
    },
    "third_party": {
      "type": "array",
      "description": "Sources this file draws on that carry their own licence.",
      "items": {
        "type": "object",
        "required": [
          "name",
          "licence",
          "url",
          "relationship",
          "note"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "licence": {
            "type": "string",
            "description": "SPDX identifier"
          },
          "url": {
            "type": "string"
          },
          "relationship": {
            "enum": [
              "source",
              "derived"
            ]
          },
          "note": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "JSONPath, relative to data, of fields derived from this source"
          },
          "fields_derived_in_part": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "JSONPath, relative to data, of fields computed partly from the fields above"
          }
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "engine_version": {
          "type": "string"
        },
        "generated_from": {
          "type": "string"
        },
        "source_locations": {
          "type": "object",
          "properties": {
            "priorities_derive_axes_quality_dims": {
              "type": "string"
            },
            "quality_function": {
              "type": "string"
            },
            "scoring_function": {
              "type": "string"
            },
            "pair_coverage": {
              "type": "string"
            },
            "data": {
              "type": "string"
            }
          },
          "required": [
            "priorities_derive_axes_quality_dims",
            "quality_function",
            "scoring_function",
            "pair_coverage",
            "data"
          ],
          "additionalProperties": false
        },
        "axes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "default_weight": {
                "type": "number"
              },
              "invert": {
                "type": "boolean"
              }
            },
            "required": [
              "key",
              "default_weight",
              "invert"
            ],
            "additionalProperties": false
          }
        },
        "priority_to_lever": {
          "type": "object",
          "properties": {
            "coverage": {
              "type": "object",
              "properties": {
                "axis": {
                  "type": "string"
                },
                "set_weight_to": {
                  "type": "integer"
                }
              },
              "required": [
                "axis",
                "set_weight_to"
              ],
              "additionalProperties": false
            },
            "complementarity": {
              "type": "object",
              "properties": {
                "axis": {
                  "type": "string"
                },
                "set_weight_to": {
                  "type": "integer"
                }
              },
              "required": [
                "axis",
                "set_weight_to"
              ],
              "additionalProperties": false
            },
            "precision": {
              "type": "object",
              "properties": {
                "quality_dim": {
                  "type": "string"
                }
              },
              "required": [
                "quality_dim"
              ],
              "additionalProperties": false
            },
            "specificity": {
              "type": "object",
              "properties": {
                "quality_dim": {
                  "type": "string"
                }
              },
              "required": [
                "quality_dim"
              ],
              "additionalProperties": false
            },
            "sensitivity": {
              "type": "object",
              "properties": {
                "quality_dim": {
                  "type": "string"
                }
              },
              "required": [
                "quality_dim"
              ],
              "additionalProperties": false
            },
            "quantification": {
              "type": "object",
              "properties": {
                "quality_dim": {
                  "type": "string"
                }
              },
              "required": [
                "quality_dim"
              ],
              "additionalProperties": false
            },
            "pqtl": {
              "type": "object",
              "properties": {
                "quality_dim": {
                  "type": "string"
                }
              },
              "required": [
                "quality_dim"
              ],
              "additionalProperties": false
            },
            "throughput": {
              "type": "object",
              "properties": {
                "quality_dim": {
                  "type": "string"
                }
              },
              "required": [
                "quality_dim"
              ],
              "additionalProperties": false
            },
            "cost": {
              "type": "object",
              "properties": {
                "axis": {
                  "type": "string"
                },
                "set_weight_to": {
                  "type": "integer"
                }
              },
              "required": [
                "axis",
                "set_weight_to"
              ],
              "additionalProperties": false
            },
            "volume": {
              "type": "object",
              "properties": {
                "axis": {
                  "type": "string"
                },
                "set_weight_to": {
                  "type": "integer"
                }
              },
              "required": [
                "axis",
                "set_weight_to"
              ],
              "additionalProperties": false
            },
            "tissue": {
              "type": "object",
              "properties": {
                "axis": {
                  "type": "string"
                },
                "set_weight_to": {
                  "type": "integer"
                }
              },
              "required": [
                "axis",
                "set_weight_to"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "coverage",
            "complementarity",
            "precision",
            "specificity",
            "sensitivity",
            "quantification",
            "pqtl",
            "throughput",
            "cost",
            "volume",
            "tissue"
          ],
          "additionalProperties": false
        },
        "priority_combination_rule": {
          "type": "string"
        },
        "quality_dims": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "group": {
                "type": "string"
              },
              "default_weight": {
                "type": "integer"
              }
            },
            "required": [
              "key",
              "group",
              "default_weight"
            ],
            "additionalProperties": false
          }
        },
        "quality_formula": {
          "type": "string"
        },
        "raw_axis_values": {
          "type": "string"
        },
        "pair_coverage_rule": {
          "type": "string"
        },
        "class_balance_rule": {
          "type": "string"
        },
        "normalisation": {
          "type": "string"
        },
        "composite_formula": {
          "type": "string"
        },
        "denominators": {
          "type": "object",
          "properties": {
            "drug_targets": {
              "type": "integer"
            },
            "proteome_atlas_union": {
              "type": "integer"
            },
            "proteome_canonical": {
              "type": "integer"
            },
            "fda_biomarkers": {
              "type": "integer"
            }
          },
          "required": [
            "drug_targets",
            "proteome_atlas_union",
            "proteome_canonical",
            "fda_biomarkers"
          ],
          "additionalProperties": false
        },
        "pathway_coverage_disclosure": {
          "type": "string"
        },
        "priority_sweep": {
          "type": "string"
        },
        "bootstrap_ci": {
          "type": "string"
        },
        "platforms": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "display_name": {
                "type": "string"
              },
              "ptm_proteoform_capable": {
                "type": "boolean"
              },
              "coverage": {
                "type": "object",
                "properties": {
                  "drug_targets": {
                    "type": "number"
                  },
                  "proteome_canonical": {
                    "type": "number"
                  },
                  "proteome_atlas_union": {
                    "type": "number"
                  },
                  "fda_biomarkers": {
                    "type": "number"
                  }
                },
                "required": [
                  "drug_targets",
                  "proteome_canonical",
                  "proteome_atlas_union",
                  "fda_biomarkers"
                ],
                "additionalProperties": false
              },
              "app_scores": {
                "type": "object",
                "properties": {
                  "proteome_coverage": {
                    "type": "integer"
                  },
                  "precision": {
                    "type": "integer"
                  },
                  "specificity": {
                    "type": "integer"
                  },
                  "sensitivity": {
                    "type": "integer"
                  },
                  "cost_efficiency": {
                    "type": "integer"
                  },
                  "throughput": {
                    "type": "integer"
                  },
                  "quantification_type": {
                    "type": "integer"
                  },
                  "sample_flexibility": {
                    "type": "integer"
                  },
                  "evidence_depth": {
                    "type": "integer"
                  },
                  "pqtl_accuracy": {
                    "type": "integer"
                  }
                },
                "required": [
                  "proteome_coverage",
                  "precision",
                  "specificity",
                  "sensitivity",
                  "cost_efficiency",
                  "throughput",
                  "quantification_type",
                  "sample_flexibility",
                  "evidence_depth",
                  "pqtl_accuracy"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "display_name",
              "ptm_proteoform_capable",
              "coverage",
              "app_scores"
            ],
            "additionalProperties": false
          }
        },
        "display_name_to_slug": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "pairs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "a": {
                "type": "string"
              },
              "b": {
                "type": "string"
              },
              "coverage_pct": {
                "type": "number"
              },
              "coverage_ci_lo": {
                "type": "number"
              },
              "coverage_ci_hi": {
                "type": "number"
              },
              "coverage_pct_canonical": {
                "type": "number"
              },
              "coverage_pct_atlas_union": {
                "type": "number"
              },
              "coverage_pct_fda": {
                "type": "number"
              },
              "coverage_fda_ci_lo": {
                "type": "number"
              },
              "coverage_fda_ci_hi": {
                "type": "number"
              },
              "net_new_pct": {
                "type": "number"
              },
              "net_new_targets": {
                "type": "integer"
              },
              "total_cost": {
                "type": "number"
              },
              "class_balance": {
                "type": "number"
              },
              "joint_volume_uL": {
                "type": "integer"
              }
            },
            "required": [
              "a",
              "b",
              "coverage_pct",
              "coverage_ci_lo",
              "coverage_ci_hi",
              "coverage_pct_canonical",
              "coverage_pct_atlas_union",
              "coverage_pct_fda",
              "coverage_fda_ci_lo",
              "coverage_fda_ci_hi",
              "net_new_pct",
              "net_new_targets",
              "total_cost",
              "class_balance",
              "joint_volume_uL"
            ],
            "additionalProperties": false
          }
        },
        "coverage_basis": {
          "type": "string"
        }
      },
      "required": [
        "engine_version",
        "generated_from",
        "source_locations",
        "axes",
        "priority_to_lever",
        "priority_combination_rule",
        "quality_dims",
        "quality_formula",
        "raw_axis_values",
        "pair_coverage_rule",
        "class_balance_rule",
        "normalisation",
        "composite_formula",
        "denominators",
        "pathway_coverage_disclosure",
        "priority_sweep",
        "bootstrap_ci",
        "platforms",
        "display_name_to_slug",
        "pairs",
        "coverage_basis"
      ],
      "additionalProperties": false
    }
  }
}
