{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "title": "IGF metadata validation schema",
    "description": "Schema for validation of metadata input file",
    "type": "array",
    "version": "1.0.1",
    "minItems": 1,
    "_uniqueItems": true,
    "items": {
        "type": "object",
        "properties": {
            "project_igf_id": {
                "type": "string",
                "pattern": "^IGF[a-zA-Z0-9-_]+$",
                "maxLength": 50
            },
            "name": {
                "type": "string",
                "pattern": "^\\w+\\s\\w+\\s?\\w+?$"
            },
            "hpc_username": {
                "type": "string",
                "pattern": "^\\S+$|^$"
            },
            "username": {
                "type": "string",
                "pattern": "^\\S+$|^$",
                "maxLength": 10
            },
            "email_id": {
                "type": "string",
                "pattern": "\\S+\\@\\S+\\.\\w+"
            },
            "sample_igf_id": {
                "type": "string",
                "pattern": "^IGF[a-zA-Z0-9-_]+$"
            },
            "sample_submitter_id": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9-]+$",
                "maxLength": 40
            },
            "barcode_check": {
                "type": "string",
                "enum": [
                    "ON",
                    "OFF",
                    ""
                ]
            },
            "species_name": {
                "type": "string",
                "enum": [
                    "HG38",
                    "HG19",
                    "HG19_MM10",
                    "UNKNOWN",
                    "MM10",
                    "MM9",
                    ""
                ]
            },
            "library_name": {
                "type": "string",
                "pattern": "^IGF[a-zA-Z0-9-_]+$|^$"
            },
            "library_source": {
                "type": "string",
                "enum": [
                    "GENOMIC",
                    "TRANSCRIPTOMIC",
                    "GENOMIC_SINGLE_CELL",
                    "TRANSCRIPTOMIC_SINGLE_CELL",
                    "METAGENOMIC",
                    "METATRANSCRIPTOMIC",
                    "SYNTHETIC",
                    "VIRAL_RNA",
                    "OTHER",
                    "UNKNOWN",
                    ""
                ]
            },
            "library_strategy": {
                "type": "string",
                "enum": [
                    "WGS",
                    "WGA",
                    "WXS",
                    "RNA-SEQ",
                    "MIRNA-SEQ",
                    "NCRNA-SEQ",
                    "FL-CDNA",
                    "EST",
                    "HI-C",
                    "ATAC-SEQ",
                    "DNASE-SEQ",
                    "WCS",
                    "RAD-SEQ",
                    "CLONE",
                    "POOLCLONE",
                    "AMPLICON",
                    "CLONEEND",
                    "FINISHING",
                    "CHIP-SEQ",
                    "MNASE-SEQ",
                    "DNASE-HYPERSENSITIVITY",
                    "BISULFITE-SEQ",
                    "CTS",
                    "MRE-SEQ",
                    "MEDIP-SEQ",
                    "MBD-SEQ",
                    "TN-SEQ",
                    "VALIDATION",
                    "FAIRE-SEQ",
                    "SELEX",
                    "RIP-SEQ",
                    "CHIA-PET",
                    "SYNTHETIC-LONG-READ",
                    "TARGETED-CAPTURE",
                    "TETHERED",
                    "NOME-SEQ",
                    "CHIRP SEQ",
                    "4-C-SEQ",
                    "5-C-SEQ",
                    "UNKNOWN",
                    ""
                ]
            },
            "experiment_type": {
                "type": "string",
                "enum": [
                    "POLYA-RNA",
                    "POLYA-RNA-3P",
                    "TOTAL-RNA",
                    "SMALL-RNA",
                    "WGS",
                    "WGA",
                    "WXS",
                    "WXS-UTR",
                    "RIBOSOME-PROFILING",
                    "RIBODEPLETION",
                    "16S",
                    "NCRNA-SEQ",
                    "FL-CDNA",
                    "EST",
                    "HI-C",
                    "DNASE-SEQ",
                    "WCS",
                    "RAD-SEQ",
                    "CLONE",
                    "POOLCLONE",
                    "AMPLICON",
                    "CLONEEND",
                    "FINISHING",
                    "DNASE-HYPERSENSITIVITY",
                    "RRBS-SEQ",
                    "WGBS",
                    "CTS",
                    "MRE-SEQ",
                    "MEDIP-SEQ",
                    "MBD-SEQ",
                    "TN-SEQ",
                    "VALIDATION",
                    "FAIRE-SEQ",
                    "SELEX",
                    "RIP-SEQ",
                    "CHIA-PET",
                    "SYNTHETIC-LONG-READ",
                    "TARGETED-CAPTURE",
                    "TETHERED",
                    "NOME-SEQ",
                    "CHIRP-SEQ",
                    "4-C-SEQ",
                    "5-C-SEQ",
                    "METAGENOMIC",
                    "METATRANSCRIPTOMIC",
                    "TF",
                    "H3K27ME3",
                    "H3K27AC",
                    "H3K9ME3",
                    "H3K36ME3",
                    "H3F3A",
                    "H3K4ME1",
                    "H3K79ME2",
                    "H3K79ME3",
                    "H3K9ME1",
                    "H3K9ME2",
                    "H4K20ME1",
                    "H2AFZ",
                    "H3AC",
                    "H3K4ME2",
                    "H3K4ME3",
                    "H3K9AC",
                    "HISTONE-NARROW",
                    "HISTONE-BROAD",
                    "CHIP-INPUT",
                    "ATAC-SEQ",
                    "TENX-TRANSCRIPTOME-3P",
                    "TENX-TRANSCRIPTOME-5P",
                    "DROP-SEQ-TRANSCRIPTOME",
                    "UNKNOWN",
                    ""
                ]
            },
            "library_layout": {
                "type": "string",
                "enum": [
                    "SINGLE",
                    "PAIRED",
                    "UNKNOWN",
                    ""
                ]
            },
            "fragment_length_distribution_mean": {
                "type": "string",
                "pattern": "^(\\d+)?\\.?(\\d+)?$|^$"
            },
            "fragment_length_distribution_sd": {
                "type": "string",
                "pattern": "^(\\d+)?\\.?(\\d+)?$|^$"
            },
            "insert_length": {
                "type": "string",
                "pattern": "^(\\d+)?\\.?(\\d+)?$|^$"
            },
            "adapter_seq1": {
                "type": "string",
                "pattern": "^[ATCG]+$|^$"
            },
            "adapter_seq2": {
                "type": "string",
                "pattern": "^[ATCG]+$|^$"
            },
            "adapter_removal": {
                "type": "string",
                "enum": [
                    "ON",
                    "OFF",
                    ""
                ]
            },
            "donor_anonymized_id": {
                "type": "string",
                "pattern": "^\\S+$|^$"
            },
            "phenotype": {
                "type": "string"
            },
            "treatment": {
                "type": "string"
            },
            "taxon_id": {
                "type": "string"
            },
            "scientific_name": {
                "type": "string"
            },
            "trait": {
                "type": "string"
            },
            "population": {
                "type": "string"
            },
            "sex": {
                "type": "string",
                "enum": [
                    "FEMALE",
                    "MALE",
                    "MIXED",
                    "UNKNOWN",
                    ""
                ]
            },
            "donor_age": {
                "type": "string",
                "pattern": "^(\\d+)?\\-?(\\d+)?\\w+$|^$"
            },
            "biomaterial_type": {
                "type": "string",
                "enum": [
                    "PRIMARY_TISSUE",
                    "PRIMARY_CELL",
                    "PRIMARY_CELL_CULTURE",
                    "CELL_LINE",
                    "SINGLE_NUCLEI",
                    "UNKNOWN",
                    ""
                ]
            },
            "cell_type": {
                "type": "string"
            },
            "tissue_type": {
                "type": "string"
            },
            "cell_line": {
                "type": "string"
            },
            "expected_reads": {
                "type": "string",
                "pattern": "^(\\d+)?$|^$"
            },
            "expected_lanes": {
                "type": "string",
                "pattern": "^(\\d+)?$|^$"
            }
        },
        "required": [
            "project_igf_id",
            "name",
            "email_id",
            "sample_igf_id"
        ]
    }
}