{
    "type": "object",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "V-pipe configuration",
    "description": "The V-pipe workflow can be customized through the configuration file `config.yaml` or `config.json` or, for backward compatibility with the [legacy INI-style format used in V-pipe v1.x/2.x](https://github.com/cbg-ethz/V-pipe/wiki/options), `vpipe.config`. This configuration file is a text file written using a basic structure composed of sections, properties and values. When using [YAML](https://yaml.org/spec/1.0/#id2564813) or [JSON](https://www.json.org/json-en.html) format use these languages associative array/dictionaries in two levels for sections and properties. When using the older [INI format](https://docs.python.org/3/library/configparser.html), sections are expected in squared brackets, and properties are followed by corresponding values.\n\nFurther more, it is possible to specify additional options on the command line using Snakemake's `--configfile` to pass additional YAML/JSON configuration files, and/or using Snakemake's `--config` to pass sections and properties in a [YAML Flow style](https://yaml.org/spec/1.2.0/#Flow)/JSON syntax.\n\nThe order of precedence is:\n_command line options (`--config`, `--configfile`)_ >> _default configuration file (`config/config.yaml` or `config.yaml`)_ >> _legacy configuration INI (`vpipe.config`)_ >> _Virus-specific base config (`virus_based_config`)_ >> _default values_\n\nExample: For instance, we suggest providing as input a tabular file specifying sample unique identifiers (e.g., patient identifiers), and dates for different sequencing runs related to the same patient. The name of this file (here, `samples.tsv`) can be provided by specifying the section as `input` and the property as `samples_file`, as follows in the example below.\n\nIn this document, we provide a comprehensive list of all user-configurable options stratified by sections.",
    "examples": [{"input":{"samples_file":"samples.tsv"}}],
    "properties": {
        "general": {
            "description": "This section of the configuration provides general options that control the overall behavior of the pipeline",
            "properties": {
                "virus_base_config": {
                    "type": "string",
                    "default": "",
                    "description": "We provide virus-specific base configuration files which contain handy defaults for, e.g., HIV and SARS-CoV-2. Check the git repository's [config subdirectory](https://github.com/cbg-ethz/V-pipe/tree/master/config#virus_base_config) to learn about them.",
                    "examples": ["hiv","sars-cov-2"]
                },
                "aligner": {
                    "type": "string",
                    "enum": ["ngshmmalign","bwa","bowtie"],
                    "default": "ngshmmalign",
                    "description": "There are three options for mapping reads, either using [`ngshmmalign`](https://github.com/cbg-ethz/ngshmmalign), [BWA MEM (`bwa`)](https://github.com/lh3/bwa) [^1], or [Bowtie 2 (`bowtie`)](http://bowtie-bio.sourceforge.net/bowtie2/index.shtml) [^2]. To use a different aligner than the default, indicate which aligner you want to use by setting the property aligner.\n\n[^1]: Li, H. Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM. 2013.\n[^2]: Langmead, B. and Salzberg, S. Fast gapped-read alignment with Bowtie 2. Nature Methods. 2012.\n\n**Note**: Some virus-specific base configuration specified in `virus_base_config` might change this option's default to a more appropriate aligner for that virus, e.g, depending on its usual diversity and mutation rate.\nYou are still free to override that default in your configuration shall the need arise.",
                    "examples": ["bowtie"]
                },
                "snv_caller": {
                    "type": "string",
                    "default": "shorah",
                    "enum": ["shorah","lofreq"],
                    "description": "There are two options available for calling single nucleotide variants, either using [ShoRAH (`shorah`)](https://github.com/cbg-ethz/shorah) [^3] or [LoFreq (`lofreq`)](https://csb5.github.io/lofreq/) [^4]. ShoRAH is used by default. If you prefer to use LoFreq, then indicate so in the configuration file as in the example\n\n[^3]: Zagordi, O. et al. ShoRAH: estimating the genetic diversity of a mixed sample from next-generation sequencing data. BMC Bioinformatics. 2011.\n[^4]: Wilm, A. et al. LoFreq: A sequence-quality aware, ultra-sensitive variant caller for uncovering cell-population heterogeneity from high-throughput sequencing datasets. Nucleic Acids Res. 2012.",
                    "examples": ["lofreq"]
                },
                "haplotype_reconstruction": {
                    "type": "string",
                    "default": "savage",
                    "enum": ["savage", "haploclique", "predicthaplo"],
                    "description": "There are three options available for haplotype reconstruction, namely [SAVAGE](https://github.com/HaploConduct/HaploConduct/tree/master/savage) [^5], [HaploClique](https://github.com/cbg-ethz/haploclique) [^6] or [PredictHaplo](https://github.com/cbg-ethz/predicthaplo/) [^7]. SAVAGE is used by default. If you wish to use HaploClique, then indicate it in the configuration file as in the example.\n\n[^5]: Baaijens, J. A. et al., De novo assembly of viral quasispecies using overlap graphs. Genome Res. 2017.\n[^6]: Töpfer, A. et al. Viral quasispecies assembly via maximal clique finding. PLOS Computational Biology. 2014.\n[^7]: Prabhakaran, S. et al. HIV haplotype inference using a propagating dirichlet process mixture model. IEEE/ACM transactions on computational biology and bioinformatics 11.1. 2013.",
                    "examples": ["haploclique"]
                },
                "threads": {
                    "type": "integer",
                    "default": 1,
                    "description": "This option should be used to specify the default number of threads for all multi-threaded rules. That is, unless the number of threads is specified for each rule, this value is set as default.",
                    "examples": [4]
                },
                "temp_prefix": {
                    "type": "string",
                    "default": "",
                    "description": "Some step of V-pipe produce temporary files such as, e.g., decompressed intermediate - i.e. files which aren't kept long-term but are deleted after all steps that needed them have finished. By default, these files are written in the output data directory. This option, makes it is possible to write them in a different directory instead. Use this option to, e.g., leverage a faster cluster-local storage or avoid wasting backup space on a snapshotted storage. You might want to consult the documentation provided by your HPC.",
                    "examples": ["temp", "/cluster/scratch"]
                }
            },
            "default": {},
            "type": "object"
        },
        "input": {
            "description": "Properties in this section of the configuration control the input of the pipeline",
            "properties": {
                "datadir": {
                    "type": "string",
                    "default": "samples/",
                    "description": "The input file for the workflow will be searched in this directory.\n\nV-pipe expects the input samples to be organized in a two-level directory hierarchy.\n\n - The first level can be, e.g., patient samples or biological replicates of an experiment.\n - The second level can be, e.g., different sampling dates or different sequencing runs of the same sample.\n - Inside that directory, the sub-directory `raw_data` holds the sequencing data in FASTQ format (optionally compressed with GZip).\n\nFor example:\n```console\nsamples\n├── patient1\n│   ├── 20100113\n│   │   └──raw_data\n│   │      ├──patient1_20100113_R1.fastq\n│   │      └──patient1_20100113_R2.fastq\n│   └── 20110202\n│       └──raw_data\n│          ├──patient1_20100202_R1.fastq\n│          └──patient1_20100202_R2.fastq\n└── patient2\n    └── 20081130\n        └──raw_data\n           ├──patient2_20081130_R1.fastq.gz\n           └──patient2_20081130_R2.fastq.gz\n```\n\n",
                    "examples": [ "tests/data/hiv/", "tests/data/sars-cov-2/" ]
                },
                "paired": {
                    "type": "boolean",
                    "default": true,
                    "description": "Indicate whether the input sequencing reads correspond to paired-end reads.\n\nPaired-ended reads need to be in split files with `_R1` and `_R2` suffixes:\n```console\nraw_data\n├──patient2_20081130_R1.fastq.gz\n└──patient2_20081130_R2.fastq.gz\n```\n\n",
                    "examples": [ false ]
                },
                "fastq_suffix": {
                    "type": "string",
                    "default": "",
                    "description": "V-pipe expects paired-end reads to be in files that end in  `_R1` and `_R2` exactly right before the file extension, e.g., `_R1.fastq.gz`, because this is how the workflow finds and recognizes them.\n\nBut Illumina's bcl2fastq demultiplexer might introduce additional strings, e.g., `_R2_001.fast.gz` or, depending on its _mismatches_ settings, e.g., `_R2_001_MM_1.fast.gz`. Use this options to specify anything which should go between the  `_R1` and `_R2` endings and the file extension.",
                    "examples": [ "_001", "_001_MM_1"]
                },
                "samples_file": {
                    "type": "string",
                    "default": "config/samples.tsv",
                    "description": "File containing sample unique identifiers and dates as tab-separated values, e.g.,\n```tsv\npatient1    20100113\npatient1    20110202\npatient2    20081130\n```\n\nHere, we have two samples from patient 1 and one sample from patient 2. By default, V-pipe searches for a file named samples.tsv, if this file does not exist, a list of samples is built by globbing datadir directory contents.\n\nOptionally, the samples file can contain a third column specifying the read length. This is particularly useful when samples are sequenced using protocols with different read lengths.\n\nStandardized Snakemake workflows place their tables inside the `config/` subdirectory, but using this options you can specify alternate locations, e.g., the current working directory (as done in legacy V-pipe v1.x/2.x)\n",
                    "examples": [ "samples.tsv" ]
                },
                "read_length": {
                    "type": "integer",
                    "default": 250,
                    "description": "Default for those samples whose read length isn't specified explicitly in the optional third column of the `samples.tsv` table.",
                    "examples": [ "100" ]
                },
                "trim_percent_cutoff": {
                    "type": "number",
                    "default": 0.8,
                    "description": "Using this parameter, the user can specify the read-length threshold that should be applied during the quality trimming as a percentage (0 < `trim_percent_cutoff` < 1).",
                    "examples": [ 0.9 ]
                },
                "reference": {
                    "type": "string",
                    "default": "results/cohort_consensus.fasta",
                    "description": "Reference sequence to use for the alignment step\n\n**Note**: The virus-specific base configuration specified in [`general` => `virus_base_config`](#general_virus_base_config) will most likely change this option's default to a reference for that virus.\nYou are still free to override that default in your configuration shall the need arise.",
                    "examples": [ "resources/hiv/HXB2.fasta", "resources/sars-cov-2/NC_045512.2.fasta" ]
                },
                "gff_directory": {
                    "type": "string",
                    "default": "",
                    "description": "A directory containing gff files that can be optionally used to annotate the reference genome in the visualization\n\n**Note**: The virus-specific base configuration specified in [`general` => `virus_base_config`](#general_virus_base_config) will most likely change this option's default.\nYou are still free to override that default in your configuration shall the need arise.",
                    "examples": [ "resources/hiv/gffs/", "resources/sars-cov-2/gffs/" ]
                },
                "metainfo_file": {
                    "type": "string",
                    "default": "",
                    "description": "An associative array providing user-friendly name to display for each annotation .gff file in the `gff_directory`\n\n**Note**: The virus-specific base configuration specified in [`general` => `virus_base_config`](#general_virus_base_config) will most likely change this option's default.\nYou are still free to override that default in your configuration shall the need arise.",
                    "examples": [ "resources/hiv/metainfo.yaml", "resources/sars-cov-2/metainfo.yaml" ]
                },
                "primers_file": {
                    "type": "string",
                    "default": "",
                    "description": "A table with primers to display on the visualization\n\n**Note**: The virus-specific base configuration specified in [`general` => `virus_base_config`](#general_virus_base_config) will most likely change this option's default.\nYou are still free to override that default in your configuration shall the need arise.",
                    "examples": [ "resources/sars-cov-2/primers/nCoV-2019.tsv" ]
                }
            },
            "default": {},
            "type": "object"
        },
        "output": {
            "description": "Properties in this section of the configuration control the output of the pipeline",
            "properties": {
                "datadir": {
                    "type": "string",
                    "default": "results",
                    "description": "The workflow will write its output files into this directory. This will follow the same structure as for the input.\n\nFor each sample, V-pipe produces several output files that are located in the corresponding sample-specific directory. First, the alignment file and consensus sequences are located in the `alignments` and `references` subdirectories, respectively. Second, output files containing SNVs and viral haplotypes are located in the `variants` subdirectories.\n\nUsing the sample example as in the [`input`](#input_datadir) section, the output files for the two patient samples will be located in the following subdirectories:\n```console\nresults\n├──patient1\n│  ├──20100113\n│  │  ├──alignments\n│  │  |  └──REF_aln.bam\n│  │  ├──references\n|  |  |  ├──consensus.bcftools.fasta\n|  |  |  ├──ref_ambig.fasta\n|  |  |  └──ref_majority.fasta\n|  |  └──variants\n|  |     ├──SNVs\n|  |     |  └──snvs.vcf\n|  |     └──global\n|  |        └──contigs_stage_c.fasta\n│  └──20110202\n│     ├──alignments\n│     |  └──REF_aln.bam\n│     ├──references\n|     |  ├──consensus.bcftools.fasta\n|     |  ├──ref_ambig.fasta\n|     |  └──ref_majority.fasta\n|     └──variants\n|        ├──SNVs\n|        |  └──snvs.vcf\n|        └──global\n|           └──contigs_stage_c.fasta\n└─patient2\n  ├──alignments\n  |  └──REF_aln.bam\n  ├──references\n  |  ├──consensus.bcftools.fasta\n  |  ├──ref_ambig.fasta\n  |  └──ref_majority.fasta\n  └──variants\n     ├──SNVs\n     |  └──snvs.vcf\n     └──global\n        └──contigs_stage_c.fasta\n```\n\n - Standardized Snakemake workflows place their output in a `results` subdirectory\n - If your prefer the output written, e.g., to the same `samples/` subdirectory as the input (as used to be done in legacy V-pipe v1.x/2.x), you can use this options you can specify alternate target locations.",
                    "examples": ["samples"]
                },
                "cohortdir": {
                    "type": "string",
                    "default": "",
                    "description": "In addition, V-pipe can optionally generate a few cohort-wide results, such as a current cohort consensus fasta file, or a TSV file containing the frequencies of all minor alleles that differ from the consensus among analyzed samples.\nBy default, these output files are located at the base of the [`output` `datadir`](#output_datadir), outside of the two-level per sample structure:\n```console\nresults\n├──minority_variants.tsv\n├──cohort_consensus.fasta\n├──patient1\n│  ├──20100113\n│  │  ├──alignments\n…\n```\n\nIf you prefer instead, e.g., such cohort-wide results behind written in a subdirectory of the working directory at the same level as the `datadir`s, you  can use this options you can specify alternate subdirectory relative to the `datadir` property. (Use `..` prefix if you want instead your cohort-wide results to be in a directory at the sample level as `samples/` and `results/`. See the example below to recreate the `variants/` directory used by legacy V-pipe v1.x/2.x)",
                    "examples": ["../variants"]
                },
                "QA": {
                    "type": "boolean",
                    "default": false,
                    "description": "V-pipe can produce several outputs to assess the quality of the output of its steps, e.g., checking whether a sample's consensus sequence generated by bctfools does result in frameshifting indels and writing a report in sample's `…/references/frameshift_deletions_check.tsv`. Such reports can be useful when submitting sequences to GISAID.\n\nThis option turns on such QA features",
                    "examples": [true]
                },
                "snv": {
                    "type": "boolean",
                    "default": false,
                    "description": "This option selects whether the SNV caller step should be executed and its output written to each sample's `…/variants/SNVs/snvs.csv`",
                    "examples": [true]
                },
                "local": {
                    "type": "boolean",
                    "default": false,
                    "description": "This option activates local haplotype reconstruction (only available when using ShoRAH)",
                    "examples": [true]
                },
                "global": {
                    "type": "boolean",
                    "default": false,
                    "description": "This option turns on global haplotype reconstruction",
                    "examples": [true]
                },
                "visualization": {
                    "type": "boolean",
                    "default": false,
                    "description": "This option selects whether to generate HTML visualization of the SNVs in each sample's `…/visualization/index.html`",
                    "examples": [true]
                }
            },
            "default": {},
            "type": "object"
        },
        "applications": {
            "description": "The path to the different software packages can be specified using this section.\n\nIt is especially useful when dependencies are not obtained via conda such as VICUNA, and when the software packages are not in the `PATH`.\n\n**Note** we strongly recommend to use conda environments, by adding the `--use-conda` flag to the V-pipe execution command, e.g. `./vpipe --use-conda`. If you prefer to use your own installations, this section allows you to specify the location of the executables",
            "examples":[{"bwa":"/path/to/bwa","haploclique":"/path/to/haploclique"}],
            "properties": {
                "gunzip": {
                    "type": "string",
                    "default": "gunzip"
                },
                "prinseq": {
                    "type": "string",
                    "default": "prinseq-lite.pl"
                },
                "fastqc": {
                    "type": "string",
                    "default": "fastqc"
                },
                "vicuna": {
                    "type": "string",
                    "default": "vicuna",
                    "description":"Due to a special license, VICUNA is **not** available from bioconda and must be installed from [its original website](https://www.broadinstitute.org/viral-genomics/vicuna).\nUse this option to specify where you have installed its executable"
                },
                "indelfixer": {
                    "type": "string",
                    "default": "InDelFixer"
                },
                "consensusfixer": {
                    "type": "string",
                    "default": "ConsensusFixer"
                },
                "picard": {
                    "type": "string",
                    "default": "picard"
                },
                "bwa": {
                    "type": "string",
                    "default": "bwa"
                },
                "bowtie_idx": {
                    "type": "string",
                    "default": "bowtie2-build"
                },
                "bowtie": {
                    "type": "string",
                    "default": "bowtie2"
                },
                "samtools": {
                    "type": "string",
                    "default": "samtools"
                },
                "extract_consensus": {
                    "type": "string",
                    "default": "extract_consensus"
                },
                "matcher": {
                    "type": "string",
                    "default": "matcher"
                },
                "frameshift_deletions_checks": {
                    "type": "string",
                    "default": "frameshift_deletions_checks"
                },
                "mafft": {
                    "type": "string",
                    "default": "mafft"
                },
                "ngshmmalign": {
                    "type": "string",
                    "default": "ngshmmalign"
                },
                "convert_reference": {
                    "type": "string",
                    "default": "convert_reference"
                },
                "extract_seq": {
                    "type": "string",
                    "default": "extract_seq"
                },
                "coverage_stats": {
                    "type": "string",
                    "default": "coverage_stats"
                },
                "remove_gaps_msa": {
                    "type": "string",
                    "default": "remove_gaps_msa"
                },
                "aln2basecnt": {
                    "type": "string",
                    "default": "aln2basecnt"
                },
                "gather_coverage": {
                    "type": "string",
                    "default": "gather_coverage"
                },
                "minority_freq": {
                    "type": "string",
                    "default": "minority_freq"
                },
                "extract_coverage_intervals": {
                    "type": "string",
                    "default": "extract_coverage_intervals"
                },
                "shorah": {
                    "type": "string",
                    "default": "shorah shotgun"
                },
                "lofreq": {
                    "type": "string",
                    "default": "lofreq"
                },
                "bcftools": {
                    "type": "string",
                    "default": "bcftools"
                },
                "haploclique": {
                    "type": "string",
                    "default": "haploclique"
                },
                "compute_mds": {
                    "type": "string",
                    "default": "compute_mds"
                },
                "savage": {
                    "type": "string",
                    "default": "savage"
                },
                "predicthaplo": {
                    "type": "string",
                    "default": "predicthaplo"
                }
            },
            "default": {},
            "type": "object"
        },
        "gunzip": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 32
                },
                "time": {
                    "type": "integer",
                    "default": 60
                }
            },
            "default": {},
            "type": "object"
        },
        "extract": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 4096
                },
                "time": {
                    "type": "integer",
                    "default": 20
                }
            },
            "default": {},
            "type": "object"
        },
        "preprocessing": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/preprocessing.yaml"
                },
                "extra": {
                    "type": "string",
                    "default": "-ns_max_n 4 -min_qual_mean 30 -trim_qual_left 30 -trim_qual_right 30 -trim_qual_window 10",
                    "description": "We use software PRINSEQ [^8] for quality control. By default, we use options `-ns_max_n 4 -min_qual_mean 30 -trim_qual_left 30 -trim_qual_right 30 -trim_qual_window 10`, which indicates to trim reads using a sliding window with size 10 bp, and trim bases if their quality scores are less than 30. Additionally, reads are filtered out if the average quality score is below 30 and if they contain more than 4 N's. The user can choose to overwrite the default settings or use additional parameters by using the property `extra`. E.g., if many reads are filtered out in this step, the user can choose to lower the quality threshold as indicated in the example.\n[^8]:Schmieder, R. and Edwards, R. Quality control and preprocessing of metagenomic datasets. Bioinformatics. 2011.\n\nPlease do not modify PRINSEQ options `-out_format`, `-out_good`, nor `-min_len`. Instead of using `-min_len` to define threshold on the read length after trimming, use [`input` => `trim_percent_cutoff`](#input_trim_percent_cutoff).",
                    "examples": ["-ns_max_n 4 -min_qual_mean 20 -trim_qual_left 20 -trim_qual_right 20 -trim_qual_window 10"]
                }
            },
            "default": {},
            "type": "object"
        },
        "fastqc": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/fastqc.yaml"
                },
                "threads": {
                    "type": "integer",
                    "default": 6
                },
                "no_group": {
                    "type": "boolean",
                    "default": false
                }
            },
            "default": {},
            "type": "object"
        },
        "initial_vicuna": {
            "description": "__NOTE__ The conda environment for this rule doesn’t work properly. The package on the bioconda channel, mvicuna, is slightly different from VICUNA and it has different command-line arguments. Moreover, VICUNA and mvicuna are no longer maintained. In the future, this rule will be deprecated.",
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1000
                },
                "time": {
                    "type": "integer",
                    "default": 600
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/initial_vicuna.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "initial_vicuna_msa": {
            "description": "**NOTE** Obtaining a initial reference *de novo* is implemented for more than one sample.",
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 10000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/initial_vicuna_msa.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "create_vicuna_initial": {
            "properties": {
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "hmm_align": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 1435
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/hmm_align.yaml"
                },
                "leave_msa_temp": {
                    "type": "boolean",
                    "default": false,
                    "description": "this option is useful for debugging purposes",
                    "examples": [true]
                },
                "extra": {
                    "type": "string",
                    "default": "",
                    "description": "pass additional options to run ngshmmalign\n\nV-pipe uses option `-R <path/to/initial_reference>`, thus option `-r arg` is not allowed. Also, instead of passing `-l` via the property `extra`, set [`leave_msa_temp`](#hmm_align_leave_msa_temp) to `True`. Lastly, please do not modify options `-o arg`, `-w arg`, `-t arg`, and `-N arg`. These are already managed by V-pipe."

                }
            },
            "default": {},
            "type": "object"
        },
        "sam2bam": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 5000
                },
                "time": {
                    "type": "integer",
                    "default": 30
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/sam2bam.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "bwa_QA": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/bwa_QA.yaml"
                },
                "ref_panel": {
                    "type": "string",
                    "default": "",
                    "description": "Panel of diverse references against which to align reads as a QA step\n\n**Note**: The virus-specific base configuration specified in [`general` => `virus_base_config`](#general_virus_base_config) will most likely change this option's default.\nYou are still free to override that default in your configuration shall the need arise.",
                    "examples": [ "resources/hiv/5-Virus-Mix.fasta" ]
                }
            },
            "default": {},
            "type": "object"
        },
        "coverage_QA": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "target": {
                    "type": "string",
                    "default": "HXB2:6614-6812,7109-7217,7376-7478,7601-7634"
                }
            },
            "default": {},
            "type": "object"
        },
        "msa": {
        "description": "This rule takes all previously aligned reads by `hmm_align`. Therefore, resources should be allocated accordingly.",
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 10000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/msa.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "convert_to_ref": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 8000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "ref_bwa_index": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/bwa_align.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "bwa_align": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/bwa_align.yaml"
                },
                "extra": {
                    "type": "string",
                    "default": "",
                    "description": " With property `extra`, users can pass additional options to run BWA MEM. For more details on BWA MEM configurable options refer to the software [documentation](http://bio-bwa.sourceforge.net/bwa.shtml)."
                }
            },
            "default": {},
            "type": "object"
        },
        "ref_bowtie_index": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/bowtie_align.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "bowtie_align": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/bowtie_align.yaml"
                },
                "phred": {
                    "type": "string",
                    "default": "--phred33",
                    "enum": ["--phred33","--phred64"],
                    "description":"indicate if qualities are Phred+33 (default) or Phred+64 (`--phred64`)",
                    "examples": ["--phred64"]
                },
                "preset": {
                    "type": "string",
                    "default": "--local --sensitive-local",
                    "description": "specify Bowtie 2 presets"
                },
                "maxins": {
                    "type": "integer"
                },
                "extra": {
                    "type": "string",
                    "default": "",
                    "description": "pass additional options to run Bowtie 2. V-pipe handles the input and output files, as well as the reference sequence. Thus, do not modify these options\nFor more details on Bowtie 2 configurable options refer to the software [documentation](http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml)."
                }
            },
            "default": {},
            "type": "object"
        },
        "consensus_sequences": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "min_coverage": {
                    "type": "integer",
                    "default": 50,
                    "description": "minimum read depth for reporting variants per locus"
                },
                "n_coverage": {
                    "type": "integer",
                    "default": 5,
                    "description": "read count below which ambiguous base 'n' is reported"
                },
                "qual_thrd": {
                    "type": "integer",
                    "default": 15,
                    "description": "minimum phred quality score for a base to be included"
                },
                "min_freq": {
                    "type": "number",
                    "default": 0.05,
                    "description": "minimum frequency for an ambiguous nucleotide"
                }
            },
            "default": {},
            "type": "object"
        },
        "consensus_bcftools": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/bcftools.yaml"
                },
                "max_coverage": {
                    "type": "integer",
                    "default": 10000
                },
                "mask_coverage_threshold": {
                    "type": "integer",
                    "default": 10
                },
                "ambiguous_base_coverage_threshold": {
                    "type": "number",
                    "default": 0.05
                }
            },
            "default": {},
            "type": "object"
        },
        "consseq_QA": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 4096
                },
                "time": {
                    "type": "integer",
                    "default": 30
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/consseq_qa.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "frameshift_deletions_checks": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 30
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "genes_gff": {
                    "type": "string",
                    "default": ""
                }
            },
            "default": {},
            "type": "object"
        },
        "basecounts": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 30
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "coverage": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1250
                },
                "time": {
                    "type": "integer",
                    "default": 30
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "minor_variants": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "min_coverage": {
                    "type": "integer",
                    "default": 100,
                    "description": "minimum read depth for reporting variants per locus",
                    "examples": [50]
                },
                "frequencies": {
                    "type": "boolean",
                    "default": false,
                    "description": "output a numpy array file containing frequencies of all bases, including gaps and also the most abundant base across samples",
                    "examples": [true]
                }
            },
            "default": {},
            "type": "object"
        },
        "coverage_intervals": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1000
                },
                "time": {
                    "type": "integer",
                    "default": 30
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "overlap": {
                    "type": "boolean",
                    "default": false,
                    "description": "construct intervals based on overlapping windows of the read alignment. By default, regions with high coverage are built based on the position-wise read depth",
                    "examples": [true]
                },
                "coverage": {
                    "type": "integer",
                    "default": 50,
                    "description": "minimum read depth. A region spanning the reference genome is returned if `coverage` is set to 0",
                    "examples": [ 0 ]
                },
                "liberal": {
                    "type": "boolean",
                    "default": true,
                    "description": "indicate whether to apply a more liberal shifting on intervals' right-endpoint",
                    "examples": [false]
                }
            },
            "default": {},
            "type": "object"
        },
        "snv": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 10000
                },
                "time": {
                    "type": "integer",
                    "default": 2880
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/snv.yaml"
                },
                "consensus": {
                    "type": "boolean",
                    "default": true,
                    "description": "indicate whether to use the cohort-consensus sequence from the analyzed samples (output from `minor_variants` rule located in the cohort-wide output `results/cohort_onsensus.fasta`) or the reference sequence by setting this option to False",
                    "examples": [false]
                },
                "alpha": {
                    "type": "number",
                    "default": 0.1,
                    "description": "hyperparameter used for instantiating a new cluster"
                },
                "ignore_indels": {
                    "type": "boolean",
                    "default": false,
                    "description": "ignore SNVs adjacent to indels"
                },
                "posterior_threshold": {
                    "type": "number",
                    "default": 0.9
                },
                "coverage": {
                    "type": "integer",
                    "default": 0,
                    "description": "omit windows with coverage less than this value",
                    "examples": [50]
                },
                "shift": {
                    "type": "integer",
                    "default": 3,
                    "description": "ShoRAH performs local haplotype reconstruction on windows of the read alignment. The overlap between these windows is defined by the window shifts. By default, it is set to 3, i.e., apart from flanking regions each position is covered by 3 windows"
                },
                "keep_files": {
                    "type": "boolean",
                    "default": false,
                    "description": "indicate whether to move files produced in previous/interrupted runs to subdirectory named `old`",
                    "examples": [true]
                },
                "localscratch": {
                    "type": "string",
                    "default": ""
                }
            },
            "default": {},
            "type": "object"
        },
        "samtools_index": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 20
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/lofreq.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "lofreq": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 60
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/lofreq.yaml"
                },
                "consensus": {
                    "type": "boolean",
                    "default": true,
                    "description": "indicate whether to use the cohort-consensus sequence from the analyzed samples (output from `minor_variants` rule located in the cohort-wide output `results/cohort_onsensus.fasta`) or the reference sequence by setting this option to False",
                    "examples": [false]
                },
                "extra": {
                    "type": "string",
                    "default": "",
                    "description": "pass additional options to run `lofreq call`"
                }
            },
            "default": {},
            "type": "object"
        },
        "alignment_coverage": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 1000
                },
                "time": {
                    "type": "integer",
                    "default": 60
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "coverage": {
                    "type": "integer",
                    "default": 5
                }
            },
            "default": {},
            "type": "object"
        },
        "stats": {
            "properties": {
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/sam2bam.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "savage": {
            "description": "**NOTE** This rule only works in Linux.",
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 10000
                },
                "time": {
                    "type": "integer",
                    "default": 1435
                },
                "threads": {
                    "type": "integer"
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/savage.yaml"
                },
                "split": {
                    "type": "integer",
                    "default": 20,
                    "description": "size of the batches of reads to be processed by SAVAGE. It is recommended that 500 < coverage/`split` < 1000"
                }
            },
            "default": {},
            "type": "object"
        },
        "haploclique": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 10000
                },
                "time": {
                    "type": "integer",
                    "default": 1435
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/haploclique.yaml"
                },
                "relax": {
                    "type": "boolean",
                    "default": true,
                    "description": "if set to `True` (default) a predefined set of parameter values is used for drawing edges between reads in the read graph"
                },
                "no_singletons": {
                    "type": "boolean",
                    "default": true,
                    "description": "singletons are defined as proposed haplotypes which are supported by a single read. If this property is set to `True`, singletons are discarded"
                },
                "no_prob0": {
                    "type": "boolean",
                    "default": true,
                    "description": "if set to `True` (default) probability of the overhangs is ignored"
                },
                "clique_size_limit": {
                    "type": "integer",
                    "default": 3,
                    "description": "sets a threshold to limit the size of cliques"
                },
                "max_num_cliques": {
                    "type": "integer",
                    "default": 10000,
                    "description": "indicates the maximum number of clique to be considered in the next iteration"
                }
            },
            "default": {},
            "type": "object"
        },
        "haploclique_visualization": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml"
                },
                "region_start": {
                    "type": "integer",
                    "default": 0,
                    "description": "use to specify a region of interest"
                },
                "region_end": {
                    "type": "integer",
                    "default": -1,
                    "description": "use to specify a region of interest",
                    "examples": [9719,29836]
                },
                "msa": {
                    "type": "string",
                    "default": "",
                    "description": "when the ground truth is available (e.g., simulation studies), a multiple sequence alignment of types making up the population can be provided, and additional checks are performed"
                }
            },
            "default": {},
            "type": "object"
        },
        "predicthaplo": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 10000
                },
                "time": {
                    "type": "integer",
                    "default": 1435
                },
                "threads": {
                    "type": "integer"
                },
                "read_min_length": {
                    "type": "integer",
                    "default": 0
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/predicthaplo.yaml"
                }
            },
            "default": {},
            "type": "object"
        },
        "web_visualization": {
            "properties": {
                "mem": {
                    "type": "integer",
                    "default": 2000
                },
                "time": {
                    "type": "integer",
                    "default": 235
                },
                "conda": {
                    "type": "string",
                    "default": "{VPIPE_BASEDIR}/envs/visualization.yaml"
                }
            },
            "default": {},
            "type": "object"
        }
    }
}
