Skip to content

Commit

Permalink
App: Support null constraints in AdditionTree()
Browse files Browse the repository at this point in the history
  • Loading branch information
ms609 committed Jun 26, 2023
1 parent e5d5da9 commit 6d893ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: TreeSearch
Title: Phylogenetic Analysis with Discrete Character Data
Version: 1.3.2.9000
Version: 1.3.2.9001
Authors@R: c(
person(
"Martin R.", 'Smith',
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TreeSearch 1.3.2.9000 (development)
# TreeSearch 1.3.2.9001 (development)

- Default to use equal weighting during ratchet iterations
- Support null constraints in `AdditionTree()`
Expand Down
14 changes: 10 additions & 4 deletions inst/Parsimony/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -1564,10 +1564,16 @@ server <- function(input, output, session) {
AdditionTree(r$dataset, concavity = concavity())
} else {
LogComment("Select starting tree")
firstOptimal <- which.min(scores())
LogCode(paste0("startTree <- trees[[", firstOptimal, "]]",
" # First tree with optimal score"))
r$trees[[firstOptimal]]
if (all(TipLabels(r$dataset) %in% TipLabels(r$trees))) {
firstOptimal <- which.min(scores())
LogCode(paste0("startTree <- trees[[", firstOptimal, "]]",
" # First tree with optimal score"))
r$trees[[firstOptimal]]
} else {
# TODO Could try fuzzy matching
AdditionTree(r$dataset, concavity = concavity(),
constraint = KeepTip(r$trees[[1]], TipLabels(r$dataset)))
}
}
LogMsg("StartSearch()")
PutData(r$dataset)
Expand Down

0 comments on commit 6d893ba

Please sign in to comment.