package com.cipres.mrBayesPlugin.ui; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import javax.swing.JFileChooser; import org.json.simple.JSONObject; import org.virion.jam.util.SimpleListener; import com.biomatters.geneious.publicapi.components.Dialogs; import com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument; import com.biomatters.geneious.publicapi.documents.sequence.SequenceAlignmentDocument; import com.biomatters.geneious.publicapi.documents.sequence.SequenceDocument; import com.biomatters.geneious.publicapi.plugin.DocumentOperationException; import com.biomatters.geneious.publicapi.plugin.Options; import com.biomatters.geneious.publicapi.plugin.Options.BooleanOption; import com.biomatters.geneious.publicapi.plugin.Options.ButtonOption; import com.biomatters.geneious.publicapi.plugin.Options.ComboBoxOption; import com.biomatters.geneious.publicapi.plugin.Options.DoubleOption; import com.biomatters.geneious.publicapi.plugin.Options.IntegerOption; import com.biomatters.geneious.publicapi.plugin.Options.Option; import com.biomatters.geneious.publicapi.plugin.Options.OptionValue; import com.biomatters.geneious.publicapi.plugin.Options.StringOption; import com.biomatters.geneious.publicapi.utilities.FileUtilities; import com.cipres.mrBayesPlugin.ui.CipresOptions.ParamType; import com.cipres.mrBayesPlugin.utilities.MrBayesUtilities; import jebl.util.SafePrintWriter; public class RAxMLRESTXSEDEOptions extends CipresOptions { private static DoubleOption maxHoursToRun; private static StringOption nameForOutput; private static IntegerOption nchar_; private static BooleanOption mlSearchUnderCAT; private static StringOption outgroup; private static IntegerOption numOfDistinctRateCate; private static BooleanOption disableRateHeterogeneity; private static StringOption treeFile; private static ButtonOption treeFileBrowse; private static BooleanOption specifyRandomSeed; private static IntegerOption randomSeed; private static BooleanOption specifyInitialRearrangeSetting; private static IntegerOption distanceFromPruningPoint; private static StringOption constraintFile; private static ButtonOption constraintFileBrowse; private static StringOption binaryBackboneFile; private static ButtonOption binaryBackboneFileBrowse; private static StringOption mixedPartitionedModelFile; private static ButtonOption mixedPartitionedModelFileBrowse; private static ComboBoxOption dnaPartitionsModel; private static BooleanOption estimateBranchLengths; private static ComboBoxOption correctAscBias; private static ComboBoxOption ascentainmentBiasCorrectionType; private static ComboBoxOption proportionOfInvariableSites; private static ComboBoxOption specify_ML_; private static StringOption excludeRangeOfPositionsFile; private static ButtonOption excludeRangeOfPositionsFileBrowse; private static StringOption weightCharactersFile; private static ButtonOption weightCharactersFileBrowse; private static BooleanOption disableCheckSeqWithNoValues; private static BooleanOption printMesquiteOutput; private static ComboBoxOption sequenceType; private static ComboBoxOption bootstrappingPhaseModel; private static ComboBoxOption gammaCATModel; private static ComboBoxOption proteinSubstitutionMatrix; private static StringOption customProteinSubstitutionMatrixFile; private static ButtonOption customProteinSubstitutionMatrixFileBrowse; private static BooleanOption usePartitionAA; private static StringOption substitutionMatrixFile1; private static ButtonOption substitutionMatrixFile1Browse; private static StringOption substitutionMatrixFile2; private static ButtonOption substitutionMatrixFile2Browse; private static StringOption substitutionMatrixFile3; private static ButtonOption substitutionMatrixFile3Browse; private static StringOption substitutionMatrixFile4; private static ButtonOption substitutionMatrixFile4Browse; private static StringOption substitutionMatrixFile5; private static ButtonOption substitutionMatrixFile5Browse; private static ComboBoxOption useEmpiricalBaseFrequencies; private static ComboBoxOption use_ml_freqs_; private static StringOption secondaryStructureFile; private static ButtonOption secondaryStructureFileBrowse; private static ComboBoxOption rnaSecondarySubModel; private static ComboBoxOption binaryDataModel; private static ComboBoxOption multipleStateDataModel; private static ComboBoxOption chooseStateDataModel; private static ComboBoxOption analysisType; private static BooleanOption specifyNumOfAltRuns; private static IntegerOption numOfAltRuns; private static StringOption topologiesBipartitionsFile; private static ButtonOption topologiesBipartitionsFileBrowse; private static BooleanOption notUseBFGS; private static BooleanOption writeIntermediateTree; private static BooleanOption useMLConvergenceCriteria; private static ComboBoxOption majorityRuleTree; private static StringOption additionalOptions; private static ComboBoxOption ascertainment_; private static ComboBoxOption ascertainment_corr_; private static StringOption ascertainment_pfile1_; private static ButtonOption ascertainment_pfile1_Browse_; private static StringOption ascertainment_pfile2_; private static ButtonOption ascertainment_pfile2_Browse_; private static StringOption ascertainment_pfile3_; private static ButtonOption ascertainment_pfile3_Browse_; private static StringOption ascertainment_pfile4_; private static ButtonOption ascertainment_pfile4_Browse_; private static StringOption ascertainment_pfile5_; private static ButtonOption ascertainment_pfile5_Browse_; private static StringOption ascertainment_pfile6_; private static ButtonOption ascertainment_pfile6_Browse_; private static BooleanOption dataset20G; private static IntegerOption numOfPatterns; private static IntegerOption numOfTaxa; private static ComboBoxOption bootstrappingType; private static IntegerOption randomSeedBootstrapping; private static ComboBoxOption bootstrapProtocol; private static IntegerOption numOfBootstraps; private static ComboBoxOption bootstoppingCriterion; private static ComboBoxOption posterioriAnalayis; private static StringOption posterioriBootstoppingFile; private static ButtonOption posterioriBootstoppingFileBrowse; private static BooleanOption printBranchLengths; protected static NameAndLabel[] nameAndLabels; /* private static BooleanOption bootstrappingHaltAuto; private static IntegerOption numOfBootstraps; private static DoubleOption spaceBuffer; private static ComboBoxOption sequenceType; private static DoubleOption spaceBuffer2; private static ComboBoxOption proteinSubstitutionMatrix; private static ComboBoxOption useEmpiricalBaseFrequencies; private static BooleanOption maximumLikelihoodSearch; private static BooleanOption notUseBFGS; private static BooleanOption printBranchLengths; */ private Options simpleOptions; private Options advancedOptions; private enum OptionIndex { MAXHOURSTORUN, NAMEFOROUTPUT, NCHAR_, MLSEARCHUNDERCAT, OUTGROUP, NUMOFDISTINCTRATECATE, DISABLERATEHETEROGENEITY, TREEFILE, SPECIFYRANDOMSEED, RANDOMSEED, SPECIFYINITIALREARRANGESETTING, DISTANCEFROMPRUNINGPOINT, CONSTRAINTFILE, BINARYBACKBONEFILE, MIXEDPARTITIONEDMODELFILE, ESTIMATEBRANCHLENGTHS, PROPORTIONOFINVARIABLESITES, SPECIFY_ML_, EXCLUDERANGEOFPOSITIONSFILE, WEIGHTCHARACTERSFILE, DISABLECHECKSEQWITHNOVALUES, PRINTMESQUITEOUTPUT, /**** Above Simple/ Below Advanced **********/ SEQUENCETYPE, BOOTSTRAPPINGPHASEMODEL, DNAPARTITIONSMODEL, GAMMACATMODEL, PROTEINSUBSTITUTIONMATRIX, CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE, USEPARTITIONAA, SUBSTITUTIONMATRIXFILE1, SUBSTITUTIONMATRIXFILE2, SUBSTITUTIONMATRIXFILE3, SUBSTITUTIONMATRIXFILE4, SUBSTITUTIONMATRIXFILE5, USEEMPIRICALBASEFREQUENCIES, USE_ML_FREQS_, SECONDARYSTRUCTUREFILE, RNASECONDARYSUBMODEL, BINARYDATAMODEL, MULTIPLESTATEDATAMODEL, CHOOSESTATEDATAMODEL, ANALYSISTYPE, SPECIFYNUMOFALTRUNS, NUMOFALTRUNS, TOPOLOGIESBIPARTITIONSFILE, NOTUSEBFGS, WRITEINTERMEDIATETREE, USEMLCONVERGENCECRITERIA, MAJORITYRULETREE, ADDITIONALOPTIONS, /* ASCERTAINMENT_, ASCERTAINMENT_CORR_,*/ CORRECTASCBIAS, ASCENTAINMENTBIASCORRECTIONTYPE, ASCERTAINMENT_PFILE1_, ASCERTAINMENT_PFILE2_, ASCERTAINMENT_PFILE3_, ASCERTAINMENT_PFILE4_, ASCERTAINMENT_PFILE5_, ASCERTAINMENT_PFILE6_, DATASET20G, NUMOFPATTERNS, NUMOFTAXA, BOOTSTRAPPINGTYPE, RANDOMSEEDBOOTSTRAPPING, BOOTSTRAPPROTOCOL, NUMOFBOOTSTRAPS, BOOTSTOPPINGCRITERION, POSTERIORIANALAYIS, POSTERIORIBOOTSTOPPINGFILE, PRINTBRANCHLENGTHS } enum ChildOptions { NUCLEICACIDOPTIONS("nucleicAcidOptions", "Nucleic Acid Options"), PROTEINOPTIONS("proteinOptions", "Protein Analysis Options"), RNAOPTIONS("RNAOptions", "RNA Secondary Structure Options"), BINARYOPTIONS("binaryOptions", "Binary Matrix Options"), MULTIPLESTATEOPTIONS("multipleStateOptions", "Multiple State Morphological Matrix Options"); private final String value; private final String label; ChildOptions(String value, String label) { this.value = value; this.label = label; } public String getValue() { return value; } public String getLabel() { return label; } } static { GENEIOUS_FORMAT = "geneious.phylip.rest"; nameAndLabels = new NameAndLabel[OptionIndex.values().length]; nameAndLabels[OptionIndex.MAXHOURSTORUN.ordinal()] = new NameAndLabel("maxHoursToRun", "Maximum Hours to Run", "runtime_", "Estimate the maximum time your job will need to run.
" + "We recommend testimg initially with a < 0.5hr test run because Jobs set for 0.5 h or less depedendably run immediately in the \"debug\" queue.
" + "Once you are sure the configuration is correct, you then increase the time.
" + "The reason is that jobs > 0.5 h are submitted to the \"normal\" queue, where jobs configured for 1 or a few hours times may run sooner than jobs configured for the full 168 hours."); nameAndLabels[OptionIndex.NAMEFOROUTPUT.ordinal()] = new NameAndLabel("nameForOutput", "Name for output files (-n)", "outsuffix_",""); nameAndLabels[OptionIndex.NCHAR_.ordinal()] = new NameAndLabel("nchar_", "Enter number of patterns in your dataset", "nchar_",""); nameAndLabels[OptionIndex.MLSEARCHUNDERCAT.ordinal()] = new NameAndLabel("mlSearchUnderCAT", "Enable ML searches under CAT (-F)", "MLsearch_CAT_", "This option allows one to enable tree searches under CAT for very large trees, as this saves memory.
"+ "This option can also be used under GAMMA models to avoid thorough optimization of the best scoring ML tree at the end of the run."); nameAndLabels[OptionIndex.OUTGROUP.ordinal()] = new NameAndLabel("outgroup", "Outgroup (one or more comma-separated outgroups)", "outgroup_", "The correct syntax for the box is outgroup1,outgroup2,outgroupn.
" + "If white space is introduced (e.g. outgroup1, outgroup2, outgroupn) the program will fail with the message \"Error, you must specify a model of substitution with the '-m' option\""); nameAndLabels[OptionIndex.NUMOFDISTINCTRATECATE.ordinal()] = new NameAndLabel("numOfDistinctRateCate", "Specify the number of distinct rate categories (-c)", "number_cats_", "This option allows you to specify the number of distinct rate categories, into which the individually optimized rates for each individual site are thrown under -m GTRCAT.
" + "The default of -c 25 works fine in most practical cases."); nameAndLabels[OptionIndex.DISABLERATEHETEROGENEITY.ordinal()] = new NameAndLabel("disableRateHeterogeneity", "Disable Rate Heterogeneity (-V)", "disable_ratehet_", "This option allows you to disable rate heterogeneity anong the sites. Valid for CAT model only."); nameAndLabels[OptionIndex.TREEFILE.ordinal()] = new NameAndLabel("treeFile", "Supply a tree (Not available when doing rapid bootstrapping, -x) (-t)", "treetop_", "Specifies a user starting tree file in Newick format.
" + "Not available when doing rapid bootstrapping.
" + "Branch lengths of that tree will be ignored.
" + "Note that you can also specify a non-comprehensive (not containing all taxa in the alignment) starting tree now.
" + "This might be useful if newly aligned/sequenced taxa have been added to your alignment.
" + "Initially, taxa will be added to the tree using the MP criterion. The comprehensive tree will then be optimized under ML."); nameAndLabels[OptionIndex.SPECIFYRANDOMSEED.ordinal()] = new NameAndLabel("specifyRandomSeed", "Specify a random seed value for parsimony inferences (-p)", "provide_parsimony_seed_", "Specify a random number seed.
" + "The -p option allows you and others to reproduce your results (reproducible/verifiable experiments) and will help Alexis debug the program.
" + "Do not use this option if you want to generate multiple different starting trees."); nameAndLabels[OptionIndex.RANDOMSEED.ordinal()] = new NameAndLabel("randomSeed", "Random seed value for parsimony inferences (-p \"value\" gives reproducible results from random starting tree)", "parsimony_seed_val_",""); nameAndLabels[OptionIndex.SPECIFYINITIALREARRANGESETTING.ordinal()] = new NameAndLabel("specifyInitialRearrangeSetting", "Specify an initial rearrangement setting (-i)", "rearrangement_yes_",""); nameAndLabels[OptionIndex.DISTANCEFROMPRUNINGPOINT.ordinal()] = new NameAndLabel("distanceFromPruningPoint", "Specify the distance from original pruning point (-i)", "number_rearrange_", "This option allows you to specify an initial rearrangement setting for the initial phase of the search algorithm.
" + "If you specify e.g. -i 10; the pruned subtrees will be inserted up to a distance of 10 nodes away from their original pruning point.
" + "If you dont specify -i; a \"good\" initial rearrangement setting will automatically be determined by RAxML."); nameAndLabels[OptionIndex.CONSTRAINTFILE.ordinal()] = new NameAndLabel("constraintFile", "Constraint (-g)", "constraint_", "This option allows you to specify an incomplete or comprehensive multifurcating constraint tree for the RAxML search in NEWICK format.
" + "Initially, multifurcations are resolved randomly.
" + "If the tree is incomplete (does not contain all taxa) the remaining taxa are added by using the MP criterion.
" + "Once a comprehensive (containing all taxa) bifurcating tree is computed, it is further optimized under ML respecting the given constraints.
" + "Important: If you specify a non-comprehensive constraint, e.g., a constraint tree that does not contain all taxa, RAxML will assume that any taxa that not found in the constraint topology are unconstrained, i.e., these taxa can be placed in any part of the tree.
" + "As an example consider an alignment with 10 taxa: Loach, Chicken, Human, Cow, Mouse, Whale, Seal, Carp, Rat, Frog. If, for example you would like Loach, Chicken, Human, Cow to be monophyletic you would specify the constraint tree as follows: ((Loach, Chicken, Human, Cow),(Mouse, Whale, Seal, Carp, Rat, Frog));
" + "Moreover, if you would like Loach, Chicken, Human, Cow to be monophyletic and in addition Human, Cow to be monophyletic within that clade you could specify: ((Loach, Chicken, (Human, Cow)),(Mouse, Whale, Seal, Carp, Rat, Frog));
" + "If you specify an incomplete constraint: ((Loach, Chicken, Human, Cow),(Mouse, Whale, Seal, Carp)); the two groups Loach, Chicken, Human, Cow and Mouse, Whale, Seal, Carp will be monophyletic, while Rat and Frog can end up anywhere in the tree."); nameAndLabels[OptionIndex.BINARYBACKBONEFILE.ordinal()] = new NameAndLabel("binaryBackbone", "Binary Backbone (-r)", "binary_backbone_", "This option allows you to pass a binary/bifurcating constraint/backbone tree in NEWICK format to RAxML.
" + "Note that using this option only makes sense if this tree contains fewer taxa than the input alignment.
" + "The remaining taxa will initially be added by using the MP criterion. Once a comprehensive tree with all taxa has been obtained it will be optimized under ML respecting the restrictions of the constraint tree."); nameAndLabels[OptionIndex.MIXEDPARTITIONEDMODELFILE.ordinal()] = new NameAndLabel("mixedPartitionedModelFile", "Use a mixed/partitioned model? (-q)", "partition_", "The multipleModelFileName parameter (-q) allows you to upload a file that specifies the regions of your alignment for which an individual model of nucleotide substitution should be estimated.
" + "This will typically be used to infer trees for long (in terms of base pairs) multi-gene alignments.
" + "For example, if -m GTRGAMMA is used, individual alpha-shape parameters, GTR-rates, and empirical base frequencies will be estimated and optimized for each partition.
" + "Since Raxml can now handle mixed Amino Acid and DNA alignments, you must specify the data type in the partition file, before the partition name.
" + "For DNA, this means you have to add DNA to each line in the partition.
" + "For AA data you must specify the transition matrices for each partition: The AA substitution model must be the first entry in each line and must be separated by a comma from the gene name, just like the DNA token above.
" + "You can not assign different models of rate heterogeneity to different partitions, i.e. it will be CAT or CATI. for all partitions.
" + "Finally, if you have a concatenated DNA and AA alignments, with DNA data at positions 1 - 500 and AA data at 501-1000 with the WAG model the partition file should look as follows: DNA, gene1 = 1-500; WAG, gene2 = 501-1000."); nameAndLabels[OptionIndex.DNAPARTITIONSMODEL.ordinal()] = new NameAndLabel("dnaPartitionsModel", "Evaluate DNA partitions only under this model", "partitionUnder_", "This option specifies that all DNA partitions will evolve under the HKY85 model, this overrides all other model specifications for DNA partitions.
" + "Note that, the output of the program might look a bit weird, since unlike in the definition of the model, RAxML actually estimates the rates from A - G and C - T while all other rates are set to 1.0.
" + "Note that, this does not matter, since the rates in the rate matrix are relative rates; the results (likelihoods) will be the same
"); nameAndLabels[OptionIndex.ESTIMATEBRANCHLENGTHS.ordinal()] = new NameAndLabel("estimateBranchLengths", "Estimate individual per-partition branch lengths (-M)", "estimate_perpartbrlen_", "The -M option switches on estimation of individual per-partition branch length.
" + "Only has effect when used in combination with -q and an alignment partition file.
" + "Branch lengths for individual partitions will be printed to separate files.
" + "A weighted average of the branch lengths is also computed by using the respective partition lengths (number of columns per partition).
" + "Note that, this does not take into account the \"gappyness\" of partitions, but I am currently not sure how to solve this problem.
" + "By default RAxML will compute a joined branch length estimate."); nameAndLabels[OptionIndex.CORRECTASCBIAS.ordinal()] = new NameAndLabel("correctAscBias", "Correct for Ascertainment bias (ASC_)", "ascertainment_", "This is useful for binary/morphological datasets that only contain variable sites (the identical morphological features are usually not included in the alignments, hence you need to correct for this, see, e.g., http://sysbio.oxfordjournals.org/content/50/6/913.short).
" + "For DNA data this option might be useful when you analyze alignments of SNPs that also don't contain constant sites.
" + "Note that, for mathematical and numerical reasons you can not apply an ascertainment bias correction to datasets or partitions that contain constantsites.
" + "In this case, RAxML will exit with an error."); nameAndLabels[OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE.ordinal()] = new NameAndLabel("ascentainmentBiasCorrectionType", "Ascertainment bias correction type (--asc-corr)", "ascertainment_corr_", "This option allows to specify the type of ascertainment bias correction you wish to use.
" + "There are three types available:
" + "Lewis: the standard correction by Paul Lewis,
" + "Felsenstein: a correction introduced by Joe Felsenstein that allows to explicitely specify the number of invariable sites (if known) one wants to correct for.
" + "Stamatakis: a correction introduced by myself that allows to explicitly specify the number of invariable sites for each character (if known) one wants to correct for.
" + "Flesenstein and Stamatkis corrections are accompanied by an upload file specified by the -q option, even if only one partiion is present.
" + "For file formatting, please see the RaxML 8.1 or higher manual."); nameAndLabels[OptionIndex.PROPORTIONOFINVARIABLESITES.ordinal()] = new NameAndLabel("proportionOfInvariableSites", "Estimate proportion of invariable sites (GTRGAMMA + I)", "invariable_", "This option is not recommended by the developer of RAxML"); nameAndLabels[OptionIndex.SPECIFY_ML_.ordinal()] = new NameAndLabel("specify_ML_", "Specify an ML estimate of base frequencies (GTRGAMMA + X)", "specify_ML_", ""); nameAndLabels[OptionIndex.EXCLUDERANGEOFPOSITIONSFILE.ordinal()] = new NameAndLabel("excludeRangeOfPositionsFile", "Choose an input file that excludes the range of positions specifed in this file (-E)", "exclude_file_", "This option is used to excludes specific positions in the matrix.
" + "For example, uploading a file that contains the text: 100-200 300-400 will create a file that excludes all columns between positions 100 and 200 as well as all columns between positions 300 and 400.
" + "Note that the boundary numbers (positions 100, 200, 300, and 400) will also be excluded.
" + "To exclude a single column write (100-100). This option does not run an analysis but just prints an alignment file without the excluded columns.
" + "Save this file to your data area, and then run the real analysis.
" + "If you use a mixed model, an appropriately adapted model file will also be written.
" + "The ntax element of the phylip files is automatically corrected Example: raxmlHPC -E excl -s infile -m GTRCAT -q part -n TEST. In this case the files with columns excluded will be named infile.excl and part.excl."); nameAndLabels[OptionIndex.WEIGHTCHARACTERSFILE.ordinal()] = new NameAndLabel("weightCharactersFile", "Weight characters as specifed in this file (-a)", "set_weights_ ", "This option alows you to specify a column weight file name to assign individual weights to each column of the alignment.
" + "Those weights must be integers separated by any type and number of whitespaces within a separate file.
" + "There must, of course, be as many weights as there are columns in your alignment.
" + "The contents of an example weight file could look like this: 5 1 1 2 1 1 1 1 1 1 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 4 1 1"); nameAndLabels[OptionIndex.DISABLECHECKSEQWITHNOVALUES.ordinal()] = new NameAndLabel("disableCheckSeqWithNoValues", "Disable checking for sequences with no values (-O)", "disable_seqcheck_",""); nameAndLabels[OptionIndex.PRINTMESQUITEOUTPUT.ordinal()] = new NameAndLabel("printMesquiteOutput", "Print output files that can be parsed by Mesquite. (-mesquite)", "mesquite_output_",""); nameAndLabels[OptionIndex.SEQUENCETYPE.ordinal()] = new NameAndLabel("sequenceType", "Sequence Type", "datatype_", ""); nameAndLabels[OptionIndex.BOOTSTRAPPINGPHASEMODEL.ordinal()] = new NameAndLabel("bootstrappingPhaseModel", "Choose model for bootstrapping phase", "dna_gtrcat_", "The meaning of the model name GTRGAMMA used by RAxML 7.2.0 is exactly opposite that used in RAxML 7.0.4, so we have eliminated selection by model name.
" + "Instead we use a description of the model analysis.
" + "This selection gives GTR + Optimization of substitution rates + Optimization of site-specific evolutionary rates which are categorized into \"numberOfCategories\" distinct rate categories for greater computational efficiency.
" + "Final tree is evaluated under GTRGAMMA. GTRMIX and GTRCAT_GAMMA have been eliminated as options.
" + "FLOAT options that are native in RAxML 7.2.3 are currently not supported here."); nameAndLabels[OptionIndex.GAMMACATMODEL.ordinal()] = new NameAndLabel("gammaCATModel", "Choose GAMMA or CAT model", "prot_sub_model_", ""); nameAndLabels[OptionIndex.PROTEINSUBSTITUTIONMATRIX.ordinal()] = new NameAndLabel("proteinSubstitutionMatrix", "Protein Substitution Matrix", "prot_matrix_spec_", "Note: FLOAT and invariable sites (I) options are not exposed here.
" + "If you require this option, please contact mmiller@sdsc.edu.
" + "-m PROTCATmatrixName: analyses using the specified AA matrix + Optimization of substitution rates + Optimization of site-specific evolutionary rates which are categorized into numberOfCategories distinct rate categories for greater computational efficiency.
" + "Final tree might be evaluated automatically under PROTGAMMAmatrixName[f], depending on the tree search option.
" + "-m PROTGAMMAmatrixName[F] anyses use the specified AA matrix + Optimization of substitution rates + GAMMA model of rate heterogeneity (alpha parameter will be estimated).
" + "Available AA substitution models: DAYHOFF, DCMUT, JTT, MTREV, WAG, RTREV, CPREV, VT, BLOSUM62, MTMAM, LG, GTR.
" + "You can specify if you want to use empirical base frequencies.
" + "Please note that for mixed models you can in addition specify the per-gene AA model in the mixed model file (see manual for details).
" + "Also note that if you estimate AA GTR parameters on a partitioned dataset, they will be linked (estimated jointly) across all partitions to avoid over-parametrization."); nameAndLabels[OptionIndex.CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE.ordinal()] = new NameAndLabel("customProteinSubstitutionMatrixFile", "Upload a Custom Protein Substitution Matrix (-P)", "user_prot_matrix_", "Specify a file containing a user-defined Protein substitution model.
" + "This file must contain 420 entries, the first 400 entires are the AA substitution rates (this matrix must be symmetric) and the last 20 entries are the empirical base frequencies"); nameAndLabels[OptionIndex.USEPARTITIONAA.ordinal()] = new NameAndLabel("usePartitionAA", "Use a Partition file that specifies AA Matrices", "mulcustom_aa_matrices_", "This option can be used to specify multiple custom matrices via a partition file.
" + "The filenames must be specified as firstpartition, secondpartition, thirdpartition, fourthpartition, and fifthpartition, in order"); nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE1.ordinal()] = new NameAndLabel("substitutionMatrixFile1", "Select the First Protein Substitution Matrix Called in Your Partition File", "user_prot_matrixq1_", "This option allows the user to upload a Protein subsitution matrix"); nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE2.ordinal()] = new NameAndLabel("substitutionMatrixFile2", "Select the Second Protein Substitution Matrix Called in Your Partition File", "user_prot_matrixq2_", "This option allows the user to upload a second Protein subsitution matrix"); nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE3.ordinal()] = new NameAndLabel("substitutionMatrixFile3", "Select the Third Protein Substitution Matrix Called in Your Partition File", "user_prot_matrixq3_", "This option allows the user to upload a third Protein subsitution matrix"); nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE4.ordinal()] = new NameAndLabel("substitutionMatrixFile4", "Select the Fourth Protein Substitution Matrix Called in Your Partition File", "user_prot_matrixq4_", "This option allows the user to upload a fourth Protein subsitution matrix"); nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE5.ordinal()] = new NameAndLabel("substitutionMatrixFile5", "Select the Fifth Protein Substitution Matrix Called in Your Partition File", "user_prot_matrixq5_", "This option allows the user to upload a fifth Protein subsitution matrix"); nameAndLabels[OptionIndex.USEEMPIRICALBASEFREQUENCIES.ordinal()] = new NameAndLabel("useEmpiricalBaseFrequencies", "Use empirical frequencies? [F]", "use_emp_freqs_", ""); nameAndLabels[OptionIndex.USE_ML_FREQS_.ordinal()] = new NameAndLabel("use_ml_freqs_", "Make an ML estimate of frequencies [X]", "use_ml_freqs_", ""); nameAndLabels[OptionIndex.SECONDARYSTRUCTUREFILE.ordinal()] = new NameAndLabel("secondaryStructureFile", "Upload a Secondary Structure File (-S)", "sec_str_file_", "This option allows you to provide a secondary structure file.
" + "The file can contain \".\" for alignment columns that do not form part of a stem and characters, while \"(), [], and {}\" are used to define stem regions and pseudoknots."); nameAndLabels[OptionIndex.RNASECONDARYSUBMODEL.ordinal()] = new NameAndLabel("rnaSecondarySubModel", "Use an RNA Secondary Structure Substitution Model (-A)", "rna_model_", "Use this option to specify one of the 6, 7, or 16 state RNA secondary structure substitution models.
" + "The nomenclature is identical to that used in the program PHASE.
" + "For more information, see PHASE documentation: 6 state model nomenclature: http://www.cs.manchester.ac.uk/ai/Software/phase/manual/node101.html; 7 state model nomenclature http://www.cs.manchester.ac.uk/ai/Software/phase/manual/node107.html; 16 state model nomenclature http://www.cs.manchester.ac.uk/ai/Software/phase/manual/node114.html"); nameAndLabels[OptionIndex.BINARYDATAMODEL.ordinal()] = new NameAndLabel("binaryDataModel", "Binary data model (-m)", "bin_model_", "Binary data is handled in RAXML 7.2.0.
" + "Binary CAT use optimization of site-specific evolutionary rates, which are categorized into numberOfCategories (option -c) distinct rate categories for greater computational efficiency.
" + "Final tree might be evaluatedautomatically under BINGAMMA, depending on the tree search option.
" + "Binary GAMMA uses the GAMMA model of rate heterogeneity (alpha parameter will be estimated). The option for invariable sites is not provided at this time.
" + "The program's author supports the use of Gamma models."); nameAndLabels[OptionIndex.MULTIPLESTATEDATAMODEL.ordinal()] = new NameAndLabel("multipleStateDataModel", "Multiple State Data Model (-m)", "multi_model_", "Multi-state morphological data are handled in RAXML at V. 7.3.0 and above.
" + "Multi-state CAT uses optimization of site-specific evolutionary rates which are categorized into numberOfCategories distinct rate categories for greater computational efficiency.
" + "Final tree might be evaluated automatically under MULTIGAMMA depending on the tree search option Mutli-state GAMMA uses the GAMMA model of rate heterogeneity (alpha parameter will be estimated).
" + "Invariable sites (I) options are not exposed here. If you require this option, please contact mmiller@sdsc.edu."); nameAndLabels[OptionIndex.CHOOSESTATEDATAMODEL.ordinal()] = new NameAndLabel("chooseStateDataModel", "Select a Multiple state data model (-K)", "choose_multi_model_", "Multi-state morphological data are handled in RAXML 7.3.0 and above.
" + "Multi-state CAT uses optimization of site-specific evolutionary rates which are categorized into numberOfCategories distinct rate categories for greater computational efficiency.
" + "Final tree might be evaluated automatically under MULTIGAMMA depending on the tree search option Mutli-state GAMMA uses the GAMMA model of rate heterogeneity (alpha parameter will be estimated).
" + "The program's author supports the use of Gamma models."); nameAndLabels[OptionIndex.ANALYSISTYPE.ordinal()] = new NameAndLabel("analysisType", "Select the Analysis Type", "select_analysis_", "-f d This is the default RAxML tree search algorithm and is substantially faster than the original search algorithm.
" + "It takes some shortcuts, but yields trees that are almost as good as the ones obtained from the full search algorithm.
" + "When -f b is specified, RAxML draws the bipartitions using a bunch of topologies (typically boot-strapped trees) specified with -z onto a single tree topology specified by -t (typically the best-scoring ML tree).
" + "When -f A is specified, RAxML computes marginal ancestral states/sequences on a given, fixed,and rooted reference tree.
" + "If you don't know what marginal ancestral states are please read Ziheng Yang's book on Computational Molecular Evolution..
" + "The -f h option computes a log likelihood test (SHtest) between the best tree passed via -t and a bunch of other trees passed via -z.
" + "The model parameters will be estimated on the first tree only!
" + "The -f T option allows the user to do a more thorough tree search that uses the less lazy, i.e. more exhaustive SPR moves, in a stand alone mode.
" + "This algorithm is typically executed in the very end of a search done by -f a.
" + "If you use the -f o option you will typically get slightly better likelihood scores while the run times are expected to increase by factor 2 to 3.
" + "The -y option computes a randomized parsimony starting tree with RAxML and not execute an ML analysis of the tree specify -y. " + "The program will exit after computation of the starting tree.
" + "This option can be useful if you want to assess the impact of randomized MP and Neighbor Joining starting trees on your search algorithm.
" + "They can also be used e.g. as starting trees for Derrick Zwickls GARLI program for ML inferences, which needs comparatively good starting trees to work well above approximately 500 taxa."); nameAndLabels[OptionIndex.SPECIFYNUMOFALTRUNS.ordinal()] = new NameAndLabel("specifyNumOfAltRuns", "Specify the number alternative runs on distinct starting trees? (-N)", "specify_runs_", "This option specifies the number of alternative runs on distinct starting trees.
" + "For example, if -N 10 is specfied, RAxML will compute 10 distinct ML trees starting from 10 distinct randomized maximum parsimony starting trees."); nameAndLabels[OptionIndex.NUMOFALTRUNS.ordinal()] = new NameAndLabel("numOfAltRuns", "Enter number of alternative runs (-N)", "altrun_number_", "if -N 10 is specfied, RAxML will compute 10 distinct ML trees starting from 10 distinct randomized maximum parsimony starting trees."); nameAndLabels[OptionIndex.TOPOLOGIESBIPARTITIONSFILE.ordinal()] = new NameAndLabel("topologiesBipartitionsFile", "File with topologies for bipartitions (-z)", "bunchotops_", "The -z option is used in combination with the -f b,-f h,-f m,-f n options.
" + "The uploaded file should contain a number of trees in NEWICK format.
" + "The file should contain one tree per line without blank lines between trees.
" + "For example, you can directly read in a RAxML bootstrap result file."); nameAndLabels[OptionIndex.NOTUSEBFGS.ordinal()] = new NameAndLabel("notUseBFGS", "Don't use BFGS searching algorithm (--no-bfgs)", "no_bfgs_", "BFGS is a more efficient optimization algorithm for optimizing branch lengths and GTR parameters simultaneously. YUOu can disable it using this option"); nameAndLabels[OptionIndex.WRITEINTERMEDIATETREE.ordinal()] = new NameAndLabel("writeIntermediateTree", "Write intermediate tree files to a file (-j)", "intermediate_treefiles_", "This will simply print out a couple of intermediate trees during the tree search and not the final tree only.
" + "The intermediate trees are written to files called: RAxML_checkpoint.TEST.0, RAxML_checkpoint.TEST.1, etc."); nameAndLabels[OptionIndex.USEMLCONVERGENCECRITERIA.ordinal()] = new NameAndLabel("useMLConvergenceCriteria", "Use ML search convergence criterion. (-D)", "convergence_criterion_", "-D option = ML search convergence criterion.
" + "This will break off ML searches if the relative RobinsonFoulds distance between the trees obtained from two consecutive lazy SPR cycles is smaller or equal to 1%.
" + "Usage recommended for very large datasets in terms of taxa.
" + "On trees with more than 500 taxa this will yield execution time improvements of approximately 50% while yielding only slightly worse trees."); nameAndLabels[OptionIndex.MAJORITYRULETREE.ordinal()] = new NameAndLabel("majorityRuleTree", "Specify majority rule consensus tree (-J) technique", "specify_mr_", "You must use a collection of trees as your input file for this option.
" + "The option lets you compute a majority rule consensus tree with \"MR\" or extended majority rule consensus tree with \"J MRE\" or strict consensus tree with \"J STRICT\".
" + "Options \"J STRICT_DROP\" and \"J MR_DROP\" will execute an algorithm that identifies dropsets which contain rogue taxa as proposed by Pattengale et al. in the paper \"Uncovering hidden phylogenetic consensus\"."); nameAndLabels[OptionIndex.ADDITIONALOPTIONS.ordinal()] = new NameAndLabel("additionalOptions", "Additional RAxML options (advanced users only)", "generic_", "This option is meant to allow users to run command line strings that are not currently supported explicitly by the interface.
" + "Values must be valid RaxML commands, and so must be preceded with a - or --. Commands requiring file uploads are not currently supported.
" + "It is possible to enter commands that dont make sense, or conflict with already provided RaxML commands.
" + "We rely on the user to be vigilant."); //nameAndLabels[OptionIndex.ASCERTAINMENT_.ordinal()] = new NameAndLabel("ascertainment_", "Correct for Ascertainmnet bias (ASC_)", "ascertainment_",""); //nameAndLabels[OptionIndex.ASCERTAINMENT_CORR_.ordinal()] = new NameAndLabel("ascertainment_corr_", "Ascertainmnet bias correction type (--asc-corr)", "ascertainment_corr_",""); nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE1_.ordinal()] = new NameAndLabel("ascertainment_pfile1_", "Choose Ascertainmnet bias correction file 1 (will be named p1.txt)", "ascertainment_pfile1_","", true); nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE2_.ordinal()] = new NameAndLabel("ascertainment_pfile2_", "Choose Ascertainmnet bias correction file 2 (will be named p2.txt)", "ascertainment_pfile2_","", true); nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE3_.ordinal()] = new NameAndLabel("ascertainment_pfile3_", "Choose Ascertainmnet bias correction file 3 (will be named p3.txt)", "ascertainment_pfile3_","", true); nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE4_.ordinal()] = new NameAndLabel("ascertainment_pfile4_", "Choose Ascertainmnet bias correction file 4 (will be named p4.txt)", "ascertainment_pfile4_","", true); nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE5_.ordinal()] = new NameAndLabel("ascertainment_pfile5_", "Choose Ascertainmnet bias correction file 5 (will be named p5.txt)", "ascertainment_pfile5_","", true); nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE6_.ordinal()] = new NameAndLabel("ascertainment_pfile6_", "Choose Ascertainmnet bias correction file 6 (will be named p6.txt)", "ascertainment_pfile6_","", true); nameAndLabels[OptionIndex.DATASET20G.ordinal()] = new NameAndLabel("dataset20G", "I have a data set that may require more than 20 GB of memory", "more_memory_", "To figure out if you need this option, use the RAxML memory calculator here: http://sco.h-its.org/exelixis/software.html.
" + "Input the number of taxa, and patterns (or characters), and the gamma model(AA or DNA, as appropriate for your data).
" + "Multiply the value you receive times 32. If that value is greater than 64 GB, then you should select this option.
" + "If you dont, the run will fail silently at the end due to an out of memory error."); nameAndLabels[OptionIndex.NUMOFPATTERNS.ordinal()] = new NameAndLabel("numOfPatterns", "Number of patterns in your dataset", "nchar_", "Knowing the number of characters in your dataset helps us determine the most efficient way to run raxml.
" + "We need to know the number of characters per row in the input data matrix"); nameAndLabels[OptionIndex.NUMOFTAXA.ordinal()] = new NameAndLabel("numOfTaxa", "Number of taxa in your dataset", "ntax_", "Knowing the number of taxa and patterns in your dataset helps us determine the most efficient way to run raxml."); nameAndLabels[OptionIndex.BOOTSTRAPPINGTYPE.ordinal()] = new NameAndLabel("bootstrappingType", "Choose a Bootstrapping Type", "choose_bootstrap_", "The -b option allows you to turn on non-parametric bootstrapping.
" + "Note that parallel bootstraps with the parallel version raxmlHPC-MPI are not reproducible despite the fact that you specify a random number seed.
" + "Use rapid bootstrapping (-x) to turn on rapid bootstrapping.
" + "CAUTION: unlike in previous versions of RAxML will conduct rapid BS replicates under the model of rate heterogeneity you specified via m and not by default under CAT"); nameAndLabels[OptionIndex.RANDOMSEEDBOOTSTRAPPING.ordinal()] = new NameAndLabel("randomSeedBootstrapping", "Enter a random seed value for bootstrapping", "seed_value_", "This random number is provided to assure that there is comparability between runs."); nameAndLabels[OptionIndex.BOOTSTRAPPROTOCOL.ordinal()] = new NameAndLabel("bootstrapProtocol", "Specify bootstrap protocol", "choose_bootstop_", "This option instructs Raxml to automatically halt bootstrapping when certain criteria are met, instead of specifying the number of bootstraps for an analysis.
" + "The exact criteria are specified/configured using subsequent entry fields."); nameAndLabels[OptionIndex.NUMOFBOOTSTRAPS.ordinal()] = new NameAndLabel("numOfBootstraps", "Bootstrap iterations (-N)", "bootstrap_value_", "Specifies the number of alternative runs on distinct starting trees.
" + "If 10, RAxML computes 10 distinct ML trees starting from 10 distinct randomized maximum parsimony starting trees.
" + "In combination with the Random seed for rapid bootstrap (-x) invoke a rapid BS analysis."); nameAndLabels[OptionIndex.BOOTSTOPPINGCRITERION.ordinal()] = new NameAndLabel("bootstoppingCriterion", "Select Bootstopping Criterion: (autoMRE is recommended)", "bootstopping_type_", ""); nameAndLabels[OptionIndex.POSTERIORIANALAYIS.ordinal()] = new NameAndLabel("posterioriAnalayis", "Select the criterion for a posteriori bootstopping analysis (-I)", "aposterior_bootstopping_", "This option allows the user to conduct a posteriori bootstopping analysis based on a set of bootstrapped trees.
" + "Use: autoFC for the frequency-based criterion, autoMR for the majority-rule consensus tree criterion, autoMRE for the extended majority-rule consensus tree criterion and autoMRE_IGN for metrics similar to MRE, but include bipartitions under the threshold whether they are compatible or not.
" + "This emulates MRE but is faster to compute.
" + "For any of these options, you also need to upload a tree file containing several bootstrap replicates via \"-z\""); nameAndLabels[OptionIndex.POSTERIORIBOOTSTOPPINGFILE.ordinal()] = new NameAndLabel("posterioriBootstoppingFile", "File with topologies for a posteriori bootstopping (-z)", "aposterior_topologies_", "File with topologies for a posteriori bootstopping"); nameAndLabels[OptionIndex.PRINTBRANCHLENGTHS.ordinal()] = new NameAndLabel("printBranchLengths", "Print branch lengths (-k)", "printbrlength_", "The -k option causes bootstrapped trees to be printed with branch lengths.
" + "The bootstraps will require a bit longer to run under this option because model parameters will be optimized at the end of each run under GAMMA or GAMMA+P-Invar respectively."); GENEIOUS_FORMAT = "geneious.xsede.phylip"; } //AnnotatedPluginDocument[] selectedDocuments = null; public RAxMLRESTXSEDEOptions(final AnnotatedPluginDocument[] selectedDocuments) throws DocumentOperationException { OPTION_NAME = "RAxML_CIPRES"; this.selectedDocuments = selectedDocuments; jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); simpleOptions = this.addChildOptions("simpleOptions", "Simple Parameters", ""); addJobNameOption(simpleOptions, selectedDocuments, 3); simpleOptions.beginAlignHorizontally(null, false); maxHoursToRun = simpleOptions.addDoubleOption(nameAndLabels[OptionIndex.MAXHOURSTORUN.ordinal()].name, nameAndLabels[OptionIndex.MAXHOURSTORUN.ordinal()].label, 0.25, 0.1, 320.00); simpleOptions.addLabel(" "); nameForOutput = simpleOptions.addStringOption(nameAndLabels[OptionIndex.NAMEFOROUTPUT.ordinal()].name, nameAndLabels[OptionIndex.NAMEFOROUTPUT.ordinal()].label, "result"); simpleOptions.addLabel(" "); //nchar_= simpleOptions.addIntegerOption(nameAndLabels[OptionIndex.NCHAR_.ordinal()].name, nameAndLabels[OptionIndex.NCHAR_.ordinal()].label, 1000, 1, Integer.MAX_VALUE); mlSearchUnderCAT = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.MLSEARCHUNDERCAT.ordinal()].name, nameAndLabels[OptionIndex.MLSEARCHUNDERCAT.ordinal()].label, false); //mlSearchUnderCAT.setEnabled(false); //maxHoursToRun.setDescription("TEST TEST"); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); nchar_= simpleOptions.addIntegerOption(nameAndLabels[OptionIndex.NCHAR_.ordinal()].name, nameAndLabels[OptionIndex.NCHAR_.ordinal()].label, 1000, 1, Integer.MAX_VALUE); simpleOptions.addLabel(" "); outgroup = simpleOptions.addStringOption(nameAndLabels[OptionIndex.OUTGROUP.ordinal()].name, nameAndLabels[OptionIndex.OUTGROUP.ordinal()].label, ""); simpleOptions.addLabel(" "); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); numOfDistinctRateCate = simpleOptions.addIntegerOption(nameAndLabels[OptionIndex.NUMOFDISTINCTRATECATE.ordinal()].name, nameAndLabels[OptionIndex.NUMOFDISTINCTRATECATE.ordinal()].label, 25, 1, Integer.MAX_VALUE); simpleOptions.addLabel(" "); disableRateHeterogeneity = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.DISABLERATEHETEROGENEITY.ordinal()].name, nameAndLabels[OptionIndex.DISABLERATEHETEROGENEITY.ordinal()].label, false) ; addBuffer(simpleOptions); //StringOption buffer00 = simpleOptions.addStringOption("buffer", "buffer", ""); //buffer00.setVisible(false); simpleOptions.addLabel(" "); simpleOptions.addLabel(" "); //simpleOptions.addLabel(" "); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); treeFile = simpleOptions.addStringOption(nameAndLabels[OptionIndex.TREEFILE.ordinal()].name, nameAndLabels[OptionIndex.TREEFILE.ordinal()].label, ""); treeFileBrowse = simpleOptions.addButtonOption("treeFileBrowse", "", "Browse"); treeFileBrowse.addActionListener(new BrowseButtonActionListener(treeFile, jfc)); ButtonOption treeFileClear = simpleOptions.addButtonOption("treeFileClear", "", "Clear"); treeFileClear.addActionListener(new ClearButtonActionListener(treeFile)); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); specifyRandomSeed = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.SPECIFYRANDOMSEED.ordinal()].name, nameAndLabels[OptionIndex.SPECIFYRANDOMSEED.ordinal()].label, true); addBuffer(simpleOptions); //StringOption buffer01 = simpleOptions.addStringOption("buffer01", "buffer", ""); //buffer01.setVisible(false); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); randomSeed = simpleOptions.addIntegerOption(nameAndLabels[OptionIndex.RANDOMSEED.ordinal()].name, nameAndLabels[OptionIndex.RANDOMSEED.ordinal()].label, 12345, Integer.MIN_VALUE, Integer.MAX_VALUE); addBuffer(simpleOptions); //StringOption buffer02 = simpleOptions.addStringOption("buffer02", "buffer", ""); //buffer02.setVisible(false); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); specifyInitialRearrangeSetting = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.SPECIFYINITIALREARRANGESETTING.ordinal()].name, nameAndLabels[OptionIndex.SPECIFYINITIALREARRANGESETTING.ordinal()].label, false); distanceFromPruningPoint = simpleOptions.addIntegerOption(nameAndLabels[OptionIndex.DISTANCEFROMPRUNINGPOINT.ordinal()].name, nameAndLabels[OptionIndex.DISTANCEFROMPRUNINGPOINT.ordinal()].label, 10, Integer.MIN_VALUE, Integer.MAX_VALUE); ; addBuffer(simpleOptions); //StringOption buffer03 = simpleOptions.addStringOption("buffer03", "buffer", ""); //buffer03.setVisible(false); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); constraintFile = simpleOptions.addStringOption(nameAndLabels[OptionIndex.CONSTRAINTFILE.ordinal()].name, nameAndLabels[OptionIndex.CONSTRAINTFILE.ordinal()].label, ""); constraintFileBrowse = simpleOptions.addButtonOption("constraintFileBrowse", "", "Browse"); constraintFileBrowse.addActionListener(new BrowseButtonActionListener(constraintFile, jfc)); ButtonOption constraintFileClear = simpleOptions.addButtonOption("constraintFileClear", "", "Clear"); constraintFileClear.addActionListener(new ClearButtonActionListener(constraintFile)); binaryBackboneFile = simpleOptions.addStringOption(nameAndLabels[OptionIndex.BINARYBACKBONEFILE.ordinal()].name, nameAndLabels[OptionIndex.BINARYBACKBONEFILE.ordinal()].label, ""); //simpleOptions.addLabel(""); binaryBackboneFileBrowse = simpleOptions.addButtonOption("binaryBackboneBrowseFile", "", "Browse"); binaryBackboneFileBrowse.addActionListener(new BrowseButtonActionListener(binaryBackboneFile, jfc)); ButtonOption binaryBackboneFileClear = simpleOptions.addButtonOption("binaryBackboneFileClear", "", "Clear"); binaryBackboneFileClear.addActionListener(new ClearButtonActionListener(binaryBackboneFile)); //constraintFile.setPreferredWidth(201); //setEnabled(OptionIndex.CONSTRAINTFILE, false); //binaryBackboneFile.setPreferredWidth(201); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); mixedPartitionedModelFile = simpleOptions.addStringOption(nameAndLabels[OptionIndex.MIXEDPARTITIONEDMODELFILE.ordinal()].name, nameAndLabels[OptionIndex.MIXEDPARTITIONEDMODELFILE.ordinal()].label, ""); mixedPartitionedModelFileBrowse = simpleOptions.addButtonOption("mixedPartitionedModelFileBrowse", "", "Browse"); mixedPartitionedModelFileBrowse.addActionListener(new BrowseButtonActionListener(mixedPartitionedModelFile, jfc)); ButtonOption mixedPartitionedModelFileClear = simpleOptions.addButtonOption("mixedPartitionedModelFileClear", "", "Clear"); mixedPartitionedModelFileClear.addActionListener(new ClearButtonActionListener(mixedPartitionedModelFile)); //spaceBuffer2 = addDoubleOption(nameAndLabels[OptionIndex.SPACEBUFFER2.ordinal()].name, nameAndLabels[OptionIndex.SPACEBUFFER2.ordinal()].label, 0.25, 0.25, Double.MAX_VALUE); //spaceBuffer2.setVisible(false); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); /* final OptionValue[] dnaModel = new OptionValue[3]; dnaModel[0] = new OptionValue(HKY85, HKY85); dnaModel[1] = new OptionValue(K80, K80); dnaModel[2] = new OptionValue(JC69, JC69);*/ estimateBranchLengths = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.ESTIMATEBRANCHLENGTHS.ordinal()].name, nameAndLabels[OptionIndex.ESTIMATEBRANCHLENGTHS.ordinal()].label, false); //dnaPartitionsModel = simpleOptions.addComboBoxOption(nameAndLabels[OptionIndex.DNAPARTITIONSMODEL.ordinal()].name, nameAndLabels[OptionIndex.DNAPARTITIONSMODEL.ordinal()].label, dnaModel, dnaModel[0]); //estimateBranchLengths.setEnabled(false); addBuffer(simpleOptions); //StringOption buffer04 = simpleOptions.addStringOption("buffer04", "buffer", ""); // buffer04.setVisible(false); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); final OptionValue[] yesOrNo0= new OptionValue[2]; yesOrNo0[0] = new OptionValue(ML_FREQUENCY, YES); yesOrNo0[1] = new OptionValue("", NO); specify_ML_ = simpleOptions.addComboBoxOption(nameAndLabels[OptionIndex.SPECIFY_ML_.ordinal()].name, nameAndLabels[OptionIndex.SPECIFY_ML_.ordinal()].label, yesOrNo0, yesOrNo0[1]); final OptionValue[] yesOrNo= new OptionValue[2]; yesOrNo[0] = new OptionValue(INVARIABLE, YES); yesOrNo[1] = new OptionValue("", NO); proportionOfInvariableSites = simpleOptions.addComboBoxOption(nameAndLabels[OptionIndex.PROPORTIONOFINVARIABLESITES.ordinal()].name, " " + nameAndLabels[OptionIndex.PROPORTIONOFINVARIABLESITES.ordinal()].label, yesOrNo, yesOrNo[1]); addBuffer(simpleOptions); //StringOption buffer06 = simpleOptions.addStringOption("buffer06", "buffer", ""); //buffer06.setVisible(false); simpleOptions.endAlignHorizontally(); /* simpleOptions.beginAlignHorizontally(null, false); final OptionValue[] yesNo = new OptionValue[2]; yesNo[0] = new OptionValue(ASC_, YES); yesNo[1] = new OptionValue("", NO); final OptionValue[] ascCorr = new OptionValue[3]; ascCorr[0] = new OptionValue(LEWIS, capitializeFirstChar(LEWIS)); ascCorr[1] = new OptionValue(FELSENSTEIN, capitializeFirstChar(FELSENSTEIN)); ascCorr[2] = new OptionValue(STAMATAKIS, capitializeFirstChar(STAMATAKIS)); correctAscBias = simpleOptions.addComboBoxOption(nameAndLabels[OptionIndex.CORRECTASCBIAS.ordinal()].name, nameAndLabels[OptionIndex.CORRECTASCBIAS.ordinal()].label, yesNo, yesNo[0]); simpleOptions.addLabel(" "); ascentainmentBiasCorrectionType = simpleOptions.addComboBoxOption(nameAndLabels[OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE.ordinal()].name, nameAndLabels[OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE.ordinal()].label, ascCorr, ascCorr[0]); addBuffer(simpleOptions); //StringOption buffer05 = simpleOptions.addStringOption("buffer05", "buffer", ""); //buffer05.setVisible(false); simpleOptions.endAlignHorizontally(); */ /* simpleOptions.beginAlignHorizontally(null, false); final OptionValue[] yesOrNo= new OptionValue[2]; yesOrNo[0] = new OptionValue(INVARIABLE, YES); yesOrNo[1] = new OptionValue("", NO); proportionOfInvariableSites = simpleOptions.addComboBoxOption(nameAndLabels[OptionIndex.PROPORTIONOFINVARIABLESITES.ordinal()].name, nameAndLabels[OptionIndex.PROPORTIONOFINVARIABLESITES.ordinal()].label, yesOrNo, yesOrNo[1]); addBuffer(simpleOptions); //StringOption buffer06 = simpleOptions.addStringOption("buffer06", "buffer", ""); //buffer06.setVisible(false); simpleOptions.endAlignHorizontally(); */ simpleOptions.beginAlignHorizontally(null, false); excludeRangeOfPositionsFile = simpleOptions.addStringOption(nameAndLabels[OptionIndex.EXCLUDERANGEOFPOSITIONSFILE.ordinal()].name, nameAndLabels[OptionIndex.EXCLUDERANGEOFPOSITIONSFILE.ordinal()].label, ""); excludeRangeOfPositionsFileBrowse = simpleOptions.addButtonOption("excludeRangeOfPositionsFileBrowse", "", "Browse"); excludeRangeOfPositionsFileBrowse.addActionListener(new BrowseButtonActionListener(excludeRangeOfPositionsFile, jfc)); ButtonOption excludeRangeOfPositionsFileClear = simpleOptions.addButtonOption("excludeRangeOfPositionsFileClear", "", "Clear"); excludeRangeOfPositionsFileClear.addActionListener(new ClearButtonActionListener(excludeRangeOfPositionsFile)); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); weightCharactersFile = simpleOptions.addStringOption(nameAndLabels[OptionIndex.WEIGHTCHARACTERSFILE.ordinal()].name, nameAndLabels[OptionIndex.WEIGHTCHARACTERSFILE.ordinal()].label, "");; weightCharactersFileBrowse = simpleOptions.addButtonOption("weightCharactersFileBrowse", "", "Browse"); weightCharactersFileBrowse.addActionListener(new BrowseButtonActionListener(weightCharactersFile, jfc)); //excludeRangeOfPositionsFile.setShouldSaveValue(false); ButtonOption weightCharactersFileClear = simpleOptions.addButtonOption("weightCharactersFileClear", "", "Clear"); weightCharactersFileClear.addActionListener(new ClearButtonActionListener(weightCharactersFile)); disableCheckSeqWithNoValues = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.DISABLECHECKSEQWITHNOVALUES.ordinal()].name, nameAndLabels[OptionIndex.DISABLECHECKSEQWITHNOVALUES.ordinal()].label, false); simpleOptions.endAlignHorizontally(); simpleOptions.beginAlignHorizontally(null, false); printMesquiteOutput = simpleOptions.addBooleanOption(nameAndLabels[OptionIndex.PRINTMESQUITEOUTPUT .ordinal()].name, nameAndLabels[OptionIndex.PRINTMESQUITEOUTPUT.ordinal()].label, false); //printMesquiteOutput.setEnabled(false); addBuffer(simpleOptions); //StringOption buffer07 = simpleOptions.addStringOption("buffer07", "buffer", ""); //buffer07.setVisible(false); simpleOptions.endAlignHorizontally(); /*******************************************************/ /* Above Simple Parameters. Below Advanced Parameters */ advancedOptions = this.addChildOptions("advancedOptions", "Advanced Parameters", ""); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] sqType = new OptionValue[5]; sqType[0] = new OptionValue(PROTEIN.toLowerCase(), PROTEIN); sqType[1] = new OptionValue(DNA, NUCLEOTIDE); sqType[2] = new OptionValue(RNA, RNA_STRUCTURE); sqType[3] = new OptionValue(BINARY, BINARY_MORPHOLOGICAL); sqType[4] = new OptionValue(MULTI, MULTI_STATE_MORPHOLOGICAL); sequenceType = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.SEQUENCETYPE.ordinal()].name, nameAndLabels[OptionIndex.SEQUENCETYPE.ordinal()].label, sqType, sqType[1]); addBuffer(advancedOptions); //StringOption buffer100 = advancedOptions.addStringOption("buffer100", "buffer", ""); //buffer100.setVisible(false); //advancedOptions.addLabel(" "); //advancedOptions.addLabel(" "); advancedOptions.addLabel(" "); advancedOptions.addLabel(" "); advancedOptions.endAlignHorizontally(); class NucleicOptions extends Options { public NucleicOptions(final AnnotatedPluginDocument[] selectedDocuments) throws DocumentOperationException { beginAlignHorizontally(null, false); final OptionValue[] model = new OptionValue[2]; model[0] = new OptionValue(GTRCAT, GTRCAT); model[1] = new OptionValue(GTRGAMMA, GTRGAMMA); bootstrappingPhaseModel = addComboBoxOption(nameAndLabels[OptionIndex.BOOTSTRAPPINGPHASEMODEL.ordinal()].name, nameAndLabels[OptionIndex.BOOTSTRAPPINGPHASEMODEL.ordinal()].label, model, model[0]); final OptionValue[] dnaModel = new OptionValue[3]; dnaModel[0] = new OptionValue(HKY85, HKY85); dnaModel[1] = new OptionValue(K80, K80); dnaModel[2] = new OptionValue(JC69, JC69); dnaPartitionsModel = addComboBoxOption(nameAndLabels[OptionIndex.DNAPARTITIONSMODEL.ordinal()].name," " + nameAndLabels[OptionIndex.DNAPARTITIONSMODEL.ordinal()].label, dnaModel, dnaModel[0]); addBuffer(this); endAlignHorizontally(); } } advancedOptions.addCollapsibleChildOptions(ChildOptions.NUCLEICACIDOPTIONS.getValue(), ChildOptions.NUCLEICACIDOPTIONS.getLabel(), ChildOptions.NUCLEICACIDOPTIONS.getLabel(), new NucleicOptions(selectedDocuments), true, false); /* advancedOptions.addDivider("Nucleic Acid Options"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] model = new OptionValue[2]; model[0] = new OptionValue(GTRCAT, GTRCAT); model[1] = new OptionValue(GTRGAMMA, GTRGAMMA); bootstrappingPhaseModel = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.BOOTSTRAPPINGPHASEMODEL.ordinal()].name, nameAndLabels[OptionIndex.BOOTSTRAPPINGPHASEMODEL.ordinal()].label, model, model[0]); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); */ class ProteinOptions extends Options { public ProteinOptions(final AnnotatedPluginDocument[] selectedDocuments) throws DocumentOperationException { beginAlignHorizontally(null, false); final OptionValue[] gammaCatModel = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.PROTGAMMA, ComboBoxValueLabel.PROTCAT);; gammaCATModel = addComboBoxOption(nameAndLabels[OptionIndex.GAMMACATMODEL.ordinal()].name, nameAndLabels[OptionIndex.GAMMACATMODEL.ordinal()].label, gammaCatModel, gammaCatModel[1]); final OptionValue[] matrix= new OptionValue[26]; int idx = 0; matrix[idx++] = new OptionValue(DAYHOFF, DAYHOFF); matrix[idx++] = new OptionValue(DCMUT, DCMUT); matrix[idx++] = new OptionValue(JTT, JTT); matrix[idx++] = new OptionValue(MTREV, MTREV); matrix[idx++] = new OptionValue(WAG, WAG); matrix[idx++] = new OptionValue(RTREV, RTREV); matrix[idx++] = new OptionValue(CPREV, CPREV); matrix[idx++] = new OptionValue(VT, VT); matrix[idx++] = new OptionValue(BLOSUM62, BLOSUM62); matrix[idx++] = new OptionValue(MTMAM, MTMAM); matrix[idx++] = new OptionValue(LG, LG); matrix[idx++] = new OptionValue(MTART, MTART); matrix[idx++] = new OptionValue(MTZOA, MTZOA); matrix[idx++] = new OptionValue(PMB, PMB); matrix[idx++] = new OptionValue(HIVB, HIVB); matrix[idx++] = new OptionValue(HIVW, HIVW); matrix[idx++] = new OptionValue(JTTDCMUT, JTTDCMUT); matrix[idx++] = new OptionValue(FLU, FLU); matrix[idx++] = new OptionValue(DUMMY, DUMMY); matrix[idx++] = new OptionValue(DUMMY2, DUMMY2); matrix[idx++] = new OptionValue(AUTO, AUTO); matrix[idx++] = new OptionValue(LG4M, LG4M); matrix[idx++] = new OptionValue(LG4X, LG4X); matrix[idx++] = new OptionValue(PROT_FILE, PROT_FILE); matrix[idx++] = new OptionValue(GTR_UNLINKED, GTR_UNLINKED); matrix[idx++] = new OptionValue(GTR, GTR); proteinSubstitutionMatrix = addComboBoxOption(nameAndLabels[OptionIndex.PROTEINSUBSTITUTIONMATRIX.ordinal()].name, " " + nameAndLabels[OptionIndex.PROTEINSUBSTITUTIONMATRIX.ordinal()].label, matrix, matrix[0]); addBuffer(this); endAlignHorizontally(); beginAlignHorizontally(null, false); customProteinSubstitutionMatrixFile = addStringOption(nameAndLabels[OptionIndex.CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE.ordinal()].name, nameAndLabels[OptionIndex.CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE.ordinal()].label, ""); customProteinSubstitutionMatrixFileBrowse = addButtonOption("customProteinSubstitutionMatrixFilieBrowse", "", "Browse"); customProteinSubstitutionMatrixFileBrowse.addActionListener(new BrowseButtonActionListener(customProteinSubstitutionMatrixFile, jfc)); ButtonOption customProteinSubstitutionMatrixFilieClear = addButtonOption("customProteinSubstitutionMatrixFileClear", "", "Clear"); customProteinSubstitutionMatrixFilieClear.addActionListener(new ClearButtonActionListener(customProteinSubstitutionMatrixFile)); final OptionValue[] empiricalFreq= new OptionValue[2]; empiricalFreq[0] = new OptionValue(FREQUENCY, YES.substring(0,1).toUpperCase() + YES.substring(1)); empiricalFreq[1] = new OptionValue("", NO.substring(0,1).toUpperCase() + NO.substring(1)); useEmpiricalBaseFrequencies = addComboBoxOption(nameAndLabels[OptionIndex.USEEMPIRICALBASEFREQUENCIES.ordinal()].name, nameAndLabels[OptionIndex.USEEMPIRICALBASEFREQUENCIES.ordinal()].label, empiricalFreq, empiricalFreq[0]); //useEmpiricalBaseFrequencies.setEnabled(false); endAlignHorizontally(); beginAlignHorizontally(null, false); final OptionValue[] useMLFreqs = new OptionValue[2]; useMLFreqs[0] = new OptionValue(ML_FREQUENCY, YES.substring(0,1).toUpperCase() + YES.substring(1)); useMLFreqs[1] = new OptionValue("", NO.substring(0,1).toUpperCase() + NO.substring(1)); use_ml_freqs_ = addComboBoxOption(nameAndLabels[OptionIndex.USE_ML_FREQS_.ordinal()].name, nameAndLabels[OptionIndex.USE_ML_FREQS_.ordinal()].label, useMLFreqs, useMLFreqs[0]); usePartitionAA = addBooleanOption(nameAndLabels[OptionIndex.USEPARTITIONAA.ordinal()].name, nameAndLabels[OptionIndex.USEPARTITIONAA.ordinal()].label, false); addBuffer(this); endAlignHorizontally(); beginAlignHorizontally(null, false); FileChooser fc1 = createFileChooser(this, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE1.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE1.ordinal()].label, false); substitutionMatrixFile1 = fc1.selectedFile; substitutionMatrixFile1Browse = fc1.selectedFileBrowse; endAlignHorizontally(); beginAlignHorizontally(null, false); FileChooser fc2 = createFileChooser(this, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE2.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE2.ordinal()].label, false); substitutionMatrixFile2 = fc2.selectedFile; substitutionMatrixFile2Browse = fc2.selectedFileBrowse; endAlignHorizontally(); beginAlignHorizontally(null, false); FileChooser fc3 = createFileChooser(this, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE3.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE3.ordinal()].label, false); substitutionMatrixFile3 = fc3.selectedFile; substitutionMatrixFile3Browse = fc3.selectedFileBrowse; endAlignHorizontally(); beginAlignHorizontally(null, false); FileChooser fc4 = createFileChooser(this, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE4.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE4.ordinal()].label, false); substitutionMatrixFile4 = fc4.selectedFile; substitutionMatrixFile4Browse = fc4.selectedFileBrowse; endAlignHorizontally(); beginAlignHorizontally(null, false); FileChooser fc5 = createFileChooser(this, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE5.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE5.ordinal()].label, false); substitutionMatrixFile5 = fc5.selectedFile; substitutionMatrixFile5Browse = fc5.selectedFileBrowse; endAlignHorizontally(); } } advancedOptions.addCollapsibleChildOptions(ChildOptions.PROTEINOPTIONS.getValue(), ChildOptions.PROTEINOPTIONS.getLabel(), ChildOptions.PROTEINOPTIONS.getLabel(), new ProteinOptions(selectedDocuments), true,true); /* advancedOptions.addDivider("Protein Analysis Options"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] gammaCatModel = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.PROTGAMMA, ComboBoxValueLabel.PROTCAT);; gammaCATModel = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.GAMMACATMODEL.ordinal()].name, nameAndLabels[OptionIndex.GAMMACATMODEL.ordinal()].label, gammaCatModel, gammaCatModel[1]); final OptionValue[] matrix= new OptionValue[26]; int idx = 0; matrix[idx++] = new OptionValue(DAYHOFF, DAYHOFF); matrix[idx++] = new OptionValue(DCMUT, DCMUT); matrix[idx++] = new OptionValue(JTT, JTT); matrix[idx++] = new OptionValue(MTREV, MTREV); matrix[idx++] = new OptionValue(WAG, WAG); matrix[idx++] = new OptionValue(RTREV, RTREV); matrix[idx++] = new OptionValue(CPREV, CPREV); matrix[idx++] = new OptionValue(VT, VT); matrix[idx++] = new OptionValue(BLOSUM62, BLOSUM62); matrix[idx++] = new OptionValue(MTMAM, MTMAM); matrix[idx++] = new OptionValue(LG, LG); matrix[idx++] = new OptionValue(MTART, MTART); matrix[idx++] = new OptionValue(MTZOA, MTZOA); matrix[idx++] = new OptionValue(PMB, PMB); matrix[idx++] = new OptionValue(HIVB, HIVB); matrix[idx++] = new OptionValue(HIVW, HIVW); matrix[idx++] = new OptionValue(JTTDCMUT, JTTDCMUT); matrix[idx++] = new OptionValue(FLU, FLU); matrix[idx++] = new OptionValue(DUMMY, DUMMY); matrix[idx++] = new OptionValue(DUMMY2, DUMMY2); matrix[idx++] = new OptionValue(AUTO, AUTO); matrix[idx++] = new OptionValue(LG4M, LG4M); matrix[idx++] = new OptionValue(LG4X, LG4X); matrix[idx++] = new OptionValue(PROT_FILE, PROT_FILE); matrix[idx++] = new OptionValue(GTR_UNLINKED, GTR_UNLINKED); matrix[idx++] = new OptionValue(GTR, GTR); proteinSubstitutionMatrix = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.PROTEINSUBSTITUTIONMATRIX.ordinal()].name, nameAndLabels[OptionIndex.PROTEINSUBSTITUTIONMATRIX.ordinal()].label, matrix, matrix[0]); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); customProteinSubstitutionMatrixFile = advancedOptions.addStringOption(nameAndLabels[OptionIndex.CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE.ordinal()].name, nameAndLabels[OptionIndex.CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE.ordinal()].label, ""); customProteinSubstitutionMatrixFileBrowse = advancedOptions.addButtonOption("customProteinSubstitutionMatrixFilieBrowse", "", "Browse"); customProteinSubstitutionMatrixFileBrowse.addActionListener(new BrowseButtonActionListener(customProteinSubstitutionMatrixFile, jfc)); ButtonOption customProteinSubstitutionMatrixFilieClear = advancedOptions.addButtonOption("customProteinSubstitutionMatrixFileClear", "", "Clear"); customProteinSubstitutionMatrixFilieClear.addActionListener(new ClearButtonActionListener(customProteinSubstitutionMatrixFile)); final OptionValue[] empiricalFreq= new OptionValue[2]; empiricalFreq[0] = new OptionValue(FREQUENCY, YES.substring(0,1).toUpperCase() + YES.substring(1)); empiricalFreq[1] = new OptionValue("", NO.substring(0,1).toUpperCase() + NO.substring(1)); useEmpiricalBaseFrequencies = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.USEEMPIRICALBASEFREQUENCIES.ordinal()].name, nameAndLabels[OptionIndex.USEEMPIRICALBASEFREQUENCIES.ordinal()].label, empiricalFreq, empiricalFreq[0]); //useEmpiricalBaseFrequencies.setEnabled(false); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); usePartitionAA = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.USEPARTITIONAA.ordinal()].name, nameAndLabels[OptionIndex.USEPARTITIONAA.ordinal()].label, false); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc1 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE1.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE1.ordinal()].label, false); substitutionMatrixFile1 = fc1.selectedFile; substitutionMatrixFile1Browse = fc1.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc2 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE2.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE2.ordinal()].label, false); substitutionMatrixFile2 = fc2.selectedFile; substitutionMatrixFile2Browse = fc2.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc3 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE3.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE3.ordinal()].label, false); substitutionMatrixFile3 = fc3.selectedFile; substitutionMatrixFile3Browse = fc3.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc4 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE4.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE4.ordinal()].label, false); substitutionMatrixFile4 = fc4.selectedFile; substitutionMatrixFile4Browse = fc4.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc5 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE5.ordinal()].name, nameAndLabels[OptionIndex.SUBSTITUTIONMATRIXFILE5.ordinal()].label, false); substitutionMatrixFile5 = fc5.selectedFile; substitutionMatrixFile5Browse = fc5.selectedFileBrowse; advancedOptions.endAlignHorizontally(); */ class RNAOptions extends Options { public RNAOptions(final AnnotatedPluginDocument[] selectedDocuments) throws DocumentOperationException { beginAlignHorizontally(null, false); FileChooser fc6 = createFileChooser(this, nameAndLabels[OptionIndex.SECONDARYSTRUCTUREFILE.ordinal()].name, nameAndLabels[OptionIndex.SECONDARYSTRUCTUREFILE.ordinal()].label, false); secondaryStructureFile = fc6.selectedFile; secondaryStructureFileBrowse = fc6.selectedFileBrowse; endAlignHorizontally(); beginAlignHorizontally(null, false); final OptionValue[] rnaModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.S6A, ComboBoxValueLabel.S16B); rnaSecondarySubModel= addComboBoxOption(nameAndLabels[OptionIndex.RNASECONDARYSUBMODEL.ordinal()].name, nameAndLabels[OptionIndex.RNASECONDARYSUBMODEL.ordinal()].label, rnaModel, rnaModel[11]); addBuffer(this); endAlignHorizontally(); } } advancedOptions.addCollapsibleChildOptions(ChildOptions.RNAOPTIONS.getValue(), ChildOptions.RNAOPTIONS.getLabel(), ChildOptions.RNAOPTIONS.getLabel(), new RNAOptions(selectedDocuments), true,true); /* advancedOptions.addDivider("RNA Secondary Structure Optionss"); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc6 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.SECONDARYSTRUCTUREFILE.ordinal()].name, nameAndLabels[OptionIndex.SECONDARYSTRUCTUREFILE.ordinal()].label, false); secondaryStructureFile = fc6.selectedFile; secondaryStructureFileBrowse = fc6.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] rnaModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.S6A, ComboBoxValueLabel.S16B); rnaSecondarySubModel= advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.RNASECONDARYSUBMODEL.ordinal()].name, nameAndLabels[OptionIndex.RNASECONDARYSUBMODEL.ordinal()].label, rnaModel, rnaModel[0]); //rnaSecondarySubModel.setEnabled(false); //StringOption buffer103 = advancedOptions.addStringOption("buffer103", "buffer", ""); //buffer103.setVisible(false); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); */ class BinaryOptions extends Options { public BinaryOptions(final AnnotatedPluginDocument[] selectedDocuments) throws DocumentOperationException { beginAlignHorizontally(null, false); final OptionValue[] binModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.BINCAT, ComboBoxValueLabel.BINGAMMA); binaryDataModel = addComboBoxOption(nameAndLabels[OptionIndex.BINARYDATAMODEL.ordinal()].name, nameAndLabels[OptionIndex.BINARYDATAMODEL.ordinal()].label, binModel, binModel[0]); addBuffer(this); endAlignHorizontally(); } } advancedOptions.addCollapsibleChildOptions(ChildOptions.BINARYOPTIONS.getValue(), ChildOptions.BINARYOPTIONS.getLabel(), ChildOptions.BINARYOPTIONS.getLabel(), new BinaryOptions(selectedDocuments), true,true); /* advancedOptions.addDivider("Binary Matrix Options"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] binModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.BINCAT, ComboBoxValueLabel.BINGAMMA); binaryDataModel = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.BINARYDATAMODEL.ordinal()].name, nameAndLabels[OptionIndex.BINARYDATAMODEL.ordinal()].label, binModel, binModel[0]); //StringOption buffer104 = advancedOptions.addStringOption("buffer104", "buffer", ""); //buffer104.setVisible(false); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); */ class MultipleStateOptions extends Options { public MultipleStateOptions(final AnnotatedPluginDocument[] selectedDocuments) throws DocumentOperationException { beginAlignHorizontally(null, false); final OptionValue[] multiStateModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.MULTICAT, ComboBoxValueLabel.MULTIGAMMA); multipleStateDataModel = addComboBoxOption(nameAndLabels[OptionIndex.MULTIPLESTATEDATAMODEL.ordinal()].name, nameAndLabels[OptionIndex.MULTIPLESTATEDATAMODEL.ordinal()].label, multiStateModel, multiStateModel[0]); addLabel(" "); final OptionValue[] chooseMultiStateModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.ORDERED, ComboBoxValueLabel.GTR); chooseStateDataModel = addComboBoxOption(nameAndLabels[OptionIndex.CHOOSESTATEDATAMODEL.ordinal()].name, nameAndLabels[OptionIndex.CHOOSESTATEDATAMODEL.ordinal()].label, chooseMultiStateModel, chooseMultiStateModel[2]); addBuffer(this); endAlignHorizontally(); } } advancedOptions.addCollapsibleChildOptions(ChildOptions.MULTIPLESTATEOPTIONS.getValue(), ChildOptions.MULTIPLESTATEOPTIONS.getLabel(), ChildOptions.MULTIPLESTATEOPTIONS.getLabel(), new MultipleStateOptions(selectedDocuments), true,true); /* advancedOptions.addDivider("Multiple State Morphological Matrix Options"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] multiStateModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.MULTICAT, ComboBoxValueLabel.MULTIGAMMA); multipleStateDataModel = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.MULTIPLESTATEDATAMODEL.ordinal()].name, nameAndLabels[OptionIndex.MULTIPLESTATEDATAMODEL.ordinal()].label, multiStateModel, multiStateModel[0]); final OptionValue[] chooseMultiStateModel= ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.ORDERED, ComboBoxValueLabel.GTR); chooseStateDataModel = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.CHOOSESTATEDATAMODEL.ordinal()].name, nameAndLabels[OptionIndex.CHOOSESTATEDATAMODEL.ordinal()].label, chooseMultiStateModel, chooseMultiStateModel[2]); //StringOption buffer105 = advancedOptions.addStringOption("buffer105", "buffer", ""); //buffer105.setVisible(false); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); */ advancedOptions.addDivider("Configure the Analysis"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] aTypes = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.fa, ComboBoxValueLabel.y); analysisType = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.ANALYSISTYPE.ordinal()].name, nameAndLabels[OptionIndex.ANALYSISTYPE.ordinal()].label, aTypes, aTypes[0]); addLabelBuffer(advancedOptions); final OptionValue[] majorityRules = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.MR, ComboBoxValueLabel.STRICT_DROP); majorityRuleTree = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.MAJORITYRULETREE.ordinal()].name, nameAndLabels[OptionIndex.MAJORITYRULETREE.ordinal()].label, majorityRules, majorityRules[0]);; //StringOption buffer106 = advancedOptions.addStringOption("buffer106", "buffer", ""); //buffer106.setVisible(false); //addBuffer(advancedOptions); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); specifyNumOfAltRuns = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.SPECIFYNUMOFALTRUNS.ordinal()].name, nameAndLabels[OptionIndex.SPECIFYNUMOFALTRUNS.ordinal()].label, false); numOfAltRuns = advancedOptions.addIntegerOption(nameAndLabels[OptionIndex.NUMOFALTRUNS.ordinal()].name, nameAndLabels[OptionIndex.NUMOFALTRUNS.ordinal()].label, 10, 1, 1000); //StringOption buffer107 = advancedOptions.addStringOption("buffer107", "buffer", ""); //buffer107.setVisible(false); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc7 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.TOPOLOGIESBIPARTITIONSFILE.ordinal()].name, nameAndLabels[OptionIndex.TOPOLOGIESBIPARTITIONSFILE.ordinal()].label, false); topologiesBipartitionsFile = fc7.selectedFile; topologiesBipartitionsFileBrowse = fc7.selectedFileBrowse; notUseBFGS = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.NOTUSEBFGS.ordinal()].name, nameAndLabels[OptionIndex.NOTUSEBFGS.ordinal()].label, false); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); writeIntermediateTree = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.WRITEINTERMEDIATETREE.ordinal()].name, nameAndLabels[OptionIndex.WRITEINTERMEDIATETREE.ordinal()].label, false); useMLConvergenceCriteria = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.USEMLCONVERGENCECRITERIA.ordinal()].name, nameAndLabels[OptionIndex.USEMLCONVERGENCECRITERIA.ordinal()].label, false); //final OptionValue[] majorityRules = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.MR, ComboBoxValueLabel.STRICT_DROP); //majorityRuleTree = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.MAJORITYRULETREE.ordinal()].name, nameAndLabels[OptionIndex.MAJORITYRULETREE.ordinal()].label, majorityRules, majorityRules[0]);; additionalOptions = advancedOptions.addStringOption(nameAndLabels[OptionIndex.ADDITIONALOPTIONS.ordinal()].name, nameAndLabels[OptionIndex.ADDITIONALOPTIONS.ordinal()].label, ""); additionalOptions.setHidden(true); //StringOption buffer108 = advancedOptions.addStringOption("buffer108", "buffer", ""); //buffer108.setVisible(false); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); addCipresDivider(advancedOptions, "Ascertainment Bias Configuration"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] yesNo = new OptionValue[2]; yesNo[0] = new OptionValue(ASC_, YES); yesNo[1] = new OptionValue("", NO); final OptionValue[] ascCorr = new OptionValue[3]; ascCorr[0] = new OptionValue(LEWIS, capitializeFirstChar(LEWIS)); ascCorr[1] = new OptionValue(FELSENSTEIN, capitializeFirstChar(FELSENSTEIN)); ascCorr[2] = new OptionValue(STAMATAKIS, capitializeFirstChar(STAMATAKIS)); correctAscBias = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.CORRECTASCBIAS.ordinal()].name, nameAndLabels[OptionIndex.CORRECTASCBIAS.ordinal()].label, yesNo, yesNo[0]); advancedOptions.addLabel(" "); ascentainmentBiasCorrectionType = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE.ordinal()].name, nameAndLabels[OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE.ordinal()].label, ascCorr, ascCorr[0]); addBuffer(advancedOptions); //StringOption buffer05 = simpleOptions.addStringOption("buffer05", "buffer", ""); //buffer05.setVisible(false); advancedOptions.endAlignHorizontally(); /* advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] ascentainmentOpts= new OptionValue[3]; int idx = 0; ascentainmentOpts[idx++] = new OptionValue("", "[Not Mandatory]"); ascentainmentOpts[idx++] = new OptionValue("ASC_", "yes"); ascentainmentOpts[idx++] = new OptionValue("", "no"); final OptionValue[] ascentainment_corr_Opts= new OptionValue[4]; idx = 0; ascentainment_corr_Opts[idx++] = new OptionValue("", "[Not Mandatory]"); ascentainment_corr_Opts[idx++] = new OptionValue("lewis", "Lewis"); ascentainment_corr_Opts[idx++] = new OptionValue("felsenstein", "Felsenstein"); ascentainment_corr_Opts[idx++] = new OptionValue("stamatakis", "Stamatakis"); ascertainment_ = addComboBoxOption(nameAndLabels[OptionIndex.ASCERTAINMENT_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_.ordinal()].label, ascentainmentOpts, ascentainmentOpts[0]); ascertainment_corr_ = addComboBoxOption(nameAndLabels[OptionIndex.ASCERTAINMENT_CORR_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_CORR_.ordinal()].label, ascentainment_corr_Opts, ascentainment_corr_Opts[0]); advancedOptions.endAlignHorizontally(); */ advancedOptions.beginAlignHorizontally(null, false); FileChooser p1 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE1_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE1_.ordinal()].label, false); ascertainment_pfile1_ = p1.selectedFile; ascertainment_pfile1_Browse_ = p1.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser p2 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE2_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE2_.ordinal()].label, false); ascertainment_pfile2_ = p2.selectedFile; ascertainment_pfile2_Browse_ = p2.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser p3 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE3_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE3_.ordinal()].label, false); ascertainment_pfile3_ = p3.selectedFile; ascertainment_pfile3_Browse_ = p3.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser p4 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE4_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE4_.ordinal()].label, false); ascertainment_pfile4_ = p4.selectedFile; ascertainment_pfile4_Browse_ = p4.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser p5 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE5_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE5_.ordinal()].label, false); ascertainment_pfile5_ = p5.selectedFile; ascertainment_pfile5_Browse_ = p5.selectedFileBrowse; advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser p6 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE6_.ordinal()].name, nameAndLabels[OptionIndex.ASCERTAINMENT_PFILE6_.ordinal()].label, false); ascertainment_pfile6_ = p6.selectedFile; ascertainment_pfile6_Browse_ = p6.selectedFileBrowse; advancedOptions.endAlignHorizontally(); /* addCipresDivider(advancedOptions, "Configure more memory"); advancedOptions.beginAlignHorizontally(null, false); dataset20G = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.DATASET20G.ordinal()].name, nameAndLabels[OptionIndex.DATASET20G.ordinal()].label, false);; numOfPatterns = advancedOptions.addIntegerOption(nameAndLabels[OptionIndex.NUMOFPATTERNS.ordinal()].name, nameAndLabels[OptionIndex.NUMOFPATTERNS.ordinal()].label, 1, 1, Integer.MAX_VALUE); numOfTaxa = advancedOptions.addIntegerOption(nameAndLabels[OptionIndex.NUMOFTAXA.ordinal()].name, nameAndLabels[OptionIndex.NUMOFTAXA.ordinal()].label, 1, 1, Integer.MAX_VALUE); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); */ addCipresDivider(advancedOptions, "Configure Bootstrapping"); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] bsTypes = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.NOTMANDATORY, ComboBoxValueLabel.RAPID); bootstrappingType = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.BOOTSTRAPPINGTYPE.ordinal()].name, nameAndLabels[OptionIndex.BOOTSTRAPPINGTYPE.ordinal()].label, bsTypes, bsTypes[0]); randomSeedBootstrapping = advancedOptions.addIntegerOption(nameAndLabels[OptionIndex.RANDOMSEEDBOOTSTRAPPING.ordinal()].name, nameAndLabels[OptionIndex.RANDOMSEEDBOOTSTRAPPING.ordinal()].label, 12345, 1, Integer.MAX_VALUE); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] stopTypes = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.SPECIFY, ComboBoxValueLabel.AUTOBOOTSTOP); bootstrapProtocol = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.BOOTSTRAPPROTOCOL.ordinal()].name, nameAndLabels[OptionIndex.BOOTSTRAPPROTOCOL.ordinal()].label, stopTypes, stopTypes[0]); numOfBootstraps = advancedOptions.addIntegerOption(nameAndLabels[OptionIndex.NUMOFBOOTSTRAPS.ordinal()].name, nameAndLabels[OptionIndex.NUMOFBOOTSTRAPS.ordinal()].label, 100, 1, 1000); addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); final OptionValue[] stoppingCriteria = ComboBoxValueLabel.fillOptionValues(ComboBoxValueLabel.AUTOFC, ComboBoxValueLabel.AUTOMRE_IGN); bootstoppingCriterion = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.BOOTSTOPPINGCRITERION.ordinal()].name, nameAndLabels[OptionIndex.BOOTSTOPPINGCRITERION.ordinal()].label, stoppingCriteria, stoppingCriteria[2]); posterioriAnalayis = advancedOptions.addComboBoxOption(nameAndLabels[OptionIndex.POSTERIORIANALAYIS.ordinal()].name, nameAndLabels[OptionIndex.POSTERIORIANALAYIS.ordinal()].label, stoppingCriteria, stoppingCriteria[2]);; addBuffer(advancedOptions); advancedOptions.endAlignHorizontally(); advancedOptions.beginAlignHorizontally(null, false); FileChooser fc8 = createFileChooser(advancedOptions, nameAndLabels[OptionIndex.POSTERIORIBOOTSTOPPINGFILE.ordinal()].name, nameAndLabels[OptionIndex.POSTERIORIBOOTSTOPPINGFILE.ordinal()].label, false); posterioriBootstoppingFile = fc8.selectedFile; posterioriBootstoppingFileBrowse = fc8.selectedFileBrowse; printBranchLengths = advancedOptions.addBooleanOption(nameAndLabels[OptionIndex.PRINTBRANCHLENGTHS.ordinal()].name, nameAndLabels[OptionIndex.PRINTBRANCHLENGTHS.ordinal()].label, false); advancedOptions.endAlignHorizontally(); /*Add tab***********************************/ Options.Option parameterChooser = addChildOptionsPageChooser("parameterChooser", "Parameters", null, Options.PageChooserType.BUTTONS, true); addLabel(" "); beginAlignHorizontally(null, false); addLabel(OPTION_NAME); endAlignHorizontally(); setInitialEnabledState(); noSavedValues(); setDescription(); buildRelationshipAmongOptions(); parameterChooser.setShouldSaveValue(false); //setDescription(OptionIndex.PRINTBRANCHLENGTHS); } @Override //public String verifyOptionsAreValid() public boolean areValuesGoodEnoughToContinue() { StringBuilder sb = new StringBuilder(); String nameForOutputVal = getValueAsString(OptionIndex.NAMEFOROUTPUT); if (nameForOutputVal == null || nameForOutputVal.isBlank()) { sb.append("Please enter name for the output files (-n)
"); } String aType = getValueAsString(OptionIndex.ANALYSISTYPE); String treeFileVal = getValueAsString(OptionIndex.TREEFILE); if (aType == null || (!aType.equals("fe") && !aType.equals("fA"))) { Boolean specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); String randomSeedVal = getValueAsString(OptionIndex.RANDOMSEED); if (specifyNumOfAltRunsVal != null && (randomSeedVal == null || randomSeedVal.isBlank())) sb.append("Please provide a parsimony seed (-p)
"); Boolean specifyRandomSeedVal = getValueAsBoolean(OptionIndex.SPECIFYRANDOMSEED); if ((treeFileVal != null && !treeFileVal.isBlank()) && specifyRandomSeedVal && (aType != null && aType.equals("fx"))) sb.append("Sorry, you cannot specify a starting tree (via the -t option) and a random seed(via -p) with the -f x option
"); } String correctASCBiasVal = getValueAsString(OptionIndex.CORRECTASCBIAS); String ascentainmentBiasCorrectionTypeVal = getValueAsString(OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE); String mixedPartitionedModelFileVal = getValueAsString(OptionIndex.MIXEDPARTITIONEDMODELFILE); if (correctASCBiasVal != null && correctASCBiasVal.equals(ASC_) && (ascentainmentBiasCorrectionTypeVal == null || ascentainmentBiasCorrectionTypeVal.isBlank())) sb.append("Please specify the ascertainment correction method"); System.out.println("mixedPartitionedModelFileVal = " + mixedPartitionedModelFileVal + " ascentainmentBiasCorrectionTypeVal = " + ascentainmentBiasCorrectionTypeVal); if (mixedPartitionedModelFileVal == null || mixedPartitionedModelFileVal.isBlank()) { if (ascentainmentBiasCorrectionTypeVal != null && ascentainmentBiasCorrectionTypeVal.equals(FELSENSTEIN)) sb.append("To use the Felsenstein option (--asc-corr), you must specify the number of invariable sites in a file using -q
"); if (ascentainmentBiasCorrectionTypeVal != null && ascentainmentBiasCorrectionTypeVal.equals(STAMATAKIS)) sb.append("To use the Stamatakis option (--asc-corr), you must specify the number of invariable sites per state for each partition in a file using -q
"); } String ascertainment_pfile1_Value = getValueAsString(OptionIndex.ASCERTAINMENT_PFILE1_); if (ascertainment_pfile1_Value == null || ascertainment_pfile1_Value.isBlank()) { if (ascentainmentBiasCorrectionTypeVal != null && ascentainmentBiasCorrectionTypeVal.equals(FELSENSTEIN)) sb.append("To use the Felsenstein option (--asc-corr), you must specify the number of invariable sites in a file using -q (p1.txt)
"); if (ascentainmentBiasCorrectionTypeVal != null && ascentainmentBiasCorrectionTypeVal.equals(STAMATAKIS)) sb.append("To use the Stamatakis option (--asc-corr), you must specify the number of invariable sites per state for each partition in a file using -q (p1.txt)
"); } String dataType = getValueAsString(OptionIndex.SEQUENCETYPE); String bootstrappingPhaseModelVal = getValueAsString(OptionIndex.BOOTSTRAPPINGPHASEMODEL); if (dataType != null && (dataType.equals(DNA) || dataType.equals(RNA))) { if (aType != null && aType.equals(ComboBoxValueLabel.fx.getValue()) && (bootstrappingPhaseModelVal==null || !bootstrappingPhaseModelVal.equals(GTRGAMMA))) sb.append("Sorry, the -f x option is valid only with GAMMA models
"); } String gammaCATModelVal = getValueAsString(OptionIndex.GAMMACATMODEL); if (dataType != null && dataType.equals(PROTEIN.toLowerCase())) { if (gammaCATModelVal == null || (!gammaCATModelVal.equals(ComboBoxValueLabel.PROTCAT.getValue()) && !gammaCATModelVal.equals(ComboBoxValueLabel.PROTGAMMA.getValue()))) sb.append("Please choose a protein model
"); if (aType != null && aType.equals(ComboBoxValueLabel.fx.getValue()) && (gammaCATModelVal == null || !gammaCATModelVal.equals(ComboBoxValueLabel.PROTGAMMA.getValue()))) sb.append("Sorry, the -f x option is valid only with GAMMA models
"); Boolean usePartitionAAVal = getValueAsBoolean(OptionIndex.USEPARTITIONAA); if (usePartitionAAVal && (mixedPartitionedModelFileVal == null || mixedPartitionedModelFileVal.isBlank())) sb.append("Please choose a partition file specifying up to 5 partitions
"); } String binaryDataModelVal = getValueAsString(OptionIndex.BINARYDATAMODEL); if (dataType != null && dataType.equals(BINARY)) { if (aType != null && aType.equals(ComboBoxValueLabel.fx.getValue()) && (binaryDataModelVal == null || !binaryDataModelVal.equals(ComboBoxValueLabel.BINGAMMA.getValue()))) sb.append("Sorry, the -f x option is valid only with GAMMA models
"); } if (dataType != null && dataType.equals(MULTI)) { String multipleStateDataModelVal = getValueAsString(OptionIndex.MULTIPLESTATEDATAMODEL); if (multipleStateDataModelVal == null || (!multipleStateDataModelVal.equals(ComboBoxValueLabel.MULTICAT.getValue()) && !multipleStateDataModelVal.equals(ComboBoxValueLabel.MULTIGAMMA.getValue()))) sb.append("Please choose a Multi-State model
"); if (aType != null && aType.equals(ComboBoxValueLabel.fx.getValue()) && (multipleStateDataModelVal == null || !multipleStateDataModelVal.equals(ComboBoxValueLabel.MULTIGAMMA.getValue()))) sb.append("Sorry, the -f x option is valid only with GAMMA models
"); if (aType != null && aType.equals(ComboBoxValueLabel.fh.getValue()) && (multipleStateDataModelVal == null || !multipleStateDataModelVal.equals(ComboBoxValueLabel.MULTIGAMMA.getValue()))) sb.append("Sorry, you cannot compute a log likelihood test (-f h) with GTRCAT models, please select PROTGAMMA for the modeluse"); } String bootstrappingTypeVal = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); if ((bootstrappingTypeVal == null || !bootstrappingTypeVal.equals(ComboBoxValueLabel.RAPID.getValue())) && (aType != null && aType.equals("fa"))) sb.append("To use the -f a option, please select Rapid Bootstrapping (-x)
"); if (treeFileVal == null || treeFileVal.isBlank()) { if (aType != null && aType.equals(ComboBoxValueLabel.fA.getValue())) sb.append("To use the -f A option, please specify a best tree with \"-t\"
"); if (aType != null && aType.equals(ComboBoxValueLabel.fJ.getValue())) sb.append("To use the -f J option, please specify a best tree with \"-t\"
"); if (aType != null && aType.equals(ComboBoxValueLabel.fe.getValue())) sb.append("To use the -f e option, please specify a best tree with \"-t\"
"); } String topologiesBipartitionsFileVal = getValueAsString(OptionIndex.TOPOLOGIESBIPARTITIONSFILE); if ((aType != null && aType.equals(ComboBoxValueLabel.fb.getValue())) && ((topologiesBipartitionsFileVal == null || topologiesBipartitionsFileVal.isBlank()) || (treeFileVal == null || treeFileVal.isBlank()))) sb.append("To use the -f b option, please spedify a best tree with \"-t\" and file containing multiple trees with the \"-z\" option
"); System.out.println("dataType = " + dataType + " aType = " + aType + " bootstrappingPhaseModelVal = " + bootstrappingPhaseModelVal); if ((dataType != null && (dataType.equals(DNA) || dataType.equals(RNA))) && (aType != null && aType.equals(ComboBoxValueLabel.fh.getValue())) && (bootstrappingPhaseModelVal != null && bootstrappingPhaseModelVal.equals(GTRCAT))) sb.append("Sorry, you cannot compute a log likelihood test (-f h) with GTRCAT models, please use GTRGAMMA for the bootstrapping phase and GTRGAMMA for the final tree
"); if ((aType != null && aType.equals(ComboBoxValueLabel.fh.getValue())) && ((topologiesBipartitionsFileVal == null || topologiesBipartitionsFileVal.isBlank()) || (treeFileVal == null || treeFileVal.isBlank()))) sb.append("To use the -f h option, please spedify a best tree with \"-t\" and file containing multiple trees with the \"-z\" option
"); if ((dataType != null && dataType.equals(PROTEIN.toLowerCase())) && (aType != null && aType.equals(ComboBoxValueLabel.fh.getValue())) && (gammaCATModelVal != null && gammaCATModelVal.equals(ComboBoxValueLabel.PROTCAT.getValue()))) sb.append("Sorry, you cannot compute a log likelihood test (-f h) with GTRCAT models, please select PROTGAMMA for the modeluse
"); //if ((dataType != null && dataType.equals(MULTI)) && (aType != null && aType.equals(ComboBoxValueLabel.fh.getValue())) // && (gammaCATModelVal != null && gammaCATModelVal.equals(ComboBoxValueLabel.MULTICAT.getValue()))) // sb.append("Sorry, you cannot compute a log likelihood test (-f h) with GTRCAT models, please select PROTGAMMA for the modeluse"); if ((dataType != null && dataType.equals(BINARY)) && (aType != null && aType.equals(ComboBoxValueLabel.fh.getValue())) && (binaryDataModelVal != null && binaryDataModelVal.equals(ComboBoxValueLabel.BINCAT.getValue()))) sb.append("Sorry, you cannot compute a log likelihood test (-f h) with GTRCAT models, please select BINGAMMA for the modeluse
"); if ((aType != null && aType.equals(ComboBoxValueLabel.fT.getValue())) && (treeFileVal == null || treeFileVal.isBlank())) sb.append("Please specify a tree (via the -t option above) to use the -f T option
"); /* Boolean dataset20GVal = getValueAsBoolean(OptionIndex.DATASET20G); if ((aType != null && aType.equals(ComboBoxValueLabel.fT.getValue())) && dataset20GVal) sb.append("Sorry, you can't use the -f option with the high memory option
"); */ Boolean estimateBranchLengthsVal = getValueAsBoolean(OptionIndex.ESTIMATEBRANCHLENGTHS); if ((aType != null && aType.equals(ComboBoxValueLabel.fk.getValue())) && (mixedPartitionedModelFileVal == null || mixedPartitionedModelFileVal.isBlank() || !estimateBranchLengthsVal || (treeFileVal == null || treeFileVal.isBlank()))) sb.append("Sorry, to use the -f k option you must provide a tree (-t) a partition (-q) and estimate per partition branch lengths (-M) option
"); if ((aType != null && aType.equals(ComboBoxValueLabel.fu.getValue())) && (treeFileVal == null || treeFileVal.isBlank())) sb.append("Please specify a tree (via the -t option) to use the -f u option
"); if ((aType != null && aType.equals(ComboBoxValueLabel.fv.getValue())) && (treeFileVal == null || treeFileVal.isBlank())) sb.append("Please specify a non-comprehensive reference tree (via the -t option) to use the -f v option
"); String posterioriBootstoppingFileVal = getValueAsString(OptionIndex.POSTERIORIBOOTSTOPPINGFILE); if ((aType != null && aType.equals(ComboBoxValueLabel.I.getValue())) && (posterioriBootstoppingFileVal == null || posterioriBootstoppingFileVal.isBlank()) && (topologiesBipartitionsFileVal == null || topologiesBipartitionsFileVal.isBlank())) sb.append("In order to use a posteriori bootstrapping option (-I), you must specify a file with topologies for a posteriori bootstopping (-z)
"); if ((aType != null && aType.equals(ComboBoxValueLabel.y.getValue())) && (treeFileVal != null && !treeFileVal.isBlank())) sb.append("Sorry, you can't use the -y option and provide a starting tree using -t.
"); Boolean specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); String numOfAltRunsVal = getValueAsString(OptionIndex.NUMOFALTRUNS); if (specifyNumOfAltRunsVal && (numOfAltRunsVal == null || numOfAltRunsVal.isBlank())) sb.append("Please specify how many runs you wish to execute with the -N option (eg 10)
"); Boolean useMLConvergenceCriteriaVal = getValueAsBoolean(OptionIndex.USEMLCONVERGENCECRITERIA); if (aType == null || (!aType.equals(ComboBoxValueLabel.fE.getValue()) && !aType.equals(ComboBoxValueLabel.J.getValue()) && !aType.equals(ComboBoxValueLabel.fA.getValue()) && !aType.equals(ComboBoxValueLabel.fb.getValue()) && !aType.equals(ComboBoxValueLabel.y.getValue()) && !aType.equals(ComboBoxValueLabel.fh.getValue()) && !aType.equals(ComboBoxValueLabel.fx.getValue()) && !aType.equals(ComboBoxValueLabel.fu.getValue()) && !aType.equals(ComboBoxValueLabel.fv.getValue()) && !specifyNumOfAltRunsVal)) { if (useMLConvergenceCriteriaVal && ((aType !=null && aType.equals(ComboBoxValueLabel.fa.getValue())) || (bootstrappingTypeVal != null && bootstrappingTypeVal.equals(ComboBoxValueLabel.RAPID.getValue())))) sb.append("The tree search convergence criterion \"-D\" has no effect in conjunction with the \"-x\" or \"-f a\" options.
"); } String majorityRuleTreeVal = getValueAsString(OptionIndex.MAJORITYRULETREE); if ((aType != null && aType.equals(ComboBoxValueLabel.J.getValue())) && (majorityRuleTreeVal == null || majorityRuleTreeVal.isBlank())) sb.append("Please select a majority rule option for the -J option
"); String additionalOptionsVal = getValueAsString(OptionIndex.ADDITIONALOPTIONS); if (additionalOptionsVal != null && !additionalOptionsVal.isBlank()) { if (!Pattern.matches(PATTERN1, additionalOptionsVal) && !Pattern.matches(PATTERN2, additionalOptionsVal)) sb.append("Additional RAxML options: You must specify each argument separately, with a - or --
"); if (Pattern.matches(PATTERN3, additionalOptionsVal) || Pattern.matches(PATTERN4, additionalOptionsVal)) sb.append("Sorry, additional RAxML options: -T and -w are not allowed
"); //if (additionalOptionsVal.startsWith(PATTERN5) || additionalOptionsVal.startsWith(PATTERN7) || ) // sb.append("Sorry, additional RAxML options: -T and -w are not allowed
"); } /* if (dataset20GVal) { String numOfPatternsVal = getValueAsString(OptionIndex.NUMOFPATTERNS); String numOfTaxaVal = getValueAsString(OptionIndex.NUMOFTAXA); if (numOfPatternsVal == null || numOfPatternsVal.isBlank()) sb.append("Please enter a value for the number of patterns in your data matrix
"); if (numOfTaxaVal == null || numOfTaxaVal.isBlank()) sb.append("Please enter a value for the number of taxa in your data matrix
"); int nchar = Integer.parseInt(numOfPatternsVal); int ntax = Integer.parseInt(numOfTaxaVal); int smallProduct = (ntax-2) * (nchar); //int product = smallProduct*16; if ((dataType != null && dataType.equals(DNA)) && (smallProduct < 5*(64*512*1024))) sb.append("Your job does not require the large memory option. Please uncheck the large meory box and run nomally.
"); if ((dataType != null && dataType.equals(DNA)) && (smallProduct > 15*(64*1024*1024))) sb.append("Your job will probably not complete as configured. Please contact us for help.
"); if ((dataType != null && dataType.equals(PROTEIN.toLowerCase())) && (smallProduct < (32*1024*1024))) sb.append("Your job does not require the large memory option. Please uncheck the large meory box and run nomally.
"); if ((dataType != null && dataType.equals(PROTEIN.toLowerCase())) && (smallProduct > (3*64*1024*1024))) sb.append("Your job will probably not complete as configured. Please contact us for help.
"); }*/ String randomSeedBootstrappingVal = getValueAsString(OptionIndex.RANDOMSEEDBOOTSTRAPPING); String bootstrapProtocolVal = getValueAsString(OptionIndex.BOOTSTRAPPROTOCOL); if (bootstrappingTypeVal != null && (bootstrappingTypeVal.equals(ComboBoxValueLabel.NONPARAMETRIC.getValue()) || bootstrappingTypeVal.equals(ComboBoxValueLabel.RAPID.getValue()))) { if (bootstrapProtocolVal == null) sb.append("Please select \"Specify an explicit number of bootstrap\" or \"Let RAxML halt bootstrapping automatically\"
"); if (randomSeedBootstrappingVal == null || randomSeedBootstrappingVal.isBlank()) sb.append("Please enter a random see for the -" + bootstrappingTypeVal + " option (eg 12345)
"); } String numOfBootstrapsVal = getValueAsString(OptionIndex.NUMOFBOOTSTRAPS); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsVal == null || numOfBootstrapsVal.isBlank())) sb.append("Please enter number of bootstraps desired (-N) (eg 100)
"); String bootstoppingCriterionVal = getValueAsString(OptionIndex.BOOTSTOPPINGCRITERION); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.AUTOBOOTSTOP.getValue()) && (bootstoppingCriterionVal == null || bootstoppingCriterionVal.isBlank())) sb.append("Please choose a bootstopping criterion
"); String use_ml_freqs_Value = getValueAsString(OptionIndex.USE_ML_FREQS_); String useEmpiricalBaseFrequencies_Value = getValueAsString(OptionIndex.USEEMPIRICALBASEFREQUENCIES); if (use_ml_freqs_Value != null && !use_ml_freqs_Value.isBlank() && useEmpiricalBaseFrequencies_Value != null && !useEmpiricalBaseFrequencies_Value.isBlank()) { sb.append("Sorry you can't use both X and F options, please choose one or the other
"); } String jobName = getJobName(); if (jobName == null || jobName.isBlank()) sb.append("Job name cannot be empty!"); if (sb.length() > 0) { sb.insert(0, ""); sb.append(""); //return sb.toString(); Dialogs.showMessageDialog(sb.toString(), "Invalid Parameter(s)", this.getPanel(), Dialogs.DialogIcon.ERROR); return false; } else { StringBuilder sbWarn = new StringBuilder(); String maxHoursToRunVal = getValueAsString(OptionIndex.MAXHOURSTORUN); double maxHoursToRunInt = Double.parseDouble(maxHoursToRunVal); /* if (numOfBootstrapsVal != null) { int numOfBootstrapsInt = Integer.parseInt(numOfBootstrapsVal); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsInt < 50) && !dataset20GVal) sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsInt >= 50) && (maxHoursToRunInt > 2)) sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsInt >= 50) && (maxHoursToRunInt <= 2)) sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); } if (numOfAltRunsVal != null) { int numOfAltRunsInt = Integer.parseInt(numOfAltRunsVal); if (specifyNumOfAltRunsVal && numOfAltRunsInt < 50 && !dataset20GVal) sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if (specifyNumOfAltRunsVal && (maxHoursToRunInt > 2) && (numOfAltRunsInt >= 50) && !dataset20GVal) sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if (specifyNumOfAltRunsVal && (maxHoursToRunInt <= 2) && (numOfAltRunsInt >= 50) && !dataset20GVal) sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); } if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.AUTOBOOTSTOP.getValue()) && (maxHoursToRunInt > 2) && !dataset20GVal) sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.AUTOBOOTSTOP.getValue()) && (maxHoursToRunInt <= 2) && !dataset20GVal) sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if ((bootstrappingTypeVal == null || (!bootstrappingTypeVal.equals(ComboBoxValueLabel.NONPARAMETRIC.getValue()) && !bootstrappingTypeVal.equals(ComboBoxValueLabel.RAPID.getValue()))) && !specifyNumOfAltRunsVal && !dataset20GVal) { sbWarn.append("The job will run on 12 processors as configured. If it runs for the entire configured time,it will consume 12 x " + maxHoursToRunVal + " cpu hour
"); } if ((maxHoursToRunInt > 2) && dataset20GVal) sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if ((maxHoursToRunInt <= 2) && dataset20GVal) sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); */ //String estRunHours = estimateRunHours(numOfBootstrapsVal, bootstrapProtocolVal, specifyNumOfAltRunsVal, numOfAltRunsVal, dataset20GVal, bootstrappingTypeVal); String nchar_Value = getValueAsString(OptionIndex.NCHAR_); int nchar_Int = 0; if (nchar_Value != null) nchar_Int = Integer.parseInt(nchar_Value); boolean protein = false; String sequenceType_Value = getValueAsString(OptionIndex.SEQUENCETYPE); protein = (sequenceType_Value != null && (sequenceType_Value.equals(PROTEIN) || sequenceType_Value.equals(PROTEIN.toLowerCase()))); boolean choose_bootstop = (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.AUTOBOOTSTOP.getValue())); int bootstrap_value = 0; if (numOfBootstrapsVal != null && !numOfBootstrapsVal.isBlank()) { bootstrap_value = Integer.parseInt(numOfBootstrapsVal); } int altrun_num = 0; if (numOfAltRunsVal != null && !numOfAltRunsVal.isBlank()) { altrun_num = Integer.parseInt(numOfAltRunsVal); } estimateRunHours(sbWarn, nchar_Int, protein, choose_bootstop, bootstrap_value, altrun_num, maxHoursToRunVal); //if (estRunHours != null) // sbWarn.append(estRunHours); if (correctASCBiasVal != null && correctASCBiasVal.equals(ASC_) && mixedPartitionedModelFileVal != null && !mixedPartitionedModelFileVal.isBlank()) { sbWarn.append("Ascertainment bias correction will be applied only to partitions for which it is requested in the partition file (-q)
"); } String proportionOfInvariableSitesVal = getValueAsString(OptionIndex.PROPORTIONOFINVARIABLESITES); if (proportionOfInvariableSitesVal != null && !proportionOfInvariableSitesVal.isBlank()) sbWarn.append("The invariable option is not recomended by the developer of RAxML. Please see the manual for details.
"); Boolean disableCheckSeqWithNoValuesVal = getValueAsBoolean(OptionIndex.DISABLECHECKSEQWITHNOVALUES); if (disableCheckSeqWithNoValuesVal) sbWarn.append("Please use the -O option with caution. It disables the check to see if sequences are completely devoid of information. See the RAxML manul for guidance
"); if (aType != null && aType.equals(ComboBoxValueLabel.J.getValue())) sbWarn.append("The -J option requires a tree file containing several UNROOTED trees as input. If you provide anything else, the job will not progress, instead it will use all of the configured run time. Please be sure you use a correct input file.
"); if (sbWarn.length() > 0) { sbWarn.insert(0, ""); sbWarn.append(""); return (Dialogs.showContinueCancelDialog(sbWarn.toString(), "Continue with job submission?", this.getPanel(), Dialogs.DialogIcon.QUESTION)); //return "You may want to adjust your parameters/input files or submit your job at a later time."; //return false; } } return true; //return sb.toString(); } /* @Override public boolean areValuesGoodEnoughToContinue() { if (!super.areValuesGoodEnoughToContinue()) { return false; } return (Dialogs.showContinueCancelDialog("Test", "Test", this.getPanel(), Dialogs.DialogIcon.QUESTION)); }*/ private void setInitialEnabledState() { mlSearchUnderCAT.setEnabled(false); estimateBranchLengths.setEnabled(false); printMesquiteOutput.setEnabled(false); gammaCATModel.setEnabled(false); proteinSubstitutionMatrix.setEnabled(false); useEmpiricalBaseFrequencies.setEnabled(false); use_ml_freqs_.setEnabled(false); rnaSecondarySubModel.setEnabled(false); binaryDataModel.setEnabled(false); multipleStateDataModel.setEnabled(false); chooseStateDataModel.setEnabled(false); specifyNumOfAltRuns.setEnabled(false); numOfAltRuns.setEnabled(false); //numOfPatterns.setEnabled(false); //numOfTaxa.setEnabled(false); bootstrapProtocol.setEnabled(false); //numOfBootstraps.setEnabled(true); majorityRuleTree.setEnabled(false); } private void noSavedValues() { treeFile.setShouldSaveValue(false); constraintFile.setShouldSaveValue(false); binaryBackboneFile.setShouldSaveValue(false); proportionOfInvariableSites.setShouldSaveValue(false); mixedPartitionedModelFile.setShouldSaveValue(false); excludeRangeOfPositionsFile.setShouldSaveValue(false); weightCharactersFile.setShouldSaveValue(false); customProteinSubstitutionMatrixFile.setShouldSaveValue(false); substitutionMatrixFile1.setShouldSaveValue(false); substitutionMatrixFile2.setShouldSaveValue(false); substitutionMatrixFile3.setShouldSaveValue(false); substitutionMatrixFile4.setShouldSaveValue(false); substitutionMatrixFile5.setShouldSaveValue(false); secondaryStructureFile.setShouldSaveValue(false); topologiesBipartitionsFile.setShouldSaveValue(false); posterioriBootstoppingFile.setShouldSaveValue(false); ascertainment_pfile1_.setShouldSaveValue(false); ascertainment_pfile2_.setShouldSaveValue(false); ascertainment_pfile3_.setShouldSaveValue(false); ascertainment_pfile4_.setShouldSaveValue(false); ascertainment_pfile5_.setShouldSaveValue(false); ascertainment_pfile6_.setShouldSaveValue(false); } private void setDescription() { for (OptionIndex index : OptionIndex.values()) { Option opt = simpleOptions.getOption(nameAndLabels[index.ordinal()].name); if (opt == null) opt = advancedOptions.getOption(nameAndLabels[index.ordinal()].name); if (opt == null || nameAndLabels[index.ordinal()].description == null || nameAndLabels[index.ordinal()].description.isBlank()) continue; opt.setDescription(nameAndLabels[index.ordinal()].description); } } private void estimateRunHours(StringBuilder sbWarn, int nchar_Int, boolean protein, boolean choose_bootstop, int bootstrap_value, int altrun_num, String runtime) { if (nchar_Int < 10000 && !protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 40 processors as configured. If it runs for the entire configured time, it will consume 40 x " + runtime + " cpu hours"); } if (nchar_Int > 9999 && nchar_Int < 40000 && !protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 125 processors as configured. If it runs for the entire configured time, it will consume 125 x " + runtime + " cpu hours"); } if (nchar_Int > 39999 && nchar_Int < 500000 && !protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 128 processors as configured. If it runs for the entire configured time, it will consume 128 x " + runtime + " cpu hours"); } if (nchar_Int > 499999 && !protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 128 processors as configured. If it runs for the entire configured time, it will consume 128 x " + runtime + " cpu hours"); } if (nchar_Int < 4000 && !protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 8 processors as configured. If it runs for the entire configured time, it will consume 8 x " + runtime + " cpu hours"); } if (nchar_Int > 3999 && nchar_Int < 16000 && !protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 16 processors as configured. If it runs for the entire configured time, it will consume 16 x " + runtime + " cpu hours"); } if (nchar_Int > 15999 && nchar_Int < 60000 && !protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time, it will consume 24 x " + runtime + " cpu hours"); } if (nchar_Int > 59999 && nchar_Int < 300000 && !protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time, it will consume 48 x " + runtime + " cpu hours"); } if (nchar_Int > 299999 && !protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 128 processors as configured. If it runs for the entire configured time, it will consume 128 x " + runtime + " cpu hours"); } if (nchar_Int < 3000 && protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 40 processors as configured. If it runs for the entire configured time, it will consume 40 x " + runtime + " cpu hours"); } if (nchar_Int > 2999 && nchar_Int < 12000 && protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 120 processors as configured. If it runs for the entire configured time, it will consume 120 x " + runtime + " cpu hours"); } if (nchar_Int > 11999 && nchar_Int < 30000 && protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 125 processors as configured. If it runs for the entire configured time, it will consume 125 x " + runtime + " cpu hours"); } if (nchar_Int > 29999 && nchar_Int < 200000 && protein && (choose_bootstop|| bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 128 processors as configured. If it runs for the entire configured time, it will consume 128 x " + runtime + " cpu hours"); } if (nchar_Int > 199999 && protein && (choose_bootstop || bootstrap_value > 9 || altrun_num > 9)) { sbWarn.append("The job will run on 128 processors as configured. If it runs for the entire configured time, it will consume 128 x " + runtime + " cpu hours"); } if (nchar_Int < 3000 && protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 12 processors as configured. If it runs for the entire configured time, it will consume 12 x " + runtime + " cpu hours"); } if (nchar_Int > 2999 && nchar_Int < 4500 && protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time, it will consume 24 x " + runtime + " cpu hours"); } if (nchar_Int > 4499 && nchar_Int < 15000 && protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 32 processors as configured. If it runs for the entire configured time, it will consume 32 x " + runtime + " cpu hours"); } if (nchar_Int > 14999 && nchar_Int < 100000 && protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 64 processors as configured. If it runs for the entire configured time, it will consume 64 x " + runtime + " cpu hours"); } if (nchar_Int > 99999 && protein && bootstrap_value < 10 && altrun_num < 10 && !choose_bootstop) { sbWarn.append("The job will run on 128 processors as configured. If it runs for the entire configured time, it will consume 128 x " + runtime + " cpu hours"); } sbWarn.append("
"); } private String estimateRunHoursOld(String numOfBootstrapsVal, String bootstrapProtocolVal, Boolean specifyNumOfAltRunsVal, String numOfAltRunsVal, Boolean dataset20GVal, String bootstrappingTypeVal) { String maxHoursToRunVal = getValueAsString(OptionIndex.MAXHOURSTORUN); double maxHoursToRunInt = Double.parseDouble(maxHoursToRunVal); int numOfProcessors = -1; if (numOfBootstrapsVal != null) { int numOfBootstrapsInt = Integer.parseInt(numOfBootstrapsVal); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsInt < 50) && !dataset20GVal) numOfProcessors = 24; //sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsInt >= 50) && (maxHoursToRunInt > 2)) numOfProcessors = 48; //sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.SPECIFY.getValue()) && (numOfBootstrapsInt >= 50) && (maxHoursToRunInt <= 2)) numOfProcessors = 24; //sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); } if (numOfAltRunsVal != null) { int numOfAltRunsInt = Integer.parseInt(numOfAltRunsVal); if (specifyNumOfAltRunsVal && numOfAltRunsInt < 50 && !dataset20GVal) numOfProcessors = 24; //sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if (specifyNumOfAltRunsVal && (maxHoursToRunInt > 2) && (numOfAltRunsInt >= 50) && !dataset20GVal) numOfProcessors = 48; //sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if (specifyNumOfAltRunsVal && (maxHoursToRunInt <= 2) && (numOfAltRunsInt >= 50) && !dataset20GVal) numOfProcessors = 24; //sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); } if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.AUTOBOOTSTOP.getValue()) && (maxHoursToRunInt > 2) && !dataset20GVal) numOfProcessors = 48; //sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals(ComboBoxValueLabel.AUTOBOOTSTOP.getValue()) && (maxHoursToRunInt <= 2) && !dataset20GVal) numOfProcessors = 24; //sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if ((bootstrappingTypeVal == null || (!bootstrappingTypeVal.equals(ComboBoxValueLabel.NONPARAMETRIC.getValue()) && !bootstrappingTypeVal.equals(ComboBoxValueLabel.RAPID.getValue()))) && !specifyNumOfAltRunsVal && !dataset20GVal) { numOfProcessors = 12; //sbWarn.append("The job will run on 12 processors as configured. If it runs for the entire configured time,it will consume 12 x " + maxHoursToRunVal + " cpu hour
"); } if ((maxHoursToRunInt > 2) && dataset20GVal) numOfProcessors = 48; //sbWarn.append("The job will run on 48 processors as configured. If it runs for the entire configured time,it will consume 48 x " + maxHoursToRunVal + " cpu hour
"); if ((maxHoursToRunInt <= 2) && dataset20GVal) numOfProcessors = 24; //sbWarn.append("The job will run on 24 processors as configured. If it runs for the entire configured time,it will consume 24 x " + maxHoursToRunVal + " cpu hour
"); if (numOfProcessors > 0) return ("The job will run on " + numOfProcessors + " processors as configured. If it runs for the entire configured time, it will consume " + numOfProcessors +" x " + maxHoursToRunVal + " cpu hour
"); else return null; } /* private void setDescription(OptionIndex index) { Option opt = this.getOption(nameAndLabels[index.ordinal()].name); if (opt == null || nameAndLabels[index.ordinal()].description == null || nameAndLabels[index.ordinal()].description.isBlank()) return; opt.setDescription(nameAndLabels[index.ordinal()].description); }*/ private void buildRelationshipAmongOptions() { SimpleListener sl = new SimpleListener() { @Override public void objectChanged() { String dataType = getValueAsString(OptionIndex.SEQUENCETYPE); if (dataType != null) { advancedOptions.setChildOptionsCollapsed(ChildOptions.NUCLEICACIDOPTIONS.getValue(), !(dataType.equals(DNA) || dataType.equals(RNA))); advancedOptions.setChildOptionsCollapsed(ChildOptions.RNAOPTIONS.getValue(), !dataType.equals(RNA)); advancedOptions.setChildOptionsCollapsed(ChildOptions.PROTEINOPTIONS.getValue(), !dataType.equals(PROTEIN.toLowerCase())); advancedOptions.setChildOptionsCollapsed(ChildOptions.BINARYOPTIONS.getValue(), !dataType.equals(BINARY)); advancedOptions.setChildOptionsCollapsed(ChildOptions.MULTIPLESTATEOPTIONS.getValue(), !dataType.equals(MULTI)); bootstrappingPhaseModel.setEnabled(dataType.equals(DNA) || dataType.equals(RNA)); dnaPartitionsModel.setEnabled(dataType.equals(DNA)); binaryDataModel.setEnabled(dataType.equals(BINARY)); gammaCATModel.setEnabled(dataType.equals(PROTEIN.toLowerCase())); proteinSubstitutionMatrix.setEnabled(dataType.equals(PROTEIN.toLowerCase())); setFileSelectorEnabled(OptionIndex.CUSTOMPROTEINSUBSTITUTIONMATRIXFILIE, dataType.equals(PROTEIN.toLowerCase())); //customProteinSubstitutionMatrixFile.setEnabled(dataType.equals(PROTEIN.toLowerCase())); usePartitionAA.setEnabled(dataType.equals(PROTEIN.toLowerCase())); useEmpiricalBaseFrequencies.setEnabled(dataType.equals(PROTEIN.toLowerCase())); use_ml_freqs_.setEnabled(dataType.equals(PROTEIN.toLowerCase())); multipleStateDataModel.setEnabled(dataType.equals(MULTI)); chooseStateDataModel.setEnabled(dataType.equals(MULTI)); } /* String chooseBootstrap = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); if ((chooseBootstrap == null || chooseBootstrap.isBlank()) || (!chooseBootstrap.equals("x") && !chooseBootstrap.equals("b"))) mlSearchUnderCAT.setEnabled(true); else mlSearchUnderCAT.setEnabled(false); String dnaGtrCAT = getValueAsString(OptionIndex.BOOTSTRAPPINGPHASEMODEL); String protSubModel = getValueAsString(OptionIndex.GAMMACATMODEL); String binModel = getValueAsString(OptionIndex.BINARYDATAMODEL); System.out.println("dataType =" + dataType + " binModel = " + binModel); if ((dataType != null && dnaGtrCAT!= null && dataType.equals("dna") && dnaGtrCAT.equals("GTRCAT")) || (dataType != null && protSubModel != null && dataType.equals("protein") && protSubModel.equals("PROTCAT")) || (dataType != null && binModel != null && dataType.equals("binary") && binModel.equals("BINCAT"))) { numOfDistinctRateCate.setEnabled(true); disableRateHeterogeneity.setEnabled(true); } else { numOfDistinctRateCate.setEnabled(false); disableRateHeterogeneity.setEnabled(false); } if (chooseBootstrap == null || !chooseBootstrap.equals("x")) { //treeFile.setEnabled(true); setFileSelectorEnabled(OptionIndex.TREEFILE, true); } else { //treeFile.setEnabled(false); setFileSelectorEnabled(OptionIndex.TREEFILE, false); } String aType = getValueAsString(OptionIndex.ANALYSISTYPE); if (aType == null || (!aType.equals("fe") && !aType.equals("fA"))) specifyRandomSeed.setEnabled(true); else specifyRandomSeed.setEnabled(false); Boolean speRandomSeed = getValueAsBoolean(OptionIndex.SPECIFYRANDOMSEED); if (speRandomSeed) randomSeed.setEnabled(true); else randomSeed.setEnabled(false); Boolean speInitialRearrangeSetting = getValueAsBoolean(OptionIndex.SPECIFYINITIALREARRANGESETTING); if (speInitialRearrangeSetting) distanceFromPruningPoint.setEnabled(true); else distanceFromPruningPoint.setEnabled(false); String binaryBBFile = getValueAsString(OptionIndex.BINARYBACKBONEFILE); if ((binaryBBFile == null || binaryBBFile.isBlank()) && (aType == null || !aType.equals("y"))) { setFileSelectorEnabled(OptionIndex.CONSTRAINTFILE, true); //constraintFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.CONSTRAINTFILE, false); //constraintFile.setEnabled(false); } String constrFile = getValueAsString(OptionIndex.CONSTRAINTFILE); if (constrFile == null || constrFile.isBlank()) { setFileSelectorEnabled(OptionIndex.BINARYBACKBONEFILE, true); //binaryBackboneFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.BINARYBACKBONEFILE, false); //binaryBackboneFile.setEnabled(false); } // //if (dataType != null && dataType.equals("dna")) // dnaPartitionsModel.setEnabled(true); //else // dnaPartitionsModel.setEnabled(false); // String mPartitionedModelFile = getValueAsString(OptionIndex.MIXEDPARTITIONEDMODELFILE); if (mPartitionedModelFile != null && !mPartitionedModelFile.isBlank()) estimateBranchLengths.setEnabled(true); else estimateBranchLengths.setEnabled(false); String proportionOfInvariableSitesVal = getValueAsString(OptionIndex.PROPORTIONOFINVARIABLESITES); if (proportionOfInvariableSitesVal == null || proportionOfInvariableSitesVal.isBlank()) correctAscBias.setEnabled(true); else correctAscBias.setEnabled(false); String btstrappingType = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); Boolean specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); if (btstrappingType == null || (!btstrappingType.equals("x") && !btstrappingType.equals("b") && !specifyNumOfAltRunsVal)) printMesquiteOutput.setEnabled(true); else printMesquiteOutput.setEnabled(false); //if (dataType != null && (dataType.equals("dna") || dataType.equals("rna"))) // bootstrappingPhaseModel.setEnabled(true); //else // bootstrappingPhaseModel.setEnabled(false); //if (dataType != null && dataType.equals("protein")) //{ // customProteinSubstitutionMatrixFile.setEnabled(true); // usePartitionAA.setEnabled(true); // useEmpiricalBaseFrequencies.setEnabled(true); //} //else //{ // customProteinSubstitutionMatrixFile.setEnabled(false); // usePartitionAA.setEnabled(false); // useEmpiricalBaseFrequencies.setEnabled(false); //} Boolean usePartitionAA = getValueAsBoolean(OptionIndex.USEPARTITIONAA); if (usePartitionAA) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE1, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE1, false); String substitutionMatrixFile1 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE1); if (usePartitionAA && substitutionMatrixFile1 != null && !substitutionMatrixFile1.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE2, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE2, false); String substitutionMatrixFile2 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE2); if (usePartitionAA && substitutionMatrixFile2 != null && !substitutionMatrixFile2.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE3, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE3, false); String substitutionMatrixFile3 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE3); if (usePartitionAA && substitutionMatrixFile3 != null && !substitutionMatrixFile2.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE4, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE4, false); String substitutionMatrixFile4 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE4); if (usePartitionAA && substitutionMatrixFile4 != null && !substitutionMatrixFile2.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE5, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE5, false); if (dataType != null && dataType.equals("rna")) { setFileSelectorEnabled(OptionIndex.SECONDARYSTRUCTUREFILE, true); //secondaryStructureFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.SECONDARYSTRUCTUREFILE, false); //secondaryStructureFile.setEnabled(false); } String secondaryStructureFile = getValueAsString(OptionIndex.SECONDARYSTRUCTUREFILE); if (secondaryStructureFile != null && !secondaryStructureFile.isBlank()) rnaSecondarySubModel.setEnabled(true); else rnaSecondarySubModel.setEnabled(false); //if (dataType != null && dataType.equals("binary")) // binaryDataModel.setEnabled(true); //else // binaryDataModel.setEnabled(false); //if (dataType != null && dataType.equals("multi")) //{ // multipleStateDataModel.setEnabled(true); // chooseStateDataModel.setEnabled(true); //} //else //{ // multipleStateDataModel.setEnabled(false); // chooseStateDataModel.setEnabled(false); //} if ((aType == null || (!aType.equals("J") && !aType.equals("fh") && !aType.equals("fT") && !aType.equals("fE") && !aType.equals("fA") && !aType.equals("fb") && !aType.equals("y") && !aType.equals("fv"))) && (btstrappingType == null || (!btstrappingType.equals("x") && !btstrappingType.equals("b")))) specifyNumOfAltRuns.setEnabled(true); else specifyNumOfAltRuns.setEnabled(false); //String specifyNumOfAltRuns = getValueAsString(OptionIndex.SPECIFYNUMOFALTRUNS); //if (specifyNumOfAltRuns != null && !specifyNumOfAltRuns.isBlank()) numOfAltRuns.setEnabled(specifyNumOfAltRunsVal); //else // numOfAltRuns.setEnabled(false); String posterioriBootstoppingFileVal = getValueAsString(OptionIndex.POSTERIORIBOOTSTOPPINGFILE); if ((aType != null && (aType.equals("fb") || aType.equals("fh"))) && (posterioriBootstoppingFileVal == null || posterioriBootstoppingFileVal.isBlank())) { setFileSelectorEnabled(OptionIndex.TOPOLOGIESBIPARTITIONSFILE, true); //topologiesBipartitionsFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.TOPOLOGIESBIPARTITIONSFILE, false); //topologiesBipartitionsFile.setEnabled(false); } if (aType == null || (!aType.equals("fT") && !aType.equals("J") && !aType.equals("fA") && !aType.equals("fb") && !aType.equals("fE") && !aType.equals("y") && !aType.equals("fh") && !aType.equals("fx") && !aType.equals("fu") && !aType.equals("fv") )) writeIntermediateTree.setEnabled(true); else writeIntermediateTree.setEnabled(false); if (aType == null || (!aType.equals("fE") && !aType.equals("J") && !aType.equals("fA") && !aType.equals("fb") && !aType.equals("y") && !aType.equals("fh") && !aType.equals("fx") && !specifyNumOfAltRunsVal && !aType.equals("fu") && !aType.equals("fv") )) useMLConvergenceCriteria.setEnabled(true); else useMLConvergenceCriteria.setEnabled(false); if (aType != null && aType.equals("J")) majorityRuleTree.setEnabled(true); else majorityRuleTree.setEnabled(false); if (dataType != null && (dataType.equals("dna") || dataType.equals("protein"))) dataset20G.setEnabled(true); else dataset20G.setEnabled(false); Boolean dataset20GVal = getValueAsBoolean(OptionIndex.DATASET20G); numOfPatterns.setEnabled(dataset20GVal); numOfTaxa.setEnabled(dataset20GVal); if (aType != null && (aType.equals("fd") || aType.equals("fa") || aType.equals("fo"))) bootstrappingType.setEnabled(true); else bootstrappingType.setEnabled(false); String bootstrappingTypeVal = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); if (bootstrappingTypeVal != null && (bootstrappingTypeVal.equals("x") || bootstrappingTypeVal.equals("b"))) { randomSeedBootstrapping.setEnabled(true); bootstrapProtocol.setEnabled(true); } else { randomSeedBootstrapping.setEnabled(false); bootstrapProtocol.setEnabled(false); } String bootstrapProtocolVal = getValueAsString(OptionIndex.BOOTSTRAPPROTOCOL); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals("specify")) numOfBootstraps.setEnabled(true); else numOfBootstraps.setEnabled(false); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals("bootstop")) bootstoppingCriterion.setEnabled(true); else bootstoppingCriterion.setEnabled(false); if (aType != null && aType.equals("I")) posterioriAnalayis.setEnabled(true); else posterioriAnalayis.setEnabled(false); String topologiesBipartitionsFileVal = getValueAsString(OptionIndex.TOPOLOGIESBIPARTITIONSFILE); if (aType != null && aType.equals("I") && (topologiesBipartitionsFileVal == null || topologiesBipartitionsFileVal.isBlank())) { setFileSelectorEnabled(OptionIndex.POSTERIORIBOOTSTOPPINGFILE, true); //posterioriBootstoppingFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.POSTERIORIBOOTSTOPPINGFILE, false); //posterioriBootstoppingFile.setEnabled(false); } */ doubleCheckRelationship(dataType); doubleCheckRelationship(null); //begin double checking /* chooseBootstrap = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); if (chooseBootstrap == null || !chooseBootstrap.equals("x")) { //treeFile.setEnabled(true); setFileSelectorEnabled(OptionIndex.TREEFILE, true); } else { //treeFile.setEnabled(false); setFileSelectorEnabled(OptionIndex.TREEFILE, false); } btstrappingType = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); if (btstrappingType == null || (!btstrappingType.equals("x") && !btstrappingType.equals("b") && !specifyNumOfAltRunsVal)) printMesquiteOutput.setEnabled(true); else printMesquiteOutput.setEnabled(false); numOfAltRuns.setEnabled(specifyNumOfAltRunsVal); */ //end double checking /* if (autoBootstrappingHalt) setEnabled(OptionIndex.CONSTRAINT, false); else { String bb = binaryBackbone.getValue(); if ((bb == null || bb.isBlank()) && !autoBootstrappingHalt) setEnabled(OptionIndex.CONSTRAINT, true); else setEnabled(OptionIndex.CONSTRAINT, false); } String cst = constraint.getValue(); if (cst == null || cst.isBlank() || !constraint.isEnabled() ) setEnabled(OptionIndex.BINARYBACKBONE, true); else setEnabled(OptionIndex.BINARYBACKBONE, false); Boolean mlSearch = maximumLikelihoodSearch.getValue(); proportionOfInvariableSites.setEnabled(mlSearch); String st= sequenceType.getValueAsString(); proteinSubstitutionMatrix.setEnabled(st.equals(PROTEIN.toLowerCase())); useEmpiricalBaseFrequencies.setEnabled(st.equals(PROTEIN.toLowerCase())); } }; bootstrappingHaltAuto.addChangeListener(sl); constraint.addChangeListener(sl); binaryBackbone.addChangeListener(sl); maximumLikelihoodSearch.addChangeListener(sl); sequenceType.addChangeListener(sl);*/ } }; bootstrappingType.addChangeListener(sl); sequenceType.addChangeListener(sl); bootstrappingPhaseModel.addChangeListener(sl); binaryDataModel.addChangeListener(sl); gammaCATModel.addChangeListener(sl); analysisType.addChangeListener(sl); specifyRandomSeed.addChangeListener(sl); specifyInitialRearrangeSetting.addChangeListener(sl); binaryBackboneFile.addChangeListener(sl); constraintFile.addChangeListener(sl); mixedPartitionedModelFile.addChangeListener(sl); proportionOfInvariableSites.addChangeListener(sl); bootstrappingType.addChangeListener(sl); specifyNumOfAltRuns.addChangeListener(sl); usePartitionAA.addChangeListener(sl); substitutionMatrixFile1.addChangeListener(sl); substitutionMatrixFile2.addChangeListener(sl); substitutionMatrixFile3.addChangeListener(sl); substitutionMatrixFile4.addChangeListener(sl); secondaryStructureFile.addChangeListener(sl); //dataset20G.addChangeListener(sl); bootstrapProtocol.addChangeListener(sl); topologiesBipartitionsFile.addChangeListener(sl); ascentainmentBiasCorrectionType.addChangeListener(sl); ascertainment_pfile1_.addChangeListener(sl); ascertainment_pfile2_.addChangeListener(sl); ascertainment_pfile3_.addChangeListener(sl); ascertainment_pfile4_.addChangeListener(sl); ascertainment_pfile5_.addChangeListener(sl); } private void doubleCheckRelationship(String dataType) { if (dataType == null) dataType = getValueAsString(OptionIndex.SEQUENCETYPE); String chooseBootstrap = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); if ((chooseBootstrap == null || chooseBootstrap.isBlank()) || (!chooseBootstrap.equals("x") && !chooseBootstrap.equals("b"))) mlSearchUnderCAT.setEnabled(true); else mlSearchUnderCAT.setEnabled(false); String dnaGtrCAT = getValueAsString(OptionIndex.BOOTSTRAPPINGPHASEMODEL); String protSubModel = getValueAsString(OptionIndex.GAMMACATMODEL); String binModel = getValueAsString(OptionIndex.BINARYDATAMODEL); System.out.println("dataType =" + dataType + " binModel = " + binModel); if ((dataType != null && dnaGtrCAT!= null && dataType.equals("dna") && dnaGtrCAT.equals("GTRCAT")) || (dataType != null && protSubModel != null && dataType.equals("protein") && protSubModel.equals("PROTCAT")) || (dataType != null && binModel != null && dataType.equals("binary") && binModel.equals("BINCAT"))) { numOfDistinctRateCate.setEnabled(true); disableRateHeterogeneity.setEnabled(true); } else { numOfDistinctRateCate.setEnabled(false); disableRateHeterogeneity.setEnabled(false); } if (chooseBootstrap == null || chooseBootstrap.isBlank()|| !chooseBootstrap.equals("x")) { //treeFile.setEnabled(true); setFileSelectorEnabled(OptionIndex.TREEFILE, true); } else { //treeFile.setEnabled(false); setFileSelectorEnabled(OptionIndex.TREEFILE, false); } String aType = getValueAsString(OptionIndex.ANALYSISTYPE); if (aType == null || (!aType.equals("fe") && !aType.equals("fA"))) specifyRandomSeed.setEnabled(true); else specifyRandomSeed.setEnabled(false); Boolean speRandomSeed = getValueAsBoolean(OptionIndex.SPECIFYRANDOMSEED); if (speRandomSeed) randomSeed.setEnabled(true); else randomSeed.setEnabled(false); Boolean speInitialRearrangeSetting = getValueAsBoolean(OptionIndex.SPECIFYINITIALREARRANGESETTING); if (speInitialRearrangeSetting) distanceFromPruningPoint.setEnabled(true); else distanceFromPruningPoint.setEnabled(false); String binaryBBFile = getValueAsString(OptionIndex.BINARYBACKBONEFILE); if ((binaryBBFile == null || binaryBBFile.isBlank()) && (aType == null || !aType.equals("y"))) { setFileSelectorEnabled(OptionIndex.CONSTRAINTFILE, true); //constraintFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.CONSTRAINTFILE, false); //constraintFile.setEnabled(false); } String constrFile = getValueAsString(OptionIndex.CONSTRAINTFILE); if (constrFile == null || constrFile.isBlank()) { setFileSelectorEnabled(OptionIndex.BINARYBACKBONEFILE, true); //binaryBackboneFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.BINARYBACKBONEFILE, false); //binaryBackboneFile.setEnabled(false); } // //if (dataType != null && dataType.equals("dna")) // dnaPartitionsModel.setEnabled(true); //else // dnaPartitionsModel.setEnabled(false); // String mPartitionedModelFile = getValueAsString(OptionIndex.MIXEDPARTITIONEDMODELFILE); if (mPartitionedModelFile != null && !mPartitionedModelFile.isBlank()) estimateBranchLengths.setEnabled(true); else estimateBranchLengths.setEnabled(false); String proportionOfInvariableSitesVal = getValueAsString(OptionIndex.PROPORTIONOFINVARIABLESITES); /* if (proportionOfInvariableSitesVal == null || proportionOfInvariableSitesVal.isBlank()) correctAscBias.setEnabled(true); else correctAscBias.setEnabled(false); */ if (proportionOfInvariableSitesVal != null && proportionOfInvariableSitesVal.equals(INVARIABLE)) { correctAscBias.setEnabled(false); } else { correctAscBias.setEnabled(true); } String ascentainmentBiasCorrectionTypeVal = getValueAsString(OptionIndex.ASCENTAINMENTBIASCORRECTIONTYPE); System.out.println("ascentainmentBiasCorrectionTypeVal = " + ascentainmentBiasCorrectionTypeVal); if (ascentainmentBiasCorrectionTypeVal != null && (ascentainmentBiasCorrectionTypeVal.toLowerCase().equals(FELSENSTEIN) || ascentainmentBiasCorrectionTypeVal.toLowerCase().equals(STAMATAKIS))) { setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE1_, true); } else setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE1_, false); String ascertainment_pfile1_Value = getValueAsString(OptionIndex.ASCERTAINMENT_PFILE1_); if (ascertainment_pfile1_Value != null && !ascertainment_pfile1_Value.isBlank()) setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE2_, true); else setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE2_, false); String ascertainment_pfile2_Value = getValueAsString(OptionIndex.ASCERTAINMENT_PFILE2_); if (ascertainment_pfile2_Value != null && !ascertainment_pfile2_Value.isBlank()) setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE3_, true); else setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE3_, false); String ascertainment_pfile3_Value = getValueAsString(OptionIndex.ASCERTAINMENT_PFILE3_); if (ascertainment_pfile3_Value != null && !ascertainment_pfile3_Value.isBlank()) setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE4_, true); else setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE4_, false); String ascertainment_pfile4_Value = getValueAsString(OptionIndex.ASCERTAINMENT_PFILE4_); if (ascertainment_pfile4_Value != null && !ascertainment_pfile4_Value.isBlank()) setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE5_, true); else setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE5_, false); String ascertainment_pfile5_Value = getValueAsString(OptionIndex.ASCERTAINMENT_PFILE5_); if (ascertainment_pfile5_Value != null && !ascertainment_pfile5_Value.isBlank()) setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE6_, true); else setFileSelectorEnabled(OptionIndex.ASCERTAINMENT_PFILE6_, false); /* String ascertainment_corr_Value = getValueAsString(OptionIndex.ASCERTAINMENT_CORR_); if(ascertainment_corr_Value != null && ) */ String btstrappingType = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); Boolean specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); if ((btstrappingType == null || ((!btstrappingType.equals("x") && !btstrappingType.equals("b")))) && !specifyNumOfAltRunsVal) printMesquiteOutput.setEnabled(true); else printMesquiteOutput.setEnabled(false); //if (dataType != null && (dataType.equals("dna") || dataType.equals("rna"))) // bootstrappingPhaseModel.setEnabled(true); //else // bootstrappingPhaseModel.setEnabled(false); //if (dataType != null && dataType.equals("protein")) //{ // customProteinSubstitutionMatrixFile.setEnabled(true); // usePartitionAA.setEnabled(true); // useEmpiricalBaseFrequencies.setEnabled(true); //} //else //{ // customProteinSubstitutionMatrixFile.setEnabled(false); // usePartitionAA.setEnabled(false); // useEmpiricalBaseFrequencies.setEnabled(false); //} Boolean usePartitionAA = getValueAsBoolean(OptionIndex.USEPARTITIONAA); if (usePartitionAA) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE1, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE1, false); String substitutionMatrixFile1 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE1); if (usePartitionAA && substitutionMatrixFile1 != null && !substitutionMatrixFile1.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE2, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE2, false); String substitutionMatrixFile2 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE2); if (usePartitionAA && substitutionMatrixFile2 != null && !substitutionMatrixFile2.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE3, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE3, false); String substitutionMatrixFile3 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE3); if (usePartitionAA && substitutionMatrixFile3 != null && !substitutionMatrixFile2.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE4, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE4, false); String substitutionMatrixFile4 = getValueAsString(OptionIndex.SUBSTITUTIONMATRIXFILE4); if (usePartitionAA && substitutionMatrixFile4 != null && !substitutionMatrixFile2.isBlank()) setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE5, true); else setFileSelectorEnabled(OptionIndex.SUBSTITUTIONMATRIXFILE5, false); if (dataType != null && dataType.equals("rna")) { setFileSelectorEnabled(OptionIndex.SECONDARYSTRUCTUREFILE, true); //secondaryStructureFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.SECONDARYSTRUCTUREFILE, false); //secondaryStructureFile.setEnabled(false); } String secondaryStructureFile = getValueAsString(OptionIndex.SECONDARYSTRUCTUREFILE); if (secondaryStructureFile != null && !secondaryStructureFile.isBlank()) rnaSecondarySubModel.setEnabled(true); else rnaSecondarySubModel.setEnabled(false); //if (dataType != null && dataType.equals("binary")) // binaryDataModel.setEnabled(true); //else // binaryDataModel.setEnabled(false); //if (dataType != null && dataType.equals("multi")) //{ // multipleStateDataModel.setEnabled(true); // chooseStateDataModel.setEnabled(true); //} //else //{ // multipleStateDataModel.setEnabled(false); // chooseStateDataModel.setEnabled(false); //} if ((aType == null || (!aType.equals("J") && !aType.equals("fh") && !aType.equals("fT") && !aType.equals("fE") && !aType.equals("fA") && !aType.equals("fb") && !aType.equals("y") && !aType.equals("fv"))) && (btstrappingType == null || (!btstrappingType.equals("x") && !btstrappingType.equals("b")))) { specifyNumOfAltRuns.setEnabled(true); } else { specifyNumOfAltRuns.setEnabled(false); } specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); //if (specifyNumOfAltRuns != null && !specifyNumOfAltRuns.isBlank()) numOfAltRuns.setEnabled(specifyNumOfAltRunsVal); //else // numOfAltRuns.setEnabled(false); String posterioriBootstoppingFileVal = getValueAsString(OptionIndex.POSTERIORIBOOTSTOPPINGFILE); if ((aType != null && (aType.equals("fb") || aType.equals("fh"))) && (posterioriBootstoppingFileVal == null || posterioriBootstoppingFileVal.isBlank())) { setFileSelectorEnabled(OptionIndex.TOPOLOGIESBIPARTITIONSFILE, true); //topologiesBipartitionsFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.TOPOLOGIESBIPARTITIONSFILE, false); //topologiesBipartitionsFile.setEnabled(false); } if (aType == null || (!aType.equals("fT") && !aType.equals("J") && !aType.equals("fA") && !aType.equals("fb") && !aType.equals("fE") && !aType.equals("y") && !aType.equals("fh") && !aType.equals("fx") && !aType.equals("fu") && !aType.equals("fv") )) writeIntermediateTree.setEnabled(true); else writeIntermediateTree.setEnabled(false); if ((aType == null || (!aType.equals("fE") && !aType.equals("J") && !aType.equals("fA") && !aType.equals("fb") && !aType.equals("y") && !aType.equals("fh") && !aType.equals("fx") && !aType.equals("fu") && !aType.equals("fv") )) && !specifyNumOfAltRunsVal) useMLConvergenceCriteria.setEnabled(true); else useMLConvergenceCriteria.setEnabled(false); if (aType != null && aType.equals("J")) majorityRuleTree.setEnabled(true); else majorityRuleTree.setEnabled(false); /* if (dataType != null && (dataType.equals("dna") || dataType.equals("protein"))) dataset20G.setEnabled(true); else dataset20G.setEnabled(false); Boolean dataset20GVal = getValueAsBoolean(OptionIndex.DATASET20G); numOfPatterns.setEnabled(dataset20GVal); numOfTaxa.setEnabled(dataset20GVal); */ if (aType != null && (aType.equals("fd") || aType.equals("fa") || aType.equals("fo"))) bootstrappingType.setEnabled(true); else bootstrappingType.setEnabled(false); String bootstrappingTypeVal = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); if (bootstrappingTypeVal != null && (bootstrappingTypeVal.equals("x") || bootstrappingTypeVal.equals("b"))) { randomSeedBootstrapping.setEnabled(true); bootstrapProtocol.setEnabled(true); } else { randomSeedBootstrapping.setEnabled(false); bootstrapProtocol.setEnabled(false); } String bootstrapProtocolVal = getValueAsString(OptionIndex.BOOTSTRAPPROTOCOL); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals("specify")) numOfBootstraps.setEnabled(true); else numOfBootstraps.setEnabled(false); if (bootstrapProtocolVal != null && bootstrapProtocolVal.equals("bootstop")) bootstoppingCriterion.setEnabled(true); else bootstoppingCriterion.setEnabled(false); if (aType != null && aType.equals("I")) posterioriAnalayis.setEnabled(true); else posterioriAnalayis.setEnabled(false); String topologiesBipartitionsFileVal = getValueAsString(OptionIndex.TOPOLOGIESBIPARTITIONSFILE); if (aType != null && aType.equals("I") && (topologiesBipartitionsFileVal == null || topologiesBipartitionsFileVal.isBlank())) { setFileSelectorEnabled(OptionIndex.POSTERIORIBOOTSTOPPINGFILE, true); //posterioriBootstoppingFile.setEnabled(true); } else { setFileSelectorEnabled(OptionIndex.POSTERIORIBOOTSTOPPINGFILE, false); //posterioriBootstoppingFile.setEnabled(false); } } /* private void doubleCheckRelationship() { String chooseBootstrap = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); //String btstrappingType = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); Boolean specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); if ((chooseBootstrap == null || chooseBootstrap.isBlank()) || (!chooseBootstrap.equals("x") && !chooseBootstrap.equals("b"))) mlSearchUnderCAT.setEnabled(true); else mlSearchUnderCAT.setEnabled(false); if (chooseBootstrap == null || chooseBootstrap.isBlank() || !chooseBootstrap.equals("x")) { //treeFile.setEnabled(true); setFileSelectorEnabled(OptionIndex.TREEFILE, true); } else { //treeFile.setEnabled(false); setFileSelectorEnabled(OptionIndex.TREEFILE, false); } //btstrappingType = getValueAsString(OptionIndex.BOOTSTRAPPINGTYPE); //specifyNumOfAltRunsVal = getValueAsBoolean(OptionIndex.SPECIFYNUMOFALTRUNS); if (chooseBootstrap == null || chooseBootstrap.isBlank() || (!chooseBootstrap.equals("x") && !chooseBootstrap.equals("b") && !specifyNumOfAltRunsVal)) printMesquiteOutput.setEnabled(true); else printMesquiteOutput.setEnabled(false); numOfAltRuns.setEnabled(specifyNumOfAltRunsVal); } */ private String getValueAsString(OptionIndex index) { return getValueAsString(index.ordinal() >= OptionIndex.SEQUENCETYPE.ordinal()? advancedOptions: simpleOptions, nameAndLabels[index.ordinal()].name); } private Boolean getValueAsBoolean(OptionIndex index) { return getValueAsBoolean(index.ordinal() >= OptionIndex.SEQUENCETYPE.ordinal()? advancedOptions: simpleOptions, nameAndLabels[index.ordinal()].name); } private void setFileSelectorEnabled(OptionIndex index, boolean enabled) { setFileSelectorEnabled(index.ordinal() >= OptionIndex.SEQUENCETYPE.ordinal()? advancedOptions: simpleOptions, nameAndLabels[index.ordinal()].name, enabled); } private JSONObject jsonCommand = new JSONObject(); private Map inputParams = new HashMap(); @SuppressWarnings("unchecked") public void populateJsonCommand() { for (OptionIndex opt : OptionIndex.values()) { if (nameAndLabels[opt.ordinal()].name.contains("File") || nameAndLabels[opt.ordinal()].isFile) continue; setParam(opt, ParamType.VParam); } } public JSONObject getJsonCommand() { return jsonCommand; } public Map> getVParams() { return MrBayesUtilities.getVParams(jsonCommand); } public Map getInputParams() { List files = new ArrayList(); final AnnotatedPluginDocument doc = selectedDocuments[0]; try { final SequenceAlignmentDocument alignmentDoc = (SequenceAlignmentDocument) doc.getDocument(); File tempFolder; tempFolder = FileUtilities.createTempFile("Geneious", "RAxMLRESTXSEDE", false); tempFolder.delete(); tempFolder.mkdirs(); StringBuilder inFileBldr = new StringBuilder(); List seqDocList = alignmentDoc.getSequences(); for(SequenceDocument seqDocument: seqDocList){ //MrBayes does not like space or dot(s) in taxa name String seqName = seqDocument.getName().trim() .replaceAll(SPACE, UNDERSCORE) .replaceAll("\\"+ DOT, "") .replaceAll("\\(","") .replaceAll("\\)",""); String seqString = seqDocument.getSequenceString().trim(); //System.out.println(seqString); //System.out.println(seqName + TAB + seqString); inFileBldr.append( ">" + seqName + NEWLINE + seqString + NEWLINE); } File outputFile = new File(tempFolder, GENEIOUS_FORMAT); files.add(outputFile); SafePrintWriter out = new SafePrintWriter(new FileWriter(outputFile)); out.println(inFileBldr.toString()); out.close(); } catch (IOException | DocumentOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } //Map inputParams = new HashMap(); //inputParams.put("infile_", "C:\\Users\\mzhuang\\Cipres_input\\infile1"); inputParams.put("infile_", files.get(0).toString()); for (OptionIndex opt : OptionIndex.values()) { if (!nameAndLabels[opt.ordinal()].name.contains("File") && !nameAndLabels[opt.ordinal()].isFile) continue; setParam(opt, ParamType.InputParam); } /* String partition = getValueAsString(OptionIndex.MIXEDPARTITIONEDMODEL); System.out.println("mix partitioned = " + partition); setParam(OptionIndex.CONSTRAINT, ParamType.InputParam); setParam(OptionIndex.BINARYBACKBONE, ParamType.InputParam); setParam(OptionIndex.MIXEDPARTITIONEDMODEL, ParamType.InputParam); setParam(OptionIndex.EXCLUDERANGEOFPOSITIONSFILE, ParamType.InputParam); */ /* if (partition != null && !partition.isBlank()) { inputParams.put("partition_", partition); }*/ return inputParams; } public HashMap getMetadata(String jobName){ jobName = getJobName(); return MrBayesUtilities.getMetadata(jobName); } @SuppressWarnings("unchecked") private void setParam(OptionIndex index, ParamType type) { Option opt = findOptionByName(index.ordinal() >= OptionIndex.SEQUENCETYPE.ordinal()? advancedOptions: simpleOptions, nameAndLabels[index.ordinal()].name); if (opt == null || !opt.isEnabled()) return; String value = null; if (opt instanceof BooleanOption) value = getBooleanValueAsString(index); else value = getValueAsString(index); if (value != null && !value.isBlank()) { if (type.equals(ParamType.VParam)) jsonCommand.put(nameAndLabels[index.ordinal()].parameter, value); else if (type.equals(ParamType.InputParam)) inputParams.put(nameAndLabels[index.ordinal()].parameter, value); } } private String getBooleanValueAsString(OptionIndex index) { BooleanOption bo = (BooleanOption)findOptionByName(index.ordinal() >= OptionIndex.SEQUENCETYPE.ordinal()? advancedOptions: simpleOptions, nameAndLabels[index.ordinal()].name); if (!bo.isEnabled()) return null; if (bo.getValue()) return ONE; else return ZERO; } }