Skip to content

Commit

Permalink
Hiding Felsenstein weights in Gamma site model for BEAUti for the mom…
Browse files Browse the repository at this point in the history
…ent.
  • Loading branch information
rambaut committed Sep 1, 2023
1 parent a0384d0 commit a3ff593
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/dr/app/beauti/sitemodelspanel/PartitionModelPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class PartitionModelPanel extends OptionsPanel {
.values());

private JComboBox heteroCombo = new JComboBox(new String[] { "None",
"Gamma (Felsenstein weights)", "Gamma (equal weights)", "Invariant Sites", "Gamma (equal weights) + Invariant Sites" });
/*"Gamma (Felsenstein weights)", */ "Gamma (equal weights)", "Invariant Sites", "Gamma (equal weights) + Invariant Sites" });

private JComboBox gammaCatCombo = new JComboBox(new String[] { "4", "5",
"6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16" });
Expand Down Expand Up @@ -216,21 +216,17 @@ public void itemStateChanged(ItemEvent ev) {

PanelUtils.setupComponent(heteroCombo);
heteroCombo
.setToolTipText("<html>Select the type of site-specific rate<br>heterogeneity model.<br>"
+ "\"Felsenstein weights\" uses the quadrature method to calculate the category weights described in <br>" +
"Felsenstein (2001) <i>J Mol Evol</i> <b>53</b>: 447-455.</html>");
.setToolTipText("<html>Select the type of site-specific rate<br>heterogeneity model." +
// "<br>\"Felsenstein weights\" uses the quadrature method to calculate the category weights described in <br>" +
// "Felsenstein (2001) <i>J Mol Evol</i> <b>53</b>: 447-455." +
"</html>");
heteroCombo.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ev) {

boolean gammaHetero = heteroCombo.getSelectedIndex() == 1 ||
heteroCombo.getSelectedIndex() == 2
|| heteroCombo.getSelectedIndex() == 4;

boolean gammaHetero = heteroCombo.getSelectedItem().toString().contains("Gamma");
model.setGammaHetero(gammaHetero);
model.setInvarHetero(heteroCombo.getSelectedIndex() == 3
|| heteroCombo.getSelectedIndex() == 4);
model.setGammaHeteroEqualWeights(heteroCombo.getSelectedIndex() == 2
|| heteroCombo.getSelectedIndex() == 4);
model.setInvarHetero(heteroCombo.getSelectedItem().toString().contains("Invariant"));
model.setGammaHeteroEqualWeights(heteroCombo.getSelectedItem().toString().contains("equal"));

if (gammaHetero) {
gammaCatLabel.setEnabled(true);
Expand Down

0 comments on commit a3ff593

Please sign in to comment.