name        "tbl2asn - Re-format annotated genome for submission to NCBI"
icon    "$BIRCH/pkg/NCBI/NCBI_tiny.png"
tip    "Convert .tbl files to .sqn (Sequin) files for submission to NCBI"

var "in1"
    type        tempfile
    direction   in
    format      tsv
    save        false

tabset


    # - - - - - - - Files and Directories - - - - - - -
    tab "Files"

        var "template"
            type        file
            label       "template file (.sbt) - REQUIRED"
            default     ""

        var "suffix"
            type        text
            label       "Suffix for identifying FASTA files"
            default     ".fsa"

        var "comment"
            type        chooser
            label       "Comments"
            default     0
            choices
                "none" ""
                "Type comments below" "-y '%COMTEXT%'"
                "Read comments from a file" "-Y %COMFILE%"

        var "comtext"
            type        text
            label       "    comments"
            default     ""

        var "comfile"
            type        file
            label       "    comment file"
            default     ""


        var "vv"
            type        chooser
            label       "Write validation file (.val)?"
            default     0
            choices
                "Yes" "v"
                "No" ""

        var "vb"
            type        chooser
            label       "Write GenBank file (.gbf)?"
            default     0
            choices
                "Yes" "b"
                "No" ""

        var "vg"
            type        chooser
            label       "Generate gene report (.t2g)?"
            default     1
            choices
                "Yes" "g"
                "No" ""


        var "resultdir"
            type        dir
            label       " Directory for results"
            default     "../tbl2asn"



        var "sfout"
            type        chooser
            label       "Write all output to a single Sequin file?"
            default     1
            choices
                "Yes" "-o %RESULTDIR%/%SFNAME%"
                "No" ""

        var "sfname"
            type        text
            label       "    name for single output file (.sqn)"
            default     ""

    # - - - - - - - Parameters - - - - - - -
    tab "Parameters"

        var "xa"
            type        chooser
            label       "Generate Definition lines automatically?"
            default     1
            choices
                "Yes" "A"
                "No" ""

        var "xe"
            type        chooser
            label       "Treat like eukaryota in the Discrepancy Report?"
            default     1
            choices
                "Yes" "E"
                "No" ""

        var "mastergenome"
            type        combobox
            label       "Master genome flags: "
            default     1
            choices
                "none"    ""
                "Normal (-M n)"    "-M n"
                "Big sequence (-M b)"    "-M b"
                "Power option (-M p)"    "-M p"
                "TSA (-M t)"       "-M t"

        var "rtax"
            type        chooser
            label       "Remote Taxonomy Lookup"
            default     1
            choices
                "Yes" "-T"
                "No" ""

        var "localids"
            type        chooser
            label       "Force local protein_id/transcript_id?"
            default     0
            choices
                "Yes" "-L"
                "No" ""

        var "gapanno"
            type        combobox
            label       "Gap annotation: "
            default     0
            choices
                "Runs of 20+ Ns are gaps, 100 Ns are unknown length"    "r20u"
                "Runs of 20+ Ns are gaps, 100 Ns are known length"    "r20k"
                "Runs of 10+ Ns are gaps, 100 Ns are unknown length"    "r10u"
                "Runs of 10+ Ns are gaps, 100 Ns are known length"    "r10k"
                "FASTA Delta, di FASTA Delta with Implicit Gaps"       "d"
                "FASTA with Gap Lines"    "z"
                "PHRAP/ACE"    "e"
                "ASN.1 for -M flag"    "b"

        var "vr"
            type        chooser
            label       "Validate without country check?"
            default     1
            choices
                "Yes" "r"
                "No" ""

        var "cf"
            type        chooser
            label       "Fix product names?"
            default     0
            choices
                "Yes" "f"
                "No" ""

        var "cx"
            type        chooser
            label       "extend feature ends 1 or 2 nucl. past gaps or seq. ends?"
            default     1
            choices
                "Yes" "x"
                "No" ""

        var "cd"
            type        chooser
            label       "Re-format date:"
            default     0
            choices
                "Off" ""
                "Day first" "D"
                "Day first" "d"

        var "additional"
            type        text
            label       "additional tbl2asn options"
            default     " "



    # - - - - - - - Source Qualifiers - - - - - - -
    # The fifth qualifier term, %Q5%, does not get parsed, 
    # but all others do. I have done extensive testing of many
    # variants of this menu, and can't get it to work. This may
    # be due to an error in how BioLegato parses menus. See Q5
    # below.
    tab "Qualifiers"
        var "sourcequal"
            type        chooser
            label       "Source qualifiers"
            default     0
            choices
                "+" "%Q1% %Q2% %Q3% %Q4% %Q6% %Q7%"
                "-" ""
        panel
            var "q1"
                type        chooser
                default     1
                choices
                    "+" " [%Q1FIELD%=%Q1VAL%]"
                    "-" ""

            var "q1field"
                type        combobox
                default     41
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q1val"
                type        text
                default     ""
        panel
            var "q2"
                type        chooser
                default     1
                choices
                    "+" " [%Q2FIELD%=%Q2VAL%]"
                    "-" ""
            var "q2field"
                type        combobox
                default     54
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q2val"
                type        text
                default     ""
        panel
            var "q3"
                type        chooser
                default     1
                choices
                    "+" " [%Q3FIELD%=%Q3VAL%]"
                    "-" ""
            var "q3field"
                type        combobox
                default     42
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q3val"
                type        text
                default     ""
        panel
            var "q4"
                type        chooser
                default     1
                choices
                    "+" " [%q4field%=%q4val%]"
                    "-" ""
            var "q4field"
                type        combobox
                default     42
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q4val"
                type        text
                default     ""
        panel
            var "q5"
                type        chooser
                default     1
                choices
                    "+" " [%Q5FIELD%=%Q5VAL%]"
                    "-" ""
            var "q5field"
                type        combobox
                default     42
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q5val"
                type        text
                default     "Known bug: Do not use this field."
        panel
            var "q6"
                type        chooser
                default     1
                choices
                    "+" " [%Q6FIELD%=%Q6VAL%]"
                    "-" ""
            var "q6field"
                type        combobox
                default     42
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q6val"
                type        text
                default     ""
        panel
            var "q7"
                type        chooser
                default     1
                choices
                    "+" " [%Q7FIELD%=%Q7VAL%]"
                    "-" ""
            var "q7field"
                type        combobox
                default     42
                choices
                    "acronym"    "acronym"
                    "altitude"    "altitude"
                    "anamorph"    "anamorph"
                    "authority"    "authority"
                    "bio-material"    "bio-material"
                    "biotype"    "biotype"
                    "biovar"    "biovar"
                    "breed"    "breed"
                    "cell-line"    "cell-line"
                    "cell-type"    "cell-type"
                    "chemovar"    "chemovar"
                    "chromosome"    "chromosome"
                    "clone"    "clone"
                    "clone-lib"    "clone-lib"
                    "collected-by"    "collected-by"
                    "collection-date"    "collection-date"
                    "common"    "common"
                    "country"    "country"
                    "cultivar"    "cultivar"
                    "culture-collection"    "culture-collection"
                    "dev-stage"    "dev-stage"
                    "ecotype"    "ecotype"
                    "endogenous-virus-name"    "endogenous-virus-name"
                    "forma"    "forma"
                    "forma-specialis"    "forma-specialis"
                    "fwd-PCR-primer-name"    "fwd-PCR-primer-name"
                    "fwd-PCR-primer-seq"    "fwd-PCR-primer-seq"
                    "genotype"    "genotype"
                    "group"    "group"
                    "haplogroup"    "haplogroup"
                    "haplotype"    "haplotype"
                    "host"    "host"
                    "identified-by"    "identified-by"
                    "isolate"    "isolate"
                    "isolation-source"    "isolation-source"
                    "lab-host"    "lab-host"
                    "lat-lon"    "lat-lon"
                    "linkage-group"    "linkage-group"
                    "map"    "map"
                    "mating-type"    "mating-type"
                    "note"    "note"
                    "organism"    "organism"
                    "pathovar"    "pathovar"
                    "plasmid-name"    "plasmid-name"
                    "plastid-name"    "plastid-name"
                    "pop-variant"    "pop-variant"
                    "rev-PCR-primer-name"    "rev-PCR-primer-name"
                    "rev-PCR-primer-seq"    "rev-PCR-primer-seq"
                    "segment"    "segment"
                    "serogroup"    "serogroup"
                    "serotype"    "serotype"
                    "serovar"    "serovar"
                    "sex"    "sex"
                    "specimen-voucher"    "specimen-voucher"
                    "strain"    "strain"
                    "sub-species"    "sub-species"
                    "subclone"    "subclone"
                    "subgroup"    "subgroup"
                    "substrain"    "substrain"
                    "subtype"    "subtype"
                    "synonym"    "synonym"
                    "teleomorph"    "teleomorph"
                    "tissue-lib"    "tissue-lib"
                    "tissue-type"    "tissue-type"
                    "type"    "type"
                    "variety"    "variety"
            var "q7val"
                type        text
                default     ""

    # - - - - - - - Sequence Properties - - - - - - -
    tab "Properties"
        var "seqprops"
            type        chooser
            label       "Sequence Properties"
            default     0
            choices
                "+" "[mol_type=%MTYPE%] %TOPOLOGY% [location=%LOCATION%] %GERM% %ENV% %META% %REARR% %TRANS% %CODE%"
                "-" ""

        # Choices commented out claim to be supported in the documentation,
        # but don't actually work with tbl2asn.
        var "mtype"
            type    combobox
            label   "Molecule type"
            default 0
            choices
                "genomic DNA"    "genomic"
