{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nmd-vcell.sema3c.chatgpt.site/resource/api/v1/external_candidate_evidence.schema.json",
  "title": "NMD-VCell external candidate evidence import record",
  "description": "A proposed evidence record. Schema validity does not authorize a candidate-status change.",
  "version": "1.0.0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "record_id", "gene", "event_date", "study_id", "record_status",
    "evidence_scope", "biological_context", "species", "model_system",
    "perturbation_type", "comparator", "endpoint_name", "endpoint_unit",
    "endpoint_direction", "result_class", "effect_measure", "effect_estimate",
    "ci_level", "ci_lower", "ci_upper", "standard_error", "p_value", "q_value",
    "n_hypotheses_tested", "multiple_testing_method", "n_units",
    "n_independent_replicates", "null_evidence_framework",
    "negligible_effect_lower", "negligible_effect_upper", "equivalence_p_value",
    "analysis_design", "determinism_class", "context_match_to_nmd_vcell",
    "independence_from_nmd_vcell", "data_reference", "data_sha256",
    "code_reference", "code_version", "code_sha256", "environment_reference",
    "source_reference", "source_reference_type", "author_attestation", "notes"
  ],
  "properties": {
    "record_id": {"type": "string", "minLength": 1},
    "gene": {"type": "string", "pattern": "^[A-Z0-9][A-Z0-9.-]*$"},
    "event_date": {"type": "string", "format": "date"},
    "study_id": {"type": "string", "minLength": 1},
    "record_status": {"const": "candidate_import"},
    "evidence_scope": {"type": "string", "minLength": 1},
    "biological_context": {"type": "string", "minLength": 1},
    "species": {"type": "string", "minLength": 1},
    "model_system": {"type": "string", "minLength": 1},
    "perturbation_type": {"type": "string", "minLength": 1},
    "comparator": {"type": "string", "minLength": 1},
    "endpoint_name": {"type": "string", "minLength": 1},
    "endpoint_unit": {"type": "string", "minLength": 1},
    "endpoint_direction": {"enum": ["higher_is_better", "lower_is_better", "two_sided"]},
    "result_class": {"enum": ["no_material_signal", "supportive_signal", "mixed", "inconclusive"]},
    "effect_measure": {"type": "string", "minLength": 1},
    "effect_estimate": {"type": "string"},
    "ci_level": {"type": "string"},
    "ci_lower": {"type": "string"},
    "ci_upper": {"type": "string"},
    "standard_error": {"type": "string"},
    "p_value": {"type": "string"},
    "q_value": {"type": "string"},
    "n_hypotheses_tested": {"type": "string"},
    "multiple_testing_method": {"type": "string"},
    "n_units": {"type": "string"},
    "n_independent_replicates": {"type": "string"},
    "null_evidence_framework": {"enum": ["equivalence_test", "confidence_interval_against_predeclared_margin", "noninferiority_test", "absence_not_tested"]},
    "negligible_effect_lower": {"type": "string"},
    "negligible_effect_upper": {"type": "string"},
    "equivalence_p_value": {"type": "string"},
    "analysis_design": {"type": "string", "minLength": 1},
    "determinism_class": {"enum": ["deterministic", "stochastic_seeded", "environment_sensitive"]},
    "context_match_to_nmd_vcell": {"enum": ["direct_same_endpoint_and_context", "partial_context_match", "cross_context_only", "unknown"]},
    "independence_from_nmd_vcell": {"enum": ["independent_external_project", "partially_overlapping_inputs", "same_project_reanalysis", "unknown"]},
    "data_reference": {"type": "string"},
    "data_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$|^$"},
    "code_reference": {"type": "string"},
    "code_version": {"type": "string"},
    "code_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$|^$"},
    "environment_reference": {"type": "string"},
    "source_reference": {"type": "string"},
    "source_reference_type": {"enum": ["", "accession", "doi", "repository_release", "internal_frozen_report", "other_traceable"]},
    "author_attestation": {"enum": ["", "true", "false"]},
    "notes": {"type": "string"}
  }
}
