# DO NOT EDIT THIS FILE!
# This file is automatically generated by blastdbkit.py during installation,
# update or by birchadmin --> UpdateAddInstall
name        "BLASTX - trans. DNA vs local protein database"
icon    "$BIRCH/pkg/NCBI/NCBI_tiny.png"
tip    "trans. DNA vs. local protein database"
var "in1"
    type        tempfile
    direction   in
    format      fasta
    save        true
tabset
    # - - - - - - - - - - - - - - - - - - - - - - -
    tab "General search options"    
        var "dbase"
            type        combobox
            label       "Database"
            default     0
            choices
                @include   $BIRCH/local/admin/BLAST/BLASTDB.pro.blinclude
                "User-created BLAST database" "-db `echo %USERFILE% | sed 's/\(.*\)\..*/\1/'`"
                "User-created file (FASTA format)" "-subject %USERFILE%"
        var "userfile"
            type        file
            label       "filename"

        var "searchtask"
            type       combobox
            label      "Type of search"
            default    1
            choices
                "blastx" "blastx"
                "blastx-fast, faster, optimized for >= 50% identity" "blastx-fast"

        var "gencode"
            type        combobox
            label       "Genetic Code"
            default     0
            choices
                "Standard"  "1"
                "Vertebrate Mitochondrial" "2"
                "Yeast Mitochondrial" "3"
                "Mold, Protozoan, and Coelenterate Mitochondrial" "4"
                "Invertebrate Mitochondrial" "5"
                "Ciliate, Dasycladacean and Hexamita" "6"
                "Echinoderm and Flatworm" "9"
                "Euplotid"  "10"
                "Bacterial and Plant Plastid" "11"
                "Alternative Yeast Nuclear" "12"
                "Ascidian Mitochondrial" "13"
                "Alternative Flatworm Mitochondrial" "14"
                "Blepharisma" "15"
                "Chlorophycean Mitochondrial" "16"
                "Trematode Mitochondrial" "21"
                "Scenedesmus obliquus mitochondrial" "22"
                "Thraustochytrium Mitochondrial" "23"
        var "evalue"
            type        combobox
            label       "E: # matches expected by random chance"
            default     0
            choices
                "1.0e-11"   "1.0e-11"
                "1.0e-10"   "1.0e-10"
                "1.0e-9"    "1.0e-9"
                "1.0e-8"    "1.0e-8"
                "1.0e-7"    "1.0e-7"
                "1.0e-6"    "1.0e-6"
                "1.0e-5"    "1.0e-5"
                "0.0001"    "0.0001"
                "0.001"     "0.001"
                "0.01"      "0.01"
                "0.1"       "0.1"
                "1"         "1"
                "10"        "10"
                "100"       "100"
 
        var "threads"
             type        number
             label       "Number of threads to use"
             min         1
             max         $BL_CORES_MAX
             default     $BL_CORES_DEFAULT
            
    # - - - - - - - - - - - - - - - - - - - - - - - 
    tab "Query filtering"

        var "strand"
            type        chooser
            label       "Strand(s)"
            default     0
            choices
                "Both strands"  "-strand both"
                "Plus strand"  "-strand plus" 
                "Minus strand"  "-strand minus"
        var "seg"
            type        chooser
            label       "Filter out low complexity regions with SEG"
            default     1
            choices
                "yes"  "-seg yes"
                "no"  "" 
        var "smask"
            type        chooser
            label       "Mask for lookup table only"
            default     1
            choices
                "yes"  "-soft_masking true"
                "no"  ""
        var "lmask"
            type        chooser
            label       "Mask letters from input that are lowercase"
            default     1
            choices
                "yes"  "-lcase_masking"
                "no"  ""

    # - - - - - - - - - - - - - - - - - - - - - - - 
    tab "Restrict search"

        var "oquery"
            type        combobox
            label       "ORGANISM:"
            default     2
            choices
                "Only search these organisms"       "-entrez_query '%OSTRING% [orgn]'"
                "Search all EXCEPT these organisms"       "-entrez_query 'NOT %OSTRING% [orgn]'"
                "All"        ""	
        var "ostring"
            type        text
            label       "common name, binomial or taxid"
            default     "none"

        var "equery"
            type        chooser
            label       "Restrict search to entries containing string:"
            default     1
            choices
                "Yes"       "-entrez_query '%ESTRING%'"
                "No"        ""	
        var "estring"
            type        text
            label       "Entrez query string"
            default     "none"

    # - - - - - - - - - - - - - - - - - - - - - - - 
    tab "Scoring"

        var "matrix"
            type        combobox
            label       "SCORING MATRIX"
            default     1
            choices
                "Blosum45 (Protein)" "BLOSUM45"
                "Blosum62 (Protein default)" "BLOSUM62"
                "Blosum80 (Protein)" "BLOSUM80"
                "PAM30 (Protein)" "PAM30"
                "PAM70 (Protein)" "PAM70"
        var "word"
            type        chooser
            label       "Word size"
            default     1
            choices
                "2"  "-word_size 2"
                "3"  "-word_size 3"
                "6"  "-word_size 6" 	
        var "gapped"
            type        chooser
            label       "Perform gapped alignment?"
            default     0
            choices
                "Yes"       ""
                "No"        "-ungapped"

