<!--
  ~ Copyright (C) 2009-2011 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>input</id>
            <shortFlag>i</shortFlag>
            <longFlag>input</longFlag>
            <required>true</required>
            <help>The SAM binary file to convert to compact alignment format.</help>
        </flaggedOption>
        <flaggedOption>
            <id>output</id>
            <shortFlag>o</shortFlag>
            <longFlag>output</longFlag>
            <required>true</required>
            <help>The output path and basename to write the compact format to.</help>
        </flaggedOption>
        <flaggedOption>
            <id>query-reads-ids</id>
            <shortFlag>q</shortFlag>
            <longFlag>query-ids</longFlag>
            <required>false</required>
            <help>A compact file describing reads which provides identifiers for each read.  If provided, read identifiers are propagated to the alignment header.  </help>
        </flaggedOption>
        <flaggedOption>
            <id>target-reference-ids</id>
            <shortFlag>t</shortFlag>
            <longFlag>target-ids</longFlag>
            <required>false</required>
            <help>A compact file describing targets which provides identifiers for each target sequence.  If provided, target identifiers are propagated to the alignment header.  </help>
        </flaggedOption>
        <switch>
            <id>propagate-query-ids</id>
            <longFlag>propagate-query-ids</longFlag>
            <help>When this switch is provided, propagate query ids if provided in the compact file designated by the query-ids option. The default is false since query ids are generally not useful and can consume a large amount of storage.  </help>
        </switch>
         <switch>
            <id>allow-missing-attributes</id>
            <longFlag>allow-missing-attributes</longFlag>
            <help>When this switch is provided, import SAM records even if they do not provide the MD or XO attributes. MD attributes are required to determine how much mismatch exist between a read and the reference. This switch forces the import of all records, irrespective of quality. If provided, XO attributes will also be ignored, thereby faking exactly one match per record across the reference. This flag is useful to convert SAM files produced by TopHat.</help>
        </switch>
        <flaggedOption>
            <id>propagate-target-ids</id>
            <longFlag>propagate-target-ids</longFlag>
            <defaults>
                <string>true</string>
            </defaults>
             <stringParser>
                <classname>BooleanStringParser</classname>
            </stringParser>
            <help>When this switch is provided, propagate target ids if provided in the compact file designated by the target-ids option. The default is true since target ids are quite useful and not very many.  </help>
        </flaggedOption>
        <flaggedOption>
            <id>read-index-filter</id>
            <shortFlag>f</shortFlag>
            <longFlag>read-index-filter</longFlag>
            <stringParser>
                <classname>FileStringParser</classname>
            </stringParser>
            <required>false</required>
            <help>The name of a read index set with multiplicity information. When provided, last-to-compact appends exactly m identical entries for a read with index </help>
        </flaggedOption>
        <flaggedOption>
            <id>ambiguity-threshold</id>
            <defaults>
                <string>2</string>
            </defaults>
            <stringParser>
                <classname>IntegerStringParser</classname>
            </stringParser>
            <longFlag>ambiguity-threshold</longFlag>
            <required>false</required>
            <help>Maximum number of locations that a read can match to be included in the alignment entries.</help>
        </flaggedOption>
        <flaggedOption>
            <id>quality-filter-parameters</id>
            <shortFlag>p</shortFlag>
            <defaults>
                <string>threshold=0.05</string>
            </defaults>
            <longFlag>quality-filter-parameters</longFlag>
            <required>false</required>
            <help>Parameters to configure the quality filter.</help>
        </flaggedOption>
         <flaggedOption>
            <id>number-of-reads</id>
            <defaults>
                <string>-1</string>
            </defaults>
            <stringParser>
                <classname>IntegerStringParser</classname>
            </stringParser>
            <longFlag>number-of-reads</longFlag>
            <required>false</required>
            <help>The number of reads in the input file. The number is determined from the argument to the -q option when provided. Use this option when importing an alignment not generated with Goby (see samtools flagstat to get the number of reads in a SAM/BAM file).</help>
        </flaggedOption>
        <flaggedOption>
            <id>third-party-input</id>
            <longFlag>third-party-input</longFlag>
            <defaults>
                <string>true</string>
            </defaults>
             <stringParser>
                <classname>BooleanStringParser</classname>
            </stringParser>
            <help>Use to import files not produced by Goby.</help>
        </flaggedOption>

        <flaggedOption>
            <id>parse</id>
            <longFlag>parse</longFlag>
             <allowMultipleDeclarations>true</allowMultipleDeclarations>
             <stringParser>
                <classname>StringStringParser</classname>
            </stringParser>
            <help>Requests parsing of a specific SAM/BAM attribute. Supported attribute include: bsmap:XR</help>
        </flaggedOption>
    </parameters>
</jsap>
