Load the whole analysis when a BEAST XML file is dropped on BEAUti (#141) - #142
Merged
Conversation
Dropping an XML file on BEAUti used to import its alignment only, because every dropped file went to the alignment importers and XMLImporter extracts just the alignment from a BEAST XML. Files that carry a beautitemplate attribute, i.e. analyses generated by BEAUti, are now loaded the way File/Load loads them, so model and MCMC settings come along. Drops are also accepted anywhere on the BEAUti window rather than only on the partitions table, and the File/Load handler moved into BeautiTabPane.loadFile so both entry points share it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #141.
Dropping an XML file on BEAUti imported its alignment only: every dropped file went
to the alignment importers, and
XMLImporterpulls just the alignment out of a BEASTXML, so the model and MCMC settings were discarded.
What changed
BeautiDoc.isBeautiAnalysisFile(File)sniffs a file for thebeautitemplateattributeon its top level element -- the same marker
extractSequencesuses to pick a template.That is what tells a BEAUti generated analysis apart from an alignment file.
(
newAnalysis+loadXML), so model and MCMC settings come back. Anything else stillgoes to the alignment importers, so dropping NEXUS/FASTA/BEAST1 files is unchanged.
Dropping a non-analysis file outside the partitions table now says where alignments go
instead of silently doing nothing.
BeautiTabPane.loadFile(File)so the menu and drag and dropshare one code path (save buttons enabled, window title, error dialog).
everything else) and BEAUti says so. If an analysis is already loaded, it asks before
replacing it -- easy to drop a file by accident, less so to pick File/Load by accident.
Platform.runLater, because it rebuilds everypanel including the one the drop came from.
Testing
DragAndDropXMLTestsets up an analysis (HKY, non-default chain length), saves it,starts a new analysis and then drops the saved file: the alignment, the site model and
the chain length all come back.
BeautiAnalysisFileTestcovers the file sniffing: BEAUti XML, BEAST XML withoutbeautitemplate, NEXUS, missing file.beast-fxsuite passes.a manual check: drop a saved analysis on various tabs, drop a NEXUS file on the partitions
table, drop a non-BEAUti XML.