{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "trimgalore",
  "description": "A wrapper tool around Cutadapt and FastQC to consistently apply quality and adapter trimming to FastQ files. \n",
  "type": "object",
  "$defs": {
    "input": {
      "title": "Input",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "exists": true,
          "description": "Input files",
          "help_text": "Type: `file`, multiple: `True`, required, direction: `input`, example: `[\"sample1_r1.fq;sample1_r2.fq;sample2_r1.fq;sample2_r2.fq\"]`. "
        }
      }
    },
    "trimming options": {
      "title": "Trimming options",
      "type": "object",
      "description": "No description",
      "properties": {
        "quality": {
          "type": "integer",
          "description": "Trim low-quality ends (below the specified Phred score) from reads in addition to adapter removal",
          "help_text": "Type: `integer`, multiple: `False`, example: `20`. "
        },
        "phred33": {
          "type": "boolean",
          "description": "Instructs Cutadapt to use ASCII+33 quality scores as Phred scores (Sanger/Illumina 1.9+ encoding) for quality trimming.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "phred64": {
          "type": "boolean",
          "description": "Instructs Cutadapt to use ASCII+64 quality scores as Phred scores (Illumina 1.5 encoding) for quality trimming.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "fastqc": {
          "type": "boolean",
          "description": "Run FastQC in the default mode on the FastQ file once trimming is complete.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "fastqc_args": {
          "type": "string",
          "description": "Passes extra arguments (excluding files) to FastQC",
          "help_text": "Type: `string`, multiple: `False`, example: `\"--nogroup --noextract\"`. "
        },
        "fastqc_contaminants": {
          "type": "string",
          "format": "path",
          "description": "Specifies a non-default file which contains the list of contaminants for FastQC to screen overrepresented sequences against",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"contaminants.txt\"`. "
        },
        "fastqc_adapters": {
          "type": "string",
          "format": "path",
          "description": "Specifies a non-default file which contains the list of adapter sequences which which FasstQC will explicity search against the library",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"adapters.txt\"`. "
        },
        "fastqc_limits": {
          "type": "string",
          "format": "path",
          "description": "Specifies a non-default file which contains a set of criteria which FastQC will use to determine the warn/error limits for the various modules",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"limits.txt\"`. "
        },
        "adapter": {
          "type": "string",
          "description": "Adapter sequence to be trimmed",
          "help_text": "Type: `string`, multiple: `False`, example: `\"AGCTCCCG\"`. "
        },
        "adapter2": {
          "type": "string",
          "description": "Optional adapter sequence to be trimmed off read 2 of paired-end files",
          "help_text": "Type: `string`, multiple: `False`, example: `\"AGCTCCCG\"`. "
        },
        "illumina": {
          "type": "boolean",
          "description": "Adapter sequence to be trimmed is the first 13bp of the Illumina universal adapter 'AGATCGGAAGAGC' instead of the default auto-detection of adapter sequence.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "stranded_illumina": {
          "type": "boolean",
          "description": "Adapter sequence to be trimmed is the first 13bp of the Illumina stranded mRNA or Total RNA adapter 'ACTGTCTCTTATA' instead of the default auto-detection of adapter sequence.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "nextera": {
          "type": "boolean",
          "description": "Adapter sequence to be trimmed is the first 12bp of the Nextera adapter 'CTGTCTCTTATA' instead of the default auto-detection of adapter sequence.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "small_rna": {
          "type": "boolean",
          "description": "Adapter sequence to be trimmed is the first 12bp of the Illumina Small RNA 3' Adapter 'TGGAATTCTCGG' instead of the default auto-detection of adapter sequence",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "consider_already_trimmed": {
          "type": "integer",
          "description": "During adapter auto-detection, the limit set by this argument allows the user to set a threshold up to which the file is considered already adapter-trimmed",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "max_length": {
          "type": "integer",
          "description": "Discard reads that are longer than the specified value after trimming",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "stringency": {
          "type": "integer",
          "description": "Overlap with adapter sequence required to trim a sequence",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "error_rate": {
          "type": "number",
          "description": "Maximum allowed error rate (no",
          "help_text": "Type: `double`, multiple: `False`, example: `0.1`. "
        },
        "gzip": {
          "type": "boolean",
          "description": "Compress the output file with GZIP",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "dont_gzip": {
          "type": "boolean",
          "description": "Output files won't be compressed with GZIP",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "length": {
          "type": "integer",
          "description": "Discard reads that became shorter than the specified length because of either quality or adapter trimming",
          "help_text": "Type: `integer`, multiple: `False`, example: `20`. "
        },
        "max_n": {
          "type": "integer",
          "description": "The total number of Ns a read may contain before it will be removed altogether.In a paired-end setting, either read exceeding this limit will result in the entire pair being removed from the trimmed output files",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "trim_n": {
          "type": "boolean",
          "description": "Removes Ns from either side of the read",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_report_file": {
          "type": "boolean",
          "description": "If specified no report file will be generated.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "suppress_warn": {
          "type": "boolean",
          "description": "If specified any output to STDOUT or STDERR will be suppressed.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "clip_R1": {
          "type": "integer",
          "description": "Instructs TrimGalore to remove given number of bp from the 5' end of read 1 (or single-end reads)",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "clip_R2": {
          "type": "integer",
          "description": "Instructs TrimGalore to remove given number bp from the 5' end of read 2 (paired-end reads only)",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "three_prime_clip_R1": {
          "type": "integer",
          "description": "Instructs Trim Galore to remove spacified number of bp from the 3' end of read 1 (or single-end reads) AFTER adapter/quality trimming has been performed",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "three_prime_clip_R2": {
          "type": "integer",
          "description": "Instructs Trim Galore to remove <int> bp from the 3' end of read 2 AFTER adapter/quality trimming has been performed",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "nextseq": {
          "type": "integer",
          "description": "This enables the option '--nextseq-trim=3'CUTOFF' within Cutadapt, which will set a quality cutoff (that is normally given with -q instead), but qualities of G bases are ignored",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "basename": {
          "type": "string",
          "description": "Use specified name (PREFERRED_NAME) as the basename for output files, instead of deriving the filenames from the input files",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "specific trimming options without adapter/quality trimming": {
      "title": "Specific trimming options without adapter/quality trimming",
      "type": "object",
      "description": "No description",
      "properties": {
        "hardtrim5": {
          "type": "integer",
          "description": "Instead of performing adapter-/quality trimming, this option will simply hard-trim sequences to <int> bp at the 5'-end",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "hardtrim3": {
          "type": "integer",
          "description": "Instead of performing adapter-/quality trimming, this option will simply hard-trim sequences to <int> bp at the 3'-end",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "clock": {
          "type": "boolean",
          "description": "In this mode, reads are trimmed in a specific way that is currently used for the Mouse Epigenetic Clock.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "polyA": {
          "type": "boolean",
          "description": "This is a new, still experimental, trimming mode to identify and remove poly-A tails from sequences",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "implicon": {
          "type": "boolean",
          "description": "This is a special mode of operation for paired-end data, such as required for the IMPLICON method, where a UMI sequence is getting transferred from the start of Read 2 to the readID of both reads",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "rrbs-specific options": {
      "title": "RRBS-specific options",
      "type": "object",
      "description": "No description",
      "properties": {
        "rrbs": {
          "type": "boolean",
          "description": "Specifies that the input file was an MspI digested RRBS sample (recognition site is CCGG)",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "non_directional": {
          "type": "boolean",
          "description": "Selecting this option for non-directional RRBS libraries will screen quality-trimmed sequences for 'CAA' or 'CGA' at the start of the read and, if found, removes the first two basepairs",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "keep": {
          "type": "boolean",
          "description": "Keep the quality trimmed intermediate file.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "paired-end specific options": {
      "title": "Paired-end specific options",
      "type": "object",
      "description": "No description",
      "properties": {
        "paired": {
          "type": "boolean",
          "description": "This option performs length trimming of quality/adapter/RRBS trimmed reads for paired-end files",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "retain_unpaired": {
          "type": "boolean",
          "description": "If only one of the two paired-end reads became too short, the longer read will be written to either '.unpaired_1.fq' or '.unpaired_2.fq' output files",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "length_1": {
          "type": "integer",
          "description": "Unpaired single-end read length cutoff needed for read 1 to be written to '.unpaired_1.fq' output file",
          "help_text": "Type: `integer`, multiple: `False`, example: `35`. "
        },
        "length_2": {
          "type": "integer",
          "description": "Unpaired single-end read length cutoff needed for read 2 to be written to '.unpaired_2.fq' output file",
          "help_text": "Type: `integer`, multiple: `False`, example: `35`. "
        }
      }
    },
    "output": {
      "title": "Output",
      "type": "object",
      "description": "No description",
      "properties": {
        "output_dir": {
          "type": "string",
          "format": "path",
          "description": "If specified all output will be written to this directory instead of the current directory.",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"trimmed_output\"`, direction: `output`. ",
          "default": "trimmed_output"
        },
        "trimmed_r1": {
          "type": "string",
          "format": "path",
          "description": "Output file for read 1",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimmed_r1.fastq\"`, direction: `output`, example: `\"read_1.fastq\"`. ",
          "default": "$id.$key.trimmed_r1.fastq"
        },
        "trimmed_r2": {
          "type": "string",
          "format": "path",
          "description": "Output file for read 2",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimmed_r2.fastq\"`, direction: `output`, example: `\"read_2.fastq\"`. ",
          "default": "$id.$key.trimmed_r2.fastq"
        },
        "trimming_report_r1": {
          "type": "string",
          "format": "path",
          "description": "Trimming report for read 1",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimming_report_r1.txt\"`, direction: `output`, example: `\"read_1.trimming_report.txt\"`. ",
          "default": "$id.$key.trimming_report_r1.txt"
        },
        "trimming_report_r2": {
          "type": "string",
          "format": "path",
          "description": "Trimming report for read 1",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimming_report_r2.txt\"`, direction: `output`, example: `\"read_2.trimming_report.txt\"`. ",
          "default": "$id.$key.trimming_report_r2.txt"
        },
        "trimmed_fastqc_html_1": {
          "type": "string",
          "format": "path",
          "description": "FastQC report for trimmed (single-end) reads (or read 1 for paired-end)",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimmed_fastqc_html_1.html\"`, direction: `output`, example: `\"read_1.fastqc.html\"`. ",
          "default": "$id.$key.trimmed_fastqc_html_1.html"
        },
        "trimmed_fastqc_html_2": {
          "type": "string",
          "format": "path",
          "description": "FastQC report for trimmed reads (read2 for paired-end)",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimmed_fastqc_html_2.html\"`, direction: `output`, example: `\"read_2.fastqc.html\"`. ",
          "default": "$id.$key.trimmed_fastqc_html_2.html"
        },
        "trimmed_fastqc_zip_1": {
          "type": "string",
          "format": "path",
          "description": "FastQC results for trimmed (single-end) reads (or read 1 for paired-end)",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimmed_fastqc_zip_1.zip\"`, direction: `output`, example: `\"read_1.fastqc.zip\"`. ",
          "default": "$id.$key.trimmed_fastqc_zip_1.zip"
        },
        "trimmed_fastqc_zip_2": {
          "type": "string",
          "format": "path",
          "description": "FastQC results for trimmed reads (read2 for paired-end)",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.trimmed_fastqc_zip_2.zip\"`, direction: `output`, example: `\"read_2.fastqc.zip\"`. ",
          "default": "$id.$key.trimmed_fastqc_zip_2.zip"
        },
        "unpaired_r1": {
          "type": "string",
          "format": "path",
          "description": "Output file for unpired read 1",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.unpaired_r1.fastq\"`, direction: `output`, example: `\"unpaired_read_1.fastq\"`. ",
          "default": "$id.$key.unpaired_r1.fastq"
        },
        "unpaired_r2": {
          "type": "string",
          "format": "path",
          "description": "Output file for unpaired read 2",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.unpaired_r2.fastq\"`, direction: `output`, example: `\"unpaired_read_2.fastq\"`. ",
          "default": "$id.$key.unpaired_r2.fastq"
        }
      }
    },
    "nextflow input-output arguments": {
      "title": "Nextflow input-output arguments",
      "type": "object",
      "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.",
      "properties": {
        "publish_dir": {
          "type": "string",
          "description": "Path to an output directory.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"output/\"`. "
        }
      }
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/input"
    },
    {
      "$ref": "#/$defs/trimming options"
    },
    {
      "$ref": "#/$defs/specific trimming options without adapter/quality trimming"
    },
    {
      "$ref": "#/$defs/rrbs-specific options"
    },
    {
      "$ref": "#/$defs/paired-end specific options"
    },
    {
      "$ref": "#/$defs/output"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
