name    "DNAML - DNA Maximum Likelihood"
icon    "$BIRCH/dat/blnalign/PCD/Phylogeny/phylip.gif"
tip     "DNA phylogenies using maximum likelihood methods (scales poorly beyond about 30 sequences)"

var "in1"
    type        tempfile
    direction   in
    format      fasta
    save        true

var "utree"
    type        chooser
    default     0
    choices
        "Search for best tree" "n%UFN%"
        "Evaluate user-supplied tree from file" "y%TFILE%"
        "Evaluate user-supplied tree from box below" "y%TBOX%"

var "tfile"
    type        file
    label       "_____User tree filename:"
    default     "none"

var "tbox"
    type        textarea
    label       "_____ Paste in a user tree"
    default     ""

var "program"
    type        chooser
    default     0
    choices
        "DNAML"     "dnaml"
        "DNAMLK (constant molecular clock)" "dnamlk"

var "tratio"
    type        number
    label       "TRANSITION/TRANSVERSION RATIO"
    min         1
    max         20
    default     2

var "speedy"
    type        chooser
    label       "SPEEDIER BUT ROUGHER ANALYSIS?"
    default     0
    choices
        "Yes"       "y"
        "No"        "n"

var "global"
    type        chooser
    label       "DO GLOBAL REARRANGEMENTS?"
    default     0
    choices
        "Yes"       "y"
        "No"        "n"

var "outgrp"
    type        number
    label       "SEQUENCE # OF OUTGROUP:"
    min         1
    max         1000
    default     1

var "method"
    type        combobox
    label       "RESAMPLING (SLOW!)"
    default     0
    choices
        "none"      "n"
        "Bootstrap" "b"
        "Delete-half jackinfe" "d"
        "Permute species for each character" "ps"
        "Permute character order" "po"
        "Permute within species" "pw"

var "replicates"
    type        number
    label       "_____Number of bootstrap replicates?"
    min         1
    max         1000
    default     100


var "blocksize"
    type        number
    label       "_____Block size (Bootstrap only)"
    min         1
    max         50
    default     1

var "percent"
    type        number
    label       "_____Percent of sites to sample"
    min         1
    max         100
    default     100

var "jumble"
    type        chooser
    label       "JUMBLE THE SEQUENCE ORDER?"
    default     0
    choices
        "Yes"       "J"
        "No"        "n"

var "numjum"
    type        number
    label       "_____Number of times to jumble"
    min         1
    max         50
    default     1

var "termout"
    type        chooser
    label       "SHOW PROGRESS REPORT"
    default     0
    choices
        "none"      "/dev/null"
        "on screen" "/dev/tty"
        "to .log file" "../../%OUTNAME%.log"

var "printdata"
    type        chooser
    label       "PRINT SEQUENCE DATA TO OUTFILE?"
    default     1
    choices
        "Yes"       "y"
        "No"        "n"

var "where"
    type        chooser
    label       "WHERE TO SEND OUTPUT"
    default     0
    choices
        "Tree editor" "bltreeoutput.py -e %in1%.outtree %in1%.outfile %OUTNAME%"
        "Drawing program" "bltreeoutput.py -d %in1%.outtree %in1%.outfile %OUTNAME%"
        "Output files" "bltreeoutput.py -f %in1%.outtree %in1%.outfile %OUTNAME%"

var "outname"
    type        text
    label       "_____raw filename (no extension)"
    default     "dnaml"

panel

    var "Run"
        type        button
        label       "Run"
        shell       "cat %in1% | sed ""s/[\:\_]CDS/_/"" > %in1%.infile;  (dnaml.py %in1%.infile %UTREE% %PROGRAM% %TRATIO% %SPEEDY% %GLOBAL% %METHOD% %REPLICATES% %BLOCKSIZE% %PERCENT% %JUMBLE% %NUMJUM% %OUTGRP% %TERMOUT% %PRINTDATA% %in1%.outfile %in1%.outtree; %WHERE%; rm %in1% %in1%.infile)"
        close       true

    var "Help"
        type        button
        label       "Help"
        shell       "$BIRCH/script/chooseviewer.py $BIRCH/doc/Phylip/dnaml.html"
        close       false
