// this menu defines windows for two RAxml interfaces: DNA and PROTEIN
// (depending on whether RAXML_DNA is defined or not)

#define RAXML_CODE(_TYPE_,_PARAMS_) \
        (GOTO_LOCAL_DIR ; \
         arb_export_rates --arb-notify -r "$RATES" > weights && \
         GEN_PHYLIP(infile) && \
         RUN_IN_WINDOW(arb_raxml _TYPE_ infile weights "$BASETREE" $CONSTRAINT \
                                $RANDOMSTART $OPTIMIZEPARAMETERS $SEARCH \
                                "$INITIALREARRANGEMENT" "$SEED" \
                                "$NUMBEROFRUNS" "$TAKETREES" $CONSENSE \
                                "PRG=RAxML FILTER=$FILTER RATE=$RATES ALGO=!$SEARCH" \
                                _PARAMS_ \
                        ); \
        RM_LOCAL_FILES(TmpInputFile last.infile treefile.in weights RAxML_info.treefile) )&

#ifdef RAXML_DNA
        item:RAxML (DNA)
        itemmethod: RAXML_CODE(DNA,$RATEMODELNUC $NUMCATEGORIES)
        seqtype:N
        itemmeta:R
#else
        item:RAxML (Protein)
        itemmethod: RAXML_CODE(PROTEIN,"$RATEMODELPROT" "$MATRIXNAME$EMPBFREQ")
        seqtype:A
        itemmeta:x
#endif
itemhelp:raxml.help

arg:RATES
argtype:weights
arglabel:Select a Weighting Mask
argchoice:POS_VAR_BY_PAR

arg:BASETREE
argtype:tree
arglabel:Base tree
argchoice:????

arg:CONSTRAINT
argtype:choice_menu
arglabel:Use as constraint tree
argchoice:No:0
argchoice:Yes:1

arg:RANDOMSTART
argtype:choice_menu
arglabel:Generate random starting tree\n(if no tree selected)
argchoice:No:0
argchoice:Yes:1



#ifdef RAXML_DNA

        arg:RATEMODELNUC
        argtype:choice_menu
        arglabel: Rate Distribution Model
        argchoice:GTRGAMMA:GTRGAMMA
        argchoice:GTRCAT:GTRCAT
        argchoice:GTRGAMMAI:GTRGAMMAI
        argchoice:GTRCATI:GTRCATI
        
        arg:NUMCATEGORIES
        argtype:text
        arglabel: # rate categories (GTRCAT only)
        argtext:25

#else

        arg:RATEMODELPROT
        argtype:choice_menu
        arglabel:Rate Distribution Model
        argchoice:PROTGAMMA:PROTGAMMA
        argchoice:PROTCAT:PROTCAT
        argchoice:PROTGAMMAI:PROTGAMMAI
        argchoice:PROTCATI:PROTCATI
        
        arg:MATRIXNAME
        argtype:choice_menu
        arglabel:AA Substitution Model
        argchoice:DAYHOFF:DAYHOFF
        argchoice:DCMUT:DCMUT
        argchoice:JTT:JTT
        argchoice:MTREV:MTREV
        argchoice:WAG:WAG
        argchoice:RTREV:RTREV
        argchoice:CPREV:CPREV
        argchoice:VT:VT
        argchoice:BLOSUM62:BLOSUM62
        argchoice:MTMAM:MTMAM
        argchoice:LG:LG
        argchoice:MTART:MTART
        argchoice:MTZOA:MTZOA
        argchoice:PMB:PMB
        argchoice:HIVB:HIVB
        argchoice:HIVW:HIVW
        argchoice:JTTDCMUT:JTTDCMUT
        argchoice:FLU:FLU
        argchoice:LG4M:LG4M
        argchoice:LG4X:LG4X
        argchoice:GTR:GTR
        argchoice:GTR_UNLINKED:GTR_UNLINKED
        argchoice:DUMMY:DUMMY
        argchoice:DUMMY2:DUMMY2
        argchoice:AUTO:AUTO

        arg:EMPBFREQ
        arglabel:Use empirical base frequencies?
        argtype:choice_menu
        argchoice:No:
        argchoice:Yes:F

#endif

arg:OPTIMIZEPARAMETERS
argtype:choice_menu
#ifdef RAXML_DNA
        arglabel:Optimize branches/parameters\n(GTRGAMMA only)
#else
        arglabel:Optimize branches/parameters\n(PROTGAMMA only)
#endif
argchoice:No:0
argchoice:Yes:1

arg:SEARCH
argtype:choice_menu
arglabel:Select RAxML algorithm
argchoice:new rapid hill climbing:d
argchoice:old hill climbing:o
argchoice:optimize input tree:e
argchoice:rapid bootstrap analysis:a
argchoice:add new sequences to input tree (MP):p
argchoice:randomized tree searches (fixed start tree):t

arg:SEED
argtype:text
arglabel:Random seed\n(empty=use time)
argtext:

arg:INITIALREARRANGEMENT
argtype:text
arglabel:Initial rearrangement setting\n(empty=autodetect)
argtext:

arg:NUMBEROFRUNS
argtype:text
arglabel:Number of runs
argtext:1

arg:TAKETREES
argtype:text
arglabel:Select ## best trees
argtext:1

arg:CONSENSE
argtype:choice_menu
arglabel:What to do with selected trees?
argchoice:Import into ARB:import
argchoice:Create consensus tree:consense

in:TmpInputFile
informat:genbank
insave:

