{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "SimpleComment": {
      "type": "object",
      "properties": {},
      "SimpleComment": [
        "Configuration file for Mikado. Please note that absent values, e.g. if a field is deleted, will be imputed by the default values for the program.",
        "Sections:",
        "- log_settings: settings related to the verbosity of logs.",
        "- db_settings: Database settings, for Mikado serialise and pick.",
        "- reference: Settings related to the genome reference.",
        "- prepare: settings related to the Mikado prepare stage",
        "- serialise: settings related to the Mikado serialise stage",
        "- pick: settings related to the Mikado pick stage",
        "- multiprocessing_method: which method (fork, spawn, forkserver) Mikado should use for multiprocessing."
      ],
      "Comment": [
        "Configuration file for Mikado.  Please note that absent values, e.g. if a field is deleted, will be imputed by the default values for the program.",
        "Sections:",
        "- log_settings: settings related to the verbosity of logs.",
        "- db_settings: Database settings, for Mikado serialise and pick.",
        "- reference: Settings related to the genome reference.",
        "- prepare: settings related to the Mikado prepare stage",
        "- serialise: settings related to the Mikado serialise stage",
        "- pick: settings related to the Mikado pick stage",
        "- multiprocessing_method: which method (fork, spawn, forkserver) Mikado should use for multiprocessing."
      ]
    },
    "threads": {
      "type": "integer",
      "default": 4,
      "Comment": "Threads to be used per process.",
      "minimum": 1
    },
    "seed": {
      "type": [
        "integer"
      ],
      "default": 0
    },
    "multiprocessing_method": {
      "type": "string",
      "default": "spawn",
      "enum": [
        "fork",
        "spawn",
        "forkserver",
        ""
      ]
    },
    "log_settings": {
      "Comment": [
        "Settings related to the logs. Keys:",
        "- sql_level: verbosity for SQL calls. Default: WARNING. In decreasing order: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'",
        "- log_level: verbosity. Default: INFO. In decreasing order: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'"
      ],
      "SimpleComment": [
        "Settings related to the logs. Keys:",
        "- log_level: verbosity. Default: INFO. In decreasing order: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'"
      ],
      "type": "object",
      "properties": {
        "log_level": {
          "type": "string",
          "enum": [
            "DEBUG",
            "INFO",
            "WARNING",
            "ERROR",
            "CRITICAL"
          ],
          "default": "INFO"
        },
        "sql_level": {
          "type": "string",
          "enum": [
            "DEBUG",
            "INFO",
            "WARNING",
            "ERROR",
            "CRITICAL"
          ],
          "default": "WARNING"
        },
        "log": {
          "type": [
            "null",
            "string"
          ],
          "default": ""
        }
      }
    },
    "db_settings": {
      "Comment": [
        "Settings related to DB connection. Parameters:",
        "db: the DB to connect to. Required. Default: mikado.db",
        "dbtype: Type of DB to use. Choices: sqlite, postgresql, mysql. Default: sqlite.",
        "dbhost: Host of the database. Unused if dbtype is sqlite. Default: localhost",
        "dbuser: DB user. Default: ''",
        "dbpasswd: DB password for the user. Default: empty string.",
        "dbport: Integer. It indicates the default port for the DB."
      ],
      "SimpleComment": [
        "Settings related to DB connection. Parameters:",
        "db: the DB to connect to. Required. Default: mikado.db",
        "dbtype: Type of DB to use. Choices: sqlite, postgresql, mysql. Default: sqlite."
      ],
      "type": "object",
      "properties": {
        "db": {
          "default": "mikado.db",
          "type": "string"
        },
        "dbtype": {
          "default": "sqlite",
          "enum": [
            "mysql",
            "postgresql",
            "sqlite"
          ],
          "type": "string"
        },
        "dbhost": {
          "format": "hostname",
          "default": "localhost"
        },
        "dbuser": {
          "type": "string",
          "default": ""
        },
        "dbpasswd": {
          "type": "string",
          "default": ""
        },
        "dbport": {
          "type": "integer",
          "default": 0
        }
      },
      "required": [
        "dbtype",
        "db"
      ]
    },
    "serialise": {
      "type": "object",
      "Comment": [
        "Options related to serialisation",
        "- force: whether to drop and reload everything into the DB",
        "- files: options related to input files",
        "- max_objects: Maximum number of objects to keep in memory while loading data into the database",
        "- max_regression: if the ORF lacks a valid start site, this percentage indicates how far",
        "  along the sequence Mikado should look for a good start site. Eg. with a value of 0.1,",
        "  on a 300bp sequence with an open ORF Mikado would look for an alternative in-frame start codon",
        "  in the first 30 bps (10% of the cDNA).",
        "- max_target_seqs: equivalently to BLAST, it indicates the maximum number of targets to keep",
        "  per blasted sequence.",
        "- discard_definition: Boolean. **Deprecated**, it was used for specifying how to load BLAST files.",
        "- single_thread: if true, Mikado prepare will force the usage of a single thread in this step."
      ],
      "SimpleComment": [
        "Options related to serialisation",
        "- max_regression: if the ORF lacks a valid start site, this percentage indicates how far",
        "  along the sequence Mikado should look for a good start site. Eg. with a value of 0.1,",
        "  on a 300bp sequence with an open ORF Mikado would look for an alternative in-frame start codon",
        "  in the first 30 bps (10% of the cDNA)."
      ],
      "required": [
        "max_regression"
      ],
      "properties": {
        "files": {
          "type": "object",
          "Comment": [],
          "SimpleComment": [],
          "required": [
            "transcripts"
          ],
          "properties": {
            "junctions": {
              "type": "array",
              "default": [],
              "optional": false
            },
            "xml": {
              "type": "array",
              "default": []
            },
            "blast_loading_debug": {
              "type": "boolean",
              "default": false
            },
            "external_scores": {
              "type": [
                "string",
                "null"
              ],
              "default": ""
            },
            "orfs": {
              "type": "array",
              "default": []
            },
            "transcripts": {
              "type": "string",
              "default": "mikado_prepared.fasta"
            },
            "log": {
              "type": "string",
              "default": "serialise.log"
            },
            "blast_targets": {
              "type": "array",
              "default": []
            },
            "output_dir": {
              "type": "string",
              "default": "."
            }
          }
        },
        "substitution_matrix": {
          "enum": [
            "blosum45",
            "blosum50",
            "blosum62",
            null,
            "blosum80",
            "blosum90",
            "pam250",
            "pam30",
            "pam70"
          ],
          "default": "blosum62"
        },
        "blast_flavour": {
          "enum": [
            "blastx",
            "blastp"
          ],
          "default": "blastx"
        },
        "max_objects": {
          "type": "integer",
          "default": 10000000,
          "minimum": 1
        },
        "max_regression": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.2
        },
        "start_adjustment": {
          "type": "boolean",
          "default": true
        },
        "max_target_seqs": {
          "type": "integer",
          "default": 100000,
          "minimum": 1
        },
        "force": {
          "type": "boolean",
          "default": false
        },
        "single_thread": {
          "type": "boolean",
          "default": false
        },
        "codon_table": {
          "enum": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            "Standard",
            "SGC0",
            "Vertebrate Mitochondrial",
            "SGC1",
            "Yeast Mitochondrial",
            "SGC2",
            "Mold Mitochondrial",
            "Protozoan Mitochondrial",
            "Coelenterate Mitochondrial",
            "Mycoplasma",
            "Spiroplasma",
            "SGC3",
            "Invertebrate Mitochondrial",
            "SGC4",
            "Ciliate Nuclear",
            "Dasycladacean Nuclear",
            "Hexamita Nuclear",
            "SGC5",
            "Echinoderm Mitochondrial",
            "Flatworm Mitochondrial",
            "SGC8",
            "Euplotid Nuclear",
            "SGC9",
            "Bacterial",
            "Archaeal",
            "Plant Plastid",
            "Alternative Yeast Nuclear",
            "Ascidian Mitochondrial",
            "Alternative Flatworm Mitochondrial",
            "Blepharisma Macronuclear",
            "Chlorophycean Mitochondrial",
            "Trematode Mitochondrial",
            "Scenedesmus obliquus Mitochondrial",
            "Thraustochytrium Mitochondrial",
            "Pterobranchia Mitochondrial",
            "Candidate Division SR1",
            "Gracilibacteria",
            "Pachysolen tannophilus Nuclear",
            "Karyorelict Nuclear",
            "Condylostoma Nuclear",
            "Mesodinium Nuclear",
            "Peritrich Nuclear",
            "Blastocrithidia Nuclear"
          ],
          "default": 0
        }
      }
    },
    "prepare": {
      "type": "object",
      "Comment": [
        "Options related to the input data preparation.",
        "- files: options relative to the input/output files.",
        "- strip_cds: whether to remove the CDS from the predictions during preparation.",
        "- lenient: if set to True, invalid transcripts will be only flagged and not removed. EXPERIMENTAL.",
        "- strand_specific: if set to True, transcripts will be assumed to be in the correct orientation, no strand flipping or removal",
        "- strand_specific_assemblies: array of input predictions which are to be considered as strand-specific.",
        "  Predictions not in this list will be considered as non-strand-specific.",
        "- canonical: canonical splice sites, to infer the correct orientation."
      ],
      "SimpleComment": [
        "Options related to the input data preparation.",
        "- procs: Number of processes to use.",
        "- strand_specific: if set to True, transcripts will be assumed to be in the correct orientation, no strand flipping or removal",
        "- strip_cds: Boolean. It indicates whether to remove the CDS from the predictions during preparation."
      ],
      "required": [
        "files",
        "strand_specific"
      ],
      "properties": {
        "keep_redundant": {
          "type": "boolean",
          "default": false
        },
        "minimum_cdna_length": {
          "type": "integer",
          "default": 200,
          "minimum": 1
        },
        "max_intron_length": {
          "type": "integer",
          "default": 1000000,
          "minimum": 20
        },
        "files": {
          "Comment": [
            "Options related to the input and output files.",
            "- out: output GTF file",
            "- out_fasta: output transcript FASTA file",
            "- gff: array of input predictions for this step.",
            "- log: output log. Default: prepare.log",
            "- labels: labels to be associated with the input GFFs. Default: None.",
            "- reference: these files are treated as reference-like, ie, these transcripts will never get discarded",
            "  during the preparation step.",
            "- source_score: optional scores to be given to each different source files. Default: none,",
            " ie no source-specific score is applied."
          ],
          "SimpleComment": [
            "Options related to the input and output files.",
            "- out: output GTF file",
            "- out_fasta: output transcript FASTA file",
            "- gff: array of input predictions for this step.",
            "- labels: labels to be associated with the input GFFs. Default: None.",
            "- reference: these files are treated as reference-like, ie, these transcripts will never get discarded",
            "  during the preparation step."
          ],
          "type": "object",
          "required": [
            "out",
            "out_fasta",
            "gff"
          ],
          "properties": {
            "output_dir": {
              "type": "string",
              "default": "."
            },
            "out": {
              "type": "string",
              "default": "mikado_prepared.gtf"
            },
            "out_fasta": {
              "type": "string",
              "default": "mikado_prepared.fasta"
            },
            "log": {
              "type": "string",
              "default": "prepare.log"
            },
            "gff": {
              "type": "array",
              "default": []
            },
            "labels": {
              "type": "array",
              "default": []
            },
            "strand_specific_assemblies": {
              "type": "array",
              "default": []
            },
            "reference": {
              "type": "array",
              "default": []
            },
            "keep_redundant": {
              "type": "array",
              "default": []
            },
            "source_score": {
              "type": "object",
              "default": {},
              "properties": {
                "source": {
                  "type": "string"
                },
                "score": {
                  "type": "number"
                }
              }
            }
          }
        },
        "strip_cds": {
          "type": "boolean",
          "default": false
        },
        "single": {
          "type": "boolean",
          "default": false
        },
        "lenient": {
          "type": "boolean",
          "default": false
        },
        "strand_specific": {
          "type": "boolean",
          "default": false
        },
        "canonical": {
          "type": "array",
          "default": [
            [
              "GT",
              "AG"
            ],
            [
              "GC",
              "AG"
            ],
            [
              "AT",
              "AC"
            ]
          ]
        }
      }
    },
    "pick": {
      "type": "object",
      "required": [
        "scoring_file"
      ],
      "Comment": [
        "- scoring_file: a scoring file for the analysis. Default: plant.yaml.",
        "- source_score: a dictionary with pre-defined scores to assign to the transcripts according to their source. Eg all Cufflinks transcripts from the seed (label: \"cuff_seed\") could be assigned a default additional score of 1."
      ],
      "SimpleComment": [
        "Parameters related to the Mikado pick stage.",
        "- alternative_splicing: Parameters related to which AS events to consider as valid during picking.",
        "- chimera_split: parameters related to splitting of transcripts in the presence of multiple ORFs",
        "- files: input and output files",
        "- run_options: generic options related to the run, eg number of processors to use.",
        "- scoring_file: a scoring file for the analysis. Default: plant.yaml."
      ],
      "properties": {
        "scoring_file": {
          "type": "string",
          "default": "plant.yaml"
        },
        "alternative_splicing": {
          "Comment": [
            "Parameters related to alternative splicing reporting.",
            "- report: whether to report at all or not the AS events.",
            "- min_cds_overlap: minimum overlap between the CDS of the primary transcript and any AS event. Default: 60%.",
            "- min_cdna_overlap: minimum overlap between the CDNA of the primary transcript and any AS event.",
            "Default: 0% i.e. disabled, we check for the CDS overlap.",
            "- keep_retained_introns: Whether to consider as valid AS events where one intron",
            "- max_isoforms: Maximum number of isoforms per locus. 1 implies no AS reported. Default: 5",
            "is retained compared to the primary or any other valid AS. Default: false.",
            "- valid_ccodes: Valid class codes for AS events. Valid codes are in categories",
            "'Alternative splicing', 'Extension' (with junction F1 lower than 100%), and Overlap (exluding m). Default: j, J, g, G, C, h",
            "- max_utr_length: Maximum length of the UTR for AS events. Default: 10e6 (i.e. no limit)",
            "- max_fiveutr_length: Maximum length of the 5'UTR for AS events. Default: 10e6 (i.e. no limit)",
            "- max_threeutr_length: Maximum length of the 5'UTR for AS events. Default: 10e6 (i.e. no limit)",
            "- min_score_perc: Minimum score threshold for subsequent AS events. Only transcripts with a score at least (best) * value are retained.",
            "- only_confirmed_introns: bring back AS events only when their introns are either present in the primary transcript or in the set of confirmed introns.",
            "- pad: boolean switch. If true, Mikado will pad all the transcript in a gene so that their ends are the same",
            "- ts_distance: if padding, this is the maximum distance in base-pairs between the starts of transcripts to be considered to be padded together.",
            "- ts_max_splices: if padding, this is the maximum amount of splicing junctions that the transcript to pad is allowed to cross. If padding would lead to cross more than this number, the transcript will not be padded."
          ],
          "SimpleComment": [
            "Parameters related to alternative splicing reporting.",
            "- report: whether to report at all or not the AS events.",
            "- only_confirmed_introns: bring back AS events only when their introns are either",
            " present in the primary transcript or in the set of confirmed introns.",
            "- pad: boolean switch. If true, Mikado will pad all the transcript in a gene so that their ends are the same"
          ],
          "required": [
            "report",
            "only_confirmed_introns",
            "pad"
          ],
          "type": "object",
          "properties": {
            "report": {
              "type": "boolean",
              "default": true
            },
            "min_cds_overlap": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.5
            },
            "min_cdna_overlap": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0.6
            },
            "keep_retained_introns": {
              "type": "boolean",
              "default": true
            },
            "keep_cds_disrupted_by_ri": {
              "type": "boolean",
              "default": false
            },
            "max_isoforms": {
              "type": "integer",
              "minimum": 1,
              "default": 10
            },
            "valid_ccodes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "j",
                  "e",
                  "o",
                  "h",
                  "J",
                  "C",
                  "g",
                  "G",
                  "=",
                  "n",
                  "_"
                ]
              },
              "default": [
                "j",
                "J",
                "G",
                "h"
              ]
            },
            "redundant_ccodes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "j",
                  "n",
                  "O",
                  "e",
                  "o",
                  "h",
                  "J",
                  "C",
                  "c",
                  "m",
                  "mo",
                  "=",
                  "_",
                  "x",
                  "p",
                  "P",
                  "X",
                  "I",
                  "i"
                ]
              },
              "default": [
                "c",
                "m",
                "_",
                "=",
                "n"
              ]
            },
            "min_score_perc": {
              "type": "number",
              "default": 0.5,
              "minimum": 0,
              "maximum": 1
            },
            "only_confirmed_introns": {
              "type": "boolean",
              "default": true
            },
            "ts_distance": {
              "type": "integer",
              "default": 2000,
              "minimum": 0
            },
            "pad": {
              "type": "boolean",
              "default": true
            },
            "ts_max_splices": {
              "type": "integer",
              "minimum": 0,
              "default": 2
            }
          }
        },
        "output_format": {
          "Comment": [
            "Parameters related to the output format.",
            "  - source: prefix for the source field in the mikado output.",
            "  - id_prefix: prefix for the ID of the genes/transcripts in the output"
          ],
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "default": "Mikado"
            },
            "id_prefix": {
              "type": "string",
              "default": "mikado"
            },
            "report_all_orfs": {
              "type": "boolean",
              "default": false
            }
          }
        },
        "orf_loading": {
          "type": "object",
          "Comment": [
            "Parameters related to ORF loading.",
            "- minimal_secondary_orf_length: Minimum length of a *secondary* ORF to be loaded after the first, in bp. Default: 200 bps",
            "- minimal_orf_length: Minimum length in bps of an ORF to be loaded, as the primary ORF, onto a transcript. Default: 50 bps",
            "- strand_specific: Boolean flag. If set to true, monoexonic transcripts will not have their ORF reversed even if they would have an ORF on the opposite strand."
          ],
          "properties": {
            "minimal_secondary_orf_length": {
              "type": "integer",
              "default": 200,
              "minimum": 0
            },
            "minimal_orf_length": {
              "type": "integer",
              "default": 50,
              "minimum": 0
            },
            "strand_specific": {
              "type": "boolean",
              "default": true
            }
          }
        },
        "chimera_split": {
          "Comment": [
            "Parameters related to the splitting of transcripts in the presence of",
            "two or more ORFs. Parameters:",
            "- execute: whether to split multi-ORF transcripts at all. Boolean.",
            "- blast_check: whether to use BLAST information to take a decision. See blast_params for details.",
            "- blast_params: Parameters related to which BLAST data we want to analyse."
          ],
          "SimpleComment": [
            "Parameters related to the splitting of transcripts in the presence of",
            "two or more ORFs. Parameters:",
            "- execute: whether to split multi-ORF transcripts at all. Boolean.",
            "- blast_check: whether to use BLAST information to take a decision. See blast_params for details.",
            "- blast_params: Parameters related to which BLAST data we want to analyse."
          ],
          "type": "object",
          "properties": {
            "blast_check": {
              "type": "boolean",
              "default": true
            },
            "execute": {
              "type": "boolean",
              "default": true
            },
            "skip": {
              "type": "array",
              "default": []
            },
            "blast_params": {
              "type": "object",
              "Comment": [
                "Parameters for the BLAST check prior to splitting.",
                "- evalue: Minimum evalue for the whole hit. Default: 1e-6",
                "- hsp_evalue: Minimum evalue for any HSP hit (some might be discarded even if the whole hit is valid). Default: 1e-6",
                "- leniency: One of 'STRINGENT', 'LENIENT', 'PERMISSIVE'. Default: STRINGENT",
                "- max_target_seqs: maximum number of hits to consider. Default: 3",
                "- minimal_hsp_overlap: minimum overlap of the ORF with the HSP (*not* reciprocal). Default: 0.8, i.e. 80%",
                "- min_overlap_duplication: minimum overlap (in %) for two ORFs to consider them as target duplications. This means that if two ORFs have no HSPs in common, but the coverage of their disjoint HSPs covers more than this % of the length of the *target*, they represent most probably a duplicated gene."
              ],
              "SimpleComment": [
                "Parameters for the BLAST check prior to splitting.",
                "- evalue: Minimum evalue for the whole hit. Default: 1e-6",
                "- leniency: One of 'STRINGENT', 'LENIENT', 'PERMISSIVE'. Default: STRINGENT",
                "- max_target_seqs: maximum number of hits to consider. Default: 3"
              ],
              "properties": {
                "evalue": {
                  "type": "number",
                  "minimum": 0,
                  "default": 1E-06
                },
                "hsp_evalue": {
                  "type": "number",
                  "minimum": 0,
                  "default": 1E-06
                },
                "leniency": {
                  "type": "string",
                  "enum": [
                    "STRINGENT",
                    "LENIENT",
                    "PERMISSIVE"
                  ],
                  "default": "STRINGENT"
                },
                "max_target_seqs": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 3
                },
                "minimal_hsp_overlap": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "default": 0.5
                },
                "min_overlap_duplication": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "default": 0.8
                }
              }
            }
          },
          "required": [
            "blast_check",
            "execute"
          ]
        },
        "run_options": {
          "type": "object",
          "required": [
            "single_thread"
          ],
          "Comment": [
            "Generic run options.",
            "- shm: boolean flag. If set and the DB is sqlite, it will be copied onto the /dev/shm faux partition",
            "- exclude_cds: boolean flag. If set, the CDS information will not be printed in Mikado output. Default: false",
            "- single_thread: boolean flag. If set, multithreading will be disabled - useful for profiling and debugging."
          ],
          "SimpleComment": [
            "Generic run options.",
            "- intron_range: A range where most of the introns (99%) should fall into. Transcripts with too many",
            " introns larger or smaller than what is defined in this range will be penalised",
            " in the scoring. Default: [60, 900]",
            "- shm: boolean flag. If set and the DB is sqlite, it will be copied onto the /dev/shm faux partition",
            "- single_thread: boolean flag. If set, multithreading will be disabled - useful for profiling and debugging."
          ],
          "properties": {
            "shm": {
              "type": "boolean",
              "default": false
            },
            "exclude_cds": {
              "type": "boolean",
              "default": false
            },
            "intron_range": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0
              },
              "_uniqueItems": true,
              "maxItems": 2,
              "minItems": 2,
              "default": [
                60,
                10000
              ]
            },
            "only_reference_update": {
              "type": "boolean",
              "default": false
            },
            "check_references": {
              "type": "boolean",
              "default": false
            },
            "single_thread": {
              "type": "boolean",
              "default": false
            }
          }
        },
        "clustering": {
          "type": "object",
          "Comment": [
            "Parameters related to the clustering of transcripts into loci.",
            "- cds_only: boolean, it specifies whether to cluster transcripts only according to their CDS (if present).",
            "- min_cds_overlap: minimal CDS overlap for the second clustering.",
            "- min_cdna_overlap: minimal cDNA overlap for the second clustering.",
            "- flank: maximum distance for transcripts to be clustered within the same superlocus.",
            "- remove_overlapping_fragments: boolean, it specifies whether to remove putative fragments.",
            "- purge: boolean, it specifies whether to remove transcripts which fail the minimum requirements check - or whether to ignore those requirements altogether.",
            "- simple_overlap_for_monoexonic: boolean. If set to true (default), then any overlap mean inclusion in a locus for or against a monoexonic transcript. If set to false, normal controls for the percentage of overlap will apply.",
            "- max_distance_for_fragments: maximum distance from a valid locus for another to be considered a fragment."
          ],
          "SimpleComment": [
            "Parameters related to the clustering of transcripts into loci.",
            "- flank: maximum distance for transcripts to be clustered within the same superlocus."
          ],
          "properties": {
            "cds_only": {
              "type": "boolean",
              "default": false
            },
            "min_cds_overlap": {
              "type": "number",
              "minimum": 1E-06,
              "maximum": 1,
              "default": 0.2
            },
            "min_cdna_overlap": {
              "type": "number",
              "minimum": 1E-06,
              "maximum": 1,
              "default": 0.2
            },
            "purge": {
              "type": "boolean",
              "default": true
            },
            "flank": {
              "type": "integer",
              "minimum": 0,
              "default": 200
            },
            "simple_overlap_for_monoexonic": {
              "type": "boolean",
              "default": true
            }
          }
        },
        "fragments": {
          "type": "object",
          "Comment": [
            "Parameters related to the handling of fragments.",
            "- remove: boolean. Whether to remove fragments or leave them, properly tagged.",
            "- max_distance: maximum distance of a putative fragment from a valid gene.",
            "- valid_class_codes: which class codes will be considered as fragments. Default: (p, P, x, X, i, m, _). Choices: '_' plus any class code with category 'Intronic', 'Fragment', or 'Overlap'."
          ],
          "SimpleComment": [
            "Parameters related to the handling of fragments.",
            "- remove: boolean. Whether to remove fragments or leave them, properly tagged."
          ],
          "properties": {
            "remove": {
              "type": "boolean",
              "default": true
            },
            "max_distance": {
              "type": "number",
              "minimum": 0,
              "default": 2000
            },
            "valid_class_codes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "p",
                  "P",
                  "i",
                  "I",
                  "ri",
                  "rI",
                  "x",
                  "X",
                  "m",
                  "_",
                  "e",
                  "o"
                ]
              },
              "default": [
                "p",
                "P",
                "x",
                "X",
                "i",
                "m",
                "_",
                "e",
                "o"
              ]
            }
          }
        },
        "files": {
          "type": "object",
          "Comment": [
            "Input and output files for Mikado pick.",
            "- gff: input GTF/GFF3 file. Default: mikado_prepared.gtf",
            "- loci_out: output GFF3 file from Mikado pick. Default: mikado.loci.gff3",
            "- subloci_out: optional GFF file with the intermediate subloci. Default: no output",
            "- monoloci_out: optional GFF file with the intermediate monoloci. Default: no output",
            "- log: log file for this step."
          ],
          "SimpleComment": [
            "Input and output files for Mikado pick.",
            "- gff: input GTF/GFF3 file. Default: mikado_prepared.gtf",
            "- loci_out: output GFF3 file from Mikado pick. Default: mikado.loci.gff3",
            "- subloci_out: optional GFF file with the intermediate subloci. Default: no output",
            "- monoloci_out: optional GFF file with the intermediate monoloci. Default: no output",
            "- log: log file for this step."
          ],
          "required": [
            "input"
          ],
          "properties": {
            "output_dir": {
              "type": "string",
              "default": "."
            },
            "input": {
              "type": "string",
              "default": "mikado_prepared.gtf"
            },
            "loci_out": {
              "type": "string",
              "default": "mikado.loci.gff3"
            },
            "subloci_out": {
              "type": [
                "string",
                "null"
              ],
              "default": ""
            },
            "monoloci_out": {
              "type": [
                "string",
                "null"
              ],
              "default": ""
            },
            "log": {
              "type": [
                "string",
                "null"
              ],
              "default": "pick.log"
            }
          }
        }
      }
    },
    "reference": {
      "type": "object",
      "Comment": [
        "Options related to the reference genome.",
        "- genome: the genome FASTA file. Required",
        "- genome_fai: the corresponding FAI for the genome. Inferred if absent.",
        "- transcriptome: a GTF/GFF reference transcriptome. Currently ignored."
      ],
      "required": [
        "genome"
      ],
      "anyOf": [
        {
          "required": [
            "genome"
          ]
        },
        {
          "required": [
            "genome_fai",
            "transcriptome"
          ]
        }
      ],
      "properties": {
        "genome": {
          "type": "string",
          "default": ""
        },
        "genome_fai": {
          "type": [
            "string"
          ],
          "default": ""
        },
        "transcriptome": {
          "type": [
            "string"
          ],
          "default": ""
        }
      }
    }
  }
}