diff --git a/config/config.yaml b/config/config.yaml index f2899fb9..401c8bbc 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,3 +1,6 @@ +# Specify the schema: +# yaml-language-server: $schema=schema.json + # Global workflow control # The length of the hash used to identify a parameter combination diff --git a/config/schema.json b/config/schema.json new file mode 100644 index 00000000..204c5705 --- /dev/null +++ b/config/schema.json @@ -0,0 +1,1710 @@ +{ + "$defs": { + "Analysis": { + "additionalProperties": false, + "properties": { + "summary": { + "$ref": "#/$defs/SummaryAnalysis", + "default": { + "include": false + } + }, + "cytoscape": { + "$ref": "#/$defs/CytoscapeAnalysis", + "default": { + "include": false + } + }, + "ml": { + "$ref": "#/$defs/MlAnalysis", + "default": { + "include": false, + "aggregate_per_algorithm": false, + "components": 2, + "labels": true, + "kde": false, + "remove_empty_pathways": false, + "linkage": "ward", + "metric": "euclidean" + } + }, + "evaluation": { + "$ref": "#/$defs/EvaluationAnalysis", + "default": { + "include": false, + "aggregate_per_algorithm": false + } + } + }, + "title": "Analysis", + "type": "object" + }, + "ContainerFramework": { + "enum": [ + "docker", + "singularity", + "apptainer", + "dsub" + ], + "title": "ContainerFramework", + "type": "string" + }, + "ContainerRegistry": { + "additionalProperties": false, + "properties": { + "base_url": { + "default": "docker.io", + "description": "The domain of the registry", + "title": "Base Url", + "type": "string" + }, + "owner": { + "default": "reedcompbio", + "description": "The owner or project of the registry", + "title": "Owner", + "type": "string" + } + }, + "title": "ContainerRegistry", + "type": "object" + }, + "ContainerSettings": { + "additionalProperties": false, + "properties": { + "framework": { + "$ref": "#/$defs/ContainerFramework", + "default": "docker" + }, + "unpack_singularity": { + "default": false, + "title": "Unpack Singularity", + "type": "boolean" + }, + "enable_profiling": { + "default": false, + "description": "A Boolean indicating whether to enable container runtime profiling (apptainer/singularity only)", + "title": "Enable Profiling", + "type": "boolean" + }, + "registry": { + "$ref": "#/$defs/ContainerRegistry" + } + }, + "required": [ + "registry" + ], + "title": "ContainerSettings", + "type": "object" + }, + "CytoscapeAnalysis": { + "additionalProperties": false, + "properties": { + "include": { + "title": "Include", + "type": "boolean" + } + }, + "required": [ + "include" + ], + "title": "CytoscapeAnalysis", + "type": "object" + }, + "Dataset": { + "additionalProperties": false, + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "node_files": { + "items": { + "type": "string" + }, + "title": "Node Files", + "type": "array" + }, + "edge_files": { + "items": { + "type": "string" + }, + "title": "Edge Files", + "type": "array" + }, + "other_files": { + "items": { + "type": "string" + }, + "title": "Other Files", + "type": "array" + }, + "data_dir": { + "title": "Data Dir", + "type": "string" + } + }, + "required": [ + "label", + "node_files", + "edge_files", + "other_files", + "data_dir" + ], + "title": "Dataset", + "type": "object" + }, + "EvaluationAnalysis": { + "additionalProperties": false, + "properties": { + "include": { + "title": "Include", + "type": "boolean" + }, + "aggregate_per_algorithm": { + "default": false, + "title": "Aggregate Per Algorithm", + "type": "boolean" + } + }, + "required": [ + "include" + ], + "title": "EvaluationAnalysis", + "type": "object" + }, + "GoldStandard": { + "additionalProperties": false, + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "node_files": { + "default": [], + "items": { + "type": "string" + }, + "title": "Node Files", + "type": "array" + }, + "edge_files": { + "default": [], + "items": { + "type": "string" + }, + "title": "Edge Files", + "type": "array" + }, + "data_dir": { + "title": "Data Dir", + "type": "string" + }, + "dataset_labels": { + "items": { + "type": "string" + }, + "title": "Dataset Labels", + "type": "array" + } + }, + "required": [ + "label", + "data_dir", + "dataset_labels" + ], + "title": "GoldStandard", + "type": "object" + }, + "Locations": { + "additionalProperties": false, + "properties": { + "reconstruction_dir": { + "title": "Reconstruction Dir", + "type": "string" + } + }, + "required": [ + "reconstruction_dir" + ], + "title": "Locations", + "type": "object" + }, + "MlAnalysis": { + "additionalProperties": false, + "properties": { + "include": { + "title": "Include", + "type": "boolean" + }, + "aggregate_per_algorithm": { + "default": false, + "title": "Aggregate Per Algorithm", + "type": "boolean" + }, + "components": { + "default": 2, + "title": "Components", + "type": "integer" + }, + "labels": { + "default": true, + "title": "Labels", + "type": "boolean" + }, + "kde": { + "default": false, + "title": "Kde", + "type": "boolean" + }, + "remove_empty_pathways": { + "default": false, + "title": "Remove Empty Pathways", + "type": "boolean" + }, + "linkage": { + "$ref": "#/$defs/MlLinkage", + "default": "ward" + }, + "metric": { + "$ref": "#/$defs/MlMetric", + "default": "euclidean" + } + }, + "required": [ + "include" + ], + "title": "MlAnalysis", + "type": "object" + }, + "MlLinkage": { + "enum": [ + "ward", + "complete", + "average", + "single" + ], + "title": "MlLinkage", + "type": "string" + }, + "MlMetric": { + "enum": [ + "euclidean", + "manhattan", + "cosine" + ], + "title": "MlMetric", + "type": "string" + }, + "ReconstructionSettings": { + "additionalProperties": false, + "properties": { + "locations": { + "$ref": "#/$defs/Locations" + } + }, + "required": [ + "locations" + ], + "title": "ReconstructionSettings", + "type": "object" + }, + "SummaryAnalysis": { + "additionalProperties": false, + "properties": { + "include": { + "title": "Include", + "type": "boolean" + } + }, + "required": [ + "include" + ], + "title": "SummaryAnalysis", + "type": "object" + }, + "allpairsModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "allpairs", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/allpairsRunModel" + }, + "default": { + "default": {} + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "allpairsModel", + "type": "object" + }, + "allpairsRunModel": { + "additionalProperties": false, + "properties": {}, + "title": "allpairsRunModel", + "type": "object" + }, + "bowtiebuilderModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "bowtiebuilder", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/bowtiebuilderRunModel" + }, + "default": { + "default": {} + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "bowtiebuilderModel", + "type": "object" + }, + "bowtiebuilderRunModel": { + "additionalProperties": false, + "properties": {}, + "title": "bowtiebuilderRunModel", + "type": "object" + }, + "dominoModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "domino", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/dominoRunModel" + }, + "default": { + "default": { + "module_threshold": null, + "slice_threshold": null + } + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "dominoModel", + "type": "object" + }, + "dominoRunModel": { + "additionalProperties": false, + "properties": { + "module_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "the p-value threshold for considering a slice as relevant (optional)", + "title": "Module Threshold" + }, + "slice_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "the p-value threshold for considering a putative module as final module (optional)", + "title": "Slice Threshold" + } + }, + "title": "dominoRunModel", + "type": "object" + }, + "meoModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "meo", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/meoRunModel" + }, + "default": { + "default": { + "max_path_length": null, + "local_search": null, + "rand_restarts": null + } + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "meoModel", + "type": "object" + }, + "meoRunModel": { + "additionalProperties": false, + "properties": { + "max_path_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "the maximal length of a path from sources and targets to orient.", + "title": "Max Path Length" + }, + "local_search": { + "anyOf": [ + { + "type": "boolean" + }, + { + "items": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "a boolean parameter that enables MEO's local search functionality.\nSee \"Improving approximations with local search\" in the associated paper\nfor more information.", + "title": "Local Search" + }, + "rand_restarts": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The number of random restarts to use.", + "title": "Rand Restarts" + } + }, + "title": "meoRunModel", + "type": "object" + }, + "mincostflowModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "mincostflow", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/mincostflowRunModel" + }, + "default": { + "default": { + "flow": null, + "capacity": null + } + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "mincostflowModel", + "type": "object" + }, + "mincostflowRunModel": { + "additionalProperties": false, + "properties": { + "flow": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "amount of flow going through the graph", + "title": "Flow" + }, + "capacity": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "amount of capacity allowed on each edge", + "title": "Capacity" + } + }, + "title": "mincostflowRunModel", + "type": "object" + }, + "omicsintegrator1Model": { + "additionalProperties": false, + "properties": { + "name": { + "const": "omicsintegrator1", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/omicsintegrator1RunModel" + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include", + "runs" + ], + "title": "omicsintegrator1Model", + "type": "object" + }, + "omicsintegrator1RunModel": { + "additionalProperties": false, + "properties": { + "dummy_mode": { + "anyOf": [ + { + "$ref": "#/$defs/spras__omicsintegrator1__DummyMode" + }, + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/spras__omicsintegrator1__DummyMode" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dummy Mode" + }, + "mu_squared": { + "anyOf": [ + { + "type": "boolean" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + } + ], + "default": false, + "title": "Mu Squared" + }, + "exclude_terms": { + "anyOf": [ + { + "type": "boolean" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + } + ], + "default": false, + "title": "Exclude Terms" + }, + "noisy_edges": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 0, + "description": "How many times you would like to add noise to the given edge values and re-run the algorithm.", + "title": "Noisy Edges" + }, + "shuffled_prizes": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 0, + "description": "How many times the algorithm should shuffle the prizes and re-run", + "title": "Shuffled Prizes" + }, + "random_terminals": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 0, + "description": "How many times to apply the given prizes to random nodes in the interactome", + "title": "Random Terminals" + }, + "seed": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The randomness seed to use.", + "title": "Seed" + }, + "w": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "Float that affects the number of connected components, with higher values leading to more components", + "title": "W" + }, + "b": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "The trade-off between including more prizes and using less reliable edgess", + "title": "B" + }, + "d": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "Controls the maximum path-length from root to terminal nodes", + "title": "D" + }, + "mu": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 0.0, + "description": "Controls the degree-based negative prizes (default 0.0)", + "title": "Mu" + }, + "noise": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Standard Deviation of the gaussian noise added to edges in Noisy Edges Randomizations", + "title": "Noise" + }, + "g": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 0.001, + "description": "(gamma) msgsteiner reinforcement parameter that affects the convergence of the solution and runtime, with larger values leading to faster convergence but suboptimal results.", + "title": "G" + }, + "r": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 0, + "description": "msgsteiner parameter that adds random noise to edges, which is rarely needed.", + "title": "R" + } + }, + "required": [ + "w", + "b", + "d" + ], + "title": "omicsintegrator1RunModel", + "type": "object" + }, + "omicsintegrator2Model": { + "additionalProperties": false, + "properties": { + "name": { + "const": "omicsintegrator2", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/omicsintegrator2RunModel" + }, + "default": { + "default": { + "w": 5.0, + "b": 1.0, + "g": 3.0, + "noise": null, + "noisy_edges": null, + "random_terminals": null, + "dummy_mode": null, + "seed": null + } + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "omicsintegrator2Model", + "type": "object" + }, + "omicsintegrator2RunModel": { + "additionalProperties": false, + "properties": { + "w": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 5, + "description": "Omega: the weight of the edges connecting the dummy node to the nodes selected by dummyMode", + "title": "W" + }, + "b": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 1, + "description": "Beta: scaling factor of prizes", + "title": "B" + }, + "g": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 3, + "description": "Gamma: multiplicative edge penalty from degree of endpoints", + "title": "G" + }, + "noise": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Standard Deviation of the gaussian noise added to edges in Noisy Edges Randomizations.", + "title": "Noise" + }, + "noisy_edges": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "An integer specifying how many times to add noise to the given edge values and re-run.", + "title": "Noisy Edges" + }, + "random_terminals": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "An integer specifying how many times to apply your given prizes to random nodes in the interactome and re-run", + "title": "Random Terminals" + }, + "dummy_mode": { + "anyOf": [ + { + "$ref": "#/$defs/spras__omicsintegrator2__DummyMode" + }, + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/spras__omicsintegrator2__DummyMode" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Tells the program which nodes in the interactome to connect the dummy node to. (default: terminals)\n \"terminals\" = connect to all terminals\n \"others\" = connect to all nodes except for terminals\n \"all\" = connect to all nodes in the interactome.", + "title": "Dummy Mode" + }, + "seed": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The random seed to use for this run.", + "title": "Seed" + } + }, + "title": "omicsintegrator2RunModel", + "type": "object" + }, + "pathlinkerModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "pathlinker", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/pathlinkerRunModel" + }, + "default": { + "default": { + "k": 100 + } + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "pathlinkerModel", + "type": "object" + }, + "pathlinkerRunModel": { + "additionalProperties": false, + "properties": { + "k": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 100, + "description": "Number of paths", + "title": "K" + } + }, + "title": "pathlinkerRunModel", + "type": "object" + }, + "responsenetModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "responsenet", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/responsenetRunModel" + }, + "default": { + "default": { + "gamma": 10 + } + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include" + ], + "title": "responsenetModel", + "type": "object" + }, + "responsenetRunModel": { + "additionalProperties": false, + "properties": { + "gamma": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "default": 10, + "description": "The 'size' of the graph. The higher gamma is, the more flow\nis encouraged to start from the source nodes.", + "title": "Gamma" + } + }, + "title": "responsenetRunModel", + "type": "object" + }, + "rwrModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "rwr", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/rwrRunModel" + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include", + "runs" + ], + "title": "rwrModel", + "type": "object" + }, + "rwrRunModel": { + "additionalProperties": false, + "properties": { + "threshold": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "The number of nodes to return", + "title": "Threshold" + }, + "alpha": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The chance of a restart during the random walk", + "title": "Alpha" + } + }, + "required": [ + "threshold" + ], + "title": "rwrRunModel", + "type": "object" + }, + "spras__omicsintegrator1__DummyMode": { + "enum": [ + "terminals", + "all", + "others", + "file" + ], + "title": "DummyMode", + "type": "string" + }, + "spras__omicsintegrator2__DummyMode": { + "enum": [ + "terminals", + "others", + "all" + ], + "title": "DummyMode", + "type": "string" + }, + "strwrModel": { + "additionalProperties": false, + "properties": { + "name": { + "const": "strwr", + "title": "Name", + "type": "string" + }, + "include": { + "title": "Include", + "type": "boolean" + }, + "runs": { + "additionalProperties": { + "$ref": "#/$defs/strwrRunModel" + }, + "title": "Runs", + "type": "object" + } + }, + "required": [ + "name", + "include", + "runs" + ], + "title": "strwrModel", + "type": "object" + }, + "strwrRunModel": { + "additionalProperties": false, + "properties": { + "threshold": { + "anyOf": [ + { + "type": "integer" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "The number of nodes to return", + "title": "Threshold" + }, + "alpha": { + "anyOf": [ + { + "type": "number" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The chance of a restart during the random walk", + "title": "Alpha" + } + }, + "required": [ + "threshold" + ], + "title": "strwrRunModel", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "containers": { + "$ref": "#/$defs/ContainerSettings" + }, + "hash_length": { + "default": 7, + "description": "The length of the hash used to identify a parameter combination", + "title": "Hash Length", + "type": "integer" + }, + "algorithms": { + "items": { + "discriminator": { + "mapping": { + "allpairs": "#/$defs/allpairsModel", + "bowtiebuilder": "#/$defs/bowtiebuilderModel", + "domino": "#/$defs/dominoModel", + "meo": "#/$defs/meoModel", + "mincostflow": "#/$defs/mincostflowModel", + "omicsintegrator1": "#/$defs/omicsintegrator1Model", + "omicsintegrator2": "#/$defs/omicsintegrator2Model", + "pathlinker": "#/$defs/pathlinkerModel", + "responsenet": "#/$defs/responsenetModel", + "rwr": "#/$defs/rwrModel", + "strwr": "#/$defs/strwrModel" + }, + "propertyName": "name" + }, + "oneOf": [ + { + "$ref": "#/$defs/allpairsModel" + }, + { + "$ref": "#/$defs/bowtiebuilderModel" + }, + { + "$ref": "#/$defs/dominoModel" + }, + { + "$ref": "#/$defs/meoModel" + }, + { + "$ref": "#/$defs/mincostflowModel" + }, + { + "$ref": "#/$defs/omicsintegrator1Model" + }, + { + "$ref": "#/$defs/omicsintegrator2Model" + }, + { + "$ref": "#/$defs/pathlinkerModel" + }, + { + "$ref": "#/$defs/responsenetModel" + }, + { + "$ref": "#/$defs/rwrModel" + }, + { + "$ref": "#/$defs/strwrModel" + } + ] + }, + "title": "Algorithms", + "type": "array" + }, + "datasets": { + "items": { + "$ref": "#/$defs/Dataset" + }, + "title": "Datasets", + "type": "array" + }, + "gold_standards": { + "default": [], + "items": { + "$ref": "#/$defs/GoldStandard" + }, + "title": "Gold Standards", + "type": "array" + }, + "analysis": { + "$ref": "#/$defs/Analysis", + "default": { + "summary": { + "include": false + }, + "cytoscape": { + "include": false + }, + "ml": { + "aggregate_per_algorithm": false, + "components": 2, + "include": false, + "kde": false, + "labels": true, + "linkage": "ward", + "metric": "euclidean", + "remove_empty_pathways": false + }, + "evaluation": { + "aggregate_per_algorithm": false, + "include": false + } + } + }, + "reconstruction_settings": { + "$ref": "#/$defs/ReconstructionSettings" + } + }, + "required": [ + "containers", + "algorithms", + "datasets", + "reconstruction_settings" + ], + "title": "RawConfig", + "type": "object" +} \ No newline at end of file diff --git a/util/update_schema.py b/util/update_schema.py new file mode 100644 index 00000000..cb5e6992 --- /dev/null +++ b/util/update_schema.py @@ -0,0 +1,13 @@ +""" +Updates config/schema.json. +This should be done whenever a new algorithm is introduced, +or the config is otherwise directly changed. +""" + +import json +from pathlib import Path + +from spras.config.schema import RawConfig + +config_schema = RawConfig.model_json_schema() +Path('config', 'schema.json').write_text(json.dumps(config_schema, indent=2))