#                "genomic RNA"    "genomic rna"
#                "pre RNA"    "pre rna"
                "mRNA"    "mrna"
                "rRNA"    "rrna"
                "tRNA"    "trna"
                "other genetic"    "other genetic"
                "viral cRNA"    "crna"
                "transcribed RNA"    "transcribed rna"
#                "tmRNA"    "tmrna"
#                "ncrna"    "ncrna"

        var "topology"
            type        chooser
            label       "topology"
            default     0
            choices
                "linear" ""
                "circular" "[topology=circular]"

        var "location"
            type        combobox
            label       "location"
            default     0
            choices
                "genomic"    "genomic"
                "mitochondrion"    "mitochondrion"
                "chloroplast"    "chloroplast"
                "apicoplast"    "apicoplast"
                "chromatophore"    "chromatophore"
                "chromoplast"    "chromoplast"
                "cyanelle"    "cyanelle"
                "endogenous-virus"    "endogenous-virus"
                "extrachromosomal"    "extrachromosomal"
                "hydrogenosome"    "hydrogenosome"
                "kinetoplast"    "kinetoplast"
                "leucoplast"    "leucoplast"
                "macronuclear"    "macronuclear"
                "nucleomorph"    "nucleomorph"
                "plasmid"    "plasmid"
                "plastid"    "plastid"
                "proplastid"    "proplastid"
                "proviral"    "proviral"

        var "germ"
            type        chooser
            label       "germline"
            default     1
            choices
                "Yes" "[germline=TRUE]"
                "No" ""

        panel

            var "code"
                type        chooser
                label       ""
                default     0
                choices
                    "genetic code" "[gcode=%GC%]"
                    "mito. genetic code" "[mgcode=%GC%]"       

            var "gc"
                type    combobox
                label   "Genetic code"
                default 0
                choices
                    "Standard Code"    "1"
                    "Vertebrate Mitochondrial Code"    "2"
                    "Yeast Mitochondrial Code"    "3"
                    "Mold, Protozoan, and Coelenterate Mito. and  Mycoplasma/Spiroplasma Code"    "4"
                    "Invertebrate Mitochondrial Code"    "5"
                    "Ciliate, Dasycladacean and Hexamita Nuclear Code"    "6"
                    "Echinoderm and Flatworm Mitochondrial Code"    "9"
                    "Euplotid Nuclear Code"    "10"
                    "Bacterial, Archaeal and Plant Plastid Code"    "11"
                    "Alternative Yeast Nuclear Code"    "12"
                    "Ascidian Mitochondrial Code"    "13"
                    "Alternative Flatworm Mitochondrial Code"    "14"
                    "Chlorophycean Mitochondrial Code"    "16"
                    "Trematode Mitochondrial Code"    "21"
                    "Scenedesmus obliquus Mitochondrial Code"    "22"
                    "Thraustochytrium Mitochondrial Code"    "23"
                    "Pterobranchia Mitochondrial Code"    "24"
                    "Candidate Division SR1 and Gracilibacteria Code"    "25"
                    "Pachysolen tannophilus Nuclear Code"    "26"
                    "Karyorelict Nuclear"    "27"
                    "Condylostoma Nuclear"    "28"
                    "Mesodinium Nuclear"    "29"
                    "Peritrich Nuclear"    "30"
                    "Blastocrithidia Nuclear"    "31"
        var "env"
            type        chooser
            label       "Environmental sample"
            default     1
            choices
                "Yes" "[environmental-sample=TRUE]"
                "No" ""
        var "meta"
            type        chooser
            label       "metagenomic sample"
            default     1
            choices
                "Yes" "[metagenomic=TRUE]"
                "No" ""


        var "rearr"
            type        chooser
            label       "rearranged"
            default     1
            choices
                "Yes" "[rearranged=TRUE]"
                "No" ""

        var "trans"
            type        chooser
            label       "transgenic"
            default     1
            choices
                "Yes" "[transgenic=TRUE]"
                "No" ""
panel
    var "Run"
        type        button
        label       "Run"
        shell       "if [ ! -d %RESULTDIR% ]; then mkdir %RESULTDIR%; fi; tbl2asn -p . -t %TEMPLATE% -x %SUFFIX% %COMMENT%  -X%XA%%XE% %MASTERGENOME% %RTAX% %LOCALIDS% -a %GAPANNO%  -V%VV%%VB%%VR%%VG% -c%CF%%CX%%CD% %ADDITIONAL% -j '%SOURCEQUAL% %SEQPROPS%' -r %RESULTDIR% %SFOUT% -Z %RESULTDIR%/discrepancies.tbl2asn; cd %RESULTDIR%; blreads"
#         shell       "echo %Q6% %Q5% %Q4%   [%q4field%=%q4val%]"
        close       true

    var "Guide"
        type        button
        label       "User Guide"
        shell       "$BIRCH/script/chooseviewer.py http://www.ncbi.nlm.nih.gov/genbank/tbl2asn2"
        close       false

    var "Manual"
        type        button
        label       "Manual"
        shell       "$BIRCH/script/chooseviewer.py $BIRCH/doc/NCBI/tbl2asn.man"
        close       false
