{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "lofreq_call",
  "description": "Call variants from a BAM file.\n\nLoFreq* (i.e. LoFreq version 2) is a fast and sensitive variant-caller for inferring SNVs and indels from next-generation sequencing data. It makes full use of base-call qualities and other sources of errors inherent in sequencing (e.g. mapping or base/indel alignment uncertainty), which are usually ignored by other methods or only used for filtering.\n\nLoFreq* can run on almost any type of aligned sequencing data (e.g. Illumina, IonTorrent or Pacbio) since no machine- or sequencing-technology dependent thresholds are used. It automatically adapts to changes in coverage and sequencing quality and can therefore be applied to a variety of data-sets e.g. viral/quasispecies, bacterial, metagenomics or somatic data.\n\nLoFreq* is very sensitive; most notably, it is able to predict variants below the average base-call quality (i.e. sequencing error rate). Each variant call is assigned a p-value which allows for rigorous false positive control. Even though it uses no approximations or heuristics, it is very efficient due to several runtime optimizations and also provides a (pseudo-)parallel implementation. LoFreq* is generic and fast enough to be applied to high-coverage data and large genomes. On a single processor it takes a minute to analyze Dengue genome sequencing data with nearly 4000X coverage, roughly one hour to call SNVs on a 600X coverage E.coli genome and also roughly an hour to run on a 100X coverage human exome dataset.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input BAM file.\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"normal.bam\"`. "
        },
        "input_bai": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Index file for the input BAM file.\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"normal.bai\"`. "
        },
        "ref": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Indexed reference fasta file (gzip supported)",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"reference.fasta\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "out": {
          "type": "string",
          "format": "path",
          "description": "Vcf output file",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.out.vcf\"`, direction: `output`, example: `\"output.vcf\"`. ",
          "default": "$id.$key.out.vcf"
        }
      }
    },
    "arguments": {
      "title": "Arguments",
      "type": "object",
      "description": "No description",
      "properties": {
        "region": {
          "type": "string",
          "description": "Limit calls to this region (chrom:start-end)",
          "help_text": "Type: `string`, multiple: `False`, example: `\"chr1:1000-2000\"`. "
        },
        "bed": {
          "type": "string",
          "format": "path",
          "description": "List of positions (chr pos) or regions (BED)",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"regions.bed\"`. "
        },
        "min_bq": {
          "type": "integer",
          "description": "Skip any base with baseQ smaller than INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `6`. "
        },
        "min_alt_bq": {
          "type": "integer",
          "description": "Skip alternate bases with baseQ smaller than INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `6`. "
        },
        "def_alt_bq": {
          "type": "integer",
          "description": "Overwrite baseQs of alternate bases (that passed bq filter) with this value (-1: use median ref-bq; 0: keep)",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "min_jq": {
          "type": "integer",
          "description": "Skip any base with joinedQ smaller than INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "min_alt_jq": {
          "type": "integer",
          "description": "Skip alternate bases with joinedQ smaller than INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "def_alt_jq": {
          "type": "integer",
          "description": "Overwrite joinedQs of alternate bases (that passed jq filter) with this value (-1: use median ref-bq; 0: keep)",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "no_baq": {
          "type": "boolean",
          "description": "Disable use of base-alignment quality (BAQ).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_idaq": {
          "type": "boolean",
          "description": "Don't use IDAQ values (NOT recommended under ANY circumstances other than debugging).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "del_baq": {
          "type": "boolean",
          "description": "Delete pre-existing BAQ values, i.e",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_ext_baq": {
          "type": "boolean",
          "description": "Use 'normal' BAQ (samtools default) instead of extended BAQ (both computed on the fly if not already present in lb tag).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "min_mq": {
          "type": "integer",
          "description": "Skip reads with mapping quality smaller than INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "max_mq": {
          "type": "integer",
          "description": "Cap mapping quality at INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `255`. "
        },
        "no_mq": {
          "type": "boolean",
          "description": "Don't merge mapping quality in LoFreq's model.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "call_indels": {
          "type": "boolean",
          "description": "Enable indel calls (note: preprocess your file to include indel alignment qualities!).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "only_indels": {
          "type": "boolean",
          "description": "Only call indels; no SNVs.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "src_qual": {
          "type": "boolean",
          "description": "Enable computation of source quality.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "ign_vcf": {
          "type": "string",
          "format": "path",
          "description": "Ignore variants in this vcf file for source quality computation",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"variants.vcf\"`. "
        },
        "def_nm_q": {
          "type": "integer",
          "description": "If >= 0, then replace non-match base qualities with this default value",
          "help_text": "Type: `integer`, multiple: `False`, example: `-1`. "
        },
        "sig": {
          "type": "number",
          "description": "P-Value cutoff / significance level",
          "help_text": "Type: `double`, multiple: `False`, example: `0.01`. "
        },
        "bonf": {
          "type": "string",
          "description": "Bonferroni factor",
          "help_text": "Type: `string`, multiple: `False`, example: `\"dynamic\"`. "
        },
        "min_cov": {
          "type": "integer",
          "description": "Test only positions having at least this coverage",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "max_depth": {
          "type": "integer",
          "description": "Cap coverage at this depth",
          "help_text": "Type: `integer`, multiple: `False`, example: `1000000`. "
        },
        "illumina_13": {
          "type": "boolean",
          "description": "Assume the quality is Illumina-1.3-1.7/ASCII+64 encoded.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "use_orphan": {
          "type": "boolean",
          "description": "Count anomalous read pairs (i.e",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "plp_summary_only": {
          "type": "boolean",
          "description": "No variant calling",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_default_filter": {
          "type": "boolean",
          "description": "Don't run default 'lofreq filter' automatically after calling variants.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "force_overwrite": {
          "type": "boolean",
          "description": "Overwrite any existing output.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "verbose": {
          "type": "boolean",
          "description": "Be verbose.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "debug": {
          "type": "boolean",
          "description": "Enable debugging.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "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/inputs"
    },
    {
      "$ref": "#/$defs/outputs"
    },
    {
      "$ref": "#/$defs/arguments"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
