name        "PROML - Protein Maximum Likelihood"
icon    "$BIRCH/dat/blpalign/PCD/Phylogeny/phylip.gif"
tip    "protein phylogeny using maximum likelihood"

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
        "PROML"     "proml"
        "PROMLK (assumes constant molecular clock)" "promlk"

var "pmodel"
    type        combobox
    label       "PROBABILITY MODEL"
    default     0
    choices
        "Jones-Taylor-Thornton" "j"
        "Henikoff/Tiller PMB" "h"
        "Dayhoff PAM" "d"
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 "alltrees"
    type        chooser
    label       "Save raw trees to a separate file?"
    default     1
    choices
        "Yes"       "y"
        "No"        "n"

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     "proml"
panel
    var "Run"
        type        button
        label       "Run"
        shell       "cat %in1% | sed ""s/[\:\_]CDS/_/"" > %in1%.infile; (proml.py %in1%.infile %UTREE% %PROGRAM% %PMODEL% %SPEEDY% %GLOBAL% %METHOD% %REPLICATES% %BLOCKSIZE% %PERCENT% %JUMBLE% %NUMJUM% %OUTGRP% %TERMOUT% %ALLTREES% %PRINTDATA% %in1%.outfile %in1%.outtree %in1%.outtree.alltrees; %WHERE%; rm %in1% %in1%.infile ) "
        close       true
    var "Help"
        type        button
        label       "Help"
        shell       "$BIRCH/script/chooseviewer.py $BIRCH/doc/Phylip/proml.html"
        close       false