# BLAST has a limited set of open/extend penalties for each scoring matrix.
# For example, the ones below are valid for BLOSUM62, but not BLOSUM45.
# It won't run if you don't give a valid pair of penalties. 
# Until we can get some sort of if/then logic into PCD, this var should
# be commented out, and we just let BLAST choose gap penalties
#        var "gap"
#            type        combobox
#            label       "Gap penalties"
#            default     6
#            choices
#                "Open: 9 Extend: 2"       "-gapopen 9 -gapextend 2"
#                "Open: 8 Extend: 2"       "-gapopen 8 -gapextend 2"
#                "Open: 7 Extend: 2"       "-gapopen 7 -gapextend 2"
#                "Open: 6 Extend: 2"       "-gapopen 6 -gapextend 2"
#                "Open: 5 Extend: 2"       "-gapopen 5 -gapextend 2"
#                "Open: 12 Extend: 1"       "-gapopen 12 -gapextend 1"
#                "Open: 11 Extend: 1"       "-gapopen 11 -gapextend 1"
#                "Open: 10 Extend: 1"       "-gapopen 10 -gapextend 1"
#                "Open: 9 Extend: 1"       "-gapopen 9 -gapextend 1"
#                "Open: 8 Extend: 1"       "-gapopen 8 -gapextend 1"                

    # - - - - - - - - - - - - - - - - - - - - - - - 
    tab "Output"

        var "voptions"
            type        combobox
            label       "Alignment view options"
            default     0
            choices
                "pairwise"  "0"
                "query-anchored showing identities" "1"
                "query-anchored no identities" "2"
                "flat query-anchored, show identities" "3"
                "flat query-anchored, no identities" "4"
                "XML Blast output" "5"
                "tabular" "6"
                "tabular with comment lines" "7"
                "Text ASN.1" "8"
                "Binary ASN.1"   "9"
                "CSV - comma-separated values" "10"
                "BLAST archive format (ASN.1)" "11"
                "Seqalign (JSON)" "12"
                "Multiple-file BLAST JSON" "13"
                "Multiple-file BLAST XML2" "14"
                "Single-file BLAST JSON" "15"
                "Single-file BLAST XML2" "16"
                # SAM only applicable for DNA to DNA comparisons
                #"Sequence Alignment/Map (SAM)" "17"
                "Organism Report" "18"
	
        var "maxdisp"
            type        combobox
            label       "Max. num. of alignments to display"
            default     4
            choices
                "10"  "10"
                "50" "50"
                "100" "100"
                "250" "250"
                "500" "500"
                "1000" "1000"
                "5000" "5000"
                "10000" "10000"
                "20000" "20000"

        var "writereport"
            type        combobox
            label       "WHERE TO SEND BLAST REPORT"
            default     1
            choices
                "none"    ""
                "Web Browser" "blblastout.py --archive %in1%.blastx.asn1  --destination browser  --outfmt %VOPTIONS%;"
                "Text Editor" "blblastout.py --archive %in1%.blastx.asn1   --destination textedit --outfmt %VOPTIONS%;"
                "HTML file" "blblastout.py --archive %in1%.blastx.asn1  --destination htmlfile --outfmt %VOPTIONS% --outfile %OUTNAME%;"
                "Text file" "blblastout.py --archive %in1%.blastx.asn1  --destination textfile --outfmt %VOPTIONS% --outfile %OUTNAME%;"

        var "writetsv"
            type        combobox
            label       "WHERE TO SEND TABLE OF HITS"
            default     1
            choices
                "none"    ""
                "blpfetch" "blblastout.py --archive %in1%.blastx.asn1 --destination blpfetch --outfmt 7,sacc,stitle,sscinames,staxids,evalue,length,slen,mismatch,gapopen,qstart,qend,sstart,send,bitscore,pident;"
                "tsvfile"  "blblastout.py --archive %in1%.blastx.asn1 --destination tsvfile --outfmt 7,sacc,stitle,sscinames,staxids,evalue,length,slen,mismatch,gapopen,qstart,qend,sstart,send,bitscore,pident --outfile %OUTNAME%;"


        var "writexml"
            type        combobox
            label       "WHERE TO SEND XML OUTPUT"
            default     1
            choices
                "none"    ""
                "BlastViewer" "blblastout.py --archive %in1%.blastx.asn1 --destination blastviewer --outfmt 5;"
                "xmlfile"  "blblastout.py --archive %in1%.blastx.asn1 --destination xmlfile --outfmt 5 --outfile %OUTNAME%;"

        var "outname"
            type        text
            label       "    Base name for output files"

        var "email"
            type        chooser
            label       "Notify of completion by email"
            default     1
            choices
                "Yes" "echo 'Query: '`grep '>' %in1%` > %in1%.log; echo 'Database: '%DBASE% >> %in1%.log; bl_email.py --recipient %ADDRESS% --subject 'blastx completed' --message %in1%.log; rm %in1%.log;"
                "No" ""

        var "address"
            type        text
            label       "    email address"
            default     "$BL_EMAIL"



panel
    var "Run"
        type        button
        label       "Run"
        shell       "(nice -n 4 blastx -query %in1% %DBASE% -task %SEARCHTASK% -query_gencode %GENCODE% -evalue %EVALUE% -num_threads %THREADS% %STRAND% %SEG% %SMASK% %LMASK% %OQUERY% %EQUERY% -matrix %MATRIX% %WORD% %GAPPED% -outfmt 11 -max_target_seqs %MAXDISP% -show_gis -parse_deflines -out %in1%.blastx.asn1; %WRITEREPORT% %WRITETSV% %WRITEXML% %EMAIL% rm -f %in1% %in1%.blastx.asn1)&"
        close       true
    var "Help"
        type        button
        label       "Help"
        shell       "chooseviewer.py $BIRCH/doc/NCBI/blastx.txt"
        close       false
