<!--
  ~ Copyright (C) 2009-2010 Institute for Computational Biomedicine,
  ~                    Weill Medical College of Cornell University
  ~
  ~  This program is free software; you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation; either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  This program is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~  You should have received a copy of the GNU General Public License
  ~  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<jsap>
    <parameters>

        <flaggedOption>
            <id>output</id>
            <shortFlag>o</shortFlag>
            <longFlag>output</longFlag>
            <required>false</required>
            <defaults>
                <string>-</string>
            </defaults>
            <help>The name of the output file.</help>
        </flaggedOption>
        <unflaggedOption>
            <id>input</id>
            <required>true</required>
            <greedy>true</greedy>
            <help>The basenames of the input alignments</help>
        </unflaggedOption>
        <flaggedOption>
            <id>include-reference-names</id>
            <shortFlag>r</shortFlag>
            <longFlag>include-reference-names</longFlag>
            <required>false</required>
            <help>When provided, process only reference identifiers listed in this comma separated list. To process only
                chromosome 19 and 1, if sequences are identified by 1 and 19, use: --include-reference-names 1,19
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>groups</id>
            <shortFlag>g</shortFlag>
            <longFlag>groups</longFlag>
            <required>false</required>
            <help>Define groups for multi-group comparisons. This option is required for some output formats. The syntax
                of the groups arguments is id-1=basename1,basename2/id-2=basename4,basename5 Where id-1 is the id of the
                first group, defined to consist of samples basename1 and basename2. basename1 must refer to a basename
                provided as input on the command line (see input). Multiple groups are separated by forward slashes (/).
                If the option is not provided, one group per sample is assumed and group1... groupN are defined
                corresponding to the N input basenames, in the order these appear on the command line.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>group-file</id>
            <longFlag>group-file</longFlag>
            <required>false</required>
            <help>Define groups for multi-group comparisons. This parameter names a file in the Java properties format.
                The format describes mapping between samples and groups. Each line must have the format
                sample-id=group-id or be a comment. Please refer to the --groups option for a description of
                sample/group mapping.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>compare</id>
            <longFlag>compare</longFlag>
            <required>false</required>
            <help>Compare sequence variations across groups of samples. This option is required for some output formats.
                When provided, the compare flag must be followed by group ids separated by slashes. For instance, if
                groups group-A and group-B have been defined (see --groups option), --compare group-A/group-B will
                evaluate statistical tests between sequence variation in groups A and B. Starting with version 1.9.8.1,
                several pairs of groups can be specified. Use format A/B,A/C,A/D to compare group A to group B, C and D
                respectively.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>eval</id>
            <longFlag>eval</longFlag>
            <required>false</required>
            <stringParser>
                <classname>StringStringParser</classname>
            </stringParser>
            <defaults>
                <string>samples</string>
            </defaults>
            <help>List of optional analysis steps. This option is currently ignored. Previous versions use this option
                to control output. Output formats are now controlled by the --format flag.
            </help>
        </flaggedOption>
        <!--flaggedOption>
             <id>filters</id>
             <longFlag>filters</longFlag>
             <required>false</required>
             <stringParser>
                <classname>StringStringParser</classname>
            </stringParser>
                <help>List of base filters to use. The default will use the filters most appropriate for the output format, but you can override this choice. The syntax of the filter argument is id1,id2,... where id1 and id2 are the names of base filters.</help>
        </flaggedOption-->
        <flaggedOption>
            <id>start-position</id>
            <shortFlag>s</shortFlag>
            <longFlag>start-position</longFlag>
            <stringParser>
                <classname>StringStringParser</classname>
            </stringParser>
            <required>false</required>
            <help>The start position within the file, which should be number of bytes into the file to start reading
                from, or a string in the format ref-id,ref-position (since Goby 1.9). Only entries that have a position
                after the start position are considered.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>end-position</id>
            <shortFlag>e</shortFlag>
            <longFlag>end-position</longFlag>
            <stringParser>
                <classname>StringStringParser</classname>
            </stringParser>
            <required>false</required>
            <help>The end position within the file, which should be number of bytes into the file to end reading from,
                or a string in the format ref-id,ref-position (since Goby 1.9). Only entries that occur before the
                specified position are analyzed.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>start-flap-size</id>
            <longFlag>start-flap-size</longFlag>
            <defaults>
                <string>1000</string>
            </defaults>
            <stringParser>
                <classname>IntegerStringParser</classname>
            </stringParser>
            <required>false</required>
            <help>Size of the flap to consider before start-position (in bp). Reads that start within start-flap and
                start are used to accumulate base counts. Base counts are used to emit statistics between start and end,
                but not between start-flap and start. This strategy makes is possible to concatenate results from
                distinct windows without reporting redundant results.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>variation-stats</id>
            <shortFlag>v</shortFlag>
            <longFlag>variation-stats</longFlag>
            <required>false</required>
            <stringParser>
                <classname>FileStringParser</classname>
            </stringParser>
            <help>Path to a variation stastistics file produced with --mode sequence-variation-stats2 over the same set
                of alignments. This file provides variation counts for specific read indices which are used in
                calculating the within group P-values for variation discovery.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>minimum-variation-support</id>
            <shortFlag>n</shortFlag>
            <longFlag>minimum-variation-support</longFlag>
            <stringParser>
                <classname>IntegerStringParser</classname>
            </stringParser>
            <required>false</required>
            <defaults>
                <string>10</string>
            </defaults>
            <help>The minimum number of times a variation must be seen across all alignments to be considered for
                statistical test.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>threshold-distinct-read-indices</id>
            <shortFlag>t</shortFlag>
            <longFlag>threshold-distinct-read-indices</longFlag>
            <stringParser>
                <classname>IntegerStringParser</classname>
            </stringParser>
            <required>false</required>
            <defaults>
                <string>3</string>
            </defaults>
            <help>The minimum number of distinct read indices that support a variation for this variation to be
                considered for statistical test.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>max-coverage-per-site</id>
            <longFlag>max-coverage-per-site</longFlag>
            <stringParser>
                <classname>IntegerStringParser</classname>
            </stringParser>
            <required>false</required>
            <defaults>
                <string>500000</string>
            </defaults>
            <help>The maximum coverage per site considered for comparisons. Any bases in excess of the specified
                coverage at a given site is ignored.
            </help>
        </flaggedOption>
        <switch>
            <id>parallel</id>
            <longFlag>parallel</longFlag>
            <help>Run some computations in parallel. You can tune the number of processors used by setting the property
                pj.nt. For instance, -Dpj.nt=5 will use 5 parallel threads. When --parallel is specified, one thread per
                processing core of the machine will be used unless specified otherwise (with pj.nt).
            </help>
        </switch>

        <flaggedOption>
            <id>format</id>
            <shortFlag>f</shortFlag>
            <longFlag>format</longFlag>
            <required>false</required>
            <defaults>
                <string>variant_discovery</string>
            </defaults>
            <help>The name of the output format. Possible choices are genotypes, allele_frequencies, compare_groups,
                methylation, somatic_variations.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>genome</id>
            <longFlag>genome</longFlag>
            <required>true</required>
            <help>A genome basename. The genome must have been processed by build-sequence-cache mode to produce the
                compressed, random access files this mode needs.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>processor</id>
            <shortFlag>p</shortFlag>
            <longFlag>processor</longFlag>
            <required>false</required>
            <defaults>
                <string>NONE</string>
            </defaults>
            <help>The name of the alignment processor. An alignment processor can be configured to scan alignment
                entries before calling variants. By default, no processor is used. If you specify realign_near_indels, a
                processor that realigns reads in the proximity of indels will be used. Please note that this feature is
                experimental (Since Goby 1.9.7).
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>call-indels</id>
            <longFlag>call-indels</longFlag>
            <stringParser>
                <classname>BooleanStringParser</classname>
            </stringParser>
            <required>false</required>
            <defaults>
                <string>false</string>
            </defaults>
            <help>Activate or disable indel calling. As of Goby 1.9.8.2, with default false (do not call indels).</help>
        </flaggedOption>
        <flaggedOption>
            <id>diploid</id>
            <longFlag>diploid</longFlag>
            <stringParser>
                <classname>BooleanStringParser</classname>
            </stringParser>
            <required>false</required>
            <defaults>
                <string>false</string>
            </defaults>
            <help>Force diploid genotypes. Use when you know the genome you are trying to call genotypes against are
                diploid.
            </help>
        </flaggedOption>
        <flaggedOption>
            <id>covariates</id>

            <longFlag>covariates</longFlag>
            <required>false</required>

            <help>The name of the covariate info file. When present, this file must be in tab delimited format, and
                provide at least one line per sample in the input.
            </help>
        </flaggedOption>
    </parameters>
</jsap>
