Skip to content

Commit

Permalink
towards fixing CompEvol/BeastFX#50
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed May 17, 2023
1 parent 5ceb4a5 commit 4f5b496
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions fxtemplates/SNAPP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<parameter name='kappa' id='kappa' value='1.0' lower='0.0' estimate='false'/>
<tree spec='beast.base.evolution.tree.ClusterTree' id='Tree.$(n)' nodetype='snap.NodeData' clusterType='upgma' clock.rate="1.0">
<input name='taxa' idref='snap.$(n)'/>
<taxonset spec="TaxonSet" alignment="@snap.$(n)"/>
</tree>
<parameter name='coalescenceRate' id='coalescenceRate' value='10'/>
</distribution>
Expand Down
19 changes: 18 additions & 1 deletion src/snap/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import beast.base.core.Description;
import beast.base.core.Input;
import beast.base.core.ProgramStatus;
import beast.base.core.Input.Validate;
import beast.base.evolution.alignment.Sequence;
import beast.base.evolution.alignment.Taxon;
Expand All @@ -42,7 +43,7 @@
import beast.base.evolution.datatype.DataType;
import beast.base.evolution.datatype.IntegerData;
import beast.base.evolution.datatype.Nucleotide;
import beast.base.evolution.datatype.StandardData;
import beast.base.evolution.datatype.StandardData;import beastfx.app.beauti.Beauti;



Expand Down Expand Up @@ -172,6 +173,22 @@ public void initAndValidate() {
}
} // initAndValidate

@Override
public List<String> getTaxaNames() {
if (ProgramStatus.name.equals("BEAUti")) {
if (taxaNames == null) {
taxaNames = new ArrayList<>();
} else {
taxaNames.clear();
}
for (Taxon s : m_taxonsets.get()) {
taxaNames.add(s.getID());
}
}
return super.getTaxaNames();
}


private void determineTotalCount(Sequence sequence, DataType dataType) {
if (sequence.totalCountInput.get() > 0) {
return;
Expand Down
2 changes: 2 additions & 0 deletions src/snap/app/inputeditor/DataInputEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ private HBox createButtonBox() {
taxonMapping.get(rows.get(i)).setTaxon2(taxon);
}
modelToTaxonset();
// refresh
taxonSetToModel();
});

Button guessButton = new Button("Guess");
Expand Down

0 comments on commit 4f5b496

Please sign in to comment.