{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/./master/nextflow_schema.json",
  "title": ". pipeline parameters",
  "description": "Creating a GO database for a model organism",
  "type": "object",
  "$defs": {
    "input_output_options": {
      "title": "Input/output options",
      "type": "object",
      "fa_icon": "fas fa-terminal",
      "description": "Define where the pipeline should find input data and save output data.",
      "required": ["outdir"],
      "properties": {
        "input": {
          "type": "string",
          "format": "file-path",
          "exists": true,
          "mimetype": "text/csv",
          "pattern": "^\\S+\\.csv$",
          "description": "Path to comma-separated file containing information about the samples in the experiment. Required unless --input_tree and --input_orthogroups are both provided and neither --run_eggnog nor --stats is set.",
          "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row.",
          "fa_icon": "fas fa-file-csv"
        },
        "outdir": {
          "type": "string",
          "format": "directory-path",
          "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.",
          "fa_icon": "fas fa-folder-open",
          "default": "results"
        }
      }
    },
    "max_job_request_options": {
      "title": "Max job request options",
      "type": "object",
      "fa_icon": "fab fa-acquisitions-incorporated",
      "description": "Set the top limit for requested resources for any single job.",
      "help_text": "If you are running on a smaller system, a pipeline step requesting more resources than are available may cause the Nextflow to stop the run with an error. These options allow you to cap the maximum resources requested by any single job so that the pipeline will run on your system.\n\nNote that you can not _increase_ the resources requested by any job using these options. For that you will need your own configuration file. See [the nf-core website](https://nf-co.re/usage/configuration) for details.",
      "properties": {
        "max_cpus": {
          "type": "integer",
          "description": "Maximum number of CPUs that can be requested for any single job.",
          "default": 16,
          "fa_icon": "fas fa-microchip",
          "help_text": "Use to set an upper-limit for the CPU requirement for each process. Should be an integer e.g. `--max_cpus 1`"
        },
        "max_memory": {
          "type": "string",
          "description": "Maximum amount of memory that can be requested for any single job.",
          "default": "128.GB",
          "fa_icon": "fas fa-memory",
          "pattern": "^\\d+(\\.\\d+)?\\.?\\s*(K|M|G|T)?B$",
          "help_text": "Use to set an upper-limit for the memory requirement for each process. Should be a string in the format integer-unit e.g. `--max_memory '8.GB'`"
        },
        "max_time": {
          "type": "string",
          "description": "Maximum amount of time that can be requested for any single job.",
          "default": "48.h",
          "fa_icon": "far fa-clock",
          "pattern": "^(\\d+\\.?\\s*(s|m|h|d|day)\\s*)+$",
          "help_text": "Use to set an upper-limit for the time requirement for each process. Should be a string in the format integer-unit e.g. `--max_time '2.h'`"
        }
      }
    },
    "generic_options": {
      "title": "Generic options",
      "type": "object",
      "fa_icon": "fas fa-file-import",
      "description": "Less common options for the pipeline, typically set in a config file.",
      "help_text": "These options are common to all nf-core pipelines and allow you to customise some of the core preferences for how the pipeline runs.\n\nTypically these options would be set in a Nextflow config file loaded for all pipeline runs, such as `~/.nextflow/config`.",
      "properties": {
        "help": {
          "type": "boolean",
          "description": "Display help text.",
          "fa_icon": "fas fa-question-circle"
        },
        "publish_dir_mode": {
          "type": "string",
          "default": "copy",
          "description": "Method used to save pipeline results to output directory.",
          "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.",
          "fa_icon": "fas fa-copy",
          "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"]
        },
        "forks": {
          "type": "integer",
          "description": "Maximum number of each process that will be run in parallel"
        },
        "clean": {
          "type": "boolean",
          "description": "Enable cleanup function"
        },
        "architecture": {
          "type": "string",
          "default": "amd",
          "description": "An amd or arm value assigned to this parameter determines whether containers built for the amd or arm CPU architecture are used"
        },
        "custom_config": {
          "type": "string",
          "description": "A path/url to a custom configuration file"
        }
      }
    },
    "excon_options": {
      "title": "Excon options",
      "type": "object",
      "description": "",
      "default": "",
      "properties": {
        "ensembl_dataset": {
          "type": "string",
          "description": "A path to a file containing a list of ensembl biomart dataset names separated by newline"
        },
        "ensembl_biomart": {
          "type": "string",
          "description": "A biomart choice (e.g. ensembl)"
        },
        "predownloaded_fasta": {
          "type": "string",
          "description": "A path to a folder containing a singular or multiple fasta files for each species you wish to use for GO assignment"
        },
        "predownloaded_gofiles": {
          "type": "string",
          "description": "Path to a folder containing pre-computed gene-to-GO mapping files (one per species), as an alternative to running EggNOG-mapper. Each file must be named {species_id}.go.txt and contain two tab-separated columns: gene_id and GO term (one pair per line, e.g. 'geneA\\tGO:0006412'). Multiple GO terms for the same gene are given on separate lines."
        },
        "chromo_go": {
          "type": "boolean",
          "description": "A flag to optionally choose to run GO analysis on each chromosome"
        },
        "go_expansion": {
          "type": "boolean",
          "description": "A flag optionally choose to run a basic expansion/contraction analysis"
        },
        "skip_cafe": {
          "type": "boolean",
          "description": "A flag to skip the cafe section. Used if you just wish to run go assignment for a species without runnig Cafe"
        },
        "input_tree": {
          "type": "string",
          "format": "file-path",
          "exists": true,
          "description": "Path to a pre-computed rooted species tree in Newick format (e.g. SpeciesTree_rooted_node_labels.txt from a previous OrthoFinder run). Providing this together with --input_orthogroups skips the slow OrthoFinder step."
        },
        "input_orthogroups": {
          "type": "string",
          "format": "file-path",
          "exists": true,
          "description": "Path to a pre-computed Orthogroups.tsv from a previous OrthoFinder run. Must be provided together with --input_tree to skip OrthoFinder."
        },
        "groups": {
          "type": "string",
          "default": "all",
          "description": "A string with NCBI taxonomic groups to download. Can be a comma-separated list. Options are [\u2018all\u2019, \u2018archaea\u2019, \u2018bacteria\u2019, \u2018fungi\u2019, \u2018invertebrate\u2019, \u2018metagenomes\u2019, \u2018plant\u2019, \u2018protozoa\u2019, \u2018vertebrate_mammalian\u2019, \u2018vertebrate_other\u2019, \u2018viral\u2019]"
        },
        "stats": {
          "type": "boolean",
          "description": "A flag to run statistics and other quality checks on genomes and annotations. Based on BUSCO, QUAST a AGAT's spstatistics"
        },
        "busco_mode": {
          "type": "string",
          "default": "proteins",
          "description": "A flag to set the busco mode. Either genome, proteins, transcriptome"
        },
        "busco_lineage": {
          "type": "string",
          "default": "auto",
          "description": "A flag to set the busco lineage, default:auto"
        },
        "busco_lineages_path": {
          "type": "string",
          "description": "A flag to set the BUSCO lineages directory"
        },
        "busco_config": {
          "type": "string",
          "description": "A path to a BUSCO config file (optional)"
        },
        "go_cutoff": {
          "type": "number",
          "description": "Choose pval cutoff (default: 0.05)",
          "default": "0.05"
        },
        "go_type": {
          "type": "string",
          "description": "Choose pvalue type (e.g. bonferoni)",
          "default": "none"
        },
        "go_max_plot": {
          "type": "integer",
          "description": "Choose number of rows to plot in GO figure",
          "default": 10
        },
        "go_algo": {
          "type": "string",
          "description": "topGO algorithm and statistic combination (classic_fisher, weight01_t, elim_ks, weight_ks)",
          "default": "classic_fisher"
        },
        "orthofinder_v2": {
            "type": "boolean",
            "default": false,
            "description": "Use OrthoFinder v2.5.5 instead of v3.1.3. Recommended for large datasets where v3 stalls or fails."
        },
        "tree_scale_factor": {
            "type": "integer",
            "default": 1000,
            "description": "Scaling factor multiplied across all branch lengths by rescale_tree.py before CAFE5. chronos() in cafe_prep.R then converts the result to a proper time tree. Default 1000 prevents numerical precision issues in CAFE5."
        },
        "cafe_max_differential": {
            "type": "integer", 
            "default": 50,
            "description": "Maximum gene count differential threshold for CAFE filtering on retry."
        },
        "run_eggnog": {
            "type": "boolean",
            "default": false,
            "description": "Run EggNOG-mapper GO annotation pipeline."
        },
        "eggnog_data_dir": {
            "type": "string",
            "description": "Path to pre-downloaded EggNOG database directory. If null, database will be downloaded automatically."
        },
"eggnog_tax_scope": {
    "anyOf": [
        {"type": "string", "pattern": "^[0-9]+(,[0-9]+)*$"},
        {"type": "integer"}
    ],
    "description": "Taxonomic scope for eggNOG OG level selection (e.g. 50557 for Insecta, or comma-separated list '50557,7399')"
},
"eggnog_target_taxa": {
    "anyOf": [
        {"type": "string", "pattern": "^[0-9]+(,[0-9]+)*$"},
        {"type": "integer"}
    ],
    "description": "Restrict eggNOG-mapper to orthologs from this taxon and descendants (NCBI taxon ID)"
},
  "eggnog_evalue": {
    "type": "number",
    "description": "eggNOG-mapper e-value threshold"
  },
  "eggnog_score": {
    "type": "number",
    "description": "eggNOG-mapper minimum bitscore"
  },
  "eggnog_pident": {
    "type": "number",
    "description": "eggNOG-mapper minimum percent identity"
  },
  "eggnog_query_cover": {
    "type": "number",
    "description": "eggNOG-mapper minimum query coverage percent"
  },
  "eggnog_subject_cover": {
    "type": "number",
    "description": "eggNOG-mapper minimum subject coverage percent"
  },
  "eggnog_rep_species": {
    "type": "string",
    "description": "Species ID to use as the representative when building the OG annotation summary. If unset, the species with the most annotated genes is chosen automatically."
  },
  "cafe_max_k": {
    "type": "integer",
    "default": 6,
    "description": "Maximum number of gamma rate categories (k) to test in CAFE5 model selection."
  }


      }
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/input_output_options"
    },
    {
      "$ref": "#/$defs/max_job_request_options"
    },
    {
      "$ref": "#/$defs/generic_options"
    },
    {
      "$ref": "#/$defs/excon_options"
    }
  ]
}
