Merge branch 'features/JAL-1767pcaInProject' into bug/JAL-3171_maintain_datasets_acro...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 19 Dec 2018 16:53:33 +0000 (16:53 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 19 Dec 2018 16:53:33 +0000 (16:53 +0000)
276 files changed:
.ant-targets-build.xml
.classpath
.gitignore
.settings/org.eclipse.jdt.ui.prefs
AUTHORS
README
RELEASE
THIRDPARTYLIBS
build.xml
doc/patching-vaqua.txt [new file with mode: 0644]
examples/rna_ss_test.stk [new file with mode: 0644]
examples/testdata/example_annot_file.jva
examples/testdata/projects/manyViews.jvp [new file with mode: 0644]
examples/testdata/projects/twoViews.jvp [new file with mode: 0644]
examples/testdata/test.aln
help/help.jhm
help/helpTOC.xml
help/html/editing/index.html
help/html/features/chimera.html
help/html/features/clarguments.html
help/html/features/commandline.html
help/html/features/dasfeatures.html [deleted file]
help/html/features/dassettings.html [deleted file]
help/html/features/jmol.html
help/html/features/preferences.html
help/html/features/schooser_enter-id.png
help/html/features/schooser_main.png
help/html/features/search.html
help/html/features/searchclearhist.png
help/html/features/seqfeatures.html
help/html/features/seqfetch.html
help/html/features/structurechooser.html
help/html/features/viewingpdbs.html
help/html/memory.html
help/html/menus/alignmentMenu.html
help/html/menus/alwview.html
help/html/menus/desktopMenu.html
help/html/menus/wsmenu.html
help/html/releases.html
help/html/webServices/dbreffetcher.html
help/html/webServices/index.html
help/html/whatsNew.html
lib/VAqua5-patch.jar [new file with mode: 0644]
lib/htsjdk-1.133.jar [deleted file]
lib/jdas-1.0.4.jar [deleted file]
nbbuild.xml
resources/authors.props
resources/lang/Messages.properties
resources/lang/Messages_es.properties
resources/uniprot_mapping.xml [deleted file]
schemas/JalviewUserColours.xsd
schemas/JalviewWsParamSet.xsd
schemas/embl.xsd [new file with mode: 0644]
schemas/embl_bindings.xml [new file with mode: 0644]
schemas/jalview.xsd
schemas/uniprot.xsd [new file with mode: 0644]
schemas/vamsas.xsd
src/MCview/PDBChain.java
src/ext/edu/ucsf/rbvi/strucviz2/ChimeraManager.java
src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java
src/jalview/analysis/Conservation.java
src/jalview/analysis/Rna.java
src/jalview/api/structures/JalviewStructureDisplayI.java
src/jalview/bin/Cache.java
src/jalview/bin/Jalview.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/datamodel/Annotation.java
src/jalview/datamodel/HiddenCursorPosition.java
src/jalview/datamodel/RangeElementsIterator.java
src/jalview/datamodel/RangeIterator.java
src/jalview/datamodel/SearchResults.java
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceFeature.java
src/jalview/datamodel/StartRegionIterator.java
src/jalview/datamodel/VisibleContigsIterator.java
src/jalview/datamodel/features/FeatureAttributes.java
src/jalview/datamodel/features/SequenceFeatures.java
src/jalview/datamodel/features/SequenceFeaturesI.java
src/jalview/datamodel/xdb/embl/EmblEntry.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblError.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblFeature.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblFile.java [deleted file]
src/jalview/datamodel/xdb/embl/EmblSequence.java [deleted file]
src/jalview/datamodel/xdb/embl/Qualifier.java [deleted file]
src/jalview/datamodel/xdb/uniprot/UniprotEntry.java [deleted file]
src/jalview/datamodel/xdb/uniprot/UniprotFeature.java [deleted file]
src/jalview/datamodel/xdb/uniprot/UniprotFile.java [deleted file]
src/jalview/datamodel/xdb/uniprot/UniprotProteinName.java [deleted file]
src/jalview/datamodel/xdb/uniprot/UniprotSequence.java [deleted file]
src/jalview/ext/ensembl/EnsemblCdna.java
src/jalview/ext/ensembl/EnsemblCds.java
src/jalview/ext/ensembl/EnsemblFeatures.java
src/jalview/ext/ensembl/EnsemblGene.java
src/jalview/ext/ensembl/EnsemblGenome.java
src/jalview/ext/ensembl/EnsemblInfo.java
src/jalview/ext/ensembl/EnsemblLookup.java
src/jalview/ext/ensembl/EnsemblMap.java
src/jalview/ext/ensembl/EnsemblProtein.java
src/jalview/ext/ensembl/EnsemblRestClient.java
src/jalview/ext/ensembl/EnsemblSeqProxy.java
src/jalview/ext/ensembl/EnsemblXref.java
src/jalview/ext/jmol/JalviewJmolBinding.java
src/jalview/ext/jmol/JmolParser.java
src/jalview/fts/core/FTSRestClient.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/AnnotationRowFilter.java
src/jalview/gui/AppJmol.java
src/jalview/gui/AppVarna.java
src/jalview/gui/AquaInternalFrameManager.java
src/jalview/gui/CalculationChooser.java
src/jalview/gui/ChimeraViewFrame.java
src/jalview/gui/DasSourceBrowser.java [deleted file]
src/jalview/gui/Desktop.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/FeatureTypeSettings.java
src/jalview/gui/FontChooser.java
src/jalview/gui/IdCanvas.java
src/jalview/gui/JDatabaseTree.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/PCAPanel.java
src/jalview/gui/Preferences.java
src/jalview/gui/SeqCanvas.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/SequenceFetcher.java
src/jalview/gui/SplitFrame.java
src/jalview/gui/StructureChooser.java
src/jalview/gui/StructureViewer.java
src/jalview/gui/StructureViewerBase.java
src/jalview/gui/TreeCanvas.java
src/jalview/gui/TreePanel.java
src/jalview/gui/UserDefinedColours.java
src/jalview/gui/VamsasApplication.java
src/jalview/gui/WsParamSetManager.java
src/jalview/io/AlignFile.java
src/jalview/io/ClustalFile.java
src/jalview/io/FeaturesFile.java
src/jalview/io/FileFormat.java
src/jalview/io/FileLoader.java
src/jalview/io/FileParse.java
src/jalview/io/JalviewFileChooser.java
src/jalview/io/JalviewFileFilter.java
src/jalview/io/JalviewFileView.java
src/jalview/io/StockholmFile.java
src/jalview/io/cache/JvCacheableInputBox.java
src/jalview/jbgui/GDesktop.java
src/jalview/jbgui/GPreferences.java
src/jalview/jbgui/GStructureChooser.java
src/jalview/project/Jalview2XML.java [new file with mode: 0644]
src/jalview/schemes/ColourSchemeLoader.java
src/jalview/structure/StructureMapping.java
src/jalview/structure/StructureSelectionManager.java
src/jalview/util/MapList.java
src/jalview/ws/DBRefFetcher.java
src/jalview/ws/DasSequenceFeatureFetcher.java [deleted file]
src/jalview/ws/SequenceFetcher.java
src/jalview/ws/dbsources/EmblXmlSource.java
src/jalview/ws/dbsources/Uniprot.java
src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java [deleted file]
src/jalview/ws/dbsources/das/api/jalviewSourceI.java [deleted file]
src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java [deleted file]
src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java [deleted file]
src/jalview/ws/dbsources/das/datamodel/JalviewSource.java [deleted file]
src/jalview/xml/binding/embl/EntrySetType.java [new file with mode: 0644]
src/jalview/xml/binding/embl/EntryType.java [new file with mode: 0644]
src/jalview/xml/binding/embl/ObjectFactory.java [new file with mode: 0644]
src/jalview/xml/binding/embl/ROOT.java [new file with mode: 0644]
src/jalview/xml/binding/embl/XrefType.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/AlcodonFrame.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/Annotation.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/AnnotationColourScheme.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/AnnotationElement.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/Feature.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/FeatureMatcher.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/FeatureMatcherSet.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/FilterBy.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/JalviewModel.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/JalviewModelType.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/JalviewUserColours.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/MapListType.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/Mapping.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/NoValueColour.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/ObjectFactory.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/Pdbentry.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/Sequence.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/SequenceSet.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/SequenceType.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/ThresholdType.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/VAMSAS.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/WebServiceParameterSet.java [new file with mode: 0644]
src/jalview/xml/binding/jalview/package-info.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/CitationType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/CofactorType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/CommentType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/ConsortiumType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/DbReferenceType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/Entry.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/EventType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/EvidenceType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/EvidencedStringType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/FeatureType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/GeneLocationType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/GeneNameType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/GeneType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/ImportedFromType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/InteractantType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/IsoformType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/KeywordType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/LocationType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/MoleculeType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/NameListType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/ObjectFactory.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/OrganismNameType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/OrganismType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/PersonType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/PositionType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/PropertyType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/ProteinExistenceType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/ProteinType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/ReferenceType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/SequenceType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/SourceDataType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/SourceType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/StatusType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/SubcellularLocationType.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/Uniprot.java [new file with mode: 0644]
src/jalview/xml/binding/uniprot/package-info.java [new file with mode: 0644]
src/org/stackoverflowusers/file/WindowsShortcut.java [new file with mode: 0644]
test/MCview/PDBChainTest.java
test/jalview/analysis/AlignmentUtilsTests.java
test/jalview/analysis/CrossRefTest.java
test/jalview/bin/CommandLineOperations.java
test/jalview/datamodel/SequenceTest.java
test/jalview/datamodel/features/FeatureAttributesTest.java
test/jalview/datamodel/features/SequenceFeaturesTest.java
test/jalview/datamodel/xdb/embl/EmblEntryTest.java [deleted file]
test/jalview/datamodel/xdb/embl/EmblFileTest.java [deleted file]
test/jalview/datamodel/xdb/embl/EmblTestHelper.java [deleted file]
test/jalview/ext/ensembl/EnsemblCdnaTest.java
test/jalview/ext/ensembl/EnsemblCdsTest.java
test/jalview/ext/ensembl/EnsemblGeneTest.java
test/jalview/ext/ensembl/EnsemblGenomeTest.java
test/jalview/ext/ensembl/EnsemblRestClientTest.java
test/jalview/ext/ensembl/EnsemblSeqProxyAdapter.java
test/jalview/ext/ensembl/EnsemblSeqProxyTest.java
test/jalview/ext/jmol/JmolViewerTest.java
test/jalview/gui/AlignFrameTest.java
test/jalview/gui/SeqCanvasTest.java
test/jalview/gui/StructureChooserTest.java
test/jalview/io/ClustalFileTest.java [new file with mode: 0644]
test/jalview/io/Jalview2xmlTests.java
test/jalview/io/StockholmFileTest.java
test/jalview/project/Jalview2xmlTests.java [new file with mode: 0644]
test/jalview/renderer/OverviewRendererTest.java
test/jalview/renderer/seqfeatures/FeatureRendererTest.java
test/jalview/structure/Mapping.java
test/jalview/structure/StructureMappingTest.java
test/jalview/util/MapListTest.java
test/jalview/ws/PDBSequenceFetcherTest.java
test/jalview/ws/SequenceFetcherTest.java
test/jalview/ws/dbsources/EmblSourceTest.java [new file with mode: 0644]
test/jalview/ws/dbsources/PfamFullTest.java
test/jalview/ws/dbsources/PfamSeedTest.java
test/jalview/ws/dbsources/RemoteFormatTest.java
test/jalview/ws/dbsources/RfamFullTest.java
test/jalview/ws/dbsources/RfamSeedTest.java
test/jalview/ws/dbsources/UniprotTest.java
test/jalview/ws/seqfetcher/DasSequenceFetcher.java [deleted file]
utils/InstallAnywhere/Jalview.iap_xml
utils/InstallAnywhere/README_IA
utils/InstallAnywhere/jalview_buildinstaller.xml
utils/classgraph-4.1.6.jar [new file with mode: 0644]

index 7ef21f1..15432a1 100644 (file)
@@ -1,2 +1,31 @@
+build
+buildPropertiesFile
+buildTests
+buildextclients
+buildindices
+castorbinding
+clean
+compileApplet
+distclean
 help
+init
+linkcheck
+makeApplet
+makedist
+makefulldist
+obfuscate
+packageApplet
+prepare
+prepareTests
+preparejnlp
+prepubapplet_1
+pubapplet
+runenv
+signApplet
+sourcedist
+sourcedoc
+sourcescrub
+testclean
+testng
 usage
+writejnlpf
index f4b8cf8..0da91bb 100644 (file)
@@ -36,7 +36,6 @@
        <classpathentry kind="lib" path="lib/miglayout-4.0-swing.jar"/>
        <classpathentry kind="lib" path="lib/jswingreader-0.3.jar" sourcepath="/jswingreader"/>
        <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
-       <classpathentry kind="lib" path="lib/jdas-1.0.4.jar"/>
        <classpathentry kind="lib" path="lib/spring-core-3.0.5.RELEASE.jar"/>
        <classpathentry kind="lib" path="lib/spring-web-3.0.5.RELEASE.jar"/>
        <classpathentry kind="lib" path="lib/jabaws-min-client-2.2.0.jar" sourcepath="/clustengine"/>
@@ -48,6 +47,8 @@
        <classpathentry kind="lib" path="lib/VARNAv3-93.jar"/>
        <classpathentry kind="lib" path="lib/jfreesvg-2.1.jar"/>
        <classpathentry kind="lib" path="lib/quaqua-filechooser-only-8.0.jar"/>
+       <classpathentry kind="lib" path="lib/VAqua5-patch.jar"/>
+       <classpathentry kind="lib" path="utils/classgraph-4.1.6.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin"/>
        <classpathentry kind="lib" path="lib/xml-apis.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
index 2a55560..86637df 100644 (file)
@@ -1,5 +1,6 @@
 .project
 /dist
+/clover
 /classes
 /tests
 /test-reports
@@ -12,4 +13,4 @@
 TESTNG
 /jalviewApplet.jar
 /benchmarking/lib
-*.class
\ No newline at end of file
+*.class
index 30e76be..958613b 100644 (file)
@@ -40,6 +40,7 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=
 sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
 sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
 sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_modifiers=false
 sp_cleanup.remove_redundant_type_arguments=true
 sp_cleanup.remove_trailing_whitespaces=false
 sp_cleanup.remove_trailing_whitespaces_all=true
diff --git a/AUTHORS b/AUTHORS
index 1bfc734..2fe3fce 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,15 +7,17 @@ or might otherwise be considered author of Jalview.
 The people listed below are 'The Jalview Authors', who collectively
 own the copyright to the Jalview source code and permit it to be released under GPL.
 
-This is the authoritative list. It was correct on 23rd November 2016.
+This is the authoritative list: it was correct on 5th September 2018 (or the last commit date!)
+
 If you are releasing a version of Jalview, please make sure any
 statement of authorship in the GUI reflects the list shown here.
 In particular, check the resources/authors.props file ! 
 
 Jim Procter
 Mungo Carstairs
-Tochukwu 'Charles' Ofoegbu
+Ben Soares
 Kira Mourao
+Tochukwu 'Charles' Ofoegbu
 Andrew Waterhouse
 Jan Engelhardt
 Lauren Lui
diff --git a/README b/README
index eaf226b..8172066 100755 (executable)
--- a/README
+++ b/README
@@ -21,13 +21,18 @@ For more help, read the file doc/building.html
 
 ##################
 
-To run application:
+To run application...
+[ NOTE: when using the -classpath option with the '*' wildcard, the argument must be quoted to avoid shell expansion of the wildcard,
+  ALSO, the wildcard MUST be as DIR/* and not DIR/*.jar etc or it will not be interpreted correctly ]
 
-java -Djava.ext.dirs=JALVIEW_HOME/lib -cp JALVIEW_HOME/jalview.jar jalview.bin.Jalview
+on Windows use:
+  java -classpath "JALVIEW_HOME/lib/*;JALVIEW_HOME/jalview.jar" jalview.bin.Jalview
+and on MacOS or Linux:
+  java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview
 
 Replace JALVIEW_HOME with the full path to Jalview Installation Directory. If building from source:
 
-java -Djava.ext.dirs=JALVIEW_BUILD/dist -cp JALVIEW_BUILD/dist/jalview.jar jalview.bin.Jalview
+  java -classpath "JALVIEW_BUILD/dist/*" jalview.bin.Jalview
 
 
 ##################
diff --git a/RELEASE b/RELEASE
index 5ad87c8..1960368 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -1,2 +1,2 @@
-jalview.release=releases/Release_2_10_4_Branch
-jalview.version=2.10.4
+jalview.release=releases/Release_2_11_Branch
+jalview.version=2.11.0
index e0be904..afa99d2 100644 (file)
@@ -9,6 +9,7 @@ ext.edu.ucsf.rbvi.strucviz2 includes sources originally developed by Scooter Mor
  
  jalview.ext.android includes code taken from the Android Open Source Project (https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util).
  The Apache 2.0 Licence (http://www.apache.org/licenses/LICENSE-2.0) is acknowledged in the source code.
+ org.stackoverflowusers.file.WindowsShortcuts was downloaded from http://github.com/codebling/WindowsShortcuts via https://stackoverflow.com/questions/309495/windows-shortcut-lnk-parser-in-java 
 
 Licensing information for each library is given below:
 
@@ -29,7 +30,6 @@ httpclient-4.0.3.jar
 httpcore-4.0.1.jar
 httpmime-4.0.3.jar
 jaxrpc.jar
-jdas-1.0.4.jar : Apache License - built from http://code.google.com/p/jdas/ (29th Feb 2012)
 jhall.jar
 jswingreader-0.3.jar : Apache license - built from http://jswingreader.sourceforge.net/ svn/trunk v12
 log4j-1.2.8.jar
@@ -38,8 +38,8 @@ miglayout-4.0-swing.jar       BSD http://www.migcalendar.com/miglayout/versions/4.0/li
 min-jaba-client.jar
 regex.jar
 saaj.jar
-spring-core-3.0.5.RELEASE.jar : Apache License: jdas runtime dependencies retrieved via maven
-spring-web-3.0.5.RELEASE.jar : Apache License: jdas runtime dependencies retrieved via maven
+spring-core-3.0.5.RELEASE.jar : Apache License: jdas runtime dependencies retrieved via maven - TODO: JAL-3035 remove if no longer needed ?
+spring-web-3.0.5.RELEASE.jar : Apache License: jdas runtime dependencies retrieved via maven - TODO: JAL-3035 remove if no longer needed ?
 vamsas-client.jar
 wsdl4j.jar
 xercesImpl.jar
@@ -49,13 +49,21 @@ jfreesvg-2.1.jar : GPL v3 licensed library from the JFree suite: http://www.jfre
 
 quaqua: v.8.0 (latest stable) by Randel S Hofer. LGPL and BSD Modified license: downloaded from http://www.randelshofer.ch/quaqua/ 
 
-lib/htsjdk-1.120-SNAPSHOT.jar: (currently not required for 2.10) built from maven master at https://github.com/samtools/htsjdk MIT License to Broad Institute
+vaqua5-patch: This is a patched version of VAqua v5 (latest stable) by Alan Snyder et al. GPLv3 with Classpath exception, also includes contributions from Quaqua: http://violetlib.org/vaqua/overview.html - see doc/patching-vaqua.txt for patch details, and http://issues.jalview.org/browse/JAL-2988 for details of the bug that the patch addresses.
+
+lib/htsjdk-2.12.jar: built from maven master at https://github.com/samtools/htsjdk MIT License to Broad Institute
 
 lib/biojava-core-4.1.0.jar LGPLv2.1 - latest license at https://github.com/biojava/biojava/blob/master/LICENSE
 
 lib/biojava-ontology-4.1.0.jar LGPLv2.1 - latest license at https://github.com/biojava/biojava/blob/master/LICENSE
 
 
+Libraries for Test Suite
+
+utils/classgraph-4.1.6.jar: BSD License - allows recovery of classpath for programmatic construction of a Java command line to launch Jalview
+                      version 4.1.6 downloaded from https://mvnrepository.com/artifact/io.github.classgraph/classgraph/4.1.6
+
+
 Additional dependencies
 
 examples/javascript/deployJava.js : http://java.com/js/deployJava.js
index 3bacc1c..5ca105a 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -20,6 +20,9 @@
 <project name="jalviewX" default="usage" basedir="."
  xmlns:if="ant:if"
     xmlns:unless="ant:unless">
+  <taskdef classpath="${clover.jar}" resource="cloverlib.xml" if:set="clover.jar"/>
+  <clover-env if:set="clover.jar"/>
+
   <target name="help" depends="usage" />
   <target name="usage" depends="init">
     <echo message="~~~Jalview Ant build.xml Usage~~~~" />
@@ -40,6 +43,7 @@
     <echo message="See docs/building.html and the comments in build file for other targets." />
     <echo message="note: compile and makeApplet optionally compile/obfuscate applet against a different Java version by specifying -Djava118.home=PathtoJDK/lib which is the lib directory in the JDK install that contains rt.jar " />
     <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
+    <echo message="Useful -D flags: -Dclover.jar to specify path to openclover for testng coverage report" />
   </target>
 
 
     <property name="docDir" value="doc" />
     <property name="sourceDir" value="src" />
     <property name="schemaDir" value="schemas" />
-    <property name="outputDir" value="classes" />
+    <property name="outputDir" value="classes" unless:set="clover.jar"/>
+    <property name="outputDir" value="cloverclasses" if:set="clover.jar"/>
     <property name="packageDir" value="dist" />
     <property name="outputJar" value="jalview.jar" />
     <!-- Jalview Applet JMol Jar Dependency -->
       verbose="2">
       <classpath>
         <pathelement location="${testOutputDir}" />
+        <pathelement location="${clover.jar}" if:set="clover.jar"/>
         <path refid="test.classpath" />
       </classpath>
       <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
   </target>
 
   <target name="buildindices" depends="init, prepare" unless="help.uptodate">
+    <replace value="${JALVIEW_VERSION}">
+      <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>
+      <fileset dir="${outputDir}/${helpDir}">
+        <include name="help.jhm" />
+      </fileset>
+    </replace>
+
     <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
       <arg line="html" />
     </java>
     </jar>
 
     <antcall target="writejnlpf">
-      <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
+      <param name="jnlpFile" value="${packageDir}/jalview_256M.jnlp" />
       <param name="inih" value="10M" />
       <param name="maxh" value="256M" />
     </antcall>
+    <antcall target="writejnlpf">
+      <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
+      <param name="inih" value="800M" />
+      <param name="maxh" value="1024M" />
+    </antcall>
 
     <antcall target="writejnlpf">
       <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
 
     <antcall target="writejnlpf">
       <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
-      <param name="inih" value="256M" />
+      <param name="inih" value="800M" />
       <param name="maxh" value="1024M" />
     </antcall>
 
         <association mime-type="application-x/ext-file" extensions="jar"/>-->
   </target>
 
-  <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp">
+  <target name="-jarsignwithtsa" depends="makedist,preparejnlp" if="timestamp" unless="nosign">
     <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="${jalview.keyalg}" digestalg="${jalview.keydig}"
       tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
       <fileset dir="${packageDir}">
       </fileset>
     </signjar>
   </target>
-  <target name="-jarsignnotsa" depends="makedist,preparejnlp" unless="timestamp">
+  <target name="-jarsignnotsa" depends="makedist,preparejnlp" if:blank="timestamp" unless="nosign">
     <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" sigalg="${jalview.keyalg}" digestalg="${jalview.keydig}">
       <fileset dir="${packageDir}">
         <include name="*.jar" />
 </target>
 
 <target name="makedist" depends="build, buildPropertiesFile, linkcheck, buildindices">
+  <fail if="clover.jar">
+    Ignoring request to build jalview distribution with clover-instrumented classes
+  </fail>
   <!-- make the package jar if not already existing -->
   <mkdir dir="${packageDir}" />
   <!-- clean dir if it already existed -->
     <include name="ap_${jsonSimple}" />
   </fileset>
 </target>
-<target name="-signappletnotsa" unless="timestamp" depends="-signapplet">
+<target name="-signappletnotsa" if:blank="timestamp" depends="-signapplet" unless="nosign">
   <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
     <fileset refid="signappletjarset" />
   </signjar>
 </target>
 
-<target name="-signapplettsa" if="timestamp" depends="-signapplet">
+<target name="-signapplettsa" if="timestamp" depends="-signapplet" unless="nosign">
   <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false" tsaproxyhost="${proxyHost}" tsaproxyport="${proxyPort}" tsaurl="${jalview.tsaurl}">
     <fileset refid="signappletjarset" />
   </signjar>
diff --git a/doc/patching-vaqua.txt b/doc/patching-vaqua.txt
new file mode 100644 (file)
index 0000000..65c9974
--- /dev/null
@@ -0,0 +1,27 @@
+VAqua5-patched.jar - how the patch was created
+
+1. Download VAqua5 source from https://violetlib.org/release/vaqua/5/VAqua5Source.zip
+2. Unzip to a directory and apply this patch
+
+diff --git a/src/org/violetlib/aqua/fc/AquaFileChooserUI.java b/src/org/violetlib/aqua/fc/AquaFileChooserUI.java
+index 833366d..61f66e5 100644
+--- a/src/org/violetlib/aqua/fc/AquaFileChooserUI.java
++++ b/src/org/violetlib/aqua/fc/AquaFileChooserUI.java
+@@ -1171,7 +1171,8 @@ public class AquaFileChooserUI extends BasicFileChooserUI {
+         goToFolderCancelButtonText = getString("FileChooser.goToFolderCancelButtonText", l, "Cancel");
+         goToFolderAcceptButtonText = getString("FileChooser.goToFolderAcceptButtonText", l, "Accept");
+         goToFolderErrorText = getString("FileChooser.goToFolderErrorText", l, "The folder can\u2019t be found.");
+-        defaultInitialSaveFileName = getString("FileChooser.defaultSaveFileName", l, "Untitled");
++        // Don't set an initial filename for saving (or loading) !  
++       // defaultInitialSaveFileName = getString("FileChooser.defaultSaveFileName", l, "Untitled");
+     }
+     /**
+
+3. Ensure XCode is installed, along with command line tools and the OSX developer packs
+ - you should have /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+
+4. Download the VAqua rendering library from violetlib.org and save to the VAqua source's lib folder as lib/VAquaRendering.jar
+
+5. change to the release directory and execute 'ant' - a few warnings are generated but providing a final jar is created, all is good!
+
diff --git a/examples/rna_ss_test.stk b/examples/rna_ss_test.stk
new file mode 100644 (file)
index 0000000..429612e
--- /dev/null
@@ -0,0 +1,6 @@
+# STOCKHOLM 1.0
+#=GF ID RNA.SS.TEST
+#=GF TP RNA;
+Test.sequence         GUACAAAAAAAAAA
+#=GC SS_cons          <(EHBheb(E)e)>
+//
index 1779247..6b9faa4 100644 (file)
@@ -18,5 +18,5 @@ SEQUENCE_GROUP        Group_A 30      50      *
 SEQUENCE_GROUP Group_B 1       351     2-5
 SEQUENCE_GROUP Group_C 12      14      -1      seq1    seq2    seq3
 PROPERTIES     Group_A description=This is the description     colour=Helix Propensity pidThreshold=0  outlineColour=red       displayBoxes=true       displayText=false       colourText=false        textCol1=black  textCol2=black  textColThreshold=0
-PROPERTIES     Group_B outlineColour=red       colour=None
+PROPERTIES     Group_B outlineColour=green     colour=None
 PROPERTIES     Group_C colour=Clustal
diff --git a/examples/testdata/projects/manyViews.jvp b/examples/testdata/projects/manyViews.jvp
new file mode 100644 (file)
index 0000000..065b29c
Binary files /dev/null and b/examples/testdata/projects/manyViews.jvp differ
diff --git a/examples/testdata/projects/twoViews.jvp b/examples/testdata/projects/twoViews.jvp
new file mode 100644 (file)
index 0000000..80333cd
Binary files /dev/null and b/examples/testdata/projects/twoViews.jvp differ
index 08a7ac3..6582b12 100644 (file)
@@ -1,53 +1,13 @@
 CLUSTAL
 
-FER_CAPAA/1-97     -----------------------------------------------------------A
-FER_CAPAN/1-144    MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA
-FER1_SOLLC/1-144   MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA
-Q93XJ9_SOLTU/1-144 MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA
-FER1_PEA/1-149     MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA
-Q7XA98_TRIPR/1-152 MATT---PALYGTAVSTSFMRRQPVPMSV-ATTTTTKAFPSGFGLKSVSTKRGDLAVAMA
-FER1_MESCR/1-148   MAAT--TAALSGATMSTAFAPK--TPPMTAALPTNVGR--ALFGLKS-SASR-GRVTAMA
-FER1_SPIOL/1-147   MAAT--TTTMMG--MATTFVPKPQAPPMMAALPSNTGR--SLFGLKT-GSR--GGRMTMA
-FER3_RAPSA/1-96    -----------------------------------------------------------A
-FER1_ARATH/1-148   MAST----ALSSAIVGTSFIRRSPAPISLRSLPSANTQ--SLFGLKS-GTARGGRVTAMA
-FER_BRANA/1-96     -----------------------------------------------------------A
-FER2_ARATH/1-148   MAST----ALSSAIVSTSFLRRQQTPISLRSLPFANTQ--SLFGLKS-STARGGRVTAMA
-Q93Z60_ARATH/1-118 MAST----ALSSAIVSTSFLRRQQTPISLRSLPFANTQ--SLFGLKS-STARGGRVTAMA
-FER1_MAIZE/1-150   MATVLGSPRAPAFFFSSSSLRAAPAPTAV--ALPAAKV--GIMGRSA-SSRR--RLRAQA
-O80429_MAIZE/1-140 MAAT---------ALSMSILR---APPPCFSSPLRLRV--AVAKPLA-APMRRQLLRAQA
-1A70|/1-97         -----------------------------------------------------------A
-
-FER_CAPAA/1-97     SYKVKLITPDGPIEFDCPDDVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDG
-FER_CAPAN/1-144    SYKVKLITPDGPIEFDCPDNVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDG
-FER1_SOLLC/1-144   SYKVKLITPEGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGSVDQSDG
-Q93XJ9_SOLTU/1-144 SYKVKLITPDGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGTVDQSDG
-FER1_PEA/1-149     SYKVKLVTPDGTQEFECPSDVYILDHAEEVGIDLPYSCRAGSCSSCAGKVVGGEVDQSDG
-Q7XA98_TRIPR/1-152 TYKVKLITPEGPQEFDCPDDVYILDHAEEVGIELPYSCRAGSCSSCAGKVVNGNVNQEDG
-FER1_MESCR/1-148   AYKVTLVTPEGKQELECPDDVYILDAAEEAGIDLPYSCRAGSCSSCAGKVTSGSVNQDDG
-FER1_SPIOL/1-147   AYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQ
-FER3_RAPSA/1-96    TYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQ
-FER1_ARATH/1-148   TYKVKFITPEGELEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQ
-FER_BRANA/1-96     TYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGFVDQSDE
-FER2_ARATH/1-148   TYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQ
-Q93Z60_ARATH/1-118 TYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQ
-FER1_MAIZE/1-150   TYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQ
-O80429_MAIZE/1-140 TYNVKLITPEGEVELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQ
-1A70|/1-97         AYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQ
-
-FER_CAPAA/1-97     NFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-
-FER_CAPAN/1-144    NFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-
-FER1_SOLLC/1-144   NFLDEDQEAAGFVLTCVAYPKGDVTIETHKEEELTA-
-Q93XJ9_SOLTU/1-144 KFLDDDQEAAGFVLTCVAYPKCDVTIETHKEEELTA-
-FER1_PEA/1-149     SFLDDEQIEAGFVLTCVAYPTSDVVIETHKEEDLTA-
-Q7XA98_TRIPR/1-152 SFLDDEQIEGGWVLTCVAFPTSDVTIETHKEEELTA-
-FER1_MESCR/1-148   SFLDDDQIKEGWVLTCVAYPTGDVTIETHKEEELTA-
-FER1_SPIOL/1-147   SFLDDDQIDEGWVLTCAAYPVSDVTIETHKEEELTA-
-FER3_RAPSA/1-96    SFLDDDQIAEGFVLTCAAYPTSDVTIETHREEDMV--
-FER1_ARATH/1-148   SFLDDEQIGEGFVLTCAAYPTSDVTIETHKEEDIV--
-FER_BRANA/1-96     SFLDDDQIAEGFVLTCAAYPTSDVTIETHKEEELV--
-FER2_ARATH/1-148   SFLDDEQMSEGYVLTCVAYPTSDVVIETHKEEAIM--
-Q93Z60_ARATH/1-118 SFLDD--------------------------------
-FER1_MAIZE/1-150   SYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA
-O80429_MAIZE/1-140 SFLNDNQVADGWVLTCAAYPTSDVVIETHKEDDLL--
-1A70|/1-97         SFLDDDQIDEGWVLTCAAYPVSDVTIETHKKEELTA
-
+FER_CAPAA/1-97     -----------------------------------------------------------A 1
+FER_CAPAN/1-144    MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA 48
+FER1_SOLLC/1-144   MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA 48
+Q93XJ9_SOLTU/1-144 MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA 48
+FER1_PEA/1-149     MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA 53
+
+FER_CAPAA/1-97     SYKVKLI 8
+FER_CAPAN/1-144    SYKVKLI 55
+FER1_SOLLC/1-144   SYKVKLI 55
+Q93XJ9_SOLTU/1-144 SYKVKLI 55
+FER1_PEA/1-149     SYKVKLV 60
index f129193..78f86b6 100755 (executable)
@@ -22,7 +22,7 @@
    <mapID target="home" url="html/index.html" />
    
    <mapID target="new" url="html/whatsNew.html"/>
-   <mapID target="release" url="html/releases.html#Jalview.2.10.4"/>
+   <mapID target="release" url="html/releases.html#Jalview.$$Version-Rel$$"/>
    <mapID target="alannotation" url="html/features/annotation.html"/>
    <mapID target="keys" url="html/keys.html"/>
    <mapID target="newkeys" url="html/features/newkeystrokes.html"/>
@@ -54,6 +54,7 @@
    <mapID target="pdbmcviewer" url="html/features/pdbviewer.html"/>
    <mapID target="pdbjmol" url="html/features/jmol.html"/>
    <mapID target="chimera" url="html/features/chimera.html"/>
+   <mapID target="chimera.annotxfer" url="html/features/chimera.html#annotxfer"/>
    <mapID target="varna" url="html/features/varna.html"/>
    <mapID target="xsspannotation" url="html/features/xsspannotation.html"/>
    <mapID target="preferences" url="html/features/preferences.html"/>     
@@ -69,8 +70,6 @@
    <mapID target="annotations.fileformat" url="html/features/annotationsFormat.html"/>
    <mapID target="features.fileformat" url="html/features/featuresFormat.html"/>
    <mapID target="features.featureschemes" url="html/features/featureschemes.html"/>
-   <mapID target="das.settings" url="html/features/dassettings.html"/>
-   <mapID target="das.viewing" url="html/features/dasfeatures.html"/>
    <mapID target="edit" url="html/editing/index.html"/>
    <mapID target="jalarchive" url="html/features/jalarchive.html"/>
    <mapID target="multipleviews" url="html/features/multipleViews.html"/>
index 20dd8db..77ddd88 100755 (executable)
@@ -24,6 +24,8 @@
        <tocitem text="Jalview Documentation" target="home" expand="true">
                        <tocitem text="What's new" target="new" expand="true">
                                <tocitem text="Latest Release Notes" target="release"/>
+                               <tocitem text="Structure Chooser" target="pdbchooser"/>
+                               <tocitem text="Chimera Annotation Exchange" target="chimera.annotxfer"/>
                </tocitem>
                
                <tocitem text="Editing Alignments" target="edit" />
@@ -58,8 +60,6 @@
                        <tocitem text="Feature Colourschemes" target="features.featureschemes" />
                        <tocitem text="User Defined Sequence Features" target="seqfeatcreat" />
                        <tocitem text="Editing Sequence Features" target="seqfeatedit" />
-                       <tocitem text="DAS Feature Retrieval" target="das.viewing" />
-                       <tocitem text="DAS Feature Settings" target="das.settings" />
                        <tocitem text="HTML annotation report" target="io.seqreport" />
                </tocitem>
                
@@ -76,8 +76,7 @@
                        <tocitem text="Alignment Conservation Analysis" target="aacon" />
                        <tocitem text="Multi-Harmony Alignment Analysis" target="shmrws" />
                        <tocitem text="Sequence Retrieval" target="seqfetch" />
-                       <tocitem text="Database Reference Retrieval" target="dbreffetcher" />
-                       <tocitem text="DAS Feature Retrieval" target="das.viewing" />
+                       <tocitem text="Database Reference Retrieval" target="dbreffetcher" />                   
                </tocitem>
                
                <tocitem text="Colour Schemes" target="colours" expand="false">
index fd8c5a3..b3600c9 100755 (executable)
@@ -61,7 +61,7 @@
     <em>Undo / redo</em> - editing of sequences (insertion/removal of
     gaps, removal of sequences, trimming sequences etc) may be undone or
     redone at any time using the appropriate menu items from the edit
-    menu. The undo history list only allows a maximum of 10 actions.
+    menu.
   <p>
     <em>Trimming alignment</em> - First select a column by clicking the
     scale indicator (above the sequences) The alignment may then be
index 68ac465..e1227de 100644 (file)
             structure in the alignment. The regions used to calculate
             the superposition will be highlighted using the 'Cartoon'
             rendering style, and the remaining data shown as a chain
-            trace.<br/><br/>
+            trace.<br />
+          <br />
         </em></li>
-        <li><strong><a name="experimental">EXPERIMENTAL FEATURES</a></strong><br/>
-          <em>
-            These are only available if the <strong>Tools&#8594;Enable
-            Experimental Features</strong> option is enabled. (Since Jalview 2.10.2)</em>
-          <ul>
-            <li><strong>Write Jalview features</strong><br /> <em>Selecting
-                this option will create new residue attributes for any
-                features currently visible in the associated alignment
-                views, allowing those positions to be selected and
-                analysed with via Chimera's 'Render by Attribute' tool
-                (found in the Tools submenu called Structure Analysis).<br />
-                <br />If you use this option, please remember to select
-                the <em>Refresh Menus</em> option in Chimera's Render by
-                Attribute dialog box in order to see the attributes
-                derived from Jalview sequence features.
-            </em><br />
-            <a href="https://issues.jalview.org/browse/JAL-2295">View
-                this function's issue in Jalview's bug tracker</a></li>
-            <li><strong>Fetch Chimera Attributes</strong><br /> <em>This
-                submenu lists available Chimera residue attributes that
-                can be imported as Jalview features on associated
-                sequences.<br />This is particularly useful for
-                transferring quantitative positional annotation. For
-                example, structure similarity for an alignment can be
-                visualised by transferring the local RMSD attributes
-                generated by Chimera's Match->Align tool onto aligned
-                sequences and displayed with a <a
-                href="featureschemes.html">Graduated feature colour
-                  scheme</a>.
-            </em><a href="https://issues.jalview.org/browse/JAL-2296">View
-                this function's issue in Jalview's bug tracker</a></li>
-          </ul></li>
-        <li><strong>Help<br>
+        <li><a name="annotxfer"><strong>Write Jalview
+              features</strong></a><br /> <em>Selecting this option will create
+            new residue attributes for any features currently visible in
+            the associated alignment views, allowing those positions to
+            be selected and analysed with via Chimera's 'Render by
+            Attribute' tool (found in the Tools submenu called Structure
+            Analysis).<br /> <br />If you use this option, please
+            remember to select the <em>Refresh Menus</em> option in
+            Chimera's Render by Attribute dialog box in order to see the
+            attributes derived from Jalview sequence features.
+        </em></li>
+        <li><strong>Fetch Chimera Attributes</strong><br /> <em>This
+            submenu lists available Chimera residue attributes that can
+            be imported as Jalview features on associated sequences.<br />This
+            is particularly useful for transferring quantitative
+            positional annotation. For example, structure similarity for
+            an alignment can be visualised by transferring the local
+            RMSD attributes generated by Chimera's Match->Align tool
+            onto aligned sequences and displayed with a <a
+            href="featureschemes.html">Graduated feature colour
+              scheme</a>. </li>
+      </ul></li>
+    <li><strong>Help<br>
     </strong>
       <ul>
         <li><strong>Chimera Help<br>
index e065494..fa273a5 100644 (file)
     </tr>
     <tr>
       <td>
-        <div align="center">-dasserver nickname=URL</div>
-      <td>
-        <div align="left">
-          Add and enable a <a href="dassettings.html">DAS server</a>
-          with given nickname (alphanumeric or underscores only) for
-          retrieval of features for all alignments<br> Sources that
-          also support the sequence command may be specified by
-          prepending the URL with 'sequence:'<br> <em>e.g.</em>
-          sequence:http://localdas.somewhere.org/das/source
-        </div>
-      </td>
-    </tr>
-    <tr>
-      <td>
-        <div align="center">-fetchfrom nickname</div>
-      <td>
-        <div align="left">
-          Query a <a href="dassettings.html">DAS source</a> called
-          nickname for features for the alignments and display them
-        </div>
-      </td>
-    </tr>
-    <tr>
-      <td>
         <div align="center">-groovy FILE/URL</div>
       <td>
         <div align="left">Execute groovy script in FILE (where
index 9cffc51..92d9323 100644 (file)
     provided by InstallAnywhere any output from the application will be
     sent to output.txt, not standard out.<br> The Jalview
     application also requires a number of additional libraries on the
-    class path. The command line below adds the Jalview installation's
-    'lib' directory to the list of directories that are searched for
-    jars to be added to the classpath:
+    class path. The command line below adds all the jar files in the
+    Jalview installation's 'lib' directory to the classpath, as well as
+    the Jalview application jar file:
   </p>
-  <pre>java -Djava.ext.dirs=$INSTALL_DIR$/lib -cp $INSTALL_DIR$/jalview.jar jalview.bin.Jalview -open [FILE] </pre>
+  <pre>java -classpath "$INSTALL_DIR$/lib/*:$INSTALL_DIR$/jalview.jar" jalview.bin.Jalview -open [FILE] </pre>
   <p>
     Use '-help' to get more information on the <a
       href="clarguments.html">command line arguments</a> that
diff --git a/help/html/features/dasfeatures.html b/help/html/features/dasfeatures.html
deleted file mode 100644 (file)
index 1965e70..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<html>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- -->
-<head>
-<title>DAS Features</title>
-</head>
-
-<body>
-  <p>
-    <strong>DAS Sequence Feature Retrieval</strong>
-  </p>
-  <p>Jalview includes a client for retrieving sequences and their
-    features via the Distributed Annotation System.</p>
-  <ol>
-    <li>Open the Feature Settings panel by selecting &quot;View
-      -&gt; Feature Settings...&quot;</li>
-    <li>Click on the &quot;<a href="dassettings.html">DAS
-        Settings</a>&quot; tabbed pane.
-    </li>
-    <li>Select the sources to use for DAS feature retrieval, then
-      click the &quot;Fetch DAS Features&quot; button.
-      <ul>
-        <li>Cancelling Feature Retrieval<br> Press the <strong>Cancel
-            Fetch</strong> button to immediately stop feature retrieval. This
-          will not remove any features already added to the alignment,
-          but will halt any outstanding DAS requests.<em>The cancel
-            fetch button is of particular use when one or more DAS
-            annotation servers are not responding!</em>
-      </ul>
-    </li>
-  </ol>
-  <p>
-    If your DAS source selection contains sources which use UniProt
-    accession ids, you will be asked whether Jalview should find UniProt
-    Accession ids for the given sequence names. It is important to
-    realise that many DAS sources only use UniProt accession ids, rather
-    than Swissprot/UniProt sequence names.<br> The <a
-      href="../webServices/dbreffetcher.html">database
-      reference fetcher</a> documentation describes how Jalview discovers
-    what database references are appropriate for the sequences in the
-    alignment.
-  <ul>
-    <li><em>Note</em><br> Please remember to save your
-      alignment if either the start/end numbering, or the sequence IDs
-      were updated during the ID retrieval process.</li>
-  </ul>
-  <p>&nbsp;
-  <p>
-    <em>DAS support was introduced in Jalview Version 2.1.</em>
-  </p>
-  <br />
-  <p>
-    <em>The DAS registry at http://www.dasregistry.org was
-      decommissioned early in 2015. An unmaintained mirror is currently
-      hosted at http://www.ebi.ac.uk/das-srv/registry/.</em>
-  </p>
-  <p>&nbsp;
-</body>
-</html>
diff --git a/help/html/features/dassettings.html b/help/html/features/dassettings.html
deleted file mode 100644 (file)
index 9600070..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<html>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- -->
-<head>
-<title>DAS Settings</title>
-</head>
-
-<body>
-  <p>
-    <strong>DAS Settings</strong>
-  </p>
-  <p>
-    Jalview can retrieve sequences and features from many <a
-      href="http://biodas.org/">DAS</a> sources. The DAS sources
-    that it uses are discovered and selected <em>via</em> the DAS
-    settings panel, opened either from the <a
-      href="featuresettings.html">View&#8594;Feature Settings</a> dialog
-    box from the alignment window's menu bar, or the <a
-      href="featuresettings.html">Tools&#8594;Preferences</a>
-    dialog box opened from the Desktop menu bar.
-  </p>
-  <p>
-    <img src="das.gif">
-  <p>The available sources are listed in the table using each
-    source's Nickname as its identifier. Clicking on a source's entry in
-    the table reveals more information about that service in the panel
-    to the right. Select the tickbox in the &quot;Use Source&quot;
-    column for a source to add it to the set Jalview queries for
-    alignment and sequence features.</p>
-  <p>You can filter the visible DAS sources by authority, type and
-    &quot;label&quot;. You should read the DAS documentation to
-    understand more about these values.
-  <p>
-    <strong>Updating the list of sources</strong>
-  </p>
-  <p>
-    When the DAS Settings panel is first opened, and when the <strong>'Refresh
-      source'</strong> buton is pressed, a list of DAS sources is retrieved from
-    the DAS registry URL. Note that the registry hosted at
-    http://www.dasregistry.org/das/ was retired at the start of 2015. An
-    alternative service is currently hosted at
-    http://www.ebi.ac.uk/das-srv/registry/das/. To connect to this
-    service, ensure your .jalview_properties file includes the following
-    line:<br> <b>DAS_REGISTRY_URL=http\://www.ebi.ac.uk/das-srv/registry/das/</b>
-  </p>
-  <p>
-    <strong>Adding your own DAS Sources</strong>
-  </p>
-  <p>You can add your own DAS source to the list by clicking the
-    &quot;Add Local Source&quot; button. Enter the URL and nickname of
-    your additional service. It should be noted that Jalview 2.1 will
-    not query additional sources for more information, but this will be
-    implemented in future editions.
-  <p>&nbsp;
-</body>
-</html>
index 0cd6168..ac2489b 100644 (file)
 </p> -->
   <p>
     <a name="align"><strong>Superposing structures based on
-        their aligned sequences</strong></a><br> If several structures are
-    available on the alignment, you may add additional structures to an
-    existing Jmol view by selecting their entry in the appropriate
-    pop-up menu. Jalview will ask you if you wish to add the structure
-    to the existing alignment, and if you do, it will import and
-    superimpose the new PDB file using the corresponding positions from
-    the alignment. If the alignment is subsequently edited, you can use
-    the <a href="#sAlign"><em>Jmol&#8594;Align</em></a> menu option from
-    the menu bar of the structure view window to superpose the
-    structures using the updated alignment.<br> <em>Sequence
+        their aligned sequences</strong></a><br> If several structures are shown
+    in a view, you can superimpose them using the corresponding
+    positions from the alignment via the <a href="#sAlign"><em>Jmol&#8594;Align</em></a>
+    menu option from the menu bar of the structure view window. <br> <em>Sequence
       based structure superposition was added in Jalview 2.6</em>
   </p>
   <p>
index b29b66b..52e88db 100755 (executable)
         Preferences</a> tab contains settings affecting the export of
       sequence alignments and EPS files.
     </li>
-    <li>The <a href="dassettings.html"><strong>&quot;DAS
-          Settings&quot;</strong> Preferences</a> tab allows you to select which DAS
-      sources to use when fetching DAS Features.
-    </li>
     <li>The <a href="../webServices/webServicesPrefs.html"><strong>&quot;Web
           Service&quot;</strong> Preferences</a> tab allows you to configure the <a
       href="http://www.compbio.dundee.ac.uk/jabaws">JABAWS</a>
     and PDB file association (if available). The Jalview id/start-end
     option is ignored if Modeller output is selected.
   <p>
-    <a name="editing"><strong>e&quot;Editinge&quot; Preferences tab</strong></a>
+    <a name="editing"><strong>&quot;Editing&quot; Preferences tab</strong></a>
   </p>
   <p>There are currently three options available which can be
     selected / deselected.</p>
index f551c50..4af0d53 100644 (file)
Binary files a/help/html/features/schooser_enter-id.png and b/help/html/features/schooser_enter-id.png differ
index ab69427..ca793fd 100644 (file)
Binary files a/help/html/features/schooser_main.png and b/help/html/features/schooser_main.png differ
index 72e5bdf..eec68ee 100755 (executable)
@@ -159,7 +159,7 @@ td {
   <p>The search history keeps up to 99 queries by default. To clear
     the history, or modify the size of the history, right-click the text
     box.</p>
-  <img src="searchclearhist.png" width="402" height="121" align="left" />
+  <img src="searchclearhist.png" width="402" height="127" align="left" />
   <p>
     <strong>Other dialogs that provide a query history</strong>
   </p>
index 200c4d3..29cc34f 100644 (file)
Binary files a/help/html/features/searchclearhist.png and b/help/html/features/searchclearhist.png differ
index 3c9d2b8..eeb63f6 100755 (executable)
       href="featuresettings.html">Sequence Feature Settings</a>
     dialog box. Feature colour schemes and display parameters are unique
     to a particular alignment, so it is possible to colour the same
-    sequence features differently in different alignment views.<br>
-    Since Jalview 2.1, it is possible to add <a href="dassettings.html">DAS
-      features</a> to an alignment via the DAS tabbed pane of the feature
-    settings window.
+    sequence features differently in different alignment views.
   </p>
   <p>
     <strong>View&#8594;Sequence ID Tooltip&#8594;Show
index 44aa1c2..e726c49 100755 (executable)
   <p>
     <strong>Sequence Fetcher</strong>
   </p>
-  <p>
-    Jalview can retrieve sequences from certain databases using either
-    the DBFetch service provided by the EMBL European Bioinformatics
-    Institute, or, since Jalview 2.4, DAS servers capable of the <em>sequence</em>
-    command (configured in <a href="dassettings.html">DAS settings</a>).
-  </p>
-  <p>The Sequence Fetcher can be opened via the &quot;File&quot;
+       <p>Jalview can retrieve sequences from a range of sequence, 3D
+               structure, genomic and domain family databases provided by EMBL-EBI.</p>
+       <p>The Sequence Fetcher can be opened via the &quot;File&quot;
     menu on the main desktop in order to retrieve sequences as a new
     alignment, or opened via the &quot;File&quot; menu of an existing
     alignment to import additional sequences. There may be a short delay
-    when the sequence fetcher is first opened, whilst Jalview compiles
-    the list of available sequence datasources from the currently
-    defined DAS server registry.</p>
+    when the sequence fetcher is first opened, whilst Jalview contacts each database's web API.</p>
   <p>
     Every time a new fetcher is opened, you will need to <strong>select
       the database you want to retrieve sequences</strong> from the database
     tooltips are shown if you mouse over some sources, explaining what
     the database will retrieve. You can select one by using the up/down
     arrow keys and hitting return, or by double clicking with the mouse.
-    <br />
-    <em>If you have DAS sources enabled, then you may have several
-      sources for the same type of sequence identifier, and these will
-      be grouped together in a sub-branch branch labeled with the
-      identifier.</em>
   </p>
   <p>Once you have selected a sequence database, its fetcher dialog
     will open. Jalview provides two types of dialog:</p>
       currently selected database into the retrieval box. Finally, press
       &quot;OK&quot; to initiate the retrieval.</li>
   </ol>
-  <p>
-    <strong>Only retrieving part of a sequence</strong>
-  </p>
-  <p>
-    When using DAS sources (indicated by a &quot;<em>(DAS)</em>&quot;),
-    you can append a range in addition to a sequence ID. For example, to
-    retrieve 50 residues starting at position 35 in UNIPROT sequence
-    P73137 using the UNIPROT DAS server, you would enter
-    &quot;'P73137:35,84'.<br /> <em>Full support for DAS range
-      queries was introduced in Jalview 2.8</em>
-  </p>
 
   <p>If you use the WSDBFetch sequence fetcher services (EMBL,
     UniProt, PFAM, and RFAM) in work for publication, please cite:</p>
index fc71826..785c429 100644 (file)
 
 <body>
   <p>
-    <strong>Structure Chooser</strong>
+    <strong>Structure Chooser Dialog Box</strong>
   </p>
 
   <p>
-    The Structure Chooser interface allows you to interactively select
-    which PDB structures to view for the currently selected set of
+    The Structure Chooser allows you to select
+    3D structures to view for the currently selected set of
     sequences. It is opened by selecting the <strong>"3D
-      Structure Data.."</strong> option from the Sequence ID panel's <a
+      Structure Data..."</strong> option from the Sequence ID panel's <a
       href="../menus/popupMenu.html">pop-up menu</a>. The dialog
     provides:
   </p>
   <p>
     <strong>Selecting and Viewing Structures</strong>
   </p>
+  <p>The drop-down menu offers different options for structure
+    discovery; the 'Cached' view is shown automatically if existing
+    structure data has been imported for the selected sequences, and if
+    none is available, the import PDB/mmCIF file options are shown.</p>
   <p>
     Once one or more structures have been selected, pressing the <strong>View</strong>
-    button will import them into <a
+    or <strong>Add</strong> button will import them <a
       href="viewingpdbs.html#afterviewbutton">a new or existing
-      structure view</a>.
+      structure view</a>. When multiple views are available, use the
+    drop-down menu to pick the target viewer for the structures.
   </p>
   <p>
     <strong>Automated discovery of structure data</strong>
     criteria (e.g. worst quality rather than best).</p>
   <p>
 
-    <img src="schooser_main.png" style="width: 464px; height: 369px;">
+    <img src="schooser_main.png" style="width: 499px; height: 437px;">
     <!-- <p><img src="schooser_config.png" style="width: 463px; height: 369px; ">
        <p><img src="schooser_drop-down.png" style="width: 464px; height: 368px; ">
        <p><img src="schooser_enter-id.png" style="width: 467px; height: 373px; ">
        <p><img src="schooser_from-file.png" style="width: 468px; height: 370px; ">
        <p><img src="schooser_cached.png"> -->
-    <br>The screenshot above shows the Structure Chooser interface
-    along with the meta-data of auto-discovered structures for the
-    sample alignment. If no structures were
-    auto-discovered, options for manually associating PDB records will be shown (see below).
-  <p>
+    <br>The screenshot above shows the Structure Chooser displayed after
+    selecting all the sequences in the Jalview example project. If no
+    structures were auto-discovered, options for manually associating
+    PDB records will be shown (see below).<p>
     <strong>Exploration of meta-data for available structures</strong>
   </p>
   <p>Information on each structure available is displayed in columns
     Columns' tab and tick the columns which you want to see.</p>
   <p>
     <img src="schooser_enter-id.png"
-      style="width: 464px; height: 369px;">
+      style="width: 464px; height: 173px;">
       <br/>
     <strong>Manual selection/association of PDB files with
       Sequences</strong>
index 45d979f..b1ad4ba 100755 (executable)
@@ -82,6 +82,7 @@
     provided it is installed and can be launched by Jalview. The default
     viewer can be configured in the <a href="preferences.html#structure">Structure
       tab</a> in the <strong>Tools&rarr;Preferences</strong> dialog box.
+  
   <p>
     Structure data imported into Jalview can also be processed to
     display secondary structure and temperature factor annotation. See
     for more information.
   </p>
   <p>
-    <strong><a name="afterviewbutton">After pressing the
-        'View' button in the Structure Chooser</a></strong><br /> The behaviour of
-    the 'View' button depends on the number of structures selected, and
-    whether structure views already exist for the selected structures or
-    aligned sequences.
+    <img src="schooser_viewbutton.png"
+      style="width: 465px; height: 81px" /><br/> <strong><a
+      name="afterviewbutton">Controlling where the new structures
+        will be shown</a></strong>
+        <br />The Structure Chooser offers several options
+    for viewing a structure. <br/><strong>New View</strong> will open a new
+    structure viewer for the selected structures, but if there are views
+    already open, you can select which one to use, and press the <strong>Add</strong>
+    button. Jalview can automatically superimpose new structures based
+    on the linked alignments - but if this is not desirable, simple
+    un-tick the <strong>Superpose Structures</strong> checkbox.
+
   </p>
-  <p>If multiple structures are selected, then Jalview will always
-    create a new structure view. The selected structures will be
-    imported into this view, and superposed with the matched positions
-    from the aligned sequences. A message in the structure viewer's
-    status bar will be shown if not enough aligned columns were
-    available to perform a superposition.</p>
   <p>
-    If a <strong>single</strong> PDB structure is selected, one of the
-    following will happen:
+    <em>Superposing structures</em><br/>Jalview superposes structures using
+    the visible portions of any associated sequence alignments. A
+    message in the structure viewer's status bar will be shown if not
+    enough aligned columns were available to perform a superposition.
   </p>
-
-  <ul>
-    <li>If no structures are open, then an interactive display of
-      the structure will be opened in a new window.</li>
-
-    <li>If another structure is already shown for the current
-      alignment, then you will be asked if you want to add and <a
-      href="jmol.html#align"></a> to the structure in the existing view.
-      (<em>new feature in Jalview 2.6</em>).
-    </li>
-
-    <li>If the structure is already shown, then you will be
-      prompted to associate the sequence with an existing view of the
-      selected structure. This is useful when working with multi-domain
-      or multi-chain PDB files.</li>
-
-    <li style="list-style: none">See the <a href="jmol.html">Jmol
-    </a> and <a href="chimera.html">Chimera</a> PDB viewer help pages for
-      more information about the display.
-    </li>
-  </ul>
-
+  <p>
+  See the <a href="jmol.html">Jmol
+    </a> and <a href="chimera.html">Chimera</a> help pages for
+      more information about their capabilities.</p>
+  
 
   <p>
     <strong>Retrieving sequences from the PDB</strong><br>You can
index 2142f98..9437a60 100755 (executable)
@@ -115,7 +115,7 @@ lax.nl.java.option.java.heap.size.initial=500m
 ! &lt;string&gt;-Xms2M&lt;/string&gt;
 ! &lt;string&gt;-Xmx64M&lt;/string&gt;
 &lt;/array&gt;
-</pre> Exchange the above two string tags for : <pre>
+</pre>Exchange the above two string tags for : <pre>
 &lt;string&gt;-Xms500M&lt;/string&gt;
 &lt;string&gt;-Xmx1000M&lt;/string&gt;
 </pre>
@@ -125,6 +125,11 @@ lax.nl.java.option.java.heap.size.initial=500m
       the file and try to start Jalview in the normal way. If it doesn't
       start, see below...</li>
   </ul>
+  <p>
+    <em>Please Note:</em> We do modify the default memory settings in
+    Jalview from time to time, so you may find different numbers to
+    those shown in the examples above.
+  </p>
   <font size="3"><em>Jalview doesn't start... What do the
       memory settings mean ?<a name="memsetting"></a>
   </em></font>
@@ -140,6 +145,12 @@ lax.nl.java.option.java.heap.size.initial=500m
     enlighten us if you know better!). Our experiments found 1000m to be
     the biggest setting that could be used on a 1GB machine. Just try
     reducing the sizes until Jalview starts up properly!</p>
+  <p>
+    We increased the default memory in Jalview 2.10.5 to 1G. To launch
+    Jalview with the pre 2.10.5 default memory allocation, use the <a
+      href="http://www.jalview.org/webstart/jalview_256MB.jnlp">Jalview
+      256MB JNLP</a>.
+  </p>
   <p>&nbsp;</p>
 </body>
 </html>
index 00a2ec4..f3ab75d 100755 (executable)
             href="../features/featuresettings.html">Sequence
               Feature Settings...</a> </strong><br> <em>Opens the
               Sequence Feature Settings dialog box to control the colour
-              and display of sequence features on the alignment, and
-              configure and retrieve features from DAS annotation
-              servers.</em></li>
+              and display of sequence features on the alignment.</em></li>
         <li><strong>Sequence ID Tooltip</strong><em>
             (application only) <br>This submenu's options allow the
             inclusion or exclusion of non-positional sequence features
       is dynamic, and may contain user-defined web service entries in
       addition to any of the following ones:</em>
     <ul>
-      <li><strong>Fetch DB References</strong><br> <em>This
-          submenu contains options for accessing any of the database
-          services that Jalview is aware of (e.g. DAS sequence servers
-          and the WSDBFetch service provided by the EBI) to verify
-          sequence start/end positions and retrieve all database cross
-          references and PDB ids associated with all or just the
-          selected sequences in the alignment.
-          <ul>
-            <li>'Trim Retrieved Sequences' - when checked, Jalview
-              will discard any additional sequence data for accessions
-              associated with sequences in the alignment. <br> <strong>Note:
-                Disabling this could cause out of memory errors when
-                working with genomic sequence records !</strong><br> <strong>Added
-                in Jalview 2.8.1</strong>
-            </li>
-            <li>'Standard Databases' will check sequences against
-              the EBI databases plus any active DAS sequence sources</li>
-          </ul> Other sub-menus allow you to pick a specific source to query
-          - sources are listed alphabetically according to their
-          nickname.
-      </em><br></li>
-    </ul>
+                               <li><strong>Fetch DB References</strong><br> <em>This
+                                               submenu contains options for accessing any of the database
+                                               services that Jalview is aware of (e.g. those provided by
+                                               EMBL-EBI) to verify sequence start/end positions and retrieve all
+                                               database cross references and PDB ids associated with all or just
+                                               the selected sequences in the alignment.
+                                               <ul>
+                                                       <li>'Trim Retrieved Sequences' - when checked, Jalview will
+                                                               discard any additional sequence data for accessions associated
+                                                               with sequences in the alignment. <br> <strong>Note:
+                                                                       Disabling this could cause out of memory errors when working
+                                                                       with genomic sequence records !</strong><br> <strong>Added
+                                                                       in Jalview 2.8.1</strong>
+                                                       </li>
+                                                       <li>'Standard Databases' will check sequences against the
+                                                               EBI databases.</li>
+                                               </ul> Other sub-menus allow you to pick a specific source to query -
+                                               sources are listed alphabetically according to their nickname.
+                               </em><br></li>
+                       </ul>
     <p>Selecting items from the following submenus will start a
       remote service on compute facilities at the University of Dundee,
       or elsewhere. You need a continuous network connection in order to
index 2028304..33ec77f 100755 (executable)
@@ -53,8 +53,7 @@
     <li><strong><a href="../features/featuresettings.html">Sequence
           Feature Settings...</a></strong><em><br> Opens the Sequence
         Feature Settings dialog box to control the colour and display of
-        sequence features on the alignment, and configure and retrieve
-        features from DAS annotation servers.</em></li>
+        sequence features on the alignment.</em></li>
     <li><strong>Sequence ID Tooltip</strong><em> (application
         only) <br>This submenu's options allow the inclusion or
         exclusion of non-positional sequence features or database cross
index a93ce4b..d716e33 100755 (executable)
@@ -86,7 +86,7 @@
             the <a href="../features/groovy.html">Groovy Console</a> for
             interactive scripting.
         </em><strong><br></strong></li>
-        <li><strong>Enable Experimental Features</strong> <em>Enable or disable <a href="../whatsNew.html#experimental">features still under development</a> in Jalview's user interface. This setting is remembered in your preferences.</em>
+        <!--         <li><strong>Enable Experimental Features</strong> <em>Enable or disable <a href="../whatsNew.html#experimental">features still under development</a> in Jalview's user interface. This setting is remembered in your preferences.</em> -->
 
       </ul></li>
     <li><strong>Vamsas</strong> <em>For more details, read the
index b71bc1a..b8b357e 100755 (executable)
       dynamic, and may contain user-defined web service entries in
       addition to any of the following ones:</em>
   <ul>
-    <li><strong>Fetch DB References</strong><br> <em>This
-        submenu contains options for accessing any of the database
-        services that Jalview is aware of (e.g. DAS sequence servers and
-        the WSDBFetch service provided by the EBI) to verify sequence
-        start/end positions and retrieve all database cross references
-        and PDB ids associated with all or just the selected sequences
-        in the alignment.
-        <ul>
+    <li><strong>Fetch DB References</strong><br> <em>This submenu
+                               contains options for accessing any of the database services that
+                               Jalview is aware of (e.g services provided by the EBI) to verify
+                               sequence start/end positions and retrieve all database cross
+                               references and PDB ids associated with all or just the selected
+                               sequences in the alignment.
+                               <ul>
           <li>'Retrieve full Sequence' - when checked, Jalview will
             retrieve the full sequence for any accessions associated
             with sequences in the alignment. <br> <strong>Note:
@@ -45,7 +44,7 @@
               in Jalview 2.8.1</strong>
           </li>
           <li>'Standard Databases' will check sequences against the
-            EBI databases plus any active DAS sequence sources<</li>
+            EBI databases</li>
         </ul> Other submenus allow you to pick a specific source to query -
         sources are listed alphabetically according to their nickname.
     </em></li>
index 006ee5c..3eaf234 100755 (executable)
@@ -67,43 +67,359 @@ li:before {
         </div>
       </td>
     </tr>
+    
+      <td width="60" nowrap>
+        <div align="center">
+          <strong><a name="Jalview.2.11.0">2.11.0</a><br />
+            <em>8/09/2018</em></strong>
+        </div>
+      </td>
+      <td><div align="left">
+          <em></em>
+          <ul>
+            <li>
+              <!--  -->
+            </li>
+          </ul>
+        </div></td>
+      <td><div align="left">
+          <em></em>
+          <ul>
+            <li>
+              <!-- JAL-3035 -->DAS sequence retrieval and annotation capabilities removed from the Jalview Desktop
+            </li>
+          </ul>
+        </div></td>
+    </tr>
+    <tr>
+    <td width="60" nowrap>
+      <div align="center">
+        <strong><a name="Jalview.2.10.5">2.10.5</a><br /> <em>10/09/2018</em></strong>
+      </div>
+    </td>
+    <td><div align="left">
+        <em></em>
+        <ul>
+            <li>
+              <!-- JAL-3101 -->Default memory for Jalview webstart and
+              InstallAnywhere increased to 1G.
+            </li>
+            <li>
+              <!-- JAL-247 -->Hidden sequence markers and representative
+              sequence bolding included when exporting alignment as EPS,
+              SVG, PNG or HTML. <em>Display is configured via the
+                Format menu, or for command-line use via a jalview
+                properties file.</em>
+            </li>
+            <li>
+              <!-- JAL-3076 -->Ensembl client updated to Version 7 REST
+              API and sequence data now imported as JSON.
+            </li>
+            <li>
+              <!-- JAL-3065 -->Change in recommended way of starting
+              Jalview via a Java command line: add jars in lib directory
+              to CLASSPATH, rather than via the deprecated java.ext.dirs
+              property.
+            </li>
+          </ul>
+          <em>Development</em>
+          <ul>
+            <li>
+              <!-- JAL-3047 -->Support added to execute test suite
+              instrumented with <a href="http://openclover.org/">Open
+                Clover</a>
+            </li>
+          </ul>
+        </div></td>
+    <td><div align="left">
+        <em></em>
+        <ul>
+            <li>
+              <!-- JAL-3104 -->Poorly scaled bar in quality annotation
+              row shown in Feredoxin Structure alignment view of example
+              alignment.
+            </li>
+            <li>
+              <!-- JAL-2854 -->Annotation obscures sequences if lots of
+              annotation displayed.
+            </li>
+            <li>
+              <!-- JAL-3107 -->Group conservation/consensus not shown
+              for newly created group when 'Apply to all groups'
+              selected
+            </li>
+            <li>
+              <!-- JAL-3087 -->Corrupted display when switching to
+              wrapped mode when sequence panel's vertical scrollbar is
+              visible.
+            </li>
+            <li>
+              <!-- JAL-3003 -->Alignment is black in exported EPS file
+              when sequences are selected in exported view.</em>
+            </li>
+            <li>
+              <!-- JAL-3059 -->Groups with different coloured borders
+              aren't rendered with correct colour.
+            </li>
+            <li>
+              <!-- JAL-3092 -->Jalview could hang when importing certain
+              types of knotted RNA secondary structure.
+            </li>
+            <li>
+              <!-- JAL-3095 -->Sequence highlight and selection in
+              trimmed VARNA 2D structure is incorrect for sequences that
+              do not start at 1.
+            </li>
+            <li>
+              <!-- JAL-3061 -->'.' inserted into RNA secondary structure
+              annotation when columns are inserted into an alignment,
+              and when exporting as Stockholm flatfile.
+            </li>
+            <li>
+              <!-- JAL-3053 -->Jalview annotation rows containing upper
+              and lower-case 'E' and 'H' do not automatically get
+              treated as RNA secondary structure.
+            </li>
+            <li>
+              <!-- JAL-3106 -->.jvp should be used as default extension
+              (not .jar) when saving a jalview project file.
+            </li>
+            <li>
+              <!-- JAL-3105 -->Mac Users: closing a window correctly
+              transfers focus to previous window on OSX
+            </li>
+          </ul>
+          <em>Java 10 Issues Resolved</em>
+          <ul>
+            <li>
+              <!-- JAL-2988 -->OSX - Can't save new files via the File
+              or export menus by typing in a name into the Save dialog
+              box.
+            </li>
+            <li>
+              <!-- JAL-2988 JAL-2968 -->Jalview now uses patched version
+              of the <a href="https://violetlib.org/vaqua/overview.html">VAqua5</a>
+              'look and feel' which has improved compatibility with the
+              latest version of OSX.
+            </li>
+          </ul>
+        </div>
+    </td>
+    </tr>
     <tr>
       <td width="60" nowrap>
         <div align="center">
-          <strong><a name="Jalview.2.10.4">2.10.4</a><br /> <em>27/02/2018</em></strong>
+          <strong><a name="Jalview.2.10.4b1">2.10.4b1</a><br />
+            <em>7/06/2018</em></strong>
         </div>
       </td>
       <td><div align="left">
           <em></em>
           <ul>
             <li>
-              <!-- JAL-984 -->Mouse cursor changes to indicate Sequence ID and annotation area margins can be click-dragged to adjust them.</li> 
+              <!-- JAL-2920 -->Use HGVS nomenclature for variant
+              annotation retrieved from Uniprot
+            </li>
             <li>
-            <!-- JAL-2885 -->Jalview uses HTTPS for Uniprot, Xfam and Ensembl services 
+              <!-- JAL-1460 -->Windows File Shortcuts can be dragged
+              onto the Jalview Desktop
             </li>
+          </ul>
+        </div></td>
+      <td><div align="left">
+          <em></em>
+          <ul>
             <li>
-            <!-- JAL-2759 -->Improved performance for large alignments and lots of hidden columns
+              <!-- JAL-3017 -->Cannot import features with multiple
+              variant elements (blocks import of some Uniprot records)
+            </li>
+            <li>
+              <!-- JAL-2997 -->Clustal files with sequence positions in
+              right-hand column parsed correctly
+            </li>
+            <li>
+              <!-- JAL-2991 -->Wrap view - export to SVG - IDs shown but
+              not alignment area in exported graphic
+            </li>
+            <li>
+              <!-- JAL-2993 -->F2/Keyboard mode edits work when Overview
+              window has input focus
+            </li>
+            <li>
+              <!-- JAL-2992 -->Annotation panel set too high when
+              annotation added to view (Windows)
+            </li>
+            <li>
+              <!-- JAL-3009 -->Jalview Desktop is slow to start up when
+              network connectivity is poor
+            </li>
+            <li>
+              <!-- JAL-1460 -->Drag URL from chrome, firefox, IE to
+              Jalview desktop on Windows doesn't open file<br /> <em>Dragging
+                the currently open URL and links from a page viewed in
+                Firefox or Chrome on Windows is now fully supported. If
+                you are using Edge, only links in the page can be
+                dragged, and with Internet Explorer, only the currently
+                open URL in the browser can be dropped onto Jalview.</em>
             </li>
           </ul>
-          </div>
+        </div></td>
+    </tr>
+    <tr>
+      <td width="60" nowrap>
+        <div align="center">
+          <strong><a name="Jalview.2.10.4">2.10.4</a><br /> <em>10/05/2018</em></strong>
+        </div>
       </td>
       <td><div align="left">
+          <em></em>
           <ul>
             <li>
-              <!-- JAL-2778 -->Slow redraw when Overview panel shown overlapping alignment panel
+              <!-- JAL-1847 JAL-2944 -->New Structure Chooser control
+              for disabling automatic superposition of multiple
+              structures and open structures in existing views
+            </li>
+            <li>
+              <!-- JAL-984 -->Mouse cursor changes to indicate Sequence
+              ID and annotation area margins can be click-dragged to
+              adjust them.
+            </li>
+            <li>
+              <!-- JAL-2885 -->Jalview uses HTTPS for Uniprot, Xfam and
+              Ensembl services
+            </li>
+            <li>
+              <!-- JAL-2759 -->Improved performance for large alignments
+              and lots of hidden columns
             </li>
             <li>
-              <!-- JAL-2666 -->Linked scrolling via protein horizontal scroll bar doesn't work for some CDS/Protein views 
+              <!-- JAL-2593 -->Improved performance when rendering lots
+              of features (particularly when transparency is disabled)
             </li>
-            <li><!-- JAL-2930 -->Trackpad scrolling is broken on OSX on Java 1.8u153 onwards and Java 1.9u4+.</li>
-            <li><!-- JAL-2924 -->Tooltip shouldn't be displayed for empty columns in annotation row</li>
-            <li><!-- JAL-2913 -->Preferences panel's ID Width control is honored in interactive and batch mode</li>
-            </ul><em>Applet</em><ul>
-            <li><!-- JAL-2926 -->Copy consensus sequence option in applet should copy the group consensus when popup is opened on it</li>
-             
           </ul>
-      </div>
+          </div>
       </td>
+      <td><div align="left">
+          <ul>
+            <li>
+              <!-- JAL-2899 -->Structure and Overview aren't updated
+              when Colour By Annotation threshold slider is adjusted
+            </li>
+            <li>
+              <!-- JAL-2778 -->Slow redraw when Overview panel shown
+              overlapping alignment panel
+            </li>
+            <li>
+              <!--  JAL-2929 -->Overview doesn't show end of unpadded
+              sequence as gaps
+            </li>
+            <li>
+              <!-- JAL-2789, JAL-2893 -->Cross-reference handling
+              improved: CDS not handled correctly if transcript has no
+              UTR
+            </li>
+            <li>
+              <!-- JAL-2321 -->Secondary structure and temperature
+              factor annotation not added to sequence when local PDB
+              file associated with it by drag'n'drop or structure
+              chooser
+            </li>
+            <li>
+              <!--  JAL-2984 -->Answering 'No' to PDB Autoassociate
+              dialog doesn't import PDB files dropped on an alignment
+            </li>
+            <li>
+              <!-- JAL-2666 -->Linked scrolling via protein horizontal
+              scroll bar doesn't work for some CDS/Protein views
+            </li>
+            <li>
+              <!-- JAL-2930 -->Trackpad scrolling is broken on OSX on
+              Java 1.8u153 onwards and Java 1.9u4+.
+            </li>
+            <li>
+              <!-- JAL-2924 -->Tooltip shouldn't be displayed for empty
+              columns in annotation row
+            </li>
+            <li>
+              <!-- JAL-2913 -->Preferences panel's ID Width control is not
+              honored in batch mode
+            </li>
+            <li>
+              <!-- JAL-2945 -->Linked sequence highlighting doesn't work
+              for structures added to existing Jmol view
+            </li>
+            <li>
+              <!-- JAL-2223 -->'View Mappings' includes duplicate
+              entries after importing project with multiple views
+            </li>
+            <li>
+              <!-- JAL-2781 JAL-2780 -->Viewing or annotating Uniprot
+              protein sequences via SIFTS from associated PDB entries
+              with negative residue numbers or missing residues fails
+            </li>
+            <li>
+              <!-- JAL-2952 -->Exception when shading sequence with negative
+              Temperature Factor values from annotated PDB files (e.g.
+              as generated by CONSURF)
+            </li>
+            <li>
+              <!-- JAL-2920 -->Uniprot 'sequence variant' features
+              tooltip doesn't include a text description of mutation
+            </li>
+            <li>
+              <!-- JAL-2922 -->Invert displayed features very slow when
+              structure and/or overview windows are also shown
+            </li>
+            <li>
+              <!-- JAL-2954 -->Selecting columns from highlighted regions
+              very slow for alignments with large numbers of sequences
+            </li>
+            <li>
+              <!-- JAL-2925 -->Copy Consensus fails for group consensus
+              with 'StringIndexOutOfBounds'
+            </li>
+            <li>
+              <!-- JAL-2976 -->VAqua(4) provided as fallback Look and Feel for OSX
+              platforms running Java 10
+            </li>
+            <li>
+              <!-- JAL-2960 -->Adding a structure to existing structure
+              view appears to do nothing because the view is hidden behind the alignment view
+            </li>
+          </ul>
+          <em>Applet</em>
+          <ul>
+            <li>
+              <!-- JAL-2926 -->Copy consensus sequence option in applet
+              should copy the group consensus when popup is opened on it
+            </li>
+          </ul>
+          <em>Batch Mode</em>
+          <ul>
+          <li>
+            <!-- JAL-2913 -->Fixed ID width preference is not respected
+          </li>
+          </ul>
+          <em>New Known Defects</em>
+          <ul>
+            <li>
+              <!-- JAL-2973 --> Exceptions occasionally raised when
+              editing a large alignment and overview is displayed
+            </li>
+            <li>
+              <!-- JAL-2974 -->'Overview updating' progress bar is shown
+              repeatedly after a series of edits even when the overview
+              is no longer reflecting updates
+            </li>
+            <li>
+              <!-- JAL-2946 -->'SIFTS Mapping Error' when viewing
+              structures for protein subsequence (if 'Trim Retrieved
+              Sequences' enabled) or Ensembl isoforms (Workaround in
+              2.10.4 is to fail back to N&amp;W mapping)
+            </li>
+          </ul>
+        </div>
+          </td>
     </tr>
     <tr>
       <td width="60" nowrap>
index 83c80ba..1f61dea 100644 (file)
@@ -30,8 +30,7 @@
   ID, and can be viewed in full via the
   <a href="../io/exportseqreport.html">Sequence Details</a> window. .
   Jalview also uses references for the retrieval of
-  <a href="../features/viewingpdbs.html">PDB structures</a> and <a
-    href="../features/dasfeatures.html">DAS features</a>, and for
+  <a href="../features/viewingpdbs.html">PDB structures</a>, and for
   retrieving sequence cross-references such as the protein products of a
   DNA sequence.
 </p>
   application provides three ways to access the retrieval function.
   Either:
 <ul>
-  <li>select the <strong>Discover PDB IDs</strong> option from the
-    structure submenu of the sequence's popup menu
-  </li>
-  <li>Choose one of the options from the 'Fetch DB Refs' submenu in
+       <li>select the <strong>Structure Chooser...</strong> option from
+               the Sequence ID popup menu.
+       </li>
+       <li>Choose one of the options from the 'Fetch DB Refs' submenu in
     the alignment window's <strong>Web Services</strong> menu:
     <ul>
-      <li><em>Standard Databases</em> will fetch references from
-        the EBI databases plus currently selected DAS sources</li>
-      <li>The other entries submenus leading to lists of individual
+                       <li><em>Standard Databases</em> will fetch references from EBI
+                               databases appropriate for the sequence type (Nucleotide or Protein)</li>
+                       <li>The other entries submenus leading to lists of individual
         database sources that Jalview can access.</li>
     </ul>
   </li>
-  <li>Answer 'Yes' when asked if you wish to retrieve database
-    references for your sequences after initiating a DAS Sequence
-    Feature fetch.</li>
 </ul>
 <p>Jalview discovers references for a sequence by generating a set
   of ID queries from the ID string of each sequence in the alignment. It
index d0b497c..8f36013 100755 (executable)
       Institute (EBI) and Distributed Annotation System servers that are
       capable of serving sequences.
     </li>
-    <li>The <a href="../features/dasfeatures.html">DAS Feature
-        Fetcher</a> enables the retrieval and visualization of features from
-      DAS annotation sources
-    </li>
-    <li>The <a href="dbreffetcher.html">Database Reference
-        Fetcher</a> transfers database references from records available
-      from DAS or the public sequence databases.
-    </li>
-    <li>The <strong>Web Services</strong> menu in each alignment
+               <li>The <a href="dbreffetcher.html">Database Reference
+                               Fetcher</a> transfers database references and annotation from the public
+                       sequence databases.
+               </li>
+               <li>The <strong>Web Services</strong> menu in each alignment
       window also provides access to the following:
       <ul>
         <li>Programs for <a href="msaclient.html">multiple
index d3972f5..13fe656 100755 (executable)
 </head>
 <body>
   <p>
-    <strong>What's new in Jalview 2.10.4 ?</strong>
-  </p>
-  <p>
-    This is the February 2018 release of Jalview, with several minor bug fixes and enhanvements. 
-    The full list bugs fixed in this release can be found in the <a href="releases.html#Jalview.2.10.4">2.10.4
-      Release Notes</a>. In addition, Jalview 2.10.4 provides:
+    <strong>What's new in Jalview 2.10.5 ?</strong>
   </p>
+  <p>Jalview 2.10.5 is a minor release that includes critical
+    patches for users working with Ensembl, RNA secondary structure
+    annotation, and those running Jalview on OSX with Java 10.</p>
   <ul>
-    <li></li>
+    <li>Jalview's default memory limit increased to 1G. <br/>If you have
+      problems starting Jalview 2.10.5 and you have 1G or less
+      physical memory on your machine, you will need to <a
+      href="memory.html#memsetting">reduce the memory</a> allocated to
+      Jalview.
+    </li>
+    <li>EPS, PNG and SVG export now includes hidden sequence
+      markers, and representative sequences are marked in bold.</li>
+    <li>Ensembl Client updated for Ensembl Rest API v7.<br />The
+      latest Ensembl API is not backwards compatible with earlier
+      versions of Jalview, so if you require Ensembl functionality you
+      will need to install this release.
+    </li>
+    <li>Improved support for VIENNA extended dot-bracket notation
+      for RNA secondary structure.</li>
+    <li>Positional and selected region highlighting in VARNA
+      'trimmed sequence' view made more reliable.</li>
   </ul>
   <p>
-    <strong><a name="experimental">Experimental Features</a></strong>
+    The full list of bugs fixed in this release can be found in the <a
+      href="releases.html#Jalview.2.10.5">2.10.5 Release Notes</a>. The
+    majority of bug fixes and improvements in 2.10.5 are due to Jalview users
+    contacting us via the jalview-discuss email list. Thanks to everyone
+    who took the time to help make Jalview better !
   </p>
   <p>
-    Remember, please enable the <em>Experimental Features</em> option in
-    the Jalview Desktop's <em>Tools</em> menu, and then restart Jalview
-    if you want to try out features below:
+    <strong>Jalview and Java 10</strong>
   </p>
+  <p>This release addresses a critical bug for OSX users who are
+    running Jalview with Java 10 which can prevent files being saved
+    correctly through the 'Save As' dialog box.</p>
+    <em>Known Issues</em>
   <ul>
-    <li><em>Annotation transfer between Chimera and Jalview</em><br />Two
-      <a href="features/chimera.html#experimental">new entries in
-        the Chimera viewer's Chimera menu</a> allow positional annotation to
-      be exchanged between Chimera and Jalview.</li>
+    <li>OSX: The 'Open File' dialog for Jalview's Groovy Console
+      appears with the title 'Save As', and attempting to select a file to load yields a FileNotFound exception.</br>The workaround is to first clear the 'Untitled' filename before selecting the file you wish to load.
+      </li>
+    <li>OSX: Links don't open when clicked on or via the Sequence or Alignment window popup menu.</li>
+    <li>OSX (Webstart): Jalview only displays old news feed items</li>
   </ul>
-  
 </body>
 </html>
diff --git a/lib/VAqua5-patch.jar b/lib/VAqua5-patch.jar
new file mode 100644 (file)
index 0000000..7b5c27b
Binary files /dev/null and b/lib/VAqua5-patch.jar differ
diff --git a/lib/htsjdk-1.133.jar b/lib/htsjdk-1.133.jar
deleted file mode 100644 (file)
index f084258..0000000
Binary files a/lib/htsjdk-1.133.jar and /dev/null differ
diff --git a/lib/jdas-1.0.4.jar b/lib/jdas-1.0.4.jar
deleted file mode 100644 (file)
index fb5d128..0000000
Binary files a/lib/jdas-1.0.4.jar and /dev/null differ
index d6e4cf3..ca8a275 100644 (file)
@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
 -->
-<!--
+
 <!-- You may freely edit this file. See commented blocks below for -->
 <!-- some examples of how to customize the build. -->
 <!-- (If you delete it and reopen the project it will be recreated.) -->
index 3488ac6..3c06708 100644 (file)
@@ -1,4 +1,4 @@
-YEAR=2016
-AUTHORS=J Procter, M Carstairs, TC Ofoegbu, K Mourao, AM Waterhouse, J Engelhardt, LM Lui, A Menard, D Barton, N Sherstnev, D Roldan-Martinez, M Clamp, S Searle, G Barton
-AUTHORFNAMES=Jim Procter, Mungo Carstairs, Tochukwu 'Charles' Ofoegbu, Kira Mourao, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Anne Menard, Daniel Barton, Natasha Sherstnev, David Roldan-Martinez, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
+YEAR=2018
+AUTHORS=J Procter, M Carstairs, B Soares, K Mourao, TC Ofoegbu, AM Waterhouse, J Engelhardt, LM Lui, A Menard, D Barton, N Sherstnev, D Roldan-Martinez, M Clamp, S Searle, G Barton
+AUTHORFNAMES=Jim Procter, Mungo Carstairs, Ben Soares, Kira Mourao, Tochukwu 'Charles' Ofoegbu, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Anne Menard, Daniel Barton, Natasha Sherstnev, David Roldan-Martinez, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
  
\ No newline at end of file
index 6581504..449c9b6 100644 (file)
@@ -265,6 +265,7 @@ label.use_rnaview = Use RNAView for secondary structure
 label.autoadd_secstr = Add secondary structure annotation to alignment
 label.autoadd_temp = Add Temperature Factor annotation to alignment
 label.structure_viewer = Default structure viewer
+label.double_click_to_browse = Double-click to browse for file
 label.chimera_path = Path to Chimera program
 label.chimera_path_tip = Jalview will first try any path entered here, else standard installation locations.<br>Double-click to browse for file.
 label.invalid_chimera_path = Chimera path not found or not executable
@@ -401,10 +402,6 @@ label.view_name_original = Original
 label.enter_view_name = Enter View Name
 label.enter_label = Enter label
 label.enter_label_for_the_structure = Enter a label for the structure
-label.pdb_entry_is_already_displayed = {0} is already displayed.\nDo you want to re-use this viewer ?
-label.map_sequences_to_visible_window = Map Sequences to Visible Window: {0}
-label.add_pdbentry_to_view = Do you want to add {0} to the view called\n{1}\n
-label.align_to_existing_structure_view = Align to existing structure view
 label.pdb_entries_couldnt_be_retrieved = The following pdb entries could not be retrieved from the PDB\:\n{0}\nPlease retry, or try downloading them manually.
 label.couldnt_load_file = Couldn't load file
 label.couldnt_find_pdb_id_in_file = Couldn't find a PDB id in the file supplied. Please enter an Id to identify this structure.
@@ -1216,7 +1213,6 @@ label.pdb_sequence_fetcher = PDB Sequence Fetcher
 label.result = result
 label.results = results
 label.structure_chooser = Structure Chooser
-label.select = Select : 
 label.invert = Invert 
 label.select_pdb_file = Select PDB File
 info.select_filter_option = Select Filter Option/Manual Entry
index 09be8c9..3c82386 100644 (file)
@@ -369,10 +369,6 @@ label.ignore_unmatched_dropped_files = Ignorar los ficheros sin coincidencias?
 label.enter_view_name = Introduzca un nombre para la vista
 label.enter_label = Introducir etiqueta
 label.enter_label_for_the_structure = Introducir una etiqueta para la estructura
-label.pdb_entry_is_already_displayed = {0} Ya est\u00E1 mostrado.\nQuieres volver a usar este visor?
-label.map_sequences_to_visible_window = Mapa de secuencias en ventana visible: {0}
-label.add_pdbentry_to_view = Quieres a\u00F1adir {0} a la vista llamada\n{1}\n
-label.align_to_existing_structure_view = Alinear a una estructura ya existente
 label.pdb_entries_couldnt_be_retrieved = Las siguientes entradas pdb no pueden ser extra\u00EDdas del PDB\:\n{0}\nPor favor, prueba descarg\u00E1ndolas manualmente.
 label.couldnt_load_file = No se pudo cargar el fichero
 label.couldnt_find_pdb_id_in_file = No se pudo encontrar un Id PDB en el fichero suministrado. Por favor, introduzca un Id para identificar esta estructura.
@@ -1176,12 +1172,12 @@ label.structures_filter=Filtro de Estructuras
 label.scale_protein_to_cdna=Adaptar proteína a cDNA
 label.scale_protein_to_cdna_tip=Hacer a los residuos de proteínas de la misma anchura que los codones en ventanas divididas
 status.loading_cached_pdb_entries=Cargando Entradas PDB en Caché
-label.select=Seleccionar :
 label.select_by_annotation=Seleccionar/Ocultar Columnas por Anotación
 action.select_by_annotation=Seleccionar/Ocultar Columnas por Anotación...
 action.export_features=Exportar Características
 error.invalid_regex=Expresión regular inválida
 label.autoadd_temp=Añadir anotación factor de temperatura al alineamiento
+label.double_click_to_browse = Haga doble clic para buscar fichero 
 label.chimera_path_tip=Jalview intentará primero las rutas introducidas aquí, Y si no las rutas usuales de instalación
 label.structure_chooser=Selector de Estructuras
 label.structure_chooser_manual_association=Selector de Estructuras - asociación manual
@@ -1228,13 +1224,13 @@ exception.resource_not_be_found=El recurso solicitado no se ha encontrado
 label.aacon_calculations=cálculos AACon
 label.pdb_web-service_error=Error de servicio web PDB
 exception.unable_to_detect_internet_connection=Jalview no puede detectar una conexión a Internet
-label.chimera_path=Ruta de acceso a programa Chimera
+label.chimera_path=Ruta de acceso a Chimera
 warn.delete_all=<html>Borrar todas las secuencias cerrará la ventana del alineamiento.<br>Confirmar o Cancelar.
 label.select_all=Seleccionar Todos
 label.alpha_helix=Hélice Alfa
 label.chimera_help=Ayuda para Chimera
 label.find_tip=Buscar alineamiento, selección o IDs de secuencia para una subsecuencia (sin huecos)
-label.structure_viewer=Visualizador de estructura por defecto
+label.structure_viewer=Visualizador por defecto
 label.embbed_biojson=Incrustar BioJSON al exportar HTML
 label.transparency_tip=Ajustar la transparencia a "ver a través" los colores de las características.
 label.choose_annotations=Escoja anotaciones
diff --git a/resources/uniprot_mapping.xml b/resources/uniprot_mapping.xml
deleted file mode 100755 (executable)
index 6344d1e..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
--->
-<mapping>
-       <class name="jalview.datamodel.xdb.uniprot.UniprotFile">
-                 <map-to xml="uniprot"/>               
-                 <field name="UniprotEntries" type="jalview.datamodel.xdb.uniprot.UniprotEntry" collection="vector">
-                     <bind-xml name="entry"/>
-                </field>               
-        </class>
-                
-        <class name="jalview.datamodel.xdb.uniprot.UniprotEntry">
-               <field name="name" type="string" collection="vector"/>
-               <field name="accession" type="string" collection="vector"/>
-               <field name="protein" type="jalview.datamodel.xdb.uniprot.UniprotProteinName"/>
-           <field name="UniprotSequence" type="jalview.datamodel.xdb.uniprot.UniprotSequence">
-               <bind-xml name="sequence"/> 
-           </field>
-           <field name="feature" type="jalview.datamodel.xdb.uniprot.UniprotFeature" collection="vector"/>
-           <field name="dbReference" type="jalview.datamodel.PDBEntry" collection="vector"/>
-                      
-        </class>
-       <class name="jalview.datamodel.xdb.uniprot.UniprotProteinName">
-               <field name="name" collection="vector" type="string">
-                       <bind-xml name="fullName" location="recommendedName" node="element"/>
-               </field>
-       </class>
-        <!-- uniprot protein name is now a collection of collections - the INCLUDES and CONTAINS entries of the uniprot
-               record. This means this doesn't exist anymore...
-        <class name="jalview.datamodel.xdb.uniprot.UniprotProteinName">
-               <field name="name" type="string" collection="vector">
-                       <bind-xml name="name"/>
-               </field>                
-        </class>
-        -->
-        
-        <class name="jalview.datamodel.xdb.uniprot.UniprotFeature">
-               <field name="type">
-                       <bind-xml node="attribute"/>
-               </field>
-               <field name="description">
-                        <bind-xml node="attribute"/>
-               </field>
-               <field name="status">
-                       <bind-xml node="attribute"/>
-               </field>
-               <field name="position">
-                <bind-xml name="position" node="attribute" location="location/position"/>
-                </field>
-               <field name="begin">
-                <bind-xml name="position" node="attribute" location="location/begin"/>
-                </field>
-               <field name="end">
-                <bind-xml name="position" node="attribute" location="location/end"/>
-                </field>
-        </class>
-       
-          <class name="jalview.datamodel.xdb.uniprot.UniprotSequence">
-                    <field name="content" type="string">
-                       <bind-xml name="sequence" node="text"/>
-                    </field>
-        </class>
-        
-        <class name="jalview.datamodel.PDBEntry">
-               <field name="type"><bind-xml node="attribute"/></field>
-               <field name="id"><bind-xml node="attribute"/></field>
-               <field name="props" collection="hashtable">
-                       <bind-xml name="property">
-                          <class name="org.exolab.castor.mapping.MapItem">
-                             <field name="key">
-                               <bind-xml name="type" node="attribute"/>
-                             </field>
-                             <field name="value">
-                               <bind-xml node="attribute"/>
-                               </field>
-                          </class>
-                       </bind-xml>
-               </field>
-        </class>
-
-</mapping>
index 3934d66..50f0479 100755 (executable)
   
   You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
 -->
+<!-- 
+       Java JAXB binding classes are generated by running command line tool xjc:
+           xjc schemas/jalview.xsd -d src -p jalview.xml.binding.jalview
+       Note this also generates code for included schemas
+-->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jalview="www.jalview.org/colours" targetNamespace="www.jalview.org/colours">
+       <xs:element name="JalviewUserColours" type="jalview:JalviewUserColours" />
        <xs:complexType name="JalviewUserColours">
                <xs:sequence>
                        <xs:element name="Version" maxOccurs="1" minOccurs="0" type="xs:string">
                                        <xs:attribute name="RGB" type="xs:string" use="required"/>
                                        <xs:attribute name="minRGB" type="xs:string" use="optional"/>
                                        <xs:attribute name="noValueColour" use="optional" type="jalview:NoValueColour" default="Min" />
-                                       <xs:attribute name="threshType" use="optional">
-                                               <xs:simpleType> 
-                                                       <xs:restriction base="xs:string">
-                                                     <xs:enumeration value="NONE" />
-                                                     <xs:enumeration value="ABOVE" />
-                                                     <xs:enumeration value="BELOW" />
-                                                   </xs:restriction>   
-                                           </xs:simpleType> 
-                                       </xs:attribute>
+                                       <xs:attribute name="threshType" use="optional" type="jalview:ThresholdType" />
                                        <xs:attribute name="threshold" type="xs:float" use="optional"/>
                                        <xs:attribute name="max" type="xs:float" use="optional"/>
                                        <xs:attribute name="min" type="xs:float" use="optional"/>
            <xs:element name="condition" type="xs:string" /> 
            <xs:element name="value" type="xs:string" /> 
          </xs:sequence>
-         <xs:attribute name="by">
-               <xs:simpleType> 
-                       <xs:restriction base="xs:string">
-                     <xs:enumeration value="byLabel" />
-                     <xs:enumeration value="byScore" />
-                     <xs:enumeration value="byAttribute" />
-                   </xs:restriction>   
-           </xs:simpleType> 
-         </xs:attribute> 
-       </xs:complexType> 
+         <xs:attribute name="by" type="jalview:FilterBy" />
+       </xs:complexType>
+
+       <xs:simpleType name="ThresholdType">
+               <xs:annotation>
+                       <xs:documentation>Whether filter has a threshold, and if so is it
+                               above or below
+                       </xs:documentation>
+               </xs:annotation>
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="NONE" />
+                       <xs:enumeration value="ABOVE" />
+                       <xs:enumeration value="BELOW" />
+               </xs:restriction>
+       </xs:simpleType>
+       
+       <xs:simpleType name="FilterBy">
+               <xs:annotation>
+                       <xs:documentation>Filter may apply to label, score or some feature attribute</xs:documentation>
+               </xs:annotation>
+               <xs:restriction base="xs:string">
+             <xs:enumeration value="byLabel" />
+             <xs:enumeration value="byScore" />
+             <xs:enumeration value="byAttribute" />
+           </xs:restriction>   
+       </xs:simpleType>
        
        <xs:simpleType name="NoValueColour">
                <xs:annotation>
index 443d19d..3a20002 100644 (file)
  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
 -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+<!-- 
+       Java JAXB binding classes are generated by running command line tool xjc:
+           xjc schemas/jalview.xsd -d src -p jalview.xml.binding.jalview
+       Note this also generates code for included schemas
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsparams="www.jalview.org/xml/wsparamset"
        targetNamespace="www.jalview.org/xml/wsparamset">
+       <xs:element name="WebServiceParameterSet" type="wsparams:WebServiceParameterSet" />
        <xs:complexType name="WebServiceParameterSet">
                <xs:sequence>
                        <xs:element name="Version" maxOccurs="1" minOccurs="0"
diff --git a/schemas/embl.xsd b/schemas/embl.xsd
new file mode 100644 (file)
index 0000000..1baebfe
--- /dev/null
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- 
+    Retrieved for Jalview 14-Sep-2018 from ftp://ftp.sra.ebi.ac.uk/meta/xsd/sra_1_5/ENA.embl.xsd 
+       Modified to match ftp://ftp.sra.ebi.ac.uk/meta/xsd/sra_1_5/ENA.root.xsd with only ENA.embl.xsd included 
+       root element "ROOT" contains a <choice> of "entry" (single accession) or "entrySet" (one or more accessions) 
+       Java binding classes are generated by 
+               xjc schemas/embl.xsd -b schemas/embl_bindings.xml -d src -p jalview.xml.binding.embl 
+-->
+<xs:schema xmlns:ebi="http://www.ebi.ac.uk/embl/schema"
+       xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       attributeFormDefault="unqualified" elementFormDefault="qualified"
+       version="1.1">
+       <xs:complexType name="XrefType">
+               <xs:annotation>
+                       <xs:documentation>Database cross-reference.</xs:documentation>
+               </xs:annotation>
+               <xs:attribute name="db" type="xs:string" use="required" />
+               <xs:attribute name="id" type="xs:string" use="required" />
+               <xs:attribute name="secondaryId" type="xs:string"
+                       use="optional" />
+       </xs:complexType>
+       <xs:complexType name="EntrySetType">
+               <xs:sequence minOccurs="1" maxOccurs="unbounded">
+                       <xs:element name="entry" type="EntryType" />
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="EntryType">
+               <xs:sequence>
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="secondaryAccession" type="xs:string" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="projectAccession" type="xs:string" />
+                       <xs:element maxOccurs="1" minOccurs="1" name="description"
+                               type="xs:string" />
+                       <xs:element maxOccurs="1" minOccurs="0" name="comment"
+                               type="xs:string" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="keyword" type="xs:string" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="reference">
+                               <xs:annotation>
+                                       <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                               </xs:annotation>
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="title"
+                                                       type="xs:string" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="author" type="xs:string" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="applicant" type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>Patent applicant.</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="consortium" type="xs:string" />
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="submissionDate" type="xs:date">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The submission date (used only for submission
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="journal"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The journal name (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="year"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The publication year (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="volume"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The volume number (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="issue"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The issue number (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="firstPage" type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The first page (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="lastPage"
+                                                       type="xs:string">
+                                                       <xs:annotation>
+                                                               <xs:documentation>The last page (used only for article
+                                                                       references).</xs:documentation>
+                                                       </xs:annotation>
+                                               </xs:element>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="comment"
+                                                       type="xs:string" />
+                                               <xs:element maxOccurs="1" minOccurs="0"
+                                                       name="referenceLocation" type="xs:string" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="xref" type="XrefType" />
+                                       </xs:sequence>
+                                       <xs:attribute name="type" use="required">
+                                               <xs:simpleType>
+                                                       <xs:restriction base="xs:string">
+                                                               <xs:enumeration value="submission" />
+                                                               <xs:enumeration value="book" />
+                                                               <xs:enumeration value="article" />
+                                                               <xs:enumeration value="patent" />
+                                                               <xs:enumeration value="thesis" />
+                                                               <xs:enumeration value="unpublished" />
+                                                       </xs:restriction>
+                                               </xs:simpleType>
+                                       </xs:attribute>
+                                       <xs:attribute name="number" type="xs:integer"
+                                               use="required" />
+                                       <xs:attribute name="location" type="xs:string" />
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="xref" type="XrefType" />
+                       <xs:element maxOccurs="unbounded" minOccurs="0"
+                               name="feature">
+                               <xs:annotation>
+                                       <xs:documentation>Sequence feature.</xs:documentation>
+                               </xs:annotation>
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element maxOccurs="1" minOccurs="0" name="taxon">
+                                                       <xs:complexType>
+                                                               <xs:sequence>
+                                                                       <xs:element maxOccurs="1" minOccurs="0"
+                                                                               name="lineage">
+                                                                               <xs:complexType>
+                                                                                       <xs:sequence>
+                                                                                               <xs:element maxOccurs="unbounded" minOccurs="1"
+                                                                                                       name="taxon">
+                                                                                                       <xs:complexType>
+                                                                                                               <xs:attribute name="scientificName"
+                                                                                                                       type="xs:string" use="required" />
+                                                                                                       </xs:complexType>
+                                                                                               </xs:element>
+                                                                                       </xs:sequence>
+                                                                               </xs:complexType>
+                                                                       </xs:element>
+                                                               </xs:sequence>
+                                                               <xs:attribute name="scientificName"
+                                                                       type="xs:string" use="required" />
+                                                               <xs:attribute name="commonName" type="xs:string"
+                                                                       use="optional" />
+                                                               <xs:attribute name="taxId" type="xs:integer"
+                                                                       use="optional" />
+                                                       </xs:complexType>
+                                               </xs:element>
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="xref" type="XrefType" />
+                                               <xs:element maxOccurs="unbounded" minOccurs="0"
+                                                       name="qualifier">
+                                                       <xs:annotation>
+                                                               <xs:documentation>Sequence feature qualifier.</xs:documentation>
+                                                       </xs:annotation>
+                                                       <xs:complexType>
+                                                               <xs:sequence>
+                                                                       <xs:element maxOccurs="1" minOccurs="0" name="value"
+                                                                               type="xs:string" />
+                                                               </xs:sequence>
+                                                               <xs:attribute name="name" type="xs:string"
+                                                                       use="required" />
+                                                       </xs:complexType>
+                                               </xs:element>
+                                       </xs:sequence>
+                                       <xs:attribute name="name" type="xs:string"
+                                               use="required" />
+                                       <xs:attribute name="location" type="xs:string"
+                                               use="required" />
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="1" minOccurs="0" name="assembly">
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element maxOccurs="unbounded" minOccurs="1"
+                                                       name="range">
+                                                       <xs:complexType>
+                                                               <xs:attribute name="begin" type="xs:integer"
+                                                                       use="required" />
+                                                               <xs:attribute name="end" type="xs:integer"
+                                                                       use="required" />
+                                                               <xs:attribute name="primaryBegin" type="xs:integer"
+                                                                       use="optional" />
+                                                               <xs:attribute name="primaryEnd" type="xs:integer"
+                                                                       use="optional" />
+                                                               <xs:attribute name="accession" type="xs:string"
+                                                                       use="required" />
+                                                               <xs:attribute name="version" type="xs:integer"
+                                                                       use="required" />
+                                                               <xs:attribute default="false" name="complement"
+                                                                       type="xs:boolean" use="optional" />
+                                                       </xs:complexType>
+                                               </xs:element>
+                                       </xs:sequence>
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="1" minOccurs="0" name="contig">
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:choice maxOccurs="unbounded" minOccurs="0">
+                                                       <xs:element maxOccurs="1" minOccurs="1" name="range">
+                                                               <xs:complexType>
+                                                                       <xs:attribute name="begin" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="end" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="primaryBegin"
+                                                                               type="xs:integer" use="optional" />
+                                                                       <xs:attribute name="primaryEnd" type="xs:integer"
+                                                                               use="optional" />
+                                                                       <xs:attribute name="accession" type="xs:string"
+                                                                               use="required" />
+                                                                       <xs:attribute name="version" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute default="false" name="complement"
+                                                                               type="xs:boolean" use="optional" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                                       <xs:element maxOccurs="1" minOccurs="1" name="gap">
+                                                               <xs:complexType>
+                                                                       <xs:attribute name="begin" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="end" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute name="length" type="xs:integer"
+                                                                               use="required" />
+                                                                       <xs:attribute default="false" name="unknownLength"
+                                                                               type="xs:boolean" use="optional" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                               </xs:choice>
+                                       </xs:sequence>
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element maxOccurs="1" minOccurs="0" name="sequence"
+                               type="xs:string" />
+               </xs:sequence>
+               <xs:attribute name="accession" type="xs:string"
+                       use="required" />
+               <xs:attribute name="version" type="xs:integer"
+                       use="required" />
+               <xs:attribute name="entryVersion" type="xs:integer">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="dataClass" type="xs:string"
+                       use="required" />
+               <xs:attribute name="taxonomicDivision" type="xs:string"
+                       use="required" />
+               <xs:attribute name="moleculeType" type="xs:string"
+                       use="required" />
+               <xs:attribute name="sequenceLength" type="xs:integer"
+                       use="required" />
+               <xs:attribute name="topology" use="required">
+                       <xs:simpleType>
+                               <xs:restriction base="xs:string">
+                                       <xs:enumeration value="circular" />
+                                       <xs:enumeration value="linear" />
+                               </xs:restriction>
+                       </xs:simpleType>
+               </xs:attribute>
+               <xs:attribute name="firstPublic" type="xs:date">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="firstPublicRelease" type="xs:integer">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="lastUpdated" type="xs:date">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+               <xs:attribute name="lastUpdatedRelease" type="xs:integer">
+                       <xs:annotation>
+                               <xs:documentation>Not supported for EMBL-CDS.</xs:documentation>
+                       </xs:annotation>
+               </xs:attribute>
+       </xs:complexType>
+       <xs:element name="ROOT">
+               <xs:complexType>
+                       <xs:choice>
+                               <xs:element name="entrySet" type="EntrySetType" />
+                               <xs:element name="entry" type="EntryType" />
+                       </xs:choice>
+               </xs:complexType>
+       </xs:element>
+</xs:schema>
diff --git a/schemas/embl_bindings.xml b/schemas/embl_bindings.xml
new file mode 100644 (file)
index 0000000..0f6f669
--- /dev/null
@@ -0,0 +1,15 @@
+<!--  
+       Binding file stops the nested 'taxon' elements generating invalid Java (nested type hiding enclosing type).
+       The binding converts EntryType/feature/taxon to EntryType$Feature$FeatureTaxon.
+       EntryType/feature/taxon/lineage/taxon generates EntryType$Feature$FeatureTaxon$Lineage$Taxon.  
+-->
+<jaxb:bindings
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" version="2.1">
+       <jaxb:bindings schemaLocation="embl.xsd">
+               <jaxb:bindings
+                       node="/xsd:schema/xsd:complexType[@name='EntryType']/xsd:sequence/xsd:element[@name='feature']/xsd:complexType/xsd:sequence/xsd:element[@name='taxon']/xsd:complexType">
+                       <jaxb:class name="FeatureTaxon" />
+               </jaxb:bindings>
+       </jaxb:bindings>
+</jaxb:bindings>
\ No newline at end of file
index c528539..07dee98 100755 (executable)
        Public License for more details. * * You should have received a copy of the 
        GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>. 
        * The Jalview Authors are detailed in the 'AUTHORS' file. -->
+<!-- 
+       Java JAXB binding classes are generated by running command line tool xjc:
+           xjc schemas/jalview.xsd -d src -p jalview.xml.binding.jalview
+       Note this also generates code for included schemas
+-->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:vamsas="www.vamsas.ac.uk/jalview/version2" xmlns:jalview="www.jalview.org/colours"
        xmlns:jv="www.jalview.org" xmlns:jvws="www.jalview.org/xml/wsparamset"
@@ -21,6 +26,7 @@
                schemaLocation="JalviewUserColours.xsd" />
        <xs:import namespace="www.jalview.org/xml/wsparamset"
                schemaLocation="JalviewWsParamSet.xsd" />
+       <xs:element name="JalviewModel" type="jv:JalviewModel" />
        <xs:complexType name="JalviewModel">
                <xs:sequence>
                        <xs:element name="creationDate" type="xs:dateTime" />
diff --git a/schemas/uniprot.xsd b/schemas/uniprot.xsd
new file mode 100644 (file)
index 0000000..1744d37
--- /dev/null
@@ -0,0 +1,1077 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- *****************************************************************************
+       UniProt Knowledgebase
+       Version:        $Revision: 1.3 $
+       Date:           $Date: 2015/04/07 15:00:57 $
+
+       Copyright (c) 2011 UniProt consortium
+       All rights reserved.
+*******************************************************************************-->
+<xs:schema targetNamespace="http://uniprot.org/uniprot" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns="http://uniprot.org/uniprot" elementFormDefault="qualified">
+<!--  
+       Retrieved for Jalview 13-Sep-2018 from https://www.uniprot.org/docs/uniprot.xsd 
+       Java binding classes are generated by 
+          xjc schemas/uniprot.xsd -d src -p jalview.xml.binding.uniprot 
+-->
+    <!-- XML Schema definition for the UniProtKB XML format
+         Tested with:
+         -XSV (XML Schema Validator), http://www.w3.org/2001/03/webdata/xsv
+         -->
+    <!-- Root element definition begins -->
+    <xs:element name="uniprot">
+        <xs:annotation>
+            <xs:documentation>Describes a collection of UniProtKB entries.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element ref="entry" maxOccurs="unbounded"/>
+                <xs:element ref="copyright" minOccurs="0"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <!-- Root element definition ends -->
+
+    <!-- Entry definition begins -->
+    <xs:element name="entry">
+        <xs:annotation>
+            <xs:documentation>Describes a UniProtKB entry.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="accession" type="xs:string" maxOccurs="unbounded"/>
+                <xs:element name="name" type="xs:string" maxOccurs="unbounded"/>
+                <xs:element name="protein" type="proteinType"/>
+                <xs:element name="gene" type="geneType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="organism" type="organismType" />
+                <xs:element name="organismHost" type="organismType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="geneLocation" type="geneLocationType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="reference" type="referenceType" maxOccurs="unbounded"/>
+                <xs:element name="comment" type="commentType" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="dbReference" type="dbReferenceType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="proteinExistence" type="proteinExistenceType"/>
+                <xs:element name="keyword" type="keywordType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="feature" type="featureType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="evidence" type="evidenceType" minOccurs="0" maxOccurs="unbounded"/>
+                <xs:element name="sequence" type="sequenceType"/>
+            </xs:sequence>
+            <xs:attribute name="dataset" use="required">
+                <xs:simpleType>
+                    <xs:restriction base="xs:string">
+                        <xs:enumeration value="Swiss-Prot"/>
+                        <xs:enumeration value="TrEMBL"/>
+                    </xs:restriction>
+                </xs:simpleType>
+            </xs:attribute>
+            <xs:attribute name="created" type="xs:date" use="required"/>
+            <xs:attribute name="modified" type="xs:date" use="required"/>
+            <xs:attribute name="version" type="xs:int" use="required"/>
+        </xs:complexType>
+    </xs:element>
+    <!-- Entry definition ends -->
+
+    <xs:element name="copyright" type="xs:string"/>
+
+    <!-- Protein names definition begins -->
+    <xs:complexType name="proteinType">
+        <xs:annotation>
+            <xs:documentation>Describes the names for the protein and parts thereof.
+            Equivalent to the flat file DE-line.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:group ref="proteinNameGroup"/>
+            <xs:element name="domain" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Describes names of "domains".
+                    Equivalent to the flat file DE-line Includes: section.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:group ref="proteinNameGroup"/>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="component" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Describes names of processed products.
+                    Equivalent to the flat file DE-line Contains: section.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:group ref="proteinNameGroup"/>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:group name="proteinNameGroup">
+        <xs:sequence>
+            <xs:element name="recommendedName" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="fullName" type="evidencedStringType"/>
+                        <xs:element name="shortName" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                        <xs:element name="ecNumber" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                    <!-- xs:attribute name="ref" type="xs:string" use="optional"/ -->
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="alternativeName" minOccurs="0" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="fullName" type="evidencedStringType" minOccurs="0"/>
+                        <xs:element name="shortName" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                        <xs:element name="ecNumber" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                    <!-- xs:attribute name="ref" type="xs:string" use="optional"/ -->
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="submittedName" minOccurs="0" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="fullName" type="evidencedStringType"/>
+                        <xs:element name="ecNumber" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                    <!-- xs:attribute name="ref" type="xs:string" use="optional"/ -->
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="allergenName" type="evidencedStringType" minOccurs="0"/>
+            <xs:element name="biotechName" type="evidencedStringType" minOccurs="0"/>
+            <xs:element name="cdAntigenName" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="innName" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:group>
+    <!-- Protein names definition ends -->
+
+    <!-- Gene names definition begins -->
+    <xs:complexType name="geneType">
+        <xs:annotation>
+            <xs:documentation>Describes a gene.
+            Equivalent to the flat file GN-line.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="name" type="geneNameType" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+    <xs:complexType name="geneNameType">
+        <xs:annotation>
+            <xs:documentation>Describes different types of gene designations.
+            Equivalent to the flat file GN-line.</xs:documentation>
+        </xs:annotation>
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="evidence" type="intListType" use="optional"/>
+                <xs:attribute name="type" use="required">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="primary"/>
+                            <xs:enumeration value="synonym"/>
+                            <xs:enumeration value="ordered locus"/>
+                            <xs:enumeration value="ORF"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <!-- Gene names definition ends -->
+
+    <!-- Organism definition begins -->
+    <xs:complexType name="organismType">
+        <xs:annotation>
+            <xs:documentation>Describes the source organism.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="name" type="organismNameType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Describes the names of the source organism.
+                    Equivalent to the flat file OS-line.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="dbReference" type="dbReferenceType" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Describes a cross-reference to the NCBI taxonomy database.
+                    Equivalent to the flat file OX-line.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="lineage" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Describes the lineage of the source organism.
+                    Equivalent to the flat file OC-line.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="taxon" type="xs:string" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="organismNameType">
+        <xs:annotation>
+            <xs:documentation>Describes different types of source organism names.</xs:documentation>
+        </xs:annotation>
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="type" use="required">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="common"/>
+                            <xs:enumeration value="full"/>
+                            <xs:enumeration value="scientific"/>
+                            <xs:enumeration value="synonym"/>
+                            <xs:enumeration value="abbreviation"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <!-- Organism definition ends -->
+
+    <!-- Gene location definition begins -->
+    <xs:complexType name="geneLocationType">
+        <xs:annotation>
+            <xs:documentation>Describes non-nuclear gene locations (organelles and plasmids).
+            Equivalent to the flat file OG-line.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="name" type="statusType" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="type" use="required">
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="apicoplast"/>
+                    <xs:enumeration value="chloroplast"/>
+                    <xs:enumeration value="organellar chromatophore"/>
+                    <xs:enumeration value="cyanelle"/>
+                    <xs:enumeration value="hydrogenosome"/>
+                    <xs:enumeration value="mitochondrion"/>
+                    <xs:enumeration value="non-photosynthetic plastid"/>
+                    <xs:enumeration value="nucleomorph"/>
+                    <xs:enumeration value="plasmid"/>
+                    <xs:enumeration value="plastid"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="statusType">
+        <xs:annotation>
+            <xs:documentation>Indicates whether the name of a plasmid is known or unknown.</xs:documentation>
+        </xs:annotation>
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="status" use="optional" default="known">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="known"/>
+                            <xs:enumeration value="unknown"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <!-- Gene location definition ends -->
+
+    <!-- Reference definition begins -->
+    <xs:complexType name="referenceType">
+        <xs:annotation>
+            <xs:documentation>Describes a citation and a summary of its content.
+            Equivalent to the flat file RN-, RP-, RC-, RX-, RG-, RA-, RT- and RL-lines.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="citation" type="citationType"/>
+            <xs:group ref="sptrCitationGroup"/>
+        </xs:sequence>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+        <xs:attribute name="key" type="xs:string" use="required"/>
+    </xs:complexType>
+    <!-- Reference definition ends -->
+
+    <!-- Citation definition begins -->
+    <xs:complexType name="citationType">
+        <xs:annotation>
+            <xs:documentation>Describes different types of citations.
+            Equivalent to the flat file RX-, RG-, RA-, RT- and RL-lines.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="title" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Describes the title of a citation.
+                    Equivalent to the flat file RT-line.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="editorList" type="nameListType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Describes the editors of a book (only used for books).
+                    Equivalent to part of the flat file RL-line of books.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="authorList" type="nameListType" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Describes the authors of a citation.
+                    Equivalent to the flat file RA-line.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="locator" type="xs:string" minOccurs="0">
+                <xs:annotation>
+                    <xs:documentation>Describes the location (URL) of an online journal article.
+                    No flat file equivalent.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="dbReference" type="dbReferenceType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Describes cross-references to bibliography databases (MEDLINE, PubMed, AGRICOLA) or other online resources (DOI).
+                    Equivalent to the flat file RX-line.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="type" use="required">
+            <xs:annotation>
+                <xs:documentation>Describes the type of a citation.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="book"/>
+                    <xs:enumeration value="journal article"/>
+                    <xs:enumeration value="online journal article"/>
+                    <xs:enumeration value="patent"/>
+                    <xs:enumeration value="submission"/>
+                    <xs:enumeration value="thesis"/>
+                    <xs:enumeration value="unpublished observations"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="date" use="optional">
+            <xs:simpleType>
+                <xs:union memberTypes="xs:date xs:gYearMonth xs:gYear"/>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="name" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the name of an (online) journal or book.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="volume" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the volume of a journal or book.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="first" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the first page of an article.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="last" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the last page of an article.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="publisher" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the publisher of a book.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="city" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the city where a book was published.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="db" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the database name of submissions.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="number" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes a patent number.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="institute" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the institute where a thesis was made.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="country" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the country where a thesis was made.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="consortiumType">
+        <xs:annotation>
+            <xs:documentation>Describes the authors of a citation when these are represented by a consortium.
+            Equivalent to the flat file RG-line.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="name" type="xs:string" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="personType">
+        <xs:attribute name="name" type="xs:string" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="nameListType">
+        <xs:choice maxOccurs="unbounded">
+            <xs:element name="consortium" type="consortiumType"/>
+            <xs:element name="person" type="personType"/>
+        </xs:choice>
+    </xs:complexType>
+    <!-- Citation definition ends -->
+
+    <!-- Citation summary definition begins -->
+    <xs:group name="sptrCitationGroup">
+        <xs:annotation>
+            <xs:documentation>Groups a citation's scope and source descriptions.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="scope" type="xs:string" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Describes the scope of a citation.
+                    Equivalent to the flat file RP-line.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="source" type="sourceDataType" minOccurs="0"/>
+        </xs:sequence>
+    </xs:group>
+    <xs:complexType name="sourceDataType">
+        <xs:annotation>
+            <xs:documentation>Describes the source of the sequence according to the citation.
+            Equivalent to the flat file RC-line.</xs:documentation>
+        </xs:annotation>
+        <xs:choice maxOccurs="unbounded">
+            <xs:element name="strain">
+                <xs:complexType>
+                    <xs:simpleContent>
+                        <xs:extension base="xs:string">
+                            <xs:attribute name="evidence" type="intListType" use="optional"/>
+                        </xs:extension>
+                    </xs:simpleContent>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="plasmid">
+                <xs:complexType>
+                    <xs:simpleContent>
+                        <xs:extension base="xs:string">
+                            <xs:attribute name="evidence" type="intListType" use="optional"/>
+                        </xs:extension>
+                    </xs:simpleContent>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="transposon">
+                <xs:complexType>
+                    <xs:simpleContent>
+                        <xs:extension base="xs:string">
+                            <xs:attribute name="evidence" type="intListType" use="optional"/>
+                        </xs:extension>
+                    </xs:simpleContent>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="tissue">
+                <xs:complexType>
+                    <xs:simpleContent>
+                        <xs:extension base="xs:string">
+                            <xs:attribute name="evidence" type="intListType" use="optional"/>
+                        </xs:extension>
+                    </xs:simpleContent>
+                </xs:complexType>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+    <!-- Citation summary definition ends -->
+
+    <!-- Comment definition begins -->
+    <xs:complexType name="commentType">
+        <xs:annotation>
+            <xs:documentation>Describes different types of general annotations.
+            Equivalent to the flat file CC-line.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="molecule" type="moleculeType" minOccurs="0"/>
+            <xs:choice minOccurs="0">
+                <xs:group ref="bpcCommentGroup"/>
+
+                <xs:sequence>
+                    <xs:annotation>
+                        <xs:documentation>Used in 'cofactor' annotations.</xs:documentation>
+                    </xs:annotation>
+                    <xs:element name="cofactor" type="cofactorType" maxOccurs="unbounded"/>
+                </xs:sequence>
+
+                <xs:sequence>
+                    <xs:annotation>
+                        <xs:documentation>Used in 'subcellular location' annotations.</xs:documentation>
+                    </xs:annotation>
+                    <xs:element name="subcellularLocation" type="subcellularLocationType" maxOccurs="unbounded"/>
+                </xs:sequence>
+
+                <xs:element name="conflict">
+                    <xs:annotation>
+                        <xs:documentation>Used in 'sequence caution' annotations.</xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="sequence" minOccurs="0">
+                                <xs:complexType>
+                                    <xs:attribute name="resource" use="required">
+                                        <xs:simpleType>
+                                            <xs:restriction base="xs:string">
+                                                <xs:enumeration value="EMBL-CDS"/>
+                                                <xs:enumeration value="EMBL"/>
+                                            </xs:restriction>
+                                        </xs:simpleType>
+                                    </xs:attribute>
+                                    <xs:attribute name="id" type="xs:string" use="required"/>
+                                    <xs:attribute name="version" type="xs:int" use="optional"/>
+                                </xs:complexType>
+                            </xs:element>
+                        </xs:sequence>
+                        <xs:attribute name="type" use="required">
+                            <xs:simpleType>
+                                <xs:restriction base="xs:string">
+                                    <xs:enumeration value="frameshift"/>
+                                    <xs:enumeration value="erroneous initiation"/>
+                                    <xs:enumeration value="erroneous termination"/>
+                                    <xs:enumeration value="erroneous gene model prediction"/>
+                                    <xs:enumeration value="erroneous translation"/>
+                                    <xs:enumeration value="miscellaneous discrepancy"/>
+                                </xs:restriction>
+                            </xs:simpleType>
+                        </xs:attribute>
+                        <xs:attribute name="ref" type="xs:string" use="optional">
+                            <xs:annotation>
+                                <xs:documentation>Refers to the 'key' attribute of a 'reference' element.</xs:documentation>
+                            </xs:annotation>
+                        </xs:attribute>
+                    </xs:complexType>
+                </xs:element>
+
+                <xs:sequence>
+                    <xs:element name="link" minOccurs="0" maxOccurs="unbounded">
+                        <xs:annotation>
+                            <xs:documentation>Used in 'online information' annotations.</xs:documentation>
+                        </xs:annotation>
+                        <xs:complexType>
+                            <xs:attribute name="uri" type="xs:anyURI" use="required"/>
+                        </xs:complexType>
+                    </xs:element>
+                </xs:sequence>
+
+                <xs:sequence>
+                    <xs:annotation>
+                        <xs:documentation>Used in 'alternative products' annotations.</xs:documentation>
+                    </xs:annotation>
+                    <xs:element name="event" type="eventType" maxOccurs="4"/>
+                    <xs:element name="isoform" type="isoformType" minOccurs="0" maxOccurs="unbounded"/>
+                </xs:sequence>
+
+                <xs:sequence>
+                    <xs:annotation>
+                        <xs:documentation>Used in 'interaction' annotations.</xs:documentation>
+                    </xs:annotation>
+                    <xs:element name="interactant" type="interactantType" minOccurs="2" maxOccurs="2"/>
+                    <xs:element name="organismsDiffer" type="xs:boolean" default="false"/>
+                    <xs:element name="experiments" type="xs:int"/>
+                </xs:sequence>
+                
+                <xs:element name="disease">
+                    <xs:annotation>
+                        <xs:documentation>Used in 'disease' annotations.</xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="name" type="xs:string"/>
+                            <xs:element name="acronym" type="xs:string"/>
+                            <xs:element name="description" type="xs:string"/>
+                            <xs:element name="dbReference" type="dbReferenceType"/>
+                        </xs:sequence>
+                        <xs:attribute name="id" type="xs:string" use="required"/>
+                    </xs:complexType>
+                </xs:element>
+
+            </xs:choice>
+
+            <xs:element name="location" type="locationType" minOccurs="0" maxOccurs="unbounded">
+                <xs:annotation>
+                    <xs:documentation>Used in 'mass spectrometry' and 'sequence caution' annotations.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+
+            <xs:element name="text" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+
+        </xs:sequence>
+
+        <xs:attribute name="type" use="required">
+            <xs:annotation>
+                <xs:documentation>Describes the type of a general annotation.
+                Equivalent to the flat file CC comment topics (except for "DATABASE" which is translated to "online information").</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="allergen"/>
+                    <xs:enumeration value="alternative products"/>
+                    <xs:enumeration value="biotechnology"/>
+                    <xs:enumeration value="biophysicochemical properties"/>
+                    <xs:enumeration value="catalytic activity"/>
+                    <xs:enumeration value="caution"/>
+                    <xs:enumeration value="cofactor"/>
+                    <xs:enumeration value="developmental stage"/>
+                    <xs:enumeration value="disease"/>
+                    <xs:enumeration value="domain"/>
+                    <xs:enumeration value="disruption phenotype"/>
+                    <xs:enumeration value="activity regulation"/>
+                    <xs:enumeration value="function"/>
+                    <xs:enumeration value="induction"/>
+                    <xs:enumeration value="miscellaneous"/>
+                    <xs:enumeration value="pathway"/>
+                    <xs:enumeration value="pharmaceutical"/>
+                    <xs:enumeration value="polymorphism"/>
+                    <xs:enumeration value="PTM"/>
+                    <xs:enumeration value="RNA editing"/>
+                    <xs:enumeration value="similarity"/>
+                    <xs:enumeration value="subcellular location"/>
+                    <xs:enumeration value="sequence caution"/>
+                    <xs:enumeration value="subunit"/>
+                    <xs:enumeration value="tissue specificity"/>
+                    <xs:enumeration value="toxic dose"/>
+                    <xs:enumeration value="online information"/>
+                    <xs:enumeration value="mass spectrometry"/>
+                    <xs:enumeration value="interaction"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+
+        <xs:attribute name="locationType" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the type of sequence location in 'RNA editing' annotations. Common values are "Not_applicable" and "Undetermined".</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="name" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes an optional name for an 'online information'.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="mass" type="xs:float" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the molecular mass in 'mass spectrometry' annotations.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="error" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the error of the mass measurement in 'mass spectrometry' annotations.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="method" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>Describes the experimental method in 'mass spectrometry' annotations.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+    </xs:complexType>
+
+    <xs:group name="bpcCommentGroup">
+        <xs:annotation>
+            <xs:documentation>Describes different types of biophysicochemical properties.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="absorption" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="max" type="evidencedStringType" minOccurs="0"/>
+                        <xs:element name="text" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="kinetics" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="KM" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                        <xs:element name="Vmax" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                        <xs:element name="text" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="phDependence" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="text" type="evidencedStringType" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="redoxPotential" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="text" type="evidencedStringType" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="temperatureDependence" minOccurs="0">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="text" type="evidencedStringType" maxOccurs="unbounded"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:group>
+
+    <xs:complexType name="cofactorType">
+        <xs:annotation>
+            <xs:documentation>Describes a cofactor.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="name" type="xs:string"/>
+            <xs:element name="dbReference" type="dbReferenceType"/>
+        </xs:sequence>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+    </xs:complexType>
+
+    <xs:complexType name="subcellularLocationType">
+        <xs:annotation>
+            <xs:documentation>Describes the subcellular location and optionally the topology and orientation of a molecule.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="location" type="evidencedStringType" maxOccurs="unbounded"/>
+            <xs:element name="topology" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="orientation" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="eventType">
+        <xs:annotation>
+            <xs:documentation>Describes the type of events that cause alternative products.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="type" use="required">
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="alternative splicing"/>
+                    <xs:enumeration value="alternative initiation"/>
+                    <xs:enumeration value="alternative promoter"/>
+                    <xs:enumeration value="ribosomal frameshifting"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+    </xs:complexType>
+
+    <xs:complexType name="isoformType">
+        <xs:annotation>
+            <xs:documentation>Describes isoforms in 'alternative products' annotations.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="id" type="xs:string" maxOccurs="unbounded"/>
+            <xs:element name="name" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:simpleContent>
+                        <xs:extension base="xs:string">
+                            <xs:attribute name="evidence" type="intListType" use="optional"/>
+                        </xs:extension>
+                    </xs:simpleContent>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="sequence">
+                <xs:complexType>
+                    <xs:attribute name="type" use="required">
+                        <xs:simpleType>
+                            <xs:restriction base="xs:string">
+                                <xs:enumeration value="not described"/>
+                                <xs:enumeration value="described"/>
+                                <xs:enumeration value="displayed"/>
+                                <xs:enumeration value="external"/>
+                            </xs:restriction>
+                        </xs:simpleType>
+                    </xs:attribute>
+                    <xs:attribute name="ref" type="xs:string" use="optional"/>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="text" type="evidencedStringType" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:group name="interactantGroup">
+        <xs:sequence>
+            <xs:element name="id" type="xs:string"/>
+            <xs:element name="label" type="xs:string" minOccurs="0"/>
+        </xs:sequence>
+    </xs:group>
+    <xs:complexType name="interactantType">
+        <xs:group ref="interactantGroup" minOccurs="0"/>
+        <xs:attribute name="intactId" type="xs:string" use="required"/>
+    </xs:complexType>
+    <!-- Comment definition ends -->
+
+    <!-- Database cross-reference definition begins -->
+    <xs:complexType name="dbReferenceType">
+        <xs:annotation>
+            <xs:documentation>Describes a database cross-reference.
+            Equivalent to the flat file DR-line.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="molecule" type="moleculeType" minOccurs="0"/>
+            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+        <xs:attribute name="type" type="xs:string" use="required">
+            <xs:annotation>
+                <xs:documentation>Describes the name of the database.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="id" type="xs:string" use="required">
+            <xs:annotation>
+                <xs:documentation>Describes a unique database identifier.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+        <!-- xs:attribute name="key" type="xs:string" use="optional"/ -->
+    </xs:complexType>
+
+    <xs:complexType name="propertyType">
+        <xs:attribute name="type" type="xs:string" use="required"/>
+        <xs:attribute name="value" type="xs:string" use="required"/>
+    </xs:complexType>
+    <!-- Database cross-reference definition ends -->
+
+    <!-- Protein existence definition begins -->
+    <xs:complexType name="proteinExistenceType">
+        <xs:annotation>
+            <xs:documentation>Describes the evidence for the protein's existence.
+            Equivalent to the flat file PE-line.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="type" use="required">
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="evidence at protein level"/>
+                    <xs:enumeration value="evidence at transcript level"/>
+                    <xs:enumeration value="inferred from homology"/>
+                    <xs:enumeration value="predicted"/>
+                    <xs:enumeration value="uncertain"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+    </xs:complexType>
+    <!-- Protein existence definition ends -->
+
+    <!-- Keyword definition begins -->
+    <xs:complexType name="keywordType">
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="evidence" type="intListType" use="optional"/>
+                <xs:attribute name="id" type="xs:string" use="required"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <!-- Keyword definition ends -->
+
+    <!-- Feature definition begins -->
+    <xs:complexType name="featureType">
+        <xs:annotation>
+            <xs:documentation>Describes different types of sequence annotations.
+            Equivalent to the flat file FT-line.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="original" type="xs:string" minOccurs="0">
+               <xs:annotation>
+                    <xs:documentation>Describes the original sequence in annotations that describe natural or artifical sequence variations.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="variation" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+              <xs:annotation>
+                    <xs:documentation>Describes the variant sequence in annotations that describe natural or artifical sequence variations.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="location" type="locationType">
+                <xs:annotation>
+                    <xs:documentation>Describes the sequence coordinates of the annotation.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="type" use="required">
+            <xs:annotation>
+                <xs:documentation>Describes the type of a sequence annotation.
+                Equivalent to the flat file FT feature keys, but using full terms instead of acronyms.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="active site"/>
+                    <xs:enumeration value="binding site"/>
+                    <xs:enumeration value="calcium-binding region"/>
+                    <xs:enumeration value="chain"/>
+                    <xs:enumeration value="coiled-coil region"/>
+                    <xs:enumeration value="compositionally biased region"/>
+                    <xs:enumeration value="cross-link"/>
+                    <xs:enumeration value="disulfide bond"/>
+                    <xs:enumeration value="DNA-binding region"/>
+                    <xs:enumeration value="domain"/>
+                    <xs:enumeration value="glycosylation site"/>
+                    <xs:enumeration value="helix"/>
+                    <xs:enumeration value="initiator methionine"/>
+                    <xs:enumeration value="lipid moiety-binding region"/>
+                    <xs:enumeration value="metal ion-binding site"/>
+                    <xs:enumeration value="modified residue"/>
+                    <xs:enumeration value="mutagenesis site"/>
+                    <xs:enumeration value="non-consecutive residues"/>
+                    <xs:enumeration value="non-terminal residue"/>
+                    <xs:enumeration value="nucleotide phosphate-binding region"/>
+                    <xs:enumeration value="peptide"/>
+                    <xs:enumeration value="propeptide"/>
+                    <xs:enumeration value="region of interest"/>
+                    <xs:enumeration value="repeat"/>
+                    <xs:enumeration value="non-standard amino acid"/>
+                    <xs:enumeration value="sequence conflict"/>
+                    <xs:enumeration value="sequence variant"/>
+                    <xs:enumeration value="short sequence motif"/>
+                    <xs:enumeration value="signal peptide"/>
+                    <xs:enumeration value="site"/>
+                    <xs:enumeration value="splice variant"/>
+                    <xs:enumeration value="strand"/>
+                    <xs:enumeration value="topological domain"/>
+                    <xs:enumeration value="transit peptide"/>
+                    <xs:enumeration value="transmembrane region"/>
+                    <xs:enumeration value="turn"/>
+                    <xs:enumeration value="unsure residue"/>
+                    <xs:enumeration value="zinc finger region"/>
+                    <xs:enumeration value="intramembrane region"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="status" use="optional">
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="by similarity"/>
+                    <xs:enumeration value="probable"/>
+                    <xs:enumeration value="potential"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="id" type="xs:string" use="optional"/>
+        <xs:attribute name="description" type="xs:string" use="optional"/>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+        <xs:attribute name="ref" type="xs:string" use="optional"/>
+    </xs:complexType>
+
+    <xs:complexType name="locationType">
+        <xs:annotation>
+            <xs:documentation>Describes a sequence location as either a range with a begin and end or as a position. The 'sequence' attribute is only used when the location is not on the canonical sequence displayed in the current entry.</xs:documentation>
+        </xs:annotation>
+        <xs:choice>
+            <xs:sequence>
+                <xs:element name="begin" type="positionType"/>
+                <xs:element name="end" type="positionType"/>
+            </xs:sequence>
+            <xs:element name="position" type="positionType"/>
+        </xs:choice>
+        <xs:attribute name="sequence" type="xs:string" use="optional"/>
+    </xs:complexType>
+
+    <xs:complexType name="positionType">
+        <xs:attribute name="position" type="xs:unsignedLong" use="optional"/>
+        <xs:attribute name="status" use="optional" default="certain">
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="certain"/>
+                    <xs:enumeration value="uncertain"/>
+                    <xs:enumeration value="less than"/>
+                    <xs:enumeration value="greater than"/>
+                    <xs:enumeration value="unknown"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="evidence" type="intListType" use="optional"/>
+    </xs:complexType>
+    <!-- Feature definition ends -->
+
+    <!-- Sequence definition begins -->
+    <xs:complexType name="sequenceType">
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="length" type="xs:int" use="required"/>
+                <xs:attribute name="mass" type="xs:int" use="required"/>
+                <xs:attribute name="checksum" type="xs:string" use="required"/>
+                <xs:attribute name="modified" type="xs:date" use="required"/>
+                <xs:attribute name="version" type="xs:int" use="required"/>
+                <xs:attribute name="precursor" type="xs:boolean" use="optional"/>
+                <xs:attribute name="fragment" use="optional">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="single"/>
+                            <xs:enumeration value="multiple"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <!-- Sequence definition ends -->
+
+    <!-- Molecule definition begins -->
+    <xs:complexType name="moleculeType">
+        <xs:annotation>
+            <xs:documentation>Describes a molecule by name or unique identifier.</xs:documentation>
+        </xs:annotation>
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="id" type="xs:string" use="optional"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+    <!-- Molecule definition ends -->
+
+    <!-- Evidence definition begins -->
+    <xs:complexType name="evidenceType">
+        <xs:annotation>
+            <xs:documentation>Describes the evidence for an annotation.
+            No flat file equivalent.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="source" type="sourceType" minOccurs="0"/>
+            <xs:element name="importedFrom" type="importedFromType" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="type" type="xs:string" use="required">
+            <xs:annotation>
+                <xs:documentation>Describes the type of an evidence using the Evidence Code Ontology (http://www.obofoundry.org/cgi-bin/detail.cgi?id=evidence_code).</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="key" type="xs:integer" use="required">
+            <xs:annotation>
+                <xs:documentation>A unique key to link annotations (via 'evidence' attributes) to evidences.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+    <xs:complexType name="sourceType">
+        <xs:annotation>
+            <xs:documentation>Describes the source of the data using a database cross-reference (or a 'ref' attribute when the source cannot be found in a public data source, such as PubMed, and is cited only within the UniProtKB entry).</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="dbReference" type="dbReferenceType" minOccurs="0"/>
+        </xs:sequence>
+        <xs:attribute name="ref" type="xs:integer" use="optional"/>
+    </xs:complexType>
+    <xs:complexType name="importedFromType">
+        <xs:annotation>
+            <xs:documentation>Describes the source of the evidence, when it is not assigned by UniProt, but imported from an external database.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="dbReference" type="dbReferenceType"/>
+        </xs:sequence>
+    </xs:complexType>
+    <!-- Evidence definition ends -->
+
+    <xs:complexType name="evidencedStringType">
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute name="evidence" type="intListType" use="optional"/>
+                <xs:attribute name="status" use="optional">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="by similarity"/>
+                            <xs:enumeration value="probable"/>
+                            <xs:enumeration value="potential"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:simpleType name="intListType">
+       <xs:list itemType="xs:int"/>
+   </xs:simpleType>
+</xs:schema>
index 65a1307..22b7aac 100755 (executable)
  * The Jalview Authors are detailed in the 'AUTHORS' file.
 -->
 <!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by ioh[ (o[ih[oh) -->
+<!-- 
+       Java JAXB binding classes are generated by running command line tool xjc:
+           xjc schemas/jalview.xsd -d src -p jalview.xml.binding.jalview
+       Note this also generates code for included schemas
+-->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vamsas="www.vamsas.ac.uk/jalview/version2" targetNamespace="www.vamsas.ac.uk/jalview/version2" elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:complexType name="VAMSAS">
                <xs:sequence>
index 29b994e..904a860 100755 (executable)
@@ -45,11 +45,11 @@ public class PDBChain
 
   public String id;
 
-  public Vector<Bond> bonds = new Vector<Bond>();
+  public Vector<Bond> bonds = new Vector<>();
 
-  public Vector<Atom> atoms = new Vector<Atom>();
+  public Vector<Atom> atoms = new Vector<>();
 
-  public Vector<Residue> residues = new Vector<Residue>();
+  public Vector<Residue> residues = new Vector<>();
 
   public int offset;
 
@@ -343,12 +343,13 @@ public class PDBChain
     boolean deoxyn = false;
     boolean nucleotide = false;
     StringBuilder seq = new StringBuilder(256);
-    Vector<SequenceFeature> resFeatures = new Vector<SequenceFeature>();
-    Vector<Annotation> resAnnotation = new Vector<Annotation>();
-    int i, iSize = atoms.size() - 1;
+    Vector<SequenceFeature> resFeatures = new Vector<>();
+    Vector<Annotation> resAnnotation = new Vector<>();
+    int iSize = atoms.size() - 1;
     int resNumber = -1;
     char insCode = ' ';
-    for (i = 0; i <= iSize; i++)
+
+    for (int i = 0; i <= iSize; i++)
     {
       Atom tmp = atoms.elementAt(i);
       resNumber = tmp.resNumber;
@@ -362,7 +363,7 @@ public class PDBChain
         offset = resNumber;
       }
 
-      Vector<Atom> resAtoms = new Vector<Atom>();
+      Vector<Atom> resAtoms = new Vector<>();
       // Add atoms to a vector while the residue number
       // remains the same as the first atom's resNumber (res)
       while ((resNumber == res) && (ins == insCode) && (i < atoms.size()))
@@ -469,7 +470,8 @@ public class PDBChain
 
     if (StructureImportSettings.isShowSeqFeatures())
     {
-      for (i = 0, iSize = resFeatures.size(); i < iSize; i++)
+      iSize = resFeatures.size();
+      for (int i = 0; i < iSize; i++)
       {
         sequence.addSequenceFeature(resFeatures.elementAt(i));
         resFeatures.setElementAt(null, i);
@@ -478,20 +480,20 @@ public class PDBChain
     if (visibleChainAnnotation)
     {
       Annotation[] annots = new Annotation[resAnnotation.size()];
-      float max = 0;
-      for (i = 0, iSize = annots.length; i < iSize; i++)
+      float max = 0f;
+      float min = 0f;
+      iSize = annots.length;
+      for (int i = 0; i < iSize; i++)
       {
         annots[i] = resAnnotation.elementAt(i);
-        if (annots[i].value > max)
-        {
-          max = annots[i].value;
-        }
+        max = Math.max(max, annots[i].value);
+        min = Math.min(min, annots[i].value);
         resAnnotation.setElementAt(null, i);
       }
 
       AlignmentAnnotation tfactorann = new AlignmentAnnotation(
               "Temperature Factor", "Temperature Factor for " + pdbid + id,
-              annots, 0, max, AlignmentAnnotation.LINE_GRAPH);
+              annots, min, max, AlignmentAnnotation.LINE_GRAPH);
       tfactorann.setSequenceRef(sequence);
       sequence.addAlignmentAnnotation(tfactorann);
     }
index 85ae718..a910a5a 100644 (file)
@@ -40,6 +40,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -83,7 +84,7 @@ public class ChimeraManager
     this.structureManager = structureManager;
     chimera = null;
     chimeraListenerThread = null;
-    currentModelsMap = new HashMap<Integer, ChimeraModel>();
+    currentModelsMap = new HashMap<>();
 
   }
 
@@ -98,7 +99,7 @@ public class ChimeraManager
   public List<ChimeraModel> getChimeraModels(String modelName,
           ModelType modelType)
   {
-    List<ChimeraModel> models = new ArrayList<ChimeraModel>();
+    List<ChimeraModel> models = new ArrayList<>();
     for (ChimeraModel model : currentModelsMap.values())
     {
       if (modelName.equals(model.getModelName())
@@ -112,7 +113,7 @@ public class ChimeraManager
 
   public Map<String, List<ChimeraModel>> getChimeraModelsMap()
   {
-    Map<String, List<ChimeraModel>> models = new HashMap<String, List<ChimeraModel>>();
+    Map<String, List<ChimeraModel>> models = new HashMap<>();
     for (ChimeraModel model : currentModelsMap.values())
     {
       String modelName = model.getModelName();
@@ -393,7 +394,7 @@ public class ChimeraManager
 
   public Map<Integer, ChimeraModel> getSelectedModels()
   {
-    Map<Integer, ChimeraModel> selectedModelsMap = new HashMap<Integer, ChimeraModel>();
+    Map<Integer, ChimeraModel> selectedModelsMap = new HashMap<>();
     List<String> chimeraReply = sendChimeraCommand(
             "list selection level molecule", true);
     if (chimeraReply != null)
@@ -418,7 +419,7 @@ public class ChimeraManager
    */
   public List<String> getSelectedResidueSpecs()
   {
-    List<String> selectedResidues = new ArrayList<String>();
+    List<String> selectedResidues = new ArrayList<>();
     List<String> chimeraReply = sendChimeraCommand(
             "list selection level residue", true);
     if (chimeraReply != null)
@@ -471,7 +472,7 @@ public class ChimeraManager
   // TODO: [Optional] Handle smiles names in a better way in Chimera?
   public List<ChimeraModel> getModelList()
   {
-    List<ChimeraModel> modelList = new ArrayList<ChimeraModel>();
+    List<ChimeraModel> modelList = new ArrayList<>();
     List<String> list = sendChimeraCommand("list models type molecule",
             true);
     if (list != null)
@@ -494,7 +495,7 @@ public class ChimeraManager
    */
   public List<String> getPresets()
   {
-    ArrayList<String> presetList = new ArrayList<String>();
+    ArrayList<String> presetList = new ArrayList<>();
     List<String> output = sendChimeraCommand("preset list", true);
     if (output != null)
     {
@@ -550,17 +551,19 @@ public class ChimeraManager
     // iterate over possible paths for starting Chimera
     for (String chimeraPath : chimeraPaths)
     {
-      File path = new File(chimeraPath);
-      // uncomment the next line to simulate Chimera not installed
-      // path = new File(chimeraPath + "x");
-      if (!path.canExecute())
-      {
-        error += "File '" + path + "' does not exist.\n";
-        continue;
-      }
       try
       {
-        List<String> args = new ArrayList<String>();
+        // ensure symbolic links are resolved
+        chimeraPath = Paths.get(chimeraPath).toRealPath().toString();
+        File path = new File(chimeraPath);
+        // uncomment the next line to simulate Chimera not installed
+        // path = new File(chimeraPath + "x");
+        if (!path.canExecute())
+        {
+          error += "File '" + path + "' does not exist.\n";
+          continue;
+        }
+        List<String> args = new ArrayList<>();
         args.add(chimeraPath);
         // shows Chimera output window but suppresses REST responses:
         // args.add("--debug");
@@ -573,7 +576,7 @@ public class ChimeraManager
         break;
       } catch (Exception e)
       {
-        // Chimera could not be started
+        // Chimera could not be started using this path
         error += e.getMessage();
       }
     }
@@ -699,7 +702,7 @@ public class ChimeraManager
 
   public List<String> getAttrList()
   {
-    List<String> attributes = new ArrayList<String>();
+    List<String> attributes = new ArrayList<>();
     final List<String> reply = sendChimeraCommand("list resattr", true);
     if (reply != null)
     {
@@ -718,7 +721,7 @@ public class ChimeraManager
   public Map<ChimeraResidue, Object> getAttrValues(String aCommand,
           ChimeraModel model)
   {
-    Map<ChimeraResidue, Object> values = new HashMap<ChimeraResidue, Object>();
+    Map<ChimeraResidue, Object> values = new HashMap<>();
     final List<String> reply = sendChimeraCommand("list residue spec "
             + model.toSpec() + " attribute " + aCommand, true);
     if (reply != null)
@@ -818,10 +821,10 @@ public class ChimeraManager
   protected List<String> sendRestCommand(String command)
   {
     String restUrl = "http://127.0.0.1:" + this.chimeraRestPort + "/run";
-    List<NameValuePair> commands = new ArrayList<NameValuePair>(1);
+    List<NameValuePair> commands = new ArrayList<>(1);
     commands.add(new BasicNameValuePair("command", command));
 
-    List<String> reply = new ArrayList<String>();
+    List<String> reply = new ArrayList<>();
     BufferedReader response = null;
     try
     {
index effe556..09a9713 100644 (file)
@@ -97,7 +97,7 @@ public class StructureManager
     this.haveGUI = haveGUI;
     // Create the Chimera interface
     chimeraManager = new ChimeraManager(this);
-    chimSelectionList = new ArrayList<ChimeraStructuralObject>();
+    chimSelectionList = new ArrayList<>();
     pathProps = new Properties();
   }
 
@@ -110,7 +110,7 @@ public class StructureManager
           ModelType type)
   {
     // new models
-    Map<String, List<ChimeraModel>> newModels = new HashMap<String, List<ChimeraModel>>();
+    Map<String, List<ChimeraModel>> newModels = new HashMap<>();
     if (chimObjNames.size() > 0)
     {
       List<String> names = chimObjNames.iterator().next();
@@ -846,7 +846,7 @@ public class StructureManager
     // alDialog.dispose();
     // }
     // System.out.println("launch align dialog");
-    List<ChimeraStructuralObject> chimObjectList = new ArrayList<ChimeraStructuralObject>();
+    List<ChimeraStructuralObject> chimObjectList = new ArrayList<>();
     for (ChimeraModel model : chimeraManager.getChimeraModels())
     {
       if (useChains)
@@ -887,7 +887,7 @@ public class StructureManager
 
   public List<String> getAllChimeraResidueAttributes()
   {
-    List<String> attributes = new ArrayList<String>();
+    List<String> attributes = new ArrayList<>();
     // attributes.addAll(rinManager.getResAttrs());
     attributes.addAll(chimeraManager.getAttrList());
     return attributes;
@@ -898,7 +898,7 @@ public class StructureManager
   // TODO: [Optional] Change priority of Chimera paths
   public static List<String> getChimeraPaths()
   {
-    List<String> pathList = new ArrayList<String>();
+    List<String> pathList = new ArrayList<>();
 
     // if no network is available and the settings have been modified by the
     // user, check for a
@@ -934,8 +934,18 @@ public class StructureManager
     }
     else if (os.startsWith("Windows"))
     {
-      pathList.add("\\Program Files\\Chimera\\bin\\chimera");
-      pathList.add("C:\\Program Files\\Chimera\\bin\\chimera.exe");
+      for (String root : new String[] { "\\Program Files",
+          "C:\\Program Files", "\\Program Files (x86)",
+          "C:\\Program Files (x86)" })
+      {
+        for (String version : new String[] { "1.11", "1.11.1", "1.11.2",
+            "1.12", "1.12.1", "1.12.2", "1.13" })
+        {
+          pathList.add(root + "\\Chimera " + version + "\\bin\\chimera");
+          pathList.add(
+                  root + "\\Chimera " + version + "\\bin\\chimera.exe");
+        }
+      }
     }
     else if (os.startsWith("Mac"))
     {
index 131b39c..0af5d20 100755 (executable)
@@ -273,7 +273,7 @@ public class Conservation
        * or not conserved (-1)
        * Using TreeMap means properties are displayed in alphabetical order
        */
-      SortedMap<String, Integer> resultHash = new TreeMap<String, Integer>();
+      SortedMap<String, Integer> resultHash = new TreeMap<>();
       SymbolCounts symbolCounts = values.getSymbolCounts();
       char[] symbols = symbolCounts.symbols;
       int[] counts = symbolCounts.values;
@@ -567,7 +567,7 @@ public class Conservation
    */
   private void percentIdentity(ScoreMatrix sm)
   {
-    seqNums = new Vector<int[]>();
+    seqNums = new Vector<>();
     int i = 0, iSize = sequences.length;
     // Do we need to calculate this again?
     for (i = 0; i < iSize; i++)
@@ -622,7 +622,7 @@ public class Conservation
   protected void findQuality(int startCol, int endCol,
           ScoreMatrix scoreMatrix)
   {
-    quality = new Vector<Double>();
+    quality = new Vector<>();
 
     double max = -Double.MAX_VALUE;
     float[][] scores = scoreMatrix.getMatrix();
@@ -721,8 +721,8 @@ public class Conservation
 
   /**
    * Complete the given consensus and quuality annotation rows. Note: currently
-   * this method will enlarge the given annotation row if it is too small,
-   * otherwise will leave its length unchanged.
+   * this method will reallocate the given annotation row if it is different to
+   * the calculated width, otherwise will leave its length unchanged.
    * 
    * @param conservation
    *          conservation annotation row
@@ -754,7 +754,7 @@ public class Conservation
     float qmax = 0f;
 
     if (conservation != null && conservation.annotations != null
-            && conservation.annotations.length < alWidth)
+            && conservation.annotations.length != alWidth)
     {
       conservation.annotations = new Annotation[alWidth];
     }
@@ -763,7 +763,7 @@ public class Conservation
     {
       quality2.graphMax = (float) qualityMaximum;
       if (quality2.annotations != null
-              && quality2.annotations.length < alWidth)
+              && quality2.annotations.length != alWidth)
       {
         quality2.annotations = new Annotation[alWidth];
       }
index 0d39abf..e5cda93 100644 (file)
@@ -440,8 +440,8 @@ public class Rna
       /*
        * catch things like <<..<<..>>..<<..>>>> |
        */
-      int j = bps.size() - 1;
-      while (j >= 0)
+      int j = bps.size();
+      while (--j >= 0)
       {
         int popen = bps.get(j).getBP5();
 
@@ -460,7 +460,6 @@ public class Rna
             break;
           }
         }
-        j -= 1;
       }
 
       // Put positions and helix information into the hashtable
index b4612cf..8f778f7 100644 (file)
@@ -20,6 +20,9 @@
  */
 package jalview.api.structures;
 
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
 import jalview.schemes.ColourSchemeI;
 import jalview.structures.models.AAStructureBindingModel;
 
@@ -69,4 +72,57 @@ public interface JalviewStructureDisplayI
    */
   boolean hasMapping();
 
+  /**
+   * Checks if the PDB file is already loaded in this viewer, if so just adds
+   * mappings as necessary and answers true, else answers false. This supports
+   * the use case of adding additional chains of the same structure to a viewer.
+   * 
+   * @param seq
+   * @param chains
+   * @param apanel
+   * @param pdbId
+   * @return
+   */
+  boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
+          AlignmentViewPanel apanel, String pdbId);
+
+  /**
+   * Adds one or more chains (sequences) of a PDB structure to this structure
+   * viewer
+   * 
+   * @param pdbentry
+   * @param seq
+   * @param chains
+   * @param apanel
+   * @param pdbId
+   * @return
+   */
+  void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
+          String[] chains, AlignmentViewPanel apanel, String pdbId);
+
+  /**
+   * refresh GUI after reconfiguring structure(s) and alignment panels
+   */
+  void updateTitleAndMenus();
+
+  /**
+   * Answers true if the viewer should attempt to align any added structures,
+   * else false
+   * 
+   * @return
+   */
+  boolean isAlignAddedStructures();
+
+  /**
+   * Sets the flag for whether added structures should be aligned
+   * 
+   * @param alignAdded
+   */
+  void setAlignAddedStructures(boolean alignAdded);
+
+  /**
+   * Raise the panel to the top of the stack...
+   */
+  void raiseViewer();
+
 }
index dcd6546..83bc810 100755 (executable)
@@ -28,8 +28,6 @@ import jalview.schemes.UserColourScheme;
 import jalview.structure.StructureImportSettings;
 import jalview.urls.IdOrgSettings;
 import jalview.util.ColorUtils;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
 import jalview.ws.sifts.SiftsSettings;
 
 import java.awt.Color;
@@ -982,22 +980,6 @@ public class Cache
     return null;
   }
 
-  private static DasSourceRegistryI sourceRegistry = null;
-
-  /**
-   * initialise and ..
-   * 
-   * @return instance of the das source registry
-   */
-  public static DasSourceRegistryI getDasSourceRegistry()
-  {
-    if (sourceRegistry == null)
-    {
-      sourceRegistry = new DasSourceRegistry();
-    }
-    return sourceRegistry;
-  }
-
   /**
    * Set the specified value, or remove it if null or empty. Does not save the
    * properties file.
index 9ec0033..3270144 100755 (executable)
@@ -20,9 +20,6 @@
  */
 package jalview.bin;
 
-import groovy.lang.Binding;
-import groovy.util.GroovyScriptEngine;
-
 import jalview.ext.so.SequenceOntology;
 import jalview.gui.AlignFrame;
 import jalview.gui.Desktop;
@@ -64,12 +61,23 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Vector;
 
+import javax.swing.LookAndFeel;
 import javax.swing.UIManager;
 
+import groovy.lang.Binding;
+import groovy.util.GroovyScriptEngine;
+
 /**
  * Main class for Jalview Application <br>
  * <br>
- * start with java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview
+ * start with: java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" \
+ * jalview.bin.Jalview
+ * 
+ * or on Windows: java -classpath "$PATH_TO_LIB$/*;$PATH_TO_CLASSES$" \
+ * jalview.bin.Jalview jalview.bin.Jalview
+ * 
+ * (ensure -classpath arg is quoted to avoid shell expansion of '*' and do not
+ * embellish '*' to e.g. '*.jar')
  * 
  * @author $author$
  * @version $Revision$
@@ -148,7 +156,6 @@ public class Jalview
           af.setProgressBar(MessageManager
                   .getString("status.das_features_being_retrived"), id);
           af.featureSettings_actionPerformed(null);
-          af.featureSettings.fetchDasFeatures(dasSources, true);
           af.setProgressBar(null, id);
           synchronized (us)
           {
@@ -264,7 +271,7 @@ public class Jalview
     {
       error.printStackTrace();
       System.out.println("\nEssential logging libraries not found."
-              + "\nUse: java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview");
+              + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
       System.exit(0);
     }
 
@@ -275,20 +282,43 @@ public class Jalview
       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     } catch (Exception ex)
     {
+      System.err.println("Unexpected Look and Feel Exception");
+      ex.printStackTrace();
     }
     if (Platform.isAMac())
     {
+
+      LookAndFeel lookAndFeel = ch.randelshofer.quaqua.QuaquaManager
+              .getLookAndFeel();
       System.setProperty("com.apple.mrj.application.apple.menu.about.name",
               "Jalview");
       System.setProperty("apple.laf.useScreenMenuBar", "true");
-      try
+      if (lookAndFeel != null)
       {
-        UIManager.setLookAndFeel(
-                ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel());
-      } catch (Throwable e)
+        try
+        {
+          UIManager.setLookAndFeel(lookAndFeel);
+        } catch (Throwable e)
+        {
+          System.err.println(
+                  "Failed to set QuaQua look and feel: " + e.toString());
+        }
+      }
+      if (lookAndFeel == null || !(lookAndFeel.getClass()
+              .isAssignableFrom(UIManager.getLookAndFeel().getClass()))
+              || !UIManager.getLookAndFeel().getClass().toString()
+                      .toLowerCase().contains("quaqua"))
       {
-        System.err.println(
-                "Failed to set QuaQua look and feel: " + e.toString());
+        try
+        {
+          System.err.println(
+                  "Quaqua LaF not available on this plaform. Using VAqua(4).\nSee https://issues.jalview.org/browse/JAL-2976");
+          UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel");
+        } catch (Throwable e)
+        {
+          System.err.println(
+                  "Failed to reset look and feel: " + e.toString());
+        }
       }
     }
 
@@ -970,7 +1000,7 @@ public class Jalview
     }
     try
     {
-      Map<String, Object> vbinding = new HashMap<String, Object>();
+      Map<String, Object> vbinding = new HashMap<>();
       vbinding.put("Jalview", this);
       if (af != null)
       {
@@ -1036,7 +1066,7 @@ public class Jalview
                         + nickname + "|" + url);
         if (source == null)
         {
-          source = new Vector<String>();
+          source = new Vector<>();
         }
         source.addElement(nickname);
       }
@@ -1054,7 +1084,7 @@ public class Jalview
       System.out.println("adding source '" + data + "'");
       if (source == null)
       {
-        source = new Vector<String>();
+        source = new Vector<>();
       }
       source.addElement(data);
     }
index 0098d76..ee9389c 100755 (executable)
@@ -25,6 +25,7 @@ import jalview.analysis.SecStrConsensus.SimpleBP;
 import jalview.analysis.WUSSParseException;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -164,6 +165,64 @@ public class AlignmentAnnotation
   }
 
   /**
+   * Get the RNA Secondary Structure SequenceFeature Array if present
+   */
+  public SequenceFeature[] getRnaSecondaryStructure()
+  {
+    return this._rnasecstr;
+  }
+
+  /**
+   * Check the RNA Secondary Structure is equivalent to one in given
+   * AlignmentAnnotation param
+   */
+  public boolean rnaSecondaryStructureEquivalent(AlignmentAnnotation that)
+  {
+    return rnaSecondaryStructureEquivalent(that, true);
+  }
+
+  public boolean rnaSecondaryStructureEquivalent(AlignmentAnnotation that, boolean compareType)
+  {
+    SequenceFeature[] thisSfArray = this.getRnaSecondaryStructure();
+    SequenceFeature[] thatSfArray = that.getRnaSecondaryStructure();
+    if (thisSfArray == null || thatSfArray == null)
+    {
+      return thisSfArray == null && thatSfArray == null;
+    }
+    if (thisSfArray.length != thatSfArray.length)
+    {
+      return false;
+    }
+    Arrays.sort(thisSfArray, new SFSortByEnd()); // probably already sorted
+                                                   // like this
+    Arrays.sort(thatSfArray, new SFSortByEnd()); // probably already sorted
+                                                   // like this
+    for (int i=0; i < thisSfArray.length; i++) {
+      SequenceFeature thisSf = thisSfArray[i];
+      SequenceFeature thatSf = thatSfArray[i];
+      if (compareType) {
+        if (thisSf.getType() == null || thatSf.getType() == null) {
+          if (thisSf.getType() == null && thatSf.getType() == null) {
+            continue;
+          } else {
+            return false;
+          }
+        }
+        if (! thisSf.getType().equals(thatSf.getType())) {
+          return false;
+        }
+      }
+      if (!(thisSf.getBegin() == thatSf.getBegin()
+              && thisSf.getEnd() == thatSf.getEnd()))
+      {
+        return false;
+      }
+    }
+    return true;
+
+  }
+
+  /**
    * map of positions in the associated annotation
    */
   private Map<Integer, Annotation> sequenceMapping;
@@ -294,6 +353,7 @@ public class AlignmentAnnotation
     char firstChar = 0;
     for (int i = 0; i < annotations.length; i++)
     {
+      // DEBUG System.out.println(i + ": " + annotations[i]);
       if (annotations[i] == null)
       {
         continue;
@@ -301,12 +361,15 @@ public class AlignmentAnnotation
       if (annotations[i].secondaryStructure == 'H'
               || annotations[i].secondaryStructure == 'E')
       {
+        // DEBUG System.out.println( "/H|E/ '" +
+        // annotations[i].secondaryStructure + "'");
         hasIcons |= true;
       }
       else
       // Check for RNA secondary structure
       {
-        // System.out.println(annotations[i].secondaryStructure);
+        // DEBUG System.out.println( "/else/ '" +
+        // annotations[i].secondaryStructure + "'");
         // TODO: 2.8.2 should this ss symbol validation check be a function in
         // RNA/ResidueProperties ?
         if (annotations[i].secondaryStructure == '('
@@ -317,10 +380,12 @@ public class AlignmentAnnotation
                 || annotations[i].secondaryStructure == 'B'
                 || annotations[i].secondaryStructure == 'C'
                 || annotations[i].secondaryStructure == 'D'
-                || annotations[i].secondaryStructure == 'E'
+                // || annotations[i].secondaryStructure == 'E' // ambiguous on
+                // its own -- already checked above
                 || annotations[i].secondaryStructure == 'F'
                 || annotations[i].secondaryStructure == 'G'
-                || annotations[i].secondaryStructure == 'H'
+                // || annotations[i].secondaryStructure == 'H' // ambiguous on
+                // its own -- already checked above
                 || annotations[i].secondaryStructure == 'I'
                 || annotations[i].secondaryStructure == 'J'
                 || annotations[i].secondaryStructure == 'K'
@@ -367,7 +432,7 @@ public class AlignmentAnnotation
         // &&
         // annotations[i].displayCharacter.charAt(0)==annotations[i].secondaryStructure
                 firstChar != ' ' && firstChar != '$' && firstChar != 0xCE
-                && firstChar != '(' && firstChar != '[' && firstChar != '>'
+                && firstChar != '(' && firstChar != '[' && firstChar != '<'
                 && firstChar != '{' && firstChar != 'A' && firstChar != 'B'
                 && firstChar != 'C' && firstChar != 'D' && firstChar != 'E'
                 && firstChar != 'F' && firstChar != 'G' && firstChar != 'H'
@@ -1648,4 +1713,5 @@ public class AlignmentAnnotation
     }
     return aa;
   }
+
 }
index ae29417..f6919cd 100755 (executable)
@@ -210,7 +210,10 @@ public class Annotation
     return ((value == 0f)
             && ((description == null) || (description.trim().length() == 0))
             && ((displayCharacter == null)
-                    || (displayCharacter.trim().length() == 0))
+                    || (displayCharacter.trim().length() == 0)
+                    || (displayCharacter.equals(" ."))) // RNA Stockholm blank
+                                                        // displayCharacter can
+                                                        // end up like this
             && (secondaryStructure == '\0' || (secondaryStructure == ' '))
             && colour == null);
   }
index 160ed71..bdca6d0 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.datamodel;
 
 public final class HiddenCursorPosition
index 85272f2..9ca6b2a 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.datamodel;
 
 import java.util.Iterator;
index 7a69ac6..5d45236 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.datamodel;
 
 import java.util.ArrayList;
index cde50e5..d1e3fcc 100755 (executable)
@@ -267,9 +267,12 @@ public class SearchResults implements SearchResultsI
   {
     int count = 0;
     BitSet mask = new BitSet();
+    int startRes = sqcol.getStartRes();
+    int endRes = sqcol.getEndRes();
+
     for (SequenceI s : sqcol.getSequences())
     {
-      int[] cols = getResults(s, sqcol.getStartRes(), sqcol.getEndRes());
+      int[] cols = getResults(s, startRes, endRes);
       if (cols != null)
       {
         for (int pair = 0; pair < cols.length; pair += 2)
index 59c3fb1..33de452 100755 (executable)
@@ -445,7 +445,7 @@ public class Sequence extends ASequence implements SequenceI
   @Override
   public Vector<PDBEntry> getAllPDBEntries()
   {
-    return pdbIds == null ? new Vector<PDBEntry>() : pdbIds;
+    return pdbIds == null ? new Vector<>() : pdbIds;
   }
 
   /**
@@ -815,7 +815,7 @@ public class Sequence extends ASequence implements SequenceI
    * @param curs
    * @return
    */
-  protected int findIndex(int pos, SequenceCursor curs)
+  protected int findIndex(final int pos, SequenceCursor curs)
   {
     if (!isValidCursor(curs))
     {
@@ -841,10 +841,15 @@ public class Sequence extends ASequence implements SequenceI
     while (newPos != pos)
     {
       col += delta; // shift one column left or right
-      if (col < 0 || col == sequence.length)
+      if (col < 0)
       {
         break;
       }
+      if (col == sequence.length)
+      {
+        col--; // return last column if we failed to reach pos
+        break;
+      }
       if (!Comparison.isGap(sequence[col]))
       {
         newPos += delta;
@@ -852,7 +857,14 @@ public class Sequence extends ASequence implements SequenceI
     }
 
     col++; // convert back to base 1
-    updateCursor(pos, col, curs.firstColumnPosition);
+
+    /*
+     * only update cursor if we found the target position
+     */
+    if (newPos == pos)
+    {
+      updateCursor(pos, col, curs.firstColumnPosition);
+    }
 
     return col;
   }
index 34565c6..7052f34 100755 (executable)
@@ -27,6 +27,7 @@ import jalview.datamodel.features.FeatureSourceI;
 import jalview.datamodel.features.FeatureSources;
 import jalview.util.StringUtils;
 
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -736,3 +737,21 @@ public class SequenceFeature implements FeatureLocationI
     source = theSource;
   }
 }
+
+class SFSortByEnd implements Comparator<SequenceFeature>
+{
+  @Override
+  public int compare(SequenceFeature a, SequenceFeature b)
+  {
+    return a.getEnd() - b.getEnd();
+  }
+}
+
+class SFSortByBegin implements Comparator<SequenceFeature>
+{
+  @Override
+  public int compare(SequenceFeature a, SequenceFeature b)
+  {
+    return a.getBegin() - b.getBegin();
+  }
+}
index bd036e4..c21f04a 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.datamodel;
 
 import java.util.ArrayList;
index 6d3f43d..0185978 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.datamodel;
 
 import java.util.ArrayList;
index e359b62..10249f3 100644 (file)
@@ -87,8 +87,8 @@ public class FeatureAttributes
     Datatype type;
 
     /**
-     * Note one instance of this attribute, recording unique, non-null names,
-     * and the min/max of any numerical values
+     * Note one instance of this attribute, recording unique, non-null
+     * descriptions, and the min/max of any numerical values
      * 
      * @param desc
      * @param value
@@ -99,20 +99,35 @@ public class FeatureAttributes
 
       if (value != null)
       {
-        try
-        {
-          float f = Float.valueOf(value);
-          min = hasValue ? Float.min(min, f) : f;
-          max = hasValue ? Float.max(max, f) : f;
-          hasValue = true;
-          type = (type == null || type == Datatype.Number) ? Datatype.Number
-                  : Datatype.Mixed;
-        } catch (NumberFormatException e)
+        value = value.trim();
+
+        /*
+         * Parse numeric value unless we have previously
+         * seen text data for this attribute type
+         */
+        if (type == null || type == Datatype.Number)
         {
-          // not a number, ignore for min-max purposes
-          type = (type == null || type == Datatype.Character)
-                  ? Datatype.Character
-                  : Datatype.Mixed;
+          try
+          {
+            float f = Float.valueOf(value);
+            min = hasValue ? Float.min(min, f) : f;
+            max = hasValue ? Float.max(max, f) : f;
+            hasValue = true;
+            type = (type == null || type == Datatype.Number)
+                    ? Datatype.Number
+                    : Datatype.Mixed;
+          } catch (NumberFormatException e)
+          {
+            /*
+             * non-numeric data: treat attribute as Character (or Mixed)
+             */
+            type = (type == null || type == Datatype.Character)
+                    ? Datatype.Character
+                    : Datatype.Mixed;
+            min = 0f;
+            max = 0f;
+            hasValue = false;
+          }
         }
       }
     }
@@ -284,9 +299,8 @@ public class FeatureAttributes
 
   /**
    * Answers the [min, max] value range of the given attribute for the given
-   * feature type, if known, else null. Attributes which only have text values
-   * would normally return null, however text values which happen to be numeric
-   * could result in a 'min-max' range.
+   * feature type, if known, else null. Attributes with a mixture of text and
+   * numeric values are considered text (do not return a min-max range).
    * 
    * @param featureType
    * @param attName
index fcf1b53..727d3ef 100644 (file)
@@ -87,7 +87,7 @@ public class SequenceFeatures implements SequenceFeaturesI
      */
     // featureStore = Collections
     // .synchronizedSortedMap(new TreeMap<String, FeatureStore>());
-    featureStore = new TreeMap<String, FeatureStore>();
+    featureStore = new TreeMap<>();
   }
 
   /**
@@ -382,9 +382,10 @@ public class SequenceFeatures implements SequenceFeaturesI
   }
 
   /**
-   * Answers true if the given type is one of the specified sequence ontology
-   * terms (or a sub-type of one), or if no terms are supplied. Answers false if
-   * filter terms are specified and the given term does not match any of them.
+   * Answers true if the given type matches one of the specified terms (or is a
+   * sub-type of one in the Sequence Ontology), or if no terms are supplied.
+   * Answers false if filter terms are specified and the given term does not
+   * match any of them.
    * 
    * @param type
    * @param soTerm
@@ -399,7 +400,7 @@ public class SequenceFeatures implements SequenceFeaturesI
     SequenceOntologyI so = SequenceOntologyFactory.getInstance();
     for (String term : soTerm)
     {
-      if (so.isA(type, term))
+      if (type.equals(term) || so.isA(type, term))
       {
         return true;
       }
index 80c4f9a..31712b9 100644 (file)
@@ -82,9 +82,9 @@ public interface SequenceFeaturesI
           String group, String... type);
 
   /**
-   * Answers a list of all features stored, whose type either matches one of the
-   * given ontology terms, or is a specialisation of a term in the Sequence
-   * Ontology. Results are returned in no particular guaranteed order.
+   * Answers a list of all features stored, whose type either matches, or is a
+   * specialisation (in the Sequence Ontology) of, one of the given terms.
+   * Results are returned in no particular order.
    * 
    * @param ontologyTerm
    * @return
diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java
deleted file mode 100644 (file)
index bbe6a20..0000000
+++ /dev/null
@@ -1,872 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import jalview.analysis.SequenceIdMatcher;
-import jalview.bin.Cache;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.FeatureProperties;
-import jalview.datamodel.Mapping;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceI;
-import jalview.util.DBRefUtils;
-import jalview.util.DnaUtils;
-import jalview.util.MapList;
-import jalview.util.MappingUtils;
-import jalview.util.StringUtils;
-
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Vector;
-import java.util.regex.Pattern;
-
-/**
- * Data model for one entry returned from an EMBL query, as marshalled by a
- * Castor binding file
- * 
- * For example: http://www.ebi.ac.uk/ena/data/view/J03321&display=xml
- * 
- * @see embl_mapping.xml
- */
-public class EmblEntry
-{
-  private static final Pattern SPACE_PATTERN = Pattern.compile(" ");
-
-  String accession;
-
-  String entryVersion;
-
-  String sequenceVersion;
-
-  String dataClass;
-
-  String moleculeType;
-
-  String topology;
-
-  String sequenceLength;
-
-  String taxonomicDivision;
-
-  String description;
-
-  String firstPublicDate;
-
-  String firstPublicRelease;
-
-  String lastUpdatedDate;
-
-  String lastUpdatedRelease;
-
-  Vector<String> keywords;
-
-  Vector<DBRefEntry> dbRefs;
-
-  Vector<EmblFeature> features;
-
-  EmblSequence sequence;
-
-  /**
-   * @return the accession
-   */
-  public String getAccession()
-  {
-    return accession;
-  }
-
-  /**
-   * @param accession
-   *          the accession to set
-   */
-  public void setAccession(String accession)
-  {
-    this.accession = accession;
-  }
-
-  /**
-   * @return the dbRefs
-   */
-  public Vector<DBRefEntry> getDbRefs()
-  {
-    return dbRefs;
-  }
-
-  /**
-   * @param dbRefs
-   *          the dbRefs to set
-   */
-  public void setDbRefs(Vector<DBRefEntry> dbRefs)
-  {
-    this.dbRefs = dbRefs;
-  }
-
-  /**
-   * @return the features
-   */
-  public Vector<EmblFeature> getFeatures()
-  {
-    return features;
-  }
-
-  /**
-   * @param features
-   *          the features to set
-   */
-  public void setFeatures(Vector<EmblFeature> features)
-  {
-    this.features = features;
-  }
-
-  /**
-   * @return the keywords
-   */
-  public Vector<String> getKeywords()
-  {
-    return keywords;
-  }
-
-  /**
-   * @param keywords
-   *          the keywords to set
-   */
-  public void setKeywords(Vector<String> keywords)
-  {
-    this.keywords = keywords;
-  }
-
-  /**
-   * @return the sequence
-   */
-  public EmblSequence getSequence()
-  {
-    return sequence;
-  }
-
-  /**
-   * @param sequence
-   *          the sequence to set
-   */
-  public void setSequence(EmblSequence sequence)
-  {
-    this.sequence = sequence;
-  }
-
-  /**
-   * Recover annotated sequences from EMBL file
-   * 
-   * @param sourceDb
-   * @param peptides
-   *          a list of protein products found so far (to add to)
-   * @return dna dataset sequence with DBRefs and features
-   */
-  public SequenceI getSequence(String sourceDb, List<SequenceI> peptides)
-  {
-    SequenceI dna = makeSequence(sourceDb);
-    if (dna == null)
-    {
-      return null;
-    }
-    dna.setDescription(description);
-    DBRefEntry retrievedref = new DBRefEntry(sourceDb, getSequenceVersion(),
-            accession);
-    dna.addDBRef(retrievedref);
-    // add map to indicate the sequence is a valid coordinate frame for the
-    // dbref
-    retrievedref
-            .setMap(new Mapping(null, new int[]
-            { 1, dna.getLength() }, new int[] { 1, dna.getLength() }, 1,
-                    1));
-
-    /*
-     * transform EMBL Database refs to canonical form
-     */
-    if (dbRefs != null)
-    {
-      for (DBRefEntry dbref : dbRefs)
-      {
-        dbref.setSource(DBRefUtils.getCanonicalName(dbref.getSource()));
-        dna.addDBRef(dbref);
-      }
-    }
-
-    SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
-    try
-    {
-      for (EmblFeature feature : features)
-      {
-        if (FeatureProperties.isCodingFeature(sourceDb, feature.getName()))
-        {
-          parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
-        }
-      }
-    } catch (Exception e)
-    {
-      System.err.println("EMBL Record Features parsing error!");
-      System.err
-              .println("Please report the following to help@jalview.org :");
-      System.err.println("EMBL Record " + accession);
-      System.err.println("Resulted in exception: " + e.getMessage());
-      e.printStackTrace(System.err);
-    }
-
-    return dna;
-  }
-
-  /**
-   * @param sourceDb
-   * @return
-   */
-  SequenceI makeSequence(String sourceDb)
-  {
-    if (sequence == null)
-    {
-      System.err.println(
-              "No sequence was returned for ENA accession " + accession);
-      return null;
-    }
-    SequenceI dna = new Sequence(sourceDb + "|" + accession,
-            sequence.getSequence());
-    return dna;
-  }
-
-  /**
-   * Extracts coding region and product from a CDS feature and properly decorate
-   * it with annotations.
-   * 
-   * @param feature
-   *          coding feature
-   * @param sourceDb
-   *          source database for the EMBLXML
-   * @param dna
-   *          parent dna sequence for this record
-   * @param peptides
-   *          list of protein product sequences for Embl entry
-   * @param matcher
-   *          helper to match xrefs in already retrieved sequences
-   */
-  void parseCodingFeature(EmblFeature feature, String sourceDb,
-          SequenceI dna, List<SequenceI> peptides,
-          SequenceIdMatcher matcher)
-  {
-    boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
-
-    int[] exons = getCdsRanges(feature);
-
-    String translation = null;
-    String proteinName = "";
-    String proteinId = null;
-    Map<String, String> vals = new Hashtable<>();
-
-    /*
-     * codon_start 1/2/3 in EMBL corresponds to phase 0/1/2 in CDS
-     * (phase is required for CDS features in GFF3 format)
-     */
-    int codonStart = 1;
-
-    /*
-     * parse qualifiers, saving protein translation, protein id,
-     * codon start position, product (name), and 'other values'
-     */
-    if (feature.getQualifiers() != null)
-    {
-      for (Qualifier q : feature.getQualifiers())
-      {
-        String qname = q.getName();
-        if (qname.equals("translation"))
-        {
-          // remove all spaces (precompiled String.replaceAll(" ", ""))
-          translation = SPACE_PATTERN.matcher(q.getValues()[0])
-                  .replaceAll("");
-        }
-        else if (qname.equals("protein_id"))
-        {
-          proteinId = q.getValues()[0].trim();
-        }
-        else if (qname.equals("codon_start"))
-        {
-          try
-          {
-            codonStart = Integer.parseInt(q.getValues()[0].trim());
-          } catch (NumberFormatException e)
-          {
-            System.err.println("Invalid codon_start in XML for " + accession
-                    + ": " + e.getMessage());
-          }
-        }
-        else if (qname.equals("product"))
-        {
-          // sometimes name is returned e.g. for V00488
-          proteinName = q.getValues()[0].trim();
-        }
-        else
-        {
-          // throw anything else into the additional properties hash
-          String[] qvals = q.getValues();
-          if (qvals != null)
-          {
-            String commaSeparated = StringUtils.arrayToSeparatorList(qvals,
-                    ",");
-            vals.put(qname, commaSeparated);
-          }
-        }
-      }
-    }
-
-    DBRefEntry proteinToEmblProteinRef = null;
-    exons = MappingUtils.removeStartPositions(codonStart - 1, exons);
-
-    SequenceI product = null;
-    Mapping dnaToProteinMapping = null;
-    if (translation != null && proteinName != null && proteinId != null)
-    {
-      int translationLength = translation.length();
-
-      /*
-       * look for product in peptides list, if not found, add it
-       */
-      product = matcher.findIdMatch(proteinId);
-      if (product == null)
-      {
-        product = new Sequence(proteinId, translation, 1,
-                translationLength);
-        product.setDescription(((proteinName.length() == 0)
-                ? "Protein Product from " + sourceDb
-                : proteinName));
-        peptides.add(product);
-        matcher.add(product);
-      }
-
-      // we have everything - create the mapping and perhaps the protein
-      // sequence
-      if (exons == null || exons.length == 0)
-      {
-        /*
-         * workaround until we handle dna location for CDS sequence
-         * e.g. location="X53828.1:60..1058" correctly
-         */
-        System.err.println(
-                "Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect ("
-                        + sourceDb + ":" + getAccession() + ")");
-        int dnaLength = dna.getLength();
-        if (translationLength * 3 == (1 - codonStart + dnaLength))
-        {
-          System.err.println(
-                  "Not allowing for additional stop codon at end of cDNA fragment... !");
-          // this might occur for CDS sequences where no features are marked
-          exons = new int[] { dna.getStart() + (codonStart - 1),
-              dna.getEnd() };
-          dnaToProteinMapping = new Mapping(product, exons,
-                  new int[]
-                  { 1, translationLength }, 3, 1);
-        }
-        if ((translationLength + 1) * 3 == (1 - codonStart + dnaLength))
-        {
-          System.err.println(
-                  "Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!");
-          exons = new int[] { dna.getStart() + (codonStart - 1),
-              dna.getEnd() - 3 };
-          dnaToProteinMapping = new Mapping(product, exons,
-                  new int[]
-                  { 1, translationLength }, 3, 1);
-        }
-      }
-      else
-      {
-        // Trim the exon mapping if necessary - the given product may only be a
-        // fragment of a larger protein. (EMBL:AY043181 is an example)
-
-        if (isEmblCdna)
-        {
-          // TODO: Add a DbRef back to the parent EMBL sequence with the exon
-          // map
-          // if given a dataset reference, search dataset for parent EMBL
-          // sequence if it exists and set its map
-          // make a new feature annotating the coding contig
-        }
-        else
-        {
-          // final product length truncation check
-          int[] cdsRanges = adjustForProteinLength(translationLength,
-                  exons);
-          dnaToProteinMapping = new Mapping(product, cdsRanges,
-                  new int[]
-                  { 1, translationLength }, 3, 1);
-          if (product != null)
-          {
-            /*
-             * make xref with mapping from protein to EMBL dna
-             */
-            DBRefEntry proteinToEmblRef = new DBRefEntry(DBRefSource.EMBL,
-                    getSequenceVersion(), proteinId,
-                    new Mapping(dnaToProteinMapping.getMap().getInverse()));
-            product.addDBRef(proteinToEmblRef);
-
-            /*
-             * make xref from protein to EMBLCDS; we assume here that the 
-             * CDS sequence version is same as dna sequence (?!)
-             */
-            MapList proteinToCdsMapList = new MapList(
-                    new int[]
-                    { 1, translationLength },
-                    new int[]
-                    { 1 + (codonStart - 1),
-                        (codonStart - 1) + 3 * translationLength },
-                    1, 3);
-            DBRefEntry proteinToEmblCdsRef = new DBRefEntry(
-                    DBRefSource.EMBLCDS, getSequenceVersion(), proteinId,
-                    new Mapping(proteinToCdsMapList));
-            product.addDBRef(proteinToEmblCdsRef);
-
-            /*
-             * make 'direct' xref from protein to EMBLCDSPROTEIN
-             */
-            proteinToEmblProteinRef = new DBRefEntry(proteinToEmblCdsRef);
-            proteinToEmblProteinRef.setSource(DBRefSource.EMBLCDSProduct);
-            proteinToEmblProteinRef.setMap(null);
-            product.addDBRef(proteinToEmblProteinRef);
-          }
-        }
-      }
-
-      /*
-       * add cds features to dna sequence
-       */
-      String cds = feature.getName(); // "CDS"
-      for (int xint = 0; exons != null && xint < exons.length - 1; xint += 2)
-      {
-        int exonStart = exons[xint];
-        int exonEnd = exons[xint + 1];
-        int begin = Math.min(exonStart, exonEnd);
-        int end = Math.max(exonStart, exonEnd);
-        int exonNumber = xint / 2 + 1;
-        String desc = String.format("Exon %d for protein '%s' EMBLCDS:%s",
-                exonNumber, proteinName, proteinId);
-
-        SequenceFeature sf = makeCdsFeature(cds, desc, begin, end,
-                sourceDb, vals);
-
-        sf.setEnaLocation(feature.getLocation());
-        boolean forwardStrand = exonStart <= exonEnd;
-        sf.setStrand(forwardStrand ? "+" : "-");
-        sf.setPhase(String.valueOf(codonStart - 1));
-        sf.setValue(FeatureProperties.EXONPOS, exonNumber);
-        sf.setValue(FeatureProperties.EXONPRODUCT, proteinName);
-
-        dna.addSequenceFeature(sf);
-      }
-    }
-
-    /*
-     * add feature dbRefs to sequence, and mappings for Uniprot xrefs
-     */
-    boolean hasUniprotDbref = false;
-    if (feature.dbRefs != null)
-    {
-      boolean mappingUsed = false;
-      for (DBRefEntry ref : feature.dbRefs)
-      {
-        /*
-         * ensure UniProtKB/Swiss-Prot converted to UNIPROT
-         */
-        String source = DBRefUtils.getCanonicalName(ref.getSource());
-        ref.setSource(source);
-        DBRefEntry proteinDbRef = new DBRefEntry(ref.getSource(),
-                ref.getVersion(), ref.getAccessionId());
-        if (source.equals(DBRefSource.UNIPROT))
-        {
-          String proteinSeqName = DBRefSource.UNIPROT + "|"
-                  + ref.getAccessionId();
-          if (dnaToProteinMapping != null
-                  && dnaToProteinMapping.getTo() != null)
-          {
-            if (mappingUsed)
-            {
-              /*
-               * two or more Uniprot xrefs for the same CDS - 
-               * each needs a distinct Mapping (as to a different sequence)
-               */
-              dnaToProteinMapping = new Mapping(dnaToProteinMapping);
-            }
-            mappingUsed = true;
-
-            /*
-             * try to locate the protein mapped to (possibly by a 
-             * previous CDS feature); if not found, construct it from
-             * the EMBL translation
-             */
-            SequenceI proteinSeq = matcher.findIdMatch(proteinSeqName);
-            if (proteinSeq == null)
-            {
-              proteinSeq = new Sequence(proteinSeqName,
-                      product.getSequenceAsString());
-              matcher.add(proteinSeq);
-              peptides.add(proteinSeq);
-            }
-            dnaToProteinMapping.setTo(proteinSeq);
-            dnaToProteinMapping.setMappedFromId(proteinId);
-            proteinSeq.addDBRef(proteinDbRef);
-            ref.setMap(dnaToProteinMapping);
-          }
-          hasUniprotDbref = true;
-        }
-        if (product != null)
-        {
-          /*
-           * copy feature dbref to our protein product
-           */
-          DBRefEntry pref = proteinDbRef;
-          pref.setMap(null); // reference is direct
-          product.addDBRef(pref);
-          // Add converse mapping reference
-          if (dnaToProteinMapping != null)
-          {
-            Mapping pmap = new Mapping(dna,
-                    dnaToProteinMapping.getMap().getInverse());
-            pref = new DBRefEntry(sourceDb, getSequenceVersion(),
-                    this.getAccession());
-            pref.setMap(pmap);
-            if (dnaToProteinMapping.getTo() != null)
-            {
-              dnaToProteinMapping.getTo().addDBRef(pref);
-            }
-          }
-        }
-        dna.addDBRef(ref);
-      }
-    }
-
-    /*
-     * if we have a product (translation) but no explicit Uniprot dbref
-     * (example: EMBL AAFI02000057 protein_id EAL65544.1)
-     * then construct mappings to an assumed EMBLCDSPROTEIN accession
-     */
-    if (!hasUniprotDbref && product != null)
-    {
-      if (proteinToEmblProteinRef == null)
-      {
-        // assuming CDSPROTEIN sequence version = dna version (?!)
-        proteinToEmblProteinRef = new DBRefEntry(DBRefSource.EMBLCDSProduct,
-                getSequenceVersion(), proteinId);
-      }
-      product.addDBRef(proteinToEmblProteinRef);
-
-      if (dnaToProteinMapping != null
-              && dnaToProteinMapping.getTo() != null)
-      {
-        DBRefEntry dnaToEmblProteinRef = new DBRefEntry(
-                DBRefSource.EMBLCDSProduct, getSequenceVersion(),
-                proteinId);
-        dnaToEmblProteinRef.setMap(dnaToProteinMapping);
-        dnaToProteinMapping.setMappedFromId(proteinId);
-        dna.addDBRef(dnaToEmblProteinRef);
-      }
-    }
-  }
-
-  /**
-   * Helper method to construct a SequenceFeature for one cds range
-   * 
-   * @param type
-   *          feature type ("CDS")
-   * @param desc
-   *          description
-   * @param begin
-   *          start position
-   * @param end
-   *          end position
-   * @param group
-   *          feature group
-   * @param vals
-   *          map of 'miscellaneous values' for feature
-   * @return
-   */
-  protected SequenceFeature makeCdsFeature(String type, String desc,
-          int begin, int end, String group, Map<String, String> vals)
-  {
-    SequenceFeature sf = new SequenceFeature(type, desc, begin, end, group);
-    if (!vals.isEmpty())
-    {
-      StringBuilder sb = new StringBuilder();
-      boolean first = true;
-      for (Entry<String, String> val : vals.entrySet())
-      {
-        if (!first)
-        {
-          sb.append(";");
-        }
-        sb.append(val.getKey()).append("=").append(val.getValue());
-        first = false;
-        sf.setValue(val.getKey(), val.getValue());
-      }
-      sf.setAttributes(sb.toString());
-    }
-    return sf;
-  }
-
-  /**
-   * Returns the CDS positions as a single array of [start, end, start, end...]
-   * positions. If on the reverse strand, these will be in descending order.
-   * 
-   * @param feature
-   * @return
-   */
-  protected int[] getCdsRanges(EmblFeature feature)
-  {
-    if (feature.location == null)
-    {
-      return new int[] {};
-    }
-
-    try
-    {
-      List<int[]> ranges = DnaUtils.parseLocation(feature.location);
-      return listToArray(ranges);
-    } catch (ParseException e)
-    {
-      Cache.log.warn(
-              String.format("Not parsing inexact CDS location %s in ENA %s",
-                      feature.location, this.accession));
-      return new int[] {};
-    }
-  }
-
-  /**
-   * Converts a list of [start, end] ranges to a single array of [start, end,
-   * start, end ...]
-   * 
-   * @param ranges
-   * @return
-   */
-  int[] listToArray(List<int[]> ranges)
-  {
-    int[] result = new int[ranges.size() * 2];
-    int i = 0;
-    for (int[] range : ranges)
-    {
-      result[i++] = range[0];
-      result[i++] = range[1];
-    }
-    return result;
-  }
-
-  /**
-   * Truncates (if necessary) the exon intervals to match 3 times the length of
-   * the protein; also accepts 3 bases longer (for stop codon not included in
-   * protein)
-   * 
-   * @param proteinLength
-   * @param exon
-   *          an array of [start, end, start, end...] intervals
-   * @return the same array (if unchanged) or a truncated copy
-   */
-  static int[] adjustForProteinLength(int proteinLength, int[] exon)
-  {
-    if (proteinLength <= 0 || exon == null)
-    {
-      return exon;
-    }
-    int expectedCdsLength = proteinLength * 3;
-    int exonLength = MappingUtils.getLength(Arrays.asList(exon));
-
-    /*
-     * if exon length matches protein, or is shorter, or longer by the 
-     * length of a stop codon (3 bases), then leave it unchanged
-     */
-    if (expectedCdsLength >= exonLength
-            || expectedCdsLength == exonLength - 3)
-    {
-      return exon;
-    }
-
-    int origxon[];
-    int sxpos = -1;
-    int endxon = 0;
-    origxon = new int[exon.length];
-    System.arraycopy(exon, 0, origxon, 0, exon.length);
-    int cdspos = 0;
-    for (int x = 0; x < exon.length; x += 2)
-    {
-      cdspos += Math.abs(exon[x + 1] - exon[x]) + 1;
-      if (expectedCdsLength <= cdspos)
-      {
-        // advanced beyond last codon.
-        sxpos = x;
-        if (expectedCdsLength != cdspos)
-        {
-          // System.err
-          // .println("Truncating final exon interval on region by "
-          // + (cdspos - cdslength));
-        }
-
-        /*
-         * shrink the final exon - reduce end position if forward
-         * strand, increase it if reverse
-         */
-        if (exon[x + 1] >= exon[x])
-        {
-          endxon = exon[x + 1] - cdspos + expectedCdsLength;
-        }
-        else
-        {
-          endxon = exon[x + 1] + cdspos - expectedCdsLength;
-        }
-        break;
-      }
-    }
-
-    if (sxpos != -1)
-    {
-      // and trim the exon interval set if necessary
-      int[] nxon = new int[sxpos + 2];
-      System.arraycopy(exon, 0, nxon, 0, sxpos + 2);
-      nxon[sxpos + 1] = endxon; // update the end boundary for the new exon
-                                // set
-      exon = nxon;
-    }
-    return exon;
-  }
-
-  public String getSequenceVersion()
-  {
-    return sequenceVersion;
-  }
-
-  public void setSequenceVersion(String sequenceVersion)
-  {
-    this.sequenceVersion = sequenceVersion;
-  }
-
-  public String getSequenceLength()
-  {
-    return sequenceLength;
-  }
-
-  public void setSequenceLength(String sequenceLength)
-  {
-    this.sequenceLength = sequenceLength;
-  }
-
-  public String getEntryVersion()
-  {
-    return entryVersion;
-  }
-
-  public void setEntryVersion(String entryVersion)
-  {
-    this.entryVersion = entryVersion;
-  }
-
-  public String getMoleculeType()
-  {
-    return moleculeType;
-  }
-
-  public void setMoleculeType(String moleculeType)
-  {
-    this.moleculeType = moleculeType;
-  }
-
-  public String getTopology()
-  {
-    return topology;
-  }
-
-  public void setTopology(String topology)
-  {
-    this.topology = topology;
-  }
-
-  public String getTaxonomicDivision()
-  {
-    return taxonomicDivision;
-  }
-
-  public void setTaxonomicDivision(String taxonomicDivision)
-  {
-    this.taxonomicDivision = taxonomicDivision;
-  }
-
-  public String getDescription()
-  {
-    return description;
-  }
-
-  public void setDescription(String description)
-  {
-    this.description = description;
-  }
-
-  public String getFirstPublicDate()
-  {
-    return firstPublicDate;
-  }
-
-  public void setFirstPublicDate(String firstPublicDate)
-  {
-    this.firstPublicDate = firstPublicDate;
-  }
-
-  public String getFirstPublicRelease()
-  {
-    return firstPublicRelease;
-  }
-
-  public void setFirstPublicRelease(String firstPublicRelease)
-  {
-    this.firstPublicRelease = firstPublicRelease;
-  }
-
-  public String getLastUpdatedDate()
-  {
-    return lastUpdatedDate;
-  }
-
-  public void setLastUpdatedDate(String lastUpdatedDate)
-  {
-    this.lastUpdatedDate = lastUpdatedDate;
-  }
-
-  public String getLastUpdatedRelease()
-  {
-    return lastUpdatedRelease;
-  }
-
-  public void setLastUpdatedRelease(String lastUpdatedRelease)
-  {
-    this.lastUpdatedRelease = lastUpdatedRelease;
-  }
-
-  public String getDataClass()
-  {
-    return dataClass;
-  }
-
-  public void setDataClass(String dataClass)
-  {
-    this.dataClass = dataClass;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblError.java b/src/jalview/datamodel/xdb/embl/EmblError.java
deleted file mode 100644 (file)
index 94de28f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-/**
- * Data model mapped from any &lt;error&gt; elements returned from an EMBL query
- * 
- * @see embl_mapping.xml
- */
-public class EmblError
-{
-  String accession;
-
-  /**
-   * @return the accession
-   */
-  public String getAccession()
-  {
-    return accession;
-  }
-
-  /**
-   * @param accession
-   *          the accession to set
-   */
-  public void setAccession(String accession)
-  {
-    this.accession = accession;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblFeature.java b/src/jalview/datamodel/xdb/embl/EmblFeature.java
deleted file mode 100644 (file)
index 51d740b..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import jalview.datamodel.DBRefEntry;
-
-import java.util.Vector;
-
-/**
- * Data model for a &lt;feature&gt; element returned from an EMBL query reply
- * 
- * @see embl_mapping.xml
- */
-public class EmblFeature
-{
-  String name;
-
-  Vector<DBRefEntry> dbRefs;
-
-  Vector<Qualifier> qualifiers;
-
-  String location;
-
-  /**
-   * @return the dbRefs
-   */
-  public Vector<DBRefEntry> getDbRefs()
-  {
-    return dbRefs;
-  }
-
-  /**
-   * @param dbRefs
-   *          the dbRefs to set
-   */
-  public void setDbRefs(Vector<DBRefEntry> dbRefs)
-  {
-    this.dbRefs = dbRefs;
-  }
-
-  /**
-   * @return the location
-   */
-  public String getLocation()
-  {
-    return location;
-  }
-
-  /**
-   * @param loc
-   */
-  public void setLocation(String loc)
-  {
-    this.location = loc;
-  }
-
-  /**
-   * @return the name
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * @param name
-   *          the name to set
-   */
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
-  /**
-   * @return the qualifiers
-   */
-  public Vector<Qualifier> getQualifiers()
-  {
-    return qualifiers;
-  }
-
-  /**
-   * @param qualifiers
-   *          the qualifiers to set
-   */
-  public void setQualifiers(Vector<Qualifier> qualifiers)
-  {
-    this.qualifiers = qualifiers;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblFile.java b/src/jalview/datamodel/xdb/embl/EmblFile.java
deleted file mode 100644 (file)
index 8a32c13..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import jalview.datamodel.DBRefEntry;
-import jalview.ws.dbsources.Uniprot;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.util.Vector;
-
-import org.exolab.castor.mapping.Mapping;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Data model for entries returned from an EMBL query, as marshalled by a Castor
- * binding file
- * 
- * For example: http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/embl/x53828/emblxml
- * 
- * @see embl_mapping.xml
- */
-public class EmblFile
-{
-  Vector<EmblEntry> entries;
-
-  Vector<EmblError> errors;
-
-  String text;
-
-  /**
-   * @return the entries
-   */
-  public Vector<EmblEntry> getEntries()
-  {
-    return entries;
-  }
-
-  /**
-   * @param entries
-   *          the entries to set
-   */
-  public void setEntries(Vector<EmblEntry> entries)
-  {
-    this.entries = entries;
-  }
-
-  /**
-   * @return the errors
-   */
-  public Vector<EmblError> getErrors()
-  {
-    return errors;
-  }
-
-  /**
-   * @param errors
-   *          the errors to set
-   */
-  public void setErrors(Vector<EmblError> errors)
-  {
-    this.errors = errors;
-  }
-
-  /**
-   * Parse an EmblXML file into an EmblFile object
-   * 
-   * @param file
-   * @return parsed EmblXML or null if exceptions were raised
-   */
-  public static EmblFile getEmblFile(File file)
-  {
-    if (file == null)
-    {
-      return null;
-    }
-    try
-    {
-      return EmblFile.getEmblFile(new FileReader(file));
-    } catch (Exception e)
-    {
-      System.err.println("Exception whilst reading EMBLfile from " + file);
-      e.printStackTrace(System.err);
-    }
-    return null;
-  }
-
-  public static EmblFile getEmblFile(Reader file)
-  {
-    EmblFile record = new EmblFile();
-    try
-    {
-      // 1. Load the mapping information from the file
-      Mapping map = new Mapping(record.getClass().getClassLoader());
-
-      java.net.URL url = record.getClass().getResource("/embl_mapping.xml");
-      map.loadMapping(url);
-
-      // 2. Unmarshal the data
-      Unmarshaller unmar = new Unmarshaller(record);
-      try
-      {
-        // uncomment to DEBUG EMBLFile reading
-        if (jalview.bin.Cache
-                .getDefault(jalview.bin.Cache.CASTORLOGLEVEL, "debug")
-                .equalsIgnoreCase("DEBUG"))
-        {
-          unmar.setDebug(jalview.bin.Cache.log.isDebugEnabled());
-        }
-      } catch (Exception e)
-      {
-      }
-      unmar.setIgnoreExtraElements(true);
-      unmar.setIgnoreExtraAttributes(true);
-      unmar.setMapping(map);
-      unmar.setLogWriter(new PrintWriter(System.out));
-      record = (EmblFile) unmar.unmarshal(file);
-
-      canonicaliseDbRefs(record);
-    } catch (Exception e)
-    {
-      e.printStackTrace(System.err);
-      record = null;
-    }
-
-    return record;
-  }
-
-  /**
-   * Change blank version to "0" in any DBRefEntry, to ensure consistent
-   * comparison with other DBRefEntry in Jalview
-   * 
-   * @param record
-   * @see Uniprot#getDbVersion
-   */
-  static void canonicaliseDbRefs(EmblFile record)
-  {
-    if (record.getEntries() == null)
-    {
-      return;
-    }
-    for (EmblEntry entry : record.getEntries())
-    {
-      if (entry.getDbRefs() != null)
-      {
-        for (DBRefEntry dbref : entry.getDbRefs())
-        {
-          if ("".equals(dbref.getVersion()))
-          {
-            dbref.setVersion("0");
-          }
-        }
-      }
-
-      if (entry.getFeatures() != null)
-      {
-        for (EmblFeature feature : entry.getFeatures())
-        {
-          if (feature.getDbRefs() != null)
-          {
-            for (DBRefEntry dbref : feature.getDbRefs())
-            {
-              if ("".equals(dbref.getVersion()))
-              {
-                dbref.setVersion("0");
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-
-  public String getText()
-  {
-    return text;
-  }
-
-  public void setText(String text)
-  {
-    this.text = text;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/EmblSequence.java b/src/jalview/datamodel/xdb/embl/EmblSequence.java
deleted file mode 100644 (file)
index 92c424b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-/**
- * Data model for the sequence extracted from an EMBL query reply
- * 
- * @see embl_mapping.xml
- */
-public class EmblSequence
-{
-  String sequence;
-
-  /**
-   * @return the sequence
-   */
-  public String getSequence()
-  {
-    return sequence;
-  }
-
-  /**
-   * @param sequence
-   *          the sequence to set
-   */
-  public void setSequence(String sequence)
-  {
-    // remove spaces introduced by unmarshalling of newline characters
-    this.sequence = sequence.replace(" ", "");
-  }
-}
diff --git a/src/jalview/datamodel/xdb/embl/Qualifier.java b/src/jalview/datamodel/xdb/embl/Qualifier.java
deleted file mode 100644 (file)
index 851dd48..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-/**
- * Data model for a &lt;qualifier&gt; child element of a &lt;feature&gt; read
- * from an EMBL query reply
- * 
- * @see embl_mapping.xml
- */
-public class Qualifier
-{
-  String name;
-
-  String[] values;
-
-  String[] evidence;
-
-  /**
-   * @return the name
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * @param name
-   *          the name to set
-   */
-  public void setName(String name)
-  {
-    this.name = name;
-  }
-
-  /**
-   * @return the values
-   */
-  public String[] getValues()
-  {
-    return values;
-  }
-
-  /**
-   * @param values
-   *          the values to set
-   */
-  public void setValues(String[] values)
-  {
-    this.values = values;
-  }
-
-  public void addEvidence(String qevidence)
-  {
-    // TODO - not used? can remove?
-    if (evidence == null)
-    {
-      evidence = new String[1];
-    }
-    else
-    {
-      String[] temp = new String[evidence.length + 1];
-      System.arraycopy(evidence, 0, temp, 0, evidence.length);
-      evidence = temp;
-    }
-    evidence[evidence.length - 1] = qevidence;
-  }
-
-  public void addValues(String value)
-  {
-    // TODO - not used? can remove?
-    if (values == null)
-    {
-      values = new String[1];
-    }
-    else
-    {
-      String[] temp = new String[values.length + 1];
-      System.arraycopy(values, 0, temp, 0, values.length);
-      values = temp;
-    }
-    values[values.length - 1] = value;
-  }
-
-  /**
-   * @return the evidence
-   */
-  public String[] getEvidence()
-  {
-    return evidence;
-  }
-
-  /**
-   * @param evidence
-   *          the evidence to set
-   */
-  public void setEvidence(String[] evidence)
-  {
-    this.evidence = evidence;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/uniprot/UniprotEntry.java b/src/jalview/datamodel/xdb/uniprot/UniprotEntry.java
deleted file mode 100755 (executable)
index a3537c9..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.uniprot;
-
-import jalview.datamodel.PDBEntry;
-
-import java.util.Vector;
-
-/**
- * Data model for an entry returned from a Uniprot query
- * 
- * @see uniprot_mapping.xml
- */
-public class UniprotEntry
-{
-
-  UniprotSequence sequence;
-
-  Vector<String> name;
-
-  Vector<String> accession;
-
-  Vector<UniprotFeature> feature;
-
-  Vector<PDBEntry> dbrefs;
-
-  UniprotProteinName protName;
-
-  public void setAccession(Vector<String> items)
-  {
-    accession = items;
-  }
-
-  public void setFeature(Vector<UniprotFeature> items)
-  {
-    feature = items;
-  }
-
-  public Vector<UniprotFeature> getFeature()
-  {
-    return feature;
-  }
-
-  public Vector<String> getAccession()
-  {
-    return accession;
-  }
-
-  public void setProtein(UniprotProteinName names)
-  {
-    protName = names;
-  }
-
-  public UniprotProteinName getProtein()
-  {
-    return protName;
-  }
-
-  public void setName(Vector<String> na)
-  {
-    name = na;
-  }
-
-  public Vector<String> getName()
-  {
-    return name;
-  }
-
-  public UniprotSequence getUniprotSequence()
-  {
-    return sequence;
-  }
-
-  public void setUniprotSequence(UniprotSequence seq)
-  {
-    sequence = seq;
-  }
-
-  public Vector<PDBEntry> getDbReference()
-  {
-    return dbrefs;
-  }
-
-  public void setDbReference(Vector<PDBEntry> dbref)
-  {
-    this.dbrefs = dbref;
-  }
-
-}
diff --git a/src/jalview/datamodel/xdb/uniprot/UniprotFeature.java b/src/jalview/datamodel/xdb/uniprot/UniprotFeature.java
deleted file mode 100644 (file)
index b1ed275..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.uniprot;
-
-/**
- * A data model class for binding from Uniprot XML via uniprot_mapping.xml
- */
-public class UniprotFeature
-{
-  private String type;
-
-  private String description;
-
-  private String status;
-
-  private int begin;
-
-  private int end;
-
-  public String getType()
-  {
-    return type;
-  }
-
-  public void setType(String t)
-  {
-    this.type = t;
-  }
-
-  public String getDescription()
-  {
-    return description;
-  }
-
-  public void setDescription(String d)
-  {
-    this.description = d;
-  }
-
-  public String getStatus()
-  {
-    return status;
-  }
-
-  public void setStatus(String s)
-  {
-    this.status = s;
-  }
-
-  public int getBegin()
-  {
-    return begin;
-  }
-
-  public void setBegin(int b)
-  {
-    this.begin = b;
-  }
-
-  public int getEnd()
-  {
-    return end;
-  }
-
-  public void setEnd(int e)
-  {
-    this.end = e;
-  }
-
-  public int getPosition()
-  {
-    return begin;
-  }
-
-  public void setPosition(int p)
-  {
-    this.begin = p;
-    this.end = p;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/uniprot/UniprotFile.java b/src/jalview/datamodel/xdb/uniprot/UniprotFile.java
deleted file mode 100755 (executable)
index 9cc0391..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.uniprot;
-
-import java.util.Vector;
-
-/**
- * Data model of a retrieved Uniprot entry, as unmarshalled by Castor using a
- * binding file (uniprot_mapping.xml)
- */
-public class UniprotFile
-{
-  Vector<UniprotEntry> _items;
-
-  public void setUniprotEntries(Vector<UniprotEntry> items)
-  {
-    _items = items;
-  }
-
-  public Vector<UniprotEntry> getUniprotEntries()
-  {
-    return _items;
-  }
-}
diff --git a/src/jalview/datamodel/xdb/uniprot/UniprotProteinName.java b/src/jalview/datamodel/xdb/uniprot/UniprotProteinName.java
deleted file mode 100755 (executable)
index 2335e71..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.uniprot;
-
-import java.util.Vector;
-
-/**
- * Data model for protein name returned from a Uniprot query
- * 
- * Protein names are read from the Uniprot XML element
- * uniprot/entry/protein/recommendedName/fullName
- * 
- * @see uniprot_mapping.xml
- */
-public class UniprotProteinName
-{
-  private Vector<String> names;
-
-  public void setName(Vector<String> names)
-  {
-    this.names = names;
-  }
-
-  public Vector<String> getName()
-  {
-    return names;
-  }
-
-}
diff --git a/src/jalview/datamodel/xdb/uniprot/UniprotSequence.java b/src/jalview/datamodel/xdb/uniprot/UniprotSequence.java
deleted file mode 100755 (executable)
index bdba73f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.uniprot;
-
-/**
- * Data model for the sequence returned by a Uniprot query
- * 
- * @see uniprot_mapping.xml
- */
-public class UniprotSequence
-{
-  private String _content = "";
-
-  /**
-   * Sets the content string, omitting any space characters
-   * 
-   * @param seq
-   */
-  public void setContent(String seq)
-  {
-    if (seq != null)
-    {
-      StringBuilder sb = new StringBuilder(seq.length());
-      for (int i = 0; i < seq.length(); i++)
-      {
-        if (seq.charAt(i) != ' ')
-        {
-          sb.append(seq.charAt(i));
-        }
-      }
-      _content = sb.toString();
-    }
-  }
-
-  public String getContent()
-  {
-    return _content;
-  }
-
-}
index 952f01e..7384327 100644 (file)
 package jalview.ext.ensembl;
 
 import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
 import jalview.io.gff.SequenceOntologyFactory;
 import jalview.io.gff.SequenceOntologyI;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import com.stevesoft.pat.Regex;
 
 /**
@@ -109,23 +113,27 @@ public class EnsemblCdna extends EnsemblSeqProxy
   }
 
   /**
-   * Answers true if the sequence feature type is 'exon' (or a subtype of exon
-   * in the Sequence Ontology), and the Parent of the feature is the transcript
-   * we are retrieving
+   * Answers a list of sequence features (if any) whose type is 'exon' (or a
+   * subtype of exon in the Sequence Ontology), and whose Parent is the
+   * transcript we are retrieving
    */
   @Override
-  protected boolean identifiesSequence(SequenceFeature sf, String accId)
+  protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq,
+          String accId)
   {
-    if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
-            SequenceOntologyI.EXON))
+    List<SequenceFeature> result = new ArrayList<>();
+    List<SequenceFeature> sfs = seq.getFeatures()
+            .getFeaturesByOntology(SequenceOntologyI.EXON);
+    for (SequenceFeature sf : sfs)
     {
       String parentFeature = (String) sf.getValue(PARENT);
       if (("transcript:" + accId).equals(parentFeature))
       {
-        return true;
+        result.add(sf);
       }
     }
-    return false;
+
+    return result;
   }
 
   /**
index 8b2550d..8a71b64 100644 (file)
@@ -102,23 +102,26 @@ public class EnsemblCds extends EnsemblSeqProxy
   }
 
   /**
-   * Answers true if the sequence feature type is 'CDS' (or a subtype of CDS in
-   * the Sequence Ontology), and the Parent of the feature is the transcript we
-   * are retrieving
+   * Answers a list of sequence features (if any) whose type is 'CDS' (or a
+   * subtype of CDS in the Sequence Ontology), and whose Parent is the
+   * transcript we are retrieving
    */
   @Override
-  protected boolean identifiesSequence(SequenceFeature sf, String accId)
+  protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq,
+          String accId)
   {
-    if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
-            SequenceOntologyI.CDS))
+    List<SequenceFeature> result = new ArrayList<>();
+    List<SequenceFeature> sfs = seq.getFeatures()
+            .getFeaturesByOntology(SequenceOntologyI.CDS);
+    for (SequenceFeature sf : sfs)
     {
       String parentFeature = (String) sf.getValue(PARENT);
       if (("transcript:" + accId).equals(parentFeature))
       {
-        return true;
+        result.add(sf);
       }
     }
-    return false;
+    return result;
   }
 
   /**
@@ -130,7 +133,7 @@ public class EnsemblCds extends EnsemblSeqProxy
   protected List<int[]> getCdsRanges(SequenceI dnaSeq)
   {
     int len = dnaSeq.getLength();
-    List<int[]> ranges = new ArrayList<int[]>();
+    List<int[]> ranges = new ArrayList<>();
     ranges.add(new int[] { 1, len });
     return ranges;
   }
index cb6f548..582eac6 100644 (file)
@@ -22,9 +22,11 @@ package jalview.ext.ensembl;
 
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
+import jalview.io.DataSourceType;
 import jalview.io.FeaturesFile;
 import jalview.io.FileParse;
 
+import java.io.BufferedReader;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -84,12 +86,13 @@ class EnsemblFeatures extends EnsemblRestClient
     // TODO: use a vararg String... for getSequenceRecords instead?
     List<String> queries = new ArrayList<>();
     queries.add(query);
-    FileParse fp = getSequenceReader(queries);
-    if (fp == null || !fp.isValid())
+    BufferedReader fp = getSequenceReader(queries);
+    if (fp == null)
     {
       return null;
     }
-    FeaturesFile fr = new FeaturesFile(fp);
+    FeaturesFile fr = new FeaturesFile(
+            new FileParse(fp, null, DataSourceType.URL));
     return new Alignment(fr.getSeqsAsArray());
   }
 
@@ -140,13 +143,13 @@ class EnsemblFeatures extends EnsemblRestClient
    * describes the required encoding of the response.
    */
   @Override
-  protected String getRequestMimeType(boolean multipleIds)
+  protected String getRequestMimeType()
   {
     return "text/x-gff3";
   }
 
   /**
-   * Returns the MIME type for GFF3.
+   * Returns the MIME type for GFF3
    */
   @Override
   protected String getResponseMimeType()
index 7e6f653..36b19e2 100644 (file)
@@ -548,23 +548,27 @@ public class EnsemblGene extends EnsemblSeqProxy
   }
 
   /**
-   * Answers true for a feature of type 'gene' (or a sub-type of gene in the
-   * Sequence Ontology), whose ID is the accession we are retrieving
+   * Answers a list of sequence features (if any) whose type is 'gene' (or a
+   * subtype of gene in the Sequence Ontology), and whose ID is the accession we
+   * are retrieving
    */
   @Override
-  protected boolean identifiesSequence(SequenceFeature sf, String accId)
+  protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq,
+          String accId)
   {
-    if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
-            SequenceOntologyI.GENE))
+    List<SequenceFeature> result = new ArrayList<>();
+    List<SequenceFeature> sfs = seq.getFeatures()
+            .getFeaturesByOntology(SequenceOntologyI.GENE);
+    for (SequenceFeature sf : sfs)
     {
       // NB features as gff use 'ID'; rest services return as 'id'
       String id = (String) sf.getValue("ID");
       if ((GENE_PREFIX + accId).equalsIgnoreCase(id))
       {
-        return true;
+        result.add(sf);
       }
     }
-    return false;
+    return result;
   }
 
   /**
@@ -595,17 +599,6 @@ public class EnsemblGene extends EnsemblSeqProxy
   }
 
   /**
-   * Answers false. This allows an optimisation - a single 'gene' feature is all
-   * that is needed to identify the positions of the gene on the genomic
-   * sequence.
-   */
-  @Override
-  protected boolean isSpliceable()
-  {
-    return false;
-  }
-
-  /**
    * Override to do nothing as Ensembl doesn't return a protein sequence for a
    * gene identifier
    */
index bde3c0f..6684e20 100644 (file)
 package jalview.ext.ensembl;
 
 import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.io.gff.SequenceOntologyI;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A client to fetch genomic sequence from Ensembl
@@ -94,22 +99,32 @@ public class EnsemblGenome extends EnsemblSeqProxy
   }
 
   /**
-   * Answers true if the sequence feature type is 'transcript' (or a subtype of
-   * transcript in the Sequence Ontology), and the ID of the feature is the
-   * transcript we are retrieving
+   * Answers a list of sequence features (if any) whose type is 'transcript' (or
+   * a subtype of transcript in the Sequence Ontology), and whose ID is the
+   * accession we are retrieving.
+   * <p>
+   * Note we also include features of type "NMD_transcript_variant", although
+   * not strictly 'transcript' in the SO, as they used in Ensembl as if they
+   * were.
    */
   @Override
-  protected boolean identifiesSequence(SequenceFeature sf, String accId)
+  protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq,
+          String accId)
   {
-    if (isTranscript(sf.getType()))
+    List<SequenceFeature> result = new ArrayList<>();
+    List<SequenceFeature> sfs = seq.getFeatures().getFeaturesByOntology(
+            SequenceOntologyI.TRANSCRIPT,
+            SequenceOntologyI.NMD_TRANSCRIPT_VARIANT);
+    for (SequenceFeature sf : sfs)
     {
+      // NB features as gff use 'ID'; rest services return as 'id'
       String id = (String) sf.getValue("ID");
       if (("transcript:" + accId).equals(id))
       {
-        return true;
+        result.add(sf);
       }
     }
-    return false;
+    return result;
   }
 
 }
index 37dff51..fa24f1e 100644 (file)
@@ -61,18 +61,6 @@ public class EnsemblInfo extends EnsemblRestClient
     return true;
   }
 
-  @Override
-  protected String getRequestMimeType(boolean multipleIds)
-  {
-    return "application/json";
-  }
-
-  @Override
-  protected String getResponseMimeType()
-  {
-    return "application/json";
-  }
-
   /**
    * Answers the domain (http://rest.ensembl.org or
    * http://rest.ensemblgenomes.org) for the given division, or null if not
index 5f353f8..c6b794a 100644 (file)
@@ -117,21 +117,9 @@ public class EnsemblLookup extends EnsemblRestClient
     return true;
   }
 
-  @Override
-  protected String getRequestMimeType(boolean multipleIds)
-  {
-    return "application/json";
-  }
-
-  @Override
-  protected String getResponseMimeType()
-  {
-    return "application/json";
-  }
-
   /**
    * Returns the gene id related to the given identifier (which may be for a
-   * gene, transcript or protein)
+   * gene, transcript or protein), or null if none is found
    * 
    * @param identifier
    * @return
@@ -143,7 +131,7 @@ public class EnsemblLookup extends EnsemblRestClient
 
   /**
    * Returns the gene id related to the given identifier (which may be for a
-   * gene, transcript or protein)
+   * gene, transcript or protein), or null if none is found
    * 
    * @param identifier
    * @param objectType
@@ -165,6 +153,10 @@ public class EnsemblLookup extends EnsemblRestClient
    */
   protected String parseGeneId(JSONObject val)
   {
+    if (val == null)
+    {
+      return null;
+    }
     String geneId = null;
     String type = val.get(OBJECT_TYPE).toString();
     if (OBJECT_TYPE_GENE.equalsIgnoreCase(type))
index 56657e0..f01bd4f 100644 (file)
@@ -98,18 +98,6 @@ public class EnsemblMap extends EnsemblRestClient
   }
 
   @Override
-  protected String getRequestMimeType(boolean multipleIds)
-  {
-    return "application/json";
-  }
-
-  @Override
-  protected String getResponseMimeType()
-  {
-    return "application/json";
-  }
-
-  @Override
   protected URL getUrl(List<String> ids) throws MalformedURLException
   {
     return null; // not used
@@ -257,7 +245,10 @@ public class EnsemblMap extends EnsemblRestClient
       {
         url = getIdMapUrl(domain, accession, start, end, cdsOrCdna);
         br = getHttpResponse(url, null);
-        return (parseIdMappingResponse(br, accession, domain));
+        if (br != null)
+        {
+          return (parseIdMappingResponse(br, accession, domain));
+        }
       }
       return null;
     } catch (Throwable t)
index 99006aa..0280f16 100644 (file)
@@ -22,6 +22,10 @@ package jalview.ext.ensembl;
 
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+
+import java.util.ArrayList;
+import java.util.List;
 
 import com.stevesoft.pat.Regex;
 
@@ -106,10 +110,10 @@ public class EnsemblProtein extends EnsemblSeqProxy
   }
 
   @Override
-  protected boolean identifiesSequence(SequenceFeature sf, String accId)
+  protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq,
+          String accId)
   {
-    // not applicable - protein sequence is not a 'subset' of genomic sequence
-    return false;
+    return new ArrayList<>();
   }
 
   @Override
index 9dea886..9e01cc4 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.ext.ensembl;
 
-import jalview.io.DataSourceType;
-import jalview.io.FileParse;
 import jalview.util.StringUtils;
 
 import java.io.BufferedReader;
@@ -66,17 +64,14 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
    * @see https://github.com/Ensembl/ensembl-rest/wiki/Change-log
    * @see http://rest.ensembl.org/info/rest?content-type=application/json
    */
-  private static final String LATEST_ENSEMBLGENOMES_REST_VERSION = "6.0";
+  private static final String LATEST_ENSEMBLGENOMES_REST_VERSION = "7.0";
 
-  private static final String LATEST_ENSEMBL_REST_VERSION = "6.1";
+  private static final String LATEST_ENSEMBL_REST_VERSION = "7.0";
 
   private static final String REST_CHANGE_LOG = "https://github.com/Ensembl/ensembl-rest/wiki/Change-log";
 
   private static Map<String, EnsemblData> domainData;
 
-  // @see https://github.com/Ensembl/ensembl-rest/wiki/Output-formats
-  private static final String PING_URL = "http://rest.ensembl.org/info/ping.json";
-
   private final static long AVAILABILITY_RETEST_INTERVAL = 10000L; // 10 seconds
 
   private final static long VERSION_RETEST_INTERVAL = 1000L * 3600; // 1 hr
@@ -156,22 +151,28 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
   protected abstract boolean useGetRequest();
 
   /**
-   * Return the desired value for the Content-Type request header
-   * 
-   * @param multipleIds
+   * Returns the desired value for the Content-Type request header. Default is
+   * application/json, override if required to vary this.
    * 
    * @return
    * @see https://github.com/Ensembl/ensembl-rest/wiki/HTTP-Headers
    */
-  protected abstract String getRequestMimeType(boolean multipleIds);
+  protected String getRequestMimeType()
+  {
+    return "application/json";
+  }
 
   /**
-   * Return the desired value for the Accept request header
+   * Return the desired value for the Accept request header. Default is
+   * application/json, override if required to vary this.
    * 
    * @return
    * @see https://github.com/Ensembl/ensembl-rest/wiki/HTTP-Headers
    */
-  protected abstract String getResponseMimeType();
+  protected String getResponseMimeType()
+  {
+    return "application/json";
+  }
 
   /**
    * Checks Ensembl's REST 'ping' endpoint, and returns true if response
@@ -225,25 +226,20 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
   }
 
   /**
-   * returns a reader to a Fasta response from the Ensembl sequence endpoint
+   * Returns a reader to a (Json) response from the Ensembl sequence endpoint.
+   * If the request failed the return value may be null.
    * 
    * @param ids
    * @return
    * @throws IOException
    */
-  protected FileParse getSequenceReader(List<String> ids) throws IOException
+  protected BufferedReader getSequenceReader(List<String> ids)
+          throws IOException
   {
     URL url = getUrl(ids);
 
     BufferedReader reader = getHttpResponse(url, ids);
-    if (reader == null)
-    {
-      // request failed
-      return null;
-    }
-    FileParse fp = new FileParse(reader, url.toString(),
-            DataSourceType.URL);
-    return fp;
+    return reader;
   }
 
   /**
@@ -262,7 +258,8 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
   }
 
   /**
-   * Sends the HTTP request and gets the response as a reader
+   * Sends the HTTP request and gets the response as a reader. Returns null if
+   * the HTTP response code was not 200.
    * 
    * @param url
    * @param ids
@@ -271,7 +268,6 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
    *          in milliseconds
    * @return
    * @throws IOException
-   *           if response code was not 200, or other I/O error
    */
   protected BufferedReader getHttpResponse(URL url, List<String> ids,
           int readTimeout) throws IOException
@@ -335,8 +331,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher
     boolean multipleIds = ids != null && ids.size() > 1;
     connection.setRequestMethod(
             multipleIds ? HttpMethod.POST : HttpMethod.GET);
-    connection.setRequestProperty("Content-Type",
-            getRequestMimeType(multipleIds));
+    connection.setRequestProperty("Content-Type", getRequestMimeType());
     connection.setRequestProperty("Accept", getResponseMimeType());
 
     connection.setUseCaches(false);
index 9229379..7b448fd 100644 (file)
@@ -28,12 +28,11 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
 import jalview.datamodel.Mapping;
+import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.features.SequenceFeatures;
 import jalview.exceptions.JalviewException;
-import jalview.io.FastaFile;
-import jalview.io.FileParse;
 import jalview.io.gff.Gff3Helper;
 import jalview.io.gff.SequenceOntologyFactory;
 import jalview.io.gff.SequenceOntologyI;
@@ -42,6 +41,7 @@ import jalview.util.DBRefUtils;
 import jalview.util.IntRangeComparator;
 import jalview.util.MapList;
 
+import java.io.BufferedReader;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -50,6 +50,10 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
 /**
  * Base class for Ensembl sequence fetchers
  * 
@@ -385,50 +389,44 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
       inProgress = false;
       throw new JalviewException("ENSEMBL Rest API not available.");
     }
-    FileParse fp = getSequenceReader(ids);
-    if (fp == null)
+    BufferedReader br = getSequenceReader(ids);
+    if (br == null)
     {
       return alignment;
     }
 
-    FastaFile fr = new FastaFile(fp);
-    if (fr.hasWarningMessage())
+    List<SequenceI> seqs = parseSequenceJson(br);
+
+    if (seqs.isEmpty())
     {
-      System.out.println(
-              String.format("Warning when retrieving %d ids %s\n%s",
-                      ids.size(), ids.toString(), fr.getWarningMessage()));
+      throw new IOException("No data returned for " + ids);
     }
-    else if (fr.getSeqs().size() != ids.size())
+
+    if (seqs.size() != ids.size())
     {
       System.out.println(String.format(
               "Only retrieved %d sequences for %d query strings",
-              fr.getSeqs().size(), ids.size()));
+              seqs.size(), ids.size()));
     }
 
-    if (fr.getSeqs().size() == 1 && fr.getSeqs().get(0).getLength() == 0)
+    if (!seqs.isEmpty())
     {
-      /*
-       * POST request has returned an empty FASTA file e.g. for invalid id
-       */
-      throw new IOException("No data returned for " + ids);
-    }
-
-    if (fr.getSeqs().size() > 0)
-    {
-      AlignmentI seqal = new Alignment(fr.getSeqsAsArray());
-      for (SequenceI sq : seqal.getSequences())
+      AlignmentI seqal = new Alignment(
+              seqs.toArray(new SequenceI[seqs.size()]));
+      for (SequenceI seq : seqs)
       {
-        if (sq.getDescription() == null)
+        if (seq.getDescription() == null)
         {
-          sq.setDescription(getDbName());
+          seq.setDescription(getDbName());
         }
-        String name = sq.getName();
+        String name = seq.getName();
         if (ids.contains(name)
                 || ids.contains(name.replace("ENSP", "ENST")))
         {
-          DBRefEntry dbref = DBRefUtils.parseToDbRef(sq, getDbSource(),
+          // TODO JAL-3077 use true accession version in dbref
+          DBRefEntry dbref = DBRefUtils.parseToDbRef(seq, getDbSource(),
                   getEnsemblDataVersion(), name);
-          sq.addDBRef(dbref);
+          seq.addDBRef(dbref);
         }
       }
       if (alignment == null)
@@ -444,6 +442,49 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
   }
 
   /**
+   * Parses a JSON response for a single sequence ID query
+   * 
+   * @param br
+   * @return a single jalview.datamodel.Sequence
+   * @see http://rest.ensembl.org/documentation/info/sequence_id
+   */
+  protected List<SequenceI> parseSequenceJson(BufferedReader br)
+  {
+    JSONParser jp = new JSONParser();
+    List<SequenceI> result = new ArrayList<>();
+    try
+    {
+      /*
+       * for now, assumes only one sequence returned; refactor if needed
+       * in future to handle a JSONArray with more than one
+       */
+      final JSONObject val = (JSONObject) jp.parse(br);
+      Object s = val.get("desc");
+      String desc = s == null ? null : s.toString();
+      s = val.get("id");
+      String id = s == null ? null : s.toString();
+      s = val.get("seq");
+      String seq = s == null ? null : s.toString();
+      Sequence sequence = new Sequence(id, seq);
+      if (desc != null)
+      {
+        sequence.setDescription(desc);
+      }
+      // todo JAL-3077 make a DBRefEntry with true accession version
+      // s = val.get("version");
+      // String version = s == null ? "0" : s.toString();
+      // DBRefEntry dbref = new DBRefEntry(getDbSource(), version, id);
+      // sequence.addDBRef(dbref);
+      result.add(sequence);
+    } catch (ParseException | IOException e)
+    {
+      System.err.println("Error processing JSON response: " + e.toString());
+      // ignore
+    }
+    return result;
+  }
+
+  /**
    * Returns the URL for the REST call
    * 
    * @return
@@ -464,7 +505,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
     }
     // @see https://github.com/Ensembl/ensembl-rest/wiki/Output-formats
     urlstring.append("?type=").append(getSourceEnsemblType().getType());
-    urlstring.append(("&Accept=text/x-fasta"));
+    urlstring.append(("&Accept=application/json"));
+    urlstring.append(("&Content-Type=application/json"));
 
     String objectType = getObjectType();
     if (objectType != null)
@@ -504,18 +546,6 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
     return false;
   }
 
-  @Override
-  protected String getRequestMimeType(boolean multipleIds)
-  {
-    return multipleIds ? "application/json" : "text/x-fasta";
-  }
-
-  @Override
-  protected String getResponseMimeType()
-  {
-    return "text/x-fasta";
-  }
-
   /**
    * 
    * @return the configured sequence return type for this source
@@ -551,8 +581,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
   protected MapList getGenomicRangesFromFeatures(SequenceI sourceSequence,
           String accId, int start)
   {
-    List<SequenceFeature> sfs = sourceSequence.getFeatures()
-            .getPositionalFeatures();
+    List<SequenceFeature> sfs = getIdentifyingFeatures(sourceSequence,
+            accId);
     if (sfs.isEmpty())
     {
       return null;
@@ -569,47 +599,31 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
 
     for (SequenceFeature sf : sfs)
     {
+      int strand = sf.getStrand();
+      strand = strand == 0 ? 1 : strand; // treat unknown as forward
+
+      if (directionSet && strand != direction)
+      {
+        // abort - mix of forward and backward
+        System.err
+                .println("Error: forward and backward strand for " + accId);
+        return null;
+      }
+      direction = strand;
+      directionSet = true;
+
       /*
-       * accept the target feature type or a specialisation of it
-       * (e.g. coding_exon for exon)
+       * add to CDS ranges, semi-sorted forwards/backwards
        */
-      if (identifiesSequence(sf, accId))
+      if (strand < 0)
       {
-        int strand = sf.getStrand();
-        strand = strand == 0 ? 1 : strand; // treat unknown as forward
-
-        if (directionSet && strand != direction)
-        {
-          // abort - mix of forward and backward
-          System.err.println(
-                  "Error: forward and backward strand for " + accId);
-          return null;
-        }
-        direction = strand;
-        directionSet = true;
-
-        /*
-         * add to CDS ranges, semi-sorted forwards/backwards
-         */
-        if (strand < 0)
-        {
-          regions.add(0, new int[] { sf.getEnd(), sf.getBegin() });
-        }
-        else
-        {
-          regions.add(new int[] { sf.getBegin(), sf.getEnd() });
-        }
-        mappedLength += Math.abs(sf.getEnd() - sf.getBegin() + 1);
-
-        if (!isSpliceable())
-        {
-          /*
-           * 'gene' sequence is contiguous so we can stop as soon as its
-           * identifying feature has been found
-           */
-          break;
-        }
+        regions.add(0, new int[] { sf.getEnd(), sf.getBegin() });
+      }
+      else
+      {
+        regions.add(new int[] { sf.getBegin(), sf.getEnd() });
       }
+      mappedLength += Math.abs(sf.getEnd() - sf.getBegin() + 1);
     }
 
     if (regions.isEmpty())
@@ -634,26 +648,18 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient
   }
 
   /**
-   * Answers true if the sequence being retrieved may occupy discontiguous
-   * regions on the genomic sequence.
-   */
-  protected boolean isSpliceable()
-  {
-    return true;
-  }
-
-  /**
-   * Returns true if the sequence feature marks positions of the genomic
+   * Answers a list of sequence features that mark positions of the genomic
    * sequence feature which are within the sequence being retrieved. For
    * example, an 'exon' feature whose parent is the target transcript marks the
-   * cdna positions of the transcript.
+   * cdna positions of the transcript. For a gene sequence, this is trivially
+   * just the 'gene' feature with matching gene id.
    * 
-   * @param sf
+   * @param seq
    * @param accId
    * @return
    */
-  protected abstract boolean identifiesSequence(SequenceFeature sf,
-          String accId);
+  protected abstract List<SequenceFeature> getIdentifyingFeatures(
+          SequenceI seq, String accId);
 
   /**
    * Transfers the sequence feature to the target sequence, locating its start
index 27c448e..77768a6 100644 (file)
@@ -88,18 +88,6 @@ class EnsemblXref extends EnsemblRestClient
     return true;
   }
 
-  @Override
-  protected String getRequestMimeType(boolean multipleIds)
-  {
-    return "application/json";
-  }
-
-  @Override
-  protected String getResponseMimeType()
-  {
-    return "application/json";
-  }
-
   /**
    * Calls the Ensembl xrefs REST endpoint and retrieves any cross-references
    * ("primary_id") for the given identifier (Ensembl accession id) and database
@@ -113,8 +101,8 @@ class EnsemblXref extends EnsemblRestClient
    */
   public List<DBRefEntry> getCrossReferences(String identifier)
   {
-    List<DBRefEntry> result = new ArrayList<DBRefEntry>();
-    List<String> ids = new ArrayList<String>();
+    List<DBRefEntry> result = new ArrayList<>();
+    List<String> ids = new ArrayList<>();
     ids.add(identifier);
 
     BufferedReader br = null;
@@ -163,7 +151,7 @@ class EnsemblXref extends EnsemblRestClient
           throws IOException
   {
     JSONParser jp = new JSONParser();
-    List<DBRefEntry> result = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> result = new ArrayList<>();
     try
     {
       JSONArray responses = (JSONArray) jp.parse(br);
index 41bc116..8832278 100644 (file)
@@ -478,6 +478,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
     lastCommand = command;
   }
 
+  Thread colourby = null;
   /**
    * Sends a set of colour commands to the structure viewer
    * 
@@ -485,15 +486,28 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
    */
   @Override
   protected void colourBySequence(
-          StructureMappingcommandSet[] colourBySequenceCommands)
+          final StructureMappingcommandSet[] colourBySequenceCommands)
   {
-    for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+    if (colourby != null)
     {
-      for (String cbyseq : cpdbbyseq.commands)
+      colourby.interrupt();
+      colourby = null;
+    }
+    colourby = new Thread(new Runnable()
+    {
+      @Override
+      public void run()
       {
-        executeWhenReady(cbyseq);
+        for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+        {
+          for (String cbyseq : cpdbbyseq.commands)
+          {
+            executeWhenReady(cbyseq);
+          }
+        }
       }
-    }
+    });
+    colourby.start();
   }
 
   /**
@@ -862,19 +876,30 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
       try
       {
         // recover PDB filename for the model hovered over.
-        int _mp = _modelFileNameMap.length - 1,
-                mnumber = new Integer(mdlId).intValue() - 1;
-        while (mnumber < _modelFileNameMap[_mp])
+        int mnumber = new Integer(mdlId).intValue() - 1;
+        if (_modelFileNameMap != null)
         {
-          _mp--;
+          int _mp = _modelFileNameMap.length - 1;
+
+          while (mnumber < _modelFileNameMap[_mp])
+          {
+            _mp--;
+          }
+          pdbfilename = modelFileNames[_mp];
         }
-        pdbfilename = modelFileNames[_mp];
-        if (pdbfilename == null)
+        else
         {
-          pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
-                  .getAbsolutePath();
-        }
+          if (mnumber >= 0 && mnumber < modelFileNames.length)
+          {
+            pdbfilename = modelFileNames[mnumber];
+          }
 
+          if (pdbfilename == null)
+          {
+            pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
+                    .getAbsolutePath();
+          }
+        }
       } catch (Exception e)
       {
       }
index dc3d0ee..2a510a2 100644 (file)
@@ -28,7 +28,6 @@ import jalview.io.DataSourceType;
 import jalview.io.FileParse;
 import jalview.io.StructureFile;
 import jalview.schemes.ResidueProperties;
-import jalview.structure.StructureImportSettings;
 import jalview.util.Format;
 import jalview.util.MessageManager;
 
@@ -60,6 +59,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener
 {
   Viewer viewer = null;
 
+  public JmolParser(boolean immediate, String inFile,
+          DataSourceType sourceType) throws IOException
+  {
+    super(immediate, inFile, sourceType);
+  }
+
   public JmolParser(String inFile, DataSourceType sourceType)
           throws IOException
   {
@@ -183,7 +188,11 @@ public class JmolParser extends StructureFile implements JmolStatusListener
         }
         lastID = tmpatom.resNumIns.trim();
       }
-      xferSettings();
+      if (isParseImmediately())
+      {
+        // configure parsing settings from the static singleton
+        xferSettings();
+      }
 
       makeResidueList();
       makeCaBondList();
@@ -200,7 +209,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener
           prot.add(chainseq);
         }
 
-        if (StructureImportSettings.isProcessSecondaryStructure())
+        // look at local setting for adding secondary tructure
+        if (predictSecondaryStructure)
         {
           createAnnotation(chainseq, chain, ms.at);
         }
index 076e212..f94d455 100644 (file)
@@ -284,7 +284,8 @@ public abstract class FTSRestClient implements FTSRestClientI
               public boolean equals(Object otherObject)
               {
                 FTSDataColumnI that = (FTSDataColumnI) otherObject;
-                return this.getCode().equals(that.getCode())
+                return otherObject == null ? false
+                        : this.getCode().equals(that.getCode())
                         && this.getName().equals(that.getName())
                         && this.getGroup().equals(that.getGroup());
               }
index 5d698c0..477db0c 100644 (file)
@@ -733,9 +733,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     int aSize = alignPanels.size();
 
-    tabbedPane.setVisible(aSize > 1 || ap.av.viewName != null);
+    tabbedPane.setVisible(aSize > 1 || ap.av.getViewName() != null);
 
-    if (aSize == 1 && ap.av.viewName == null)
+    if (aSize == 1 && ap.av.getViewName() == null)
     {
       this.getContentPane().add(ap, BorderLayout.CENTER);
     }
@@ -748,7 +748,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       expandViews.setEnabled(true);
       gatherViews.setEnabled(true);
-      tabbedPane.addTab(ap.av.viewName, ap);
+      tabbedPane.addTab(ap.av.getViewName(), ap);
 
       ap.setVisible(false);
     }
@@ -771,7 +771,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     gatherViews.setEnabled(true);
     tabbedPane.setVisible(true);
     AlignmentPanel first = alignPanels.get(0);
-    tabbedPane.addTab(first.av.viewName, first);
+    tabbedPane.addTab(first.av.getViewName(), first);
     this.getContentPane().add(tabbedPane, BorderLayout.CENTER);
   }
 
@@ -872,7 +872,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    * @param av
    *          AlignViewport
    */
-  void setMenusFromViewport(AlignViewport av)
+  public void setMenusFromViewport(AlignViewport av)
   {
     padGapsMenuitem.setSelected(av.isPadGaps());
     colourTextMenuItem.setSelected(av.isShowColourText());
@@ -1154,7 +1154,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 shortName.lastIndexOf(java.io.File.separatorChar) + 1);
       }
 
-      success = new Jalview2XML().saveAlignment(this, file, shortName);
+      success = new jalview.project.Jalview2XML().saveAlignment(this, file,
+              shortName);
 
       statusBar.setText(MessageManager.formatMessage(
               "label.successfully_saved_to_file_in_format", new Object[]
@@ -2701,7 +2702,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     /*
      * Create a new AlignmentPanel (with its own, new Viewport)
      */
-    AlignmentPanel newap = new Jalview2XML().copyAlignPanel(alignPanel);
+    AlignmentPanel newap = new jalview.project.Jalview2XML()
+            .copyAlignPanel(alignPanel);
     if (!copyAnnotation)
     {
       /*
@@ -2713,10 +2715,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     newap.av.setGatherViewsHere(false);
 
-    if (viewport.viewName == null)
+    if (viewport.getViewName() == null)
     {
-      viewport.viewName = MessageManager
-              .getString("label.view_name_original");
+      viewport.setViewName(MessageManager
+              .getString("label.view_name_original"));
     }
 
     /*
@@ -2740,7 +2742,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       newap.refresh(true); // adjust layout of annotations
     }
 
-    newap.av.viewName = getNewViewName(viewTitle);
+    newap.av.setViewName(getNewViewName(viewTitle));
 
     addAlignmentPanel(newap, true);
     newap.alignmentChanged();
@@ -2803,9 +2805,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       if (comp instanceof AlignmentPanel)
       {
         AlignmentPanel ap = (AlignmentPanel) comp;
-        if (!existingNames.contains(ap.av.viewName))
+        if (!existingNames.contains(ap.av.getViewName()))
         {
-          existingNames.add(ap.av.viewName);
+          existingNames.add(ap.av.getViewName());
         }
       }
     }
@@ -3260,6 +3262,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 alignPanel.setOverviewPanel(null);
               };
             });
+    if (getKeyListeners().length > 0)
+    {
+      frame.addKeyListener(getKeyListeners()[0]);
+    }
 
     alignPanel.setOverviewPanel(overview);
   }
@@ -3593,9 +3599,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     frameTitle += " from ";
 
-    if (viewport.viewName != null)
+    if (viewport.getViewName() != null)
     {
-      frameTitle += viewport.viewName + " of ";
+      frameTitle += viewport.getViewName() + " of ";
     }
 
     frameTitle += this.title;
@@ -4460,17 +4466,21 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             int assocfiles = 0;
             if (filesmatched.size() > 0)
             {
-              if (Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false)
-                      || JvOptionPane.showConfirmDialog(thisaf,
-                              MessageManager.formatMessage(
-                                      "label.automatically_associate_structure_files_with_sequences_same_name",
-                                      new Object[]
-                                      { Integer.valueOf(filesmatched.size())
-                                              .toString() }),
-                              MessageManager.getString(
-                                      "label.automatically_associate_structure_files_by_name"),
-                              JvOptionPane.YES_NO_OPTION) == JvOptionPane.YES_OPTION)
-
+              boolean autoAssociate = Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false);
+              if (!autoAssociate)
+              {
+                String msg = MessageManager.formatMessage(
+                        "label.automatically_associate_structure_files_with_sequences_same_name",
+                        new Object[]
+                        { Integer.valueOf(filesmatched.size())
+                                .toString() });
+                String ttl = MessageManager.getString(
+                        "label.automatically_associate_structure_files_by_name");
+                int choice = JvOptionPane.showConfirmDialog(thisaf, msg,
+                        ttl, JvOptionPane.YES_NO_OPTION);
+                autoAssociate = choice == JvOptionPane.YES_OPTION;
+              }
+              if (autoAssociate)
               {
                 for (Object[] fm : filesmatched)
                 {
@@ -4496,6 +4506,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   alignPanel.paintAlignment(true, false);
                 }
               }
+              else
+              {
+                /*
+                 * add declined structures as sequences
+                 */
+                for (Object[] o : filesmatched)
+                {
+                  filesnotmatched.add((String) o[0]);
+                }
+              }
             }
             if (filesnotmatched.size() > 0)
             {
@@ -4749,7 +4769,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       if (reply != null)
       {
-        viewport.viewName = reply;
+        viewport.setViewName(reply);
         // TODO warn if reply is in getExistingViewNames()?
         tabbedPane.setTitleAt(tabbedPane.getSelectedIndex(), reply);
       }
@@ -5287,6 +5307,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     if (avc.createGroup())
     {
+      if (applyAutoAnnotationSettings.isSelected())
+      {
+        alignPanel.updateAnnotation(true, false);
+      }
       alignPanel.alignmentChanged();
     }
   }
@@ -5377,7 +5401,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public List<? extends AlignmentViewPanel> getAlignPanels()
   {
-    return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels;
+    // alignPanels is never null
+    // return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels;
+    return alignPanels;
   }
 
   /**
index 7e77bec..cc533ce 100644 (file)
@@ -79,7 +79,7 @@ public class AlignViewport extends AlignmentViewport
 
   private Rectangle explodedGeometry;
 
-  String viewName;
+  private String viewName;
 
   /*
    * Flag set true on the view that should 'gather' multiple views of the same
@@ -1032,4 +1032,14 @@ public class AlignViewport extends AlignmentViewport
     }
     fr.setTransparency(featureSettings.getTransparency());
   }
+
+  public String getViewName()
+  {
+    return viewName;
+  }
+
+  public void setViewName(String viewName)
+  {
+    this.viewName = viewName;
+  }
 }
index f5634d2..c03b56d 100644 (file)
@@ -37,7 +37,6 @@ import jalview.schemes.ResidueProperties;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.Comparison;
 import jalview.util.MessageManager;
-import jalview.util.Platform;
 import jalview.viewmodel.ViewportListenerI;
 import jalview.viewmodel.ViewportRanges;
 
@@ -48,7 +47,7 @@ import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.FontMetrics;
 import java.awt.Graphics;
-import java.awt.Insets;
+import java.awt.Graphics2D;
 import java.awt.event.AdjustmentEvent;
 import java.awt.event.AdjustmentListener;
 import java.awt.event.ComponentAdapter;
@@ -547,40 +546,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
   protected void validateAnnotationDimensions(boolean adjustPanelHeight)
   {
     int annotationHeight = getAnnotationPanel().adjustPanelHeight();
+    annotationHeight = getAnnotationPanel()
+            .adjustForAlignFrame(adjustPanelHeight, annotationHeight);
 
-    if (adjustPanelHeight)
-    {
-      int rowHeight = av.getCharHeight();
-      int alignmentHeight = rowHeight * av.getAlignment().getHeight();
-
-      /*
-       * Estimate available height in the AlignFrame for alignment +
-       * annotations. Deduct an estimate for title bar, menu bar, scale panel,
-       * hscroll, status bar (as these are not laid out we can't inspect their
-       * actual heights). Insets gives frame borders.
-       */
-      int stuff = Platform.isAMac() ? 80 : 100;
-      Insets insets = alignFrame.getInsets();
-      int availableHeight = alignFrame.getHeight() - stuff - insets.top
-              - insets.bottom;
-
-      /*
-       * If not enough vertical space, maximize annotation height while keeping
-       * at least two rows of alignment visible
-       */
-      if (annotationHeight + alignmentHeight > availableHeight)
-      {
-        annotationHeight = Math.min(annotationHeight,
-                availableHeight - 2 * rowHeight);
-      }
-    }
-    else
-    {
-      // maintain same window layout whilst updating sliders
-      annotationHeight = annotationScroller.getSize().height;
-    }
     hscroll.addNotify();
-
     annotationScroller.setPreferredSize(
             new Dimension(annotationScroller.getWidth(), annotationHeight));
 
@@ -619,6 +588,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     {
       annotationScroller.setVisible(true);
       annotationSpaceFillerHolder.setVisible(true);
+      validateAnnotationDimensions(false);
     }
 
     int canvasWidth = getSeqPanel().seqCanvas.getWidth();
@@ -946,30 +916,16 @@ public class AlignmentPanel extends GAlignmentPanel implements
   }
 
   /**
-   * DOCUMENT ME!
-   * 
-   * @param pg
-   *          DOCUMENT ME!
-   * @param pwidth
-   *          DOCUMENT ME!
-   * @param pheight
-   *          DOCUMENT ME!
-   * @param pi
-   *          DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   * 
-   * @throws PrinterException
-   *           DOCUMENT ME!
-   */
-  /**
    * Draws the alignment image, including sequence ids, sequences, and
    * annotation labels and annotations if shown, on either one or two Graphics
-   * context.
+   * contexts.
    * 
    * @param pageWidth
+   *          in pixels
    * @param pageHeight
-   * @param pi
+   *          in pixels
+   * @param pageIndex
+   *          (0, 1, ...)
    * @param idGraphics
    *          the graphics context for sequence ids and annotation labels
    * @param alignmentGraphics
@@ -978,7 +934,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    * @return
    * @throws PrinterException
    */
-  public int printUnwrapped(int pageWidth, int pageHeight, int pi,
+  public int printUnwrapped(int pageWidth, int pageHeight, int pageIndex,
           Graphics idGraphics, Graphics alignmentGraphics)
           throws PrinterException
   {
@@ -992,8 +948,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
             : idWidth;
 
     FontMetrics fm = getFontMetrics(av.getFont());
-    int charHeight = av.getCharHeight();
-    int scaleHeight = charHeight + fm.getDescent();
+    final int charHeight = av.getCharHeight();
+    final int scaleHeight = charHeight + fm.getDescent();
 
     idGraphics.setColor(Color.white);
     idGraphics.fillRect(0, 0, pageWidth, pageHeight);
@@ -1002,29 +958,20 @@ public class AlignmentPanel extends GAlignmentPanel implements
     /*
      * How many sequences and residues can we fit on a printable page?
      */
-    int totalRes = (pageWidth - idWidth) / av.getCharWidth();
+    final int totalRes = (pageWidth - idWidth) / av.getCharWidth();
 
-    int totalSeq = (pageHeight - scaleHeight) / charHeight - 1;
+    final int totalSeq = (pageHeight - scaleHeight) / charHeight - 1;
 
-    int alignmentWidth = av.getAlignment().getWidth();
-    int pagesWide = (alignmentWidth / totalRes) + 1;
+    final int alignmentWidth = av.getAlignment().getWidth();
+    final int pagesWide = (alignmentWidth / totalRes) + 1;
 
-    final int startRes = (pi % pagesWide) * totalRes;
-    int endRes = (startRes + totalRes) - 1;
+    final int startRes = (pageIndex % pagesWide) * totalRes;
+    final int endRes = Math.min(startRes + totalRes - 1,
+            alignmentWidth - 1);
 
-    if (endRes > (alignmentWidth - 1))
-    {
-      endRes = alignmentWidth - 1;
-    }
-
-    final int startSeq = (pi / pagesWide) * totalSeq;
-    int endSeq = startSeq + totalSeq;
-
-    int alignmentHeight = av.getAlignment().getHeight();
-    if (endSeq > alignmentHeight)
-    {
-      endSeq = alignmentHeight;
-    }
+    final int startSeq = (pageIndex / pagesWide) * totalSeq;
+    final int alignmentHeight = av.getAlignment().getHeight();
+    final int endSeq = Math.min(startSeq + totalSeq, alignmentHeight);
 
     int pagesHigh = ((alignmentHeight / totalSeq) + 1) * pageHeight;
 
@@ -1035,7 +982,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     pagesHigh /= pageHeight;
 
-    if (pi >= (pagesWide * pagesHigh))
+    if (pageIndex >= (pagesWide * pagesHigh))
     {
       return Printable.NO_SUCH_PAGE;
     }
@@ -1054,47 +1001,12 @@ public class AlignmentPanel extends GAlignmentPanel implements
      * then reset to top left (0, 0)
      */
     idGraphics.translate(0, scaleHeight);
-    idGraphics.setFont(getIdPanel().getIdCanvas().getIdfont());
-    Color currentColor = null;
-    Color currentTextColor = null;
-
-    SequenceI seq;
-    for (int i = startSeq; i < endSeq; i++)
-    {
-      seq = av.getAlignment().getSequenceAt(i);
-      if ((av.getSelectionGroup() != null)
-              && av.getSelectionGroup().getSequences(null).contains(seq))
-      {
-        /*
-         * gray out ids of sequences in selection group (if any)
-         */
-        currentColor = Color.gray;
-        currentTextColor = Color.black;
-      }
-      else
-      {
-        currentColor = av.getSequenceColour(seq);
-        currentTextColor = Color.black;
-      }
-
-      idGraphics.setColor(currentColor);
-      idGraphics.fillRect(0, (i - startSeq) * charHeight, idWidth,
-              charHeight);
-
-      idGraphics.setColor(currentTextColor);
-
-      int xPos = 0;
-      String displayId = seq.getDisplayId(av.getShowJVSuffix());
-      if (av.isRightAlignIds())
-      {
-        fm = idGraphics.getFontMetrics();
-        xPos = idWidth - fm.stringWidth(displayId) - 4;
-      }
+    IdCanvas idCanvas = getIdPanel().getIdCanvas();
+    List<SequenceI> selection = av.getSelectionGroup() == null ? null
+            : av.getSelectionGroup().getSequences(null);
+    idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1,
+            selection);
 
-      idGraphics.drawString(displayId, xPos,
-              (((i - startSeq) * charHeight) + charHeight)
-                      - (charHeight / 5));
-    }
     idGraphics.setFont(av.getFont());
     idGraphics.translate(0, -scaleHeight);
 
@@ -1104,7 +1016,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
      */
     alignmentGraphics.translate(alignmentGraphicsOffset, scaleHeight);
     getSeqPanel().seqCanvas.drawPanelForPrinting(alignmentGraphics, startRes,
-            endRes, startSeq, endSeq);
+            endRes, startSeq, endSeq - 1);
     alignmentGraphics.translate(-alignmentGraphicsOffset, 0);
 
     if (av.isShowAnnotation() && (endSeq == alignmentHeight))
@@ -1134,31 +1046,27 @@ public class AlignmentPanel extends GAlignmentPanel implements
   }
 
   /**
-   * DOCUMENT ME!
+   * Prints one page of an alignment in wrapped mode. Returns
+   * Printable.PAGE_EXISTS (0) if a page was drawn, or Printable.NO_SUCH_PAGE if
+   * no page could be drawn (page number out of range).
    * 
-   * @param pg
-   *          DOCUMENT ME!
-   * @param pwidth
-   *          DOCUMENT ME!
-   * @param pheight
-   *          DOCUMENT ME!
-   * @param pi
-   *          DOCUMENT ME!
+   * @param pageWidth
+   * @param pageHeight
+   * @param pageNumber
+   *          (0, 1, ...)
+   * @param g
    * 
-   * @return DOCUMENT ME!
+   * @return
    * 
    * @throws PrinterException
-   *           DOCUMENT ME!
    */
-  public int printWrappedAlignment(int pwidth, int pheight, int pi,
-          Graphics pg) throws PrinterException
+  public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber,
+          Graphics g) throws PrinterException
   {
     int annotationHeight = 0;
-    AnnotationLabels labels = null;
     if (av.isShowAnnotation())
     {
       annotationHeight = getAnnotationPanel().adjustPanelHeight();
-      labels = new AnnotationLabels(av);
     }
 
     int hgap = av.getCharHeight();
@@ -1180,64 +1088,39 @@ public class AlignmentPanel extends GAlignmentPanel implements
     }
 
     int resWidth = getSeqPanel().seqCanvas
-            .getWrappedCanvasWidth(pwidth - idWidth);
+            .getWrappedCanvasWidth(pageWidth - idWidth);
 
     int totalHeight = cHeight * (maxwidth / resWidth + 1);
 
-    pg.setColor(Color.white);
-    pg.fillRect(0, 0, pwidth, pheight);
-    pg.setFont(av.getFont());
-
-    // //////////////
-    // Draw the ids
-    pg.setColor(Color.black);
+    g.setColor(Color.white);
+    g.fillRect(0, 0, pageWidth, pageHeight);
+    g.setFont(av.getFont());
+    g.setColor(Color.black);
 
-    pg.translate(0, -pi * pheight);
-
-    pg.setClip(0, pi * pheight, pwidth, pheight);
-
-    int ypos = hgap;
-
-    do
-    {
-      for (int i = 0; i < av.getAlignment().getHeight(); i++)
-      {
-        pg.setFont(getIdPanel().getIdCanvas().getIdfont());
-        SequenceI s = av.getAlignment().getSequenceAt(i);
-        String string = s.getDisplayId(av.getShowJVSuffix());
-        int xPos = 0;
-        if (av.isRightAlignIds())
-        {
-          FontMetrics fm = pg.getFontMetrics();
-          xPos = idWidth - fm.stringWidth(string) - 4;
-        }
-        pg.drawString(string, xPos,
-                ((i * av.getCharHeight()) + ypos + av.getCharHeight())
-                        - (av.getCharHeight() / 5));
-      }
-      if (labels != null)
-      {
-        pg.translate(-3, ypos
-                + (av.getAlignment().getHeight() * av.getCharHeight()));
+    /*
+     * method: print the whole wrapped alignment, but with a clip region that
+     * is restricted to the requested page; this supports selective print of 
+     * single  pages or ranges, (at the cost of some repeated processing in 
+     * the 'normal' case, when all pages are printed)
+     */
+    g.translate(0, -pageNumber * pageHeight);
 
-        pg.setFont(av.getFont());
-        labels.drawComponent(pg, idWidth);
-        pg.translate(+3, -ypos
-                - (av.getAlignment().getHeight() * av.getCharHeight()));
-      }
+    g.setClip(0, pageNumber * pageHeight, pageWidth, pageHeight);
 
-      ypos += cHeight;
-    } while (ypos < totalHeight);
+    /*
+     * draw sequence ids and annotation labels (if shown)
+     */
+    IdCanvas idCanvas = getIdPanel().getIdCanvas();
+    idCanvas.drawIdsWrapped((Graphics2D) g, av, 0, totalHeight);
 
-    pg.translate(idWidth, 0);
+    g.translate(idWidth, 0);
 
-    getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(pg, pwidth - idWidth,
+    getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(g, pageWidth - idWidth,
             totalHeight, 0);
 
-    if ((pi * pheight) < totalHeight)
+    if ((pageNumber * pageHeight) < totalHeight)
     {
       return Printable.PAGE_EXISTS;
-
     }
     else
     {
@@ -1684,7 +1567,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   @Override
   public String getViewName()
   {
-    return av.viewName;
+    return av.getViewName();
   }
 
   /**
index 153f70c..384635b 100644 (file)
@@ -459,4 +459,11 @@ public class AnnotationColourChooser extends AnnotationRowFilter
     }
   }
 
+  @Override
+  protected void sliderDragReleased()
+  {
+    super.sliderDragReleased();
+    ap.paintAlignment(true, true);
+  }
+
 }
index dee56b0..50971c7 100755 (executable)
@@ -30,6 +30,7 @@ import jalview.renderer.AwtRenderPanelI;
 import jalview.schemes.ResidueProperties;
 import jalview.util.Comparison;
 import jalview.util.MessageManager;
+import jalview.util.Platform;
 import jalview.viewmodel.ViewportListenerI;
 import jalview.viewmodel.ViewportRanges;
 
@@ -206,7 +207,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   @Override
   public Dimension getPreferredScrollableViewportSize()
   {
-    return getPreferredSize();
+    Dimension ps = getPreferredSize();
+    return new Dimension(ps.width, adjustForAlignFrame(false, ps.height));
   }
 
   @Override
@@ -1196,4 +1198,49 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       repaint();
     }
   }
+
+  /**
+   * computes the visible height of the annotation panel
+   * 
+   * @param adjustPanelHeight
+   *          - when false, just adjust existing height according to other
+   *          windows
+   * @param annotationHeight
+   * @return height to use for the ScrollerPreferredVisibleSize
+   */
+  public int adjustForAlignFrame(boolean adjustPanelHeight,
+          int annotationHeight)
+  {
+    /*
+     * Estimate available height in the AlignFrame for alignment +
+     * annotations. Deduct an estimate for title bar, menu bar, scale panel,
+     * hscroll, status bar, insets. 
+     */
+    int stuff = (ap.getViewName() != null ? 30 : 0)
+            + (Platform.isAMac() ? 120 : 140);
+    int availableHeight = ap.alignFrame.getHeight() - stuff;
+    int rowHeight = av.getCharHeight();
+
+    if (adjustPanelHeight)
+    {
+      int alignmentHeight = rowHeight * av.getAlignment().getHeight();
+
+      /*
+       * If not enough vertical space, maximize annotation height while keeping
+       * at least two rows of alignment visible
+       */
+      if (annotationHeight + alignmentHeight > availableHeight)
+      {
+        annotationHeight = Math.min(annotationHeight,
+                availableHeight - 2 * rowHeight);
+      }
+    }
+    else
+    {
+      // maintain same window layout whilst updating sliders
+      annotationHeight = Math.min(ap.annotationScroller.getSize().height,
+              availableHeight - 2 * rowHeight);
+    }
+    return annotationHeight;
+  }
 }
index 71ad6a5..f13cb10 100644 (file)
@@ -172,11 +172,7 @@ public abstract class AnnotationRowFilter extends JPanel
       @Override
       public void mouseReleased(MouseEvent evt)
       {
-        if (sliderDragging)
-        {
-          sliderDragging = false;
-          valueChanged(true);
-        }
+        sliderDragReleased();
       }
     });
   }
@@ -523,4 +519,13 @@ public abstract class AnnotationRowFilter extends JPanel
   {
     this.annotations = anns;
   }
+
+  protected void sliderDragReleased()
+  {
+    if (sliderDragging)
+    {
+      sliderDragging = false;
+      valueChanged(true);
+    }
+  }
 }
index fef7451..6c934c8 100644 (file)
@@ -44,7 +44,6 @@ import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JInternalFrame;
 import javax.swing.JPanel;
 import javax.swing.JSplitPane;
 import javax.swing.SwingUtilities;
@@ -58,7 +57,7 @@ public class AppJmol extends StructureViewerBase
 
   private static final String SPACE = " ";
 
-  private static final String BACKSLASH = "\"";
+  private static final String QUOTE = "\"";
 
   AppJmolBinding jmb;
 
@@ -162,8 +161,9 @@ public class AppJmol extends StructureViewerBase
   {
     return progressBar;
   }
+  
   /**
-   * add a single PDB structure to a new or existing Jmol view
+   * display a single PDB structure in a new Jmol view
    * 
    * @param pdbentry
    * @param seq
@@ -174,33 +174,14 @@ public class AppJmol extends StructureViewerBase
           final AlignmentPanel ap)
   {
     progressBar = ap.alignFrame;
-    String pdbId = pdbentry.getId();
 
-    /*
-     * If the PDB file is already loaded, the user may just choose to add to an
-     * existing viewer (or cancel)
-     */
-    if (addAlreadyLoadedFile(seq, chains, ap, pdbId))
-    {
-      return;
-    }
-
-    /*
-     * Check if there are other Jmol views involving this alignment and prompt
-     * user about adding this molecule to one of them
-     */
-    if (addToExistingViewer(pdbentry, seq, chains, ap, pdbId))
-    {
-      return;
-    }
-
-    /*
-     * If the options above are declined or do not apply, open a new viewer
-     */
-    openNewJmol(ap, new PDBEntry[] { pdbentry }, new SequenceI[][] { seq });
+    openNewJmol(ap, alignAddedStructures, new PDBEntry[] { pdbentry },
+            new SequenceI[][]
+            { seq });
   }
 
-  private void openNewJmol(AlignmentPanel ap, PDBEntry[] pdbentrys,
+  private void openNewJmol(AlignmentPanel ap, boolean alignAdded,
+          PDBEntry[] pdbentrys,
           SequenceI[][] seqs)
   {
     progressBar = ap.alignFrame;
@@ -209,11 +190,9 @@ public class AppJmol extends StructureViewerBase
     addAlignmentPanel(ap);
     useAlignmentPanelForColourbyseq(ap);
 
-    if (pdbentrys.length > 1)
-    {
-      alignAddedStructures = true;
-      useAlignmentPanelForSuperposition(ap);
-    }
+    alignAddedStructures = alignAdded;
+    useAlignmentPanelForSuperposition(ap);
+
     jmb.setColourBySequence(true);
     setSize(400, 400); // probably should be a configurable/dynamic default here
     initMenus();
@@ -234,41 +213,21 @@ public class AppJmol extends StructureViewerBase
   }
 
   /**
-   * create a new Jmol containing several structures superimposed using the
-   * given alignPanel.
+   * create a new Jmol containing several structures optionally superimposed
+   * using the given alignPanel.
    * 
    * @param ap
+   * @param alignAdded
+   *          - true to superimpose
    * @param pe
    * @param seqs
    */
-  public AppJmol(AlignmentPanel ap, PDBEntry[] pe, SequenceI[][] seqs)
+  public AppJmol(AlignmentPanel ap, boolean alignAdded, PDBEntry[] pe,
+          SequenceI[][] seqs)
   {
-    openNewJmol(ap, pe, seqs);
+    openNewJmol(ap, alignAdded, pe, seqs);
   }
 
-  /**
-   * Returns a list of any Jmol viewers. The list is restricted to those linked
-   * to the given alignment panel if it is not null.
-   */
-  @Override
-  protected List<StructureViewerBase> getViewersFor(AlignmentPanel apanel)
-  {
-    List<StructureViewerBase> result = new ArrayList<>();
-    JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
-    for (JInternalFrame frame : frames)
-    {
-      if (frame instanceof AppJmol)
-      {
-        if (apanel == null
-                || ((StructureViewerBase) frame).isLinkedWith(apanel))
-        {
-          result.add((StructureViewerBase) frame);
-        }
-      }
-    }
-    return result;
-  }
 
   void initJmol(String command)
   {
@@ -300,8 +259,6 @@ public class AppJmol extends StructureViewerBase
     jmb.setFinishedInit(true);
   }
 
-  boolean allChainsSelected = false;
-
   @Override
   void showSelectedChains()
   {
@@ -368,8 +325,8 @@ public class AppJmol extends StructureViewerBase
     StringBuilder fileList = new StringBuilder();
     for (String s : files)
     {
-      fileList.append(SPACE).append(BACKSLASH)
-              .append(Platform.escapeString(s)).append(BACKSLASH);
+      fileList.append(SPACE).append(QUOTE)
+              .append(Platform.escapeString(s)).append(QUOTE);
     }
     String filesString = fileList.toString();
 
@@ -444,7 +401,7 @@ public class AppJmol extends StructureViewerBase
       jmb.updateColours(ap);
     }
     // do superposition if asked to
-    if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
+    if (alignAddedStructures)
     {
       alignAddedStructures();
     }
@@ -478,7 +435,7 @@ public class AppJmol extends StructureViewerBase
         }
       }
     });
-    alignAddedStructures = false;
+
   }
 
   /**
@@ -507,6 +464,7 @@ public class AppJmol extends StructureViewerBase
         String file = jmb.getPdbEntry(pi).getFile();
         if (file == null)
         {
+          // todo: extract block as method and pull up (also ChimeraViewFrame)
           // retrieve the pdb and store it locally
           AlignmentI pdbseq = null;
           pdbid = jmb.getPdbEntry(pi).getId();
index ea16f23..3a64716 100644 (file)
@@ -120,6 +120,15 @@ public class AppVarna extends JInternalFrame
       }
     }
 
+    /**
+     * highlight a region from start to end (inclusive) on rna
+     * 
+     * @param rna
+     * @param start
+     *          - first base pair index (from 0)
+     * @param end
+     *          - last base pair index (from 0)
+     */
     public void highlightRegion(RNA rna, int start, int end)
     {
       clearLastSelection();
@@ -397,7 +406,8 @@ public class AppVarna extends JInternalFrame
     RnaModel rnaModel = models.get(rna);
     if (rnaModel.seq == sequence)
     {
-      int highlightPos = rnaModel.gapped ? index : position - 1;
+      int highlightPos = rnaModel.gapped ? index
+              : position - sequence.getStart();
       mouseOverHighlighter.highlightRegion(rna, highlightPos, highlightPos);
       vab.updateSelectedRNA(rna);
     }
@@ -418,15 +428,28 @@ public class AppVarna extends JInternalFrame
     {
       return;
     }
-    if (seqsel != null && seqsel.getSize() > 0)
+
+    RnaModel rnaModel = models.get(rna);
+
+    if (seqsel != null && seqsel.getSize() > 0
+            && seqsel.contains(rnaModel.seq))
     {
       int start = seqsel.getStartRes(), end = seqsel.getEndRes();
-      ShiftList shift = offsets.get(rna);
-      if (shift != null)
+      if (rnaModel.gapped)
       {
-        start = shift.shift(start);
-        end = shift.shift(end);
+        ShiftList shift = offsets.get(rna);
+        if (shift != null)
+        {
+          start = shift.shift(start);
+          end = shift.shift(end);
+        }
       }
+      else
+      {
+        start = rnaModel.seq.findPosition(start) - rnaModel.seq.getStart();
+        end = rnaModel.seq.findPosition(end) - rnaModel.seq.getStart();
+      }
+
       selectionHighlighter.highlightRegion(rna, start, end);
       selectionHighlighter.getLastHighlight()
               .setOutlineColor(seqsel.getOutlineColour());
index 537ec17..8ef204c 100644 (file)
@@ -152,11 +152,12 @@ public class AquaInternalFrameManager extends DefaultDesktopManager
         super.activateFrame(f);
       }
 
-      // If this is the first activation, add to child list.
-      if (fChildFrames.indexOf(f) == -1)
+      // add or relocate to top of stack
+      if (fChildFrames.indexOf(f) != -1)
       {
-        fChildFrames.addElement(f);
+        fChildFrames.remove(f);
       }
+      fChildFrames.addElement(f);
 
       if (fCurrentFrame != null && f != fCurrentFrame)
       {
index a41a998..336a312 100644 (file)
@@ -271,9 +271,9 @@ public class CalculationChooser extends JPanel
 
     setMinimumSize(new Dimension(325, height - 10));
     String title = MessageManager.getString("label.choose_calculation");
-    if (af.getViewport().viewName != null)
+    if (af.getViewport().getViewName() != null)
     {
-      title = title + " (" + af.getViewport().viewName + ")";
+      title = title + " (" + af.getViewport().getViewName() + ")";
     }
 
     Desktop.addInternalFrame(frame, title, width, height, false);
index 89de2e8..d07a7c2 100644 (file)
@@ -100,41 +100,34 @@ public class ChimeraViewFrame extends StructureViewerBase
     savemenu.setVisible(false); // not yet implemented
     viewMenu.add(fitToWindow);
 
-    /*
-     * exchange of Jalview features and Chimera attributes is for now
-     * an optionally enabled experimental feature
-     */
-    if (Desktop.instance.showExperimental())
+    JMenuItem writeFeatures = new JMenuItem(
+            MessageManager.getString("label.create_chimera_attributes"));
+    writeFeatures.setToolTipText(MessageManager
+            .getString("label.create_chimera_attributes_tip"));
+    writeFeatures.addActionListener(new ActionListener()
     {
-      JMenuItem writeFeatures = new JMenuItem(
-              MessageManager.getString("label.create_chimera_attributes"));
-      writeFeatures.setToolTipText(MessageManager
-              .getString("label.create_chimera_attributes_tip"));
-      writeFeatures.addActionListener(new ActionListener()
-      {
-        @Override
-        public void actionPerformed(ActionEvent e)
-        {
-          sendFeaturesToChimera();
-        }
-      });
-      viewerActionMenu.add(writeFeatures);
-
-      final JMenu fetchAttributes = new JMenu(
-              MessageManager.getString("label.fetch_chimera_attributes"));
-      fetchAttributes.setToolTipText(MessageManager
-              .getString("label.fetch_chimera_attributes_tip"));
-      fetchAttributes.addMouseListener(new MouseAdapter()
+      @Override
+      public void actionPerformed(ActionEvent e)
       {
+        sendFeaturesToChimera();
+      }
+    });
+    viewerActionMenu.add(writeFeatures);
 
-        @Override
-        public void mouseEntered(MouseEvent e)
-        {
-          buildAttributesMenu(fetchAttributes);
-        }
-      });
-      viewerActionMenu.add(fetchAttributes);
-    }
+    final JMenu fetchAttributes = new JMenu(
+            MessageManager.getString("label.fetch_chimera_attributes"));
+    fetchAttributes.setToolTipText(
+            MessageManager.getString("label.fetch_chimera_attributes_tip"));
+    fetchAttributes.addMouseListener(new MouseAdapter()
+    {
+
+      @Override
+      public void mouseEntered(MouseEvent e)
+      {
+        buildAttributesMenu(fetchAttributes);
+      }
+    });
+    viewerActionMenu.add(fetchAttributes);
   }
 
   /**
@@ -202,7 +195,7 @@ public class ChimeraViewFrame extends StructureViewerBase
   }
 
   /**
-   * add a single PDB structure to a new or existing Chimera view
+   * open a single PDB structure in a new Chimera view
    * 
    * @param pdbentry
    * @param seq
@@ -213,30 +206,7 @@ public class ChimeraViewFrame extends StructureViewerBase
           String[] chains, final AlignmentPanel ap)
   {
     this();
-    String pdbId = pdbentry.getId();
-
-    /*
-     * If the PDB file is already loaded, the user may just choose to add to an
-     * existing viewer (or cancel)
-     */
-    if (addAlreadyLoadedFile(seq, chains, ap, pdbId))
-    {
-      return;
-    }
 
-    /*
-     * Check if there are other Chimera views involving this alignment and give
-     * user the option to add and align this molecule to one of them (or cancel)
-     */
-    if (addToExistingViewer(pdbentry, seq, chains, ap, pdbId))
-    {
-      return;
-    }
-
-    /*
-     * If the options above are declined or do not apply, show the structure in
-     * a new viewer
-     */
     openNewChimera(ap, new PDBEntry[] { pdbentry },
             new SequenceI[][]
             { seq });
@@ -264,7 +234,6 @@ public class ChimeraViewFrame extends StructureViewerBase
 
     if (pdbentrys.length > 1)
     {
-      alignAddedStructures = true;
       useAlignmentPanelForSuperposition(ap);
     }
     jmb.setColourBySequence(true);
@@ -323,17 +292,19 @@ public class ChimeraViewFrame extends StructureViewerBase
   }
 
   /**
-   * create a new viewer containing several structures superimposed using the
-   * given alignPanel.
+   * create a new viewer containing several structures, optionally superimposed
+   * using the given alignPanel.
    * 
    * @param pe
    * @param seqs
    * @param ap
    */
-  public ChimeraViewFrame(PDBEntry[] pe, SequenceI[][] seqs,
+  public ChimeraViewFrame(PDBEntry[] pe, boolean alignAdded,
+          SequenceI[][] seqs,
           AlignmentPanel ap)
   {
     this();
+    setAlignAddedStructures(alignAdded);
     openNewChimera(ap, pe, seqs);
   }
 
@@ -352,29 +323,6 @@ public class ChimeraViewFrame extends StructureViewerBase
   }
 
   /**
-   * Returns a list of any Chimera viewers in the desktop. The list is
-   * restricted to those linked to the given alignment panel if it is not null.
-   */
-  @Override
-  protected List<StructureViewerBase> getViewersFor(AlignmentPanel ap)
-  {
-    List<StructureViewerBase> result = new ArrayList<>();
-    JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
-    for (JInternalFrame frame : frames)
-    {
-      if (frame instanceof ChimeraViewFrame)
-      {
-        if (ap == null || ((StructureViewerBase) frame).isLinkedWith(ap))
-        {
-          result.add((StructureViewerBase) frame);
-        }
-      }
-    }
-    return result;
-  }
-
-  /**
    * Launch Chimera. If we have a chimera session file name, send Chimera the
    * command to open its saved session file.
    */
@@ -641,7 +589,7 @@ public class ChimeraViewFrame extends StructureViewerBase
         jmb.updateColours(ap);
       }
       // do superposition if asked to
-      if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
+      if (alignAddedStructures)
       {
         new Thread(new Runnable()
         {
@@ -651,7 +599,6 @@ public class ChimeraViewFrame extends StructureViewerBase
             alignStructs_withAllAlignPanels();
           }
         }).start();
-        alignAddedStructures = false;
       }
       addingStructures = false;
     }
@@ -681,7 +628,6 @@ public class ChimeraViewFrame extends StructureViewerBase
 
   private String fetchPdbFile(PDBEntry processingEntry) throws Exception
   {
-    // FIXME: this is duplicated code with Jmol frame ?
     String filePath = null;
     Pdb pdbclient = new Pdb();
     AlignmentI pdbseq = null;
diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java
deleted file mode 100644 (file)
index 8570ac3..0000000
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.gui;
-
-import jalview.jbgui.GDasSourceBrowser;
-import jalview.util.MessageManager;
-import jalview.util.TableSorter;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingUtilities;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.AbstractTableModel;
-
-import org.biodas.jdas.schema.sources.CAPABILITY;
-import org.biodas.jdas.schema.sources.COORDINATES;
-import org.biodas.jdas.schema.sources.PROP;
-import org.biodas.jdas.schema.sources.VERSION;
-
-public class DasSourceBrowser extends GDasSourceBrowser
-        implements Runnable, ListSelectionListener
-{
-  DasSourceRegistryI sourceRegistry = null;
-
-  Vector<String> selectedSources;
-
-  public DasSourceBrowser(FeatureSettings featureSettings)
-  {
-    fs = featureSettings;
-    // TODO DasSourceRegistryProvider API
-    sourceRegistry = jalview.bin.Cache.getDasSourceRegistry();
-    String registry = sourceRegistry.getDasRegistryURL();
-
-    registryURL.setText(registry);
-
-    setSelectedFromProperties();
-
-    displayFullDetails(null);
-    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
-    filter1.addListSelectionListener(this);
-    filter2.addListSelectionListener(this);
-    filter3.addListSelectionListener(this);
-
-    // Ask to be notified of selection changes.
-    ListSelectionModel rowSM = table.getSelectionModel();
-    rowSM.addListSelectionListener(new ListSelectionListener()
-    {
-      @Override
-      public void valueChanged(ListSelectionEvent e)
-      {
-        ListSelectionModel lsm = (ListSelectionModel) e.getSource();
-        if (!lsm.isSelectionEmpty())
-        {
-          int selectedRow = lsm.getMinSelectionIndex();
-          displayFullDetails(table.getValueAt(selectedRow, 0).toString());
-        }
-      }
-    });
-
-    table.addMouseListener(new MouseAdapter()
-    {
-      @Override
-      public void mouseClicked(MouseEvent evt)
-      {
-        if (evt.getClickCount() == 2 || evt.isPopupTrigger())
-        {
-          editRemoveLocalSource(evt);
-        }
-      }
-    });
-
-    if (sourceRegistry.getSources() != null)
-    {
-      init();
-    }
-  }
-
-  FeatureSettings fs = null;
-
-  private boolean loadingDasSources;
-
-  public DasSourceBrowser()
-  {
-    this(null);
-  }
-
-  @Override
-  public void paintComponent(java.awt.Graphics g)
-  {
-    if (sourceRegistry == null)
-    {
-      Thread worker = new Thread(this);
-      worker.start();
-    }
-  }
-
-  void init()
-  {
-    List<jalviewSourceI> sources = sourceRegistry.getSources();
-    int dSize = sources.size();
-    Object[][] data = new Object[dSize][2];
-    for (int i = 0; i < dSize; i++)
-    {
-      data[i][0] = sources.get(i).getTitle(); // what's equivalent of nickname
-      data[i][1] = new Boolean(
-              selectedSources.contains(sources.get(i).getTitle()));
-    }
-
-    refreshTableData(data);
-    setCapabilities(sourceRegistry);
-
-    javax.swing.SwingUtilities.invokeLater(new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        TableSorter sorter = (TableSorter) table.getModel();
-        sorter.setSortingStatus(1, TableSorter.DESCENDING);
-        sorter.setSortingStatus(1, TableSorter.NOT_SORTED);
-      }
-    });
-
-    progressBar.setIndeterminate(false);
-    progressBar.setVisible(false);
-    addLocal.setVisible(true);
-    refresh.setVisible(true);
-  }
-
-  public void refreshTableData(Object[][] data)
-  {
-    TableSorter sorter = new TableSorter(new DASTableModel(data));
-    sorter.setTableHeader(table.getTableHeader());
-    table.setModel(sorter);
-  }
-
-  void displayFullDetails(String nickName)
-  {
-
-    StringBuffer text = new StringBuffer(
-            "<HTML><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">");
-
-    if (nickName == null)
-    {
-      fullDetails.setText(text + MessageManager
-              .getString("label.select_das_service_from_table"));
-      return;
-    }
-
-    int dSize = sourceRegistry.getSources().size();
-    for (jalviewSourceI ds : sourceRegistry.getSources())
-    {
-      if (!ds.getTitle().equals(nickName))
-      {
-        continue;
-      }
-
-      VERSION latest = ds.getVersion();
-      text.append(
-              "<font color=\"#0000FF\">Id:</font> " + ds.getUri() + "<br>");
-      text.append("<font color=\"#0000FF\">Nickname:</font> "
-              + ds.getTitle() + "<br>");
-
-      text.append("<font color=\"#0000FF\">URL:</font> <a href=\""
-              + ds.getSourceURL() + "\">" + ds.getSourceURL() + "</a>"
-              + "<br>");
-      if (!ds.isLocal())
-      {
-        if (ds.getDocHref() != null && ds.getDocHref().length() > 0)
-        {
-          text.append("<font color=\"#0000FF\">Site:</font> <a href=\""
-                  + ds.getDocHref() + "\">" + ds.getDocHref() + "</a>"
-                  + "<br>");
-        }
-
-        text.append("<font color=\"#0000FF\">Description:</font> "
-                + ds.getDescription() + "<br>");
-
-        text.append(
-                "<font color=\"#0000FF\">Admin Email:</font> <a href=\"mailto:"
-                        + ds.getEmail() + "\">" + ds.getEmail() + "</a>"
-                        + "<br>");
-
-        text.append("<font color=\"#0000FF\">Registered at:</font> "
-                + latest.getCreated() + "<br>");
-
-        // TODO: Identify last successful test date
-        // text.append("<font color=\"#0000FF\">Last successful test:</font> "
-        // + latest.dasSources[i].getLeaseDate() + "<br>");
-      }
-      else
-      {
-        text.append("Source was added manually.<br/>");
-      }
-      text.append("<font color=\"#0000FF\">Labels:</font> ");
-      boolean b = false;
-      for (PROP labl : latest.getPROP())
-      {
-        if (labl.getName().equalsIgnoreCase("LABEL"))
-        {
-          if (b)
-          {
-            text.append(",");
-          }
-          text.append(" ");
-
-          text.append(labl.getValue());
-          b = true;
-        }
-        ;
-      }
-      text.append("<br>");
-
-      text.append("<font color=\"#0000FF\">Capabilities:</font> ");
-      CAPABILITY[] scap = latest.getCAPABILITY().toArray(new CAPABILITY[0]);
-      for (int j = 0; j < scap.length; j++)
-      {
-        text.append(scap[j].getType());
-        if (j < scap.length - 1)
-        {
-          text.append(", ");
-        }
-      }
-      text.append("<br>");
-
-      text.append("<font color=\"#0000FF\">Coordinates:</font>");
-      int i = 1;
-      for (COORDINATES dcs : latest.getCOORDINATES())
-      {
-        text.append("<br/>" + i++ + ". ");
-        text.append(dcs.getAuthority() + " : " + dcs.getSource());
-        if (dcs.getTaxid() != null && dcs.getTaxid().trim().length() > 0)
-        {
-          text.append(" [TaxId:" + dcs.getTaxid() + "]");
-        }
-        if (dcs.getVersion() != null
-                && dcs.getVersion().trim().length() > 0)
-        {
-          {
-            text.append(" {v. " + dcs.getVersion() + "}");
-          }
-        }
-        text.append(" (<a href=\"" + dcs.getUri() + "\">" + dcs.getUri()
-                + "</a>)");
-      }
-      text.append("</font></html>");
-
-      break;
-    }
-
-    fullDetails.setText(text.toString());
-    javax.swing.SwingUtilities.invokeLater(new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        fullDetailsScrollpane.getVerticalScrollBar().setValue(0);
-      }
-    });
-  }
-
-  @Override
-  public void run()
-  {
-    loadingDasSources = true;
-
-    addLocal.setVisible(false);
-    refresh.setVisible(false);
-    progressBar.setVisible(true);
-    progressBar.setIndeterminate(true);
-    setParentGuiEnabled(false);
-    // Refresh the source list.
-    sourceRegistry.refreshSources();
-
-    init();
-
-    setParentGuiEnabled(true);
-    loadingDasSources = false;
-
-  }
-
-  private void setParentGuiEnabled(boolean b)
-  {
-    if (fs != null)
-    {
-      fs.fetchDAS.setEnabled(b);
-      fs.saveDAS.setEnabled(b);
-    }
-  }
-
-  public Vector<jalviewSourceI> getSelectedSources()
-  {
-    // wait around if we're still loading.
-    while (sourceRegistry == null)
-    {
-      if (!loadingDasSources)
-      {
-        new Thread(this).start();
-        try
-        {
-          Thread.sleep(5);
-        } catch (Exception e)
-        {
-        }
-        ;
-        while (loadingDasSources)
-        {
-          try
-          {
-            Thread.sleep(5);
-          } catch (Exception e)
-          {
-          }
-          ;
-        }
-        ;
-      }
-    }
-
-    Vector<jalviewSourceI> selected = new Vector<jalviewSourceI>();
-    for (String source : selectedSources)
-    {
-      jalviewSourceI srce = sourceRegistry.getSource(source);
-      if (srce != null)
-      {
-        selected.addElement(srce);
-      }
-    }
-    return selected;
-  }
-
-  @Override
-  public void refresh_actionPerformed(ActionEvent e)
-  {
-    saveProperties(jalview.bin.Cache.applicationProperties);
-
-    Thread worker = new Thread(this);
-    worker.start();
-  }
-
-  private void setCapabilities(DasSourceRegistryI sourceRegistry2)
-  {
-    Vector<String> authority = new Vector<String>();
-    Vector<String> type = new Vector<String>();
-    Vector<String> label = new Vector<String>();
-    Vector<String> taxIds = new Vector<String>();
-    authority.add("Any");
-    type.add("Any");
-    label.add("Any");
-
-    for (jalviewSourceI ds : sourceRegistry2.getSources())
-    {
-      VERSION latest = ds.getVersion();
-
-      for (COORDINATES cs : latest.getCOORDINATES())
-      {
-        if (!type.contains(cs.getSource()))
-        {
-          type.add(cs.getSource()); // source==category
-        }
-
-        if (!authority.contains(cs.getAuthority()))
-        {
-          authority.add(cs.getAuthority());
-        }
-      }
-
-      for (PROP slabel : latest.getPROP())
-      {
-        if (slabel.getName().equalsIgnoreCase("LABEL")
-                && !label.contains(slabel.getValue()))
-        {
-          label.add(slabel.getValue());
-        }
-      }
-
-    }
-
-    filter1.setListData(authority);
-    filter2.setListData(type);
-    filter3.setListData(label);
-    // filter4 taxIds
-
-    javax.swing.SwingUtilities.invokeLater(new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        filter1.setSelectedIndex(0);
-        filter2.setSelectedIndex(0);
-        filter3.setSelectedIndex(0);
-      }
-    });
-  }
-
-  @Override
-  public void amendLocal(boolean newSource)
-  {
-    String url = "http://localhost:8080/", nickname = "";
-    boolean seqsrc = false;
-    if (!newSource)
-    {
-      int selectedRow = table.getSelectionModel().getMinSelectionIndex();
-      nickname = table.getValueAt(selectedRow, 0).toString();
-      jalviewSourceI source = sourceRegistry.getSource(nickname);
-      url = source.getUri();
-      seqsrc = source.isSequenceSource();
-    }
-
-    JTextField nametf = new JTextField(nickname, 40);
-    JTextField urltf = new JTextField(url, 40);
-    JCheckBox seqs = new JCheckBox(
-            MessageManager.getString("label.sequence_source"));
-    seqs.setSelected(seqsrc);
-    JPanel panel = new JPanel(new BorderLayout());
-    JPanel pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel(MessageManager.getString("label.name:")),
-            BorderLayout.CENTER);
-    pane12.add(nametf, BorderLayout.EAST);
-    panel.add(pane12, BorderLayout.NORTH);
-    pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel(MessageManager.getString("label.url:")),
-            BorderLayout.NORTH);
-    pane12.add(seqs, BorderLayout.SOUTH);
-    pane12.add(urltf, BorderLayout.EAST);
-    panel.add(pane12, BorderLayout.SOUTH);
-
-    int reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
-            panel, MessageManager.getString("label.enter_local_das_source"),
-            JvOptionPane.OK_CANCEL_OPTION);
-
-    if (reply != JvOptionPane.OK_OPTION)
-    {
-      return;
-    }
-
-    if (!urltf.getText().endsWith("/"))
-    {
-      urltf.setText(urltf.getText() + "/");
-    }
-
-    jalviewSourceI local = sourceRegistry.createLocalSource(urltf.getText(),
-            nametf.getText(), seqs.isSelected(), true);
-    List sources = sourceRegistry.getSources();
-    int osize = sources.size();
-    int size = osize + (newSource ? 1 : 0);
-
-    Object[][] data = new Object[size][2];
-    DASTableModel dtm = (table != null)
-            ? (DASTableModel) ((TableSorter) table.getModel())
-                    .getTableModel()
-            : null;
-    for (int i = 0; i < osize; i++)
-    {
-      String osrc = (dtm == null || i >= osize) ? null
-              : (String) dtm.getValueAt(i, 0);
-      if (!newSource && osrc != null
-              && dtm.getValueAt(i, 0).equals(nickname))
-      {
-        data[i][0] = local.getTitle();
-        data[i][1] = new Boolean(true);
-      }
-      else
-      {
-        data[i][0] = osrc;
-        data[i][1] = new Boolean(selectedSources.contains(osrc));
-      }
-    }
-    // Always add a new source at the end
-    if (newSource)
-    {
-      data[osize][0] = local.getTitle();
-      data[osize][1] = new Boolean(true);
-      selectedSources.add(local.getTitle());
-    }
-
-    refreshTableData(data);
-
-    SwingUtilities.invokeLater(new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        scrollPane.getVerticalScrollBar()
-                .setValue(scrollPane.getVerticalScrollBar().getMaximum());
-      }
-    });
-
-    displayFullDetails(local.getTitle());
-  }
-
-  public void editRemoveLocalSource(MouseEvent evt)
-  {
-    int selectedRow = table.getSelectionModel().getMinSelectionIndex();
-    if (selectedRow == -1)
-    {
-      return;
-    }
-
-    String nickname = table.getValueAt(selectedRow, 0).toString();
-
-    if (!sourceRegistry.getSource(nickname).isLocal())
-    {
-      JvOptionPane.showInternalMessageDialog(Desktop.desktop,
-              MessageManager.getString(
-                      "label.you_can_only_edit_or_remove_local_das_sources"),
-              MessageManager.getString("label.public_das_source"),
-              JvOptionPane.WARNING_MESSAGE);
-      return;
-    }
-
-    Object[] options = { "Edit", "Remove", "Cancel" };
-    int choice = JvOptionPane.showInternalOptionDialog(Desktop.desktop,
-            "Do you want to edit or remove " + nickname + "?",
-            "Edit / Remove Local DAS Source",
-            JvOptionPane.YES_NO_CANCEL_OPTION,
-            JvOptionPane.QUESTION_MESSAGE, null, options, options[2]);
-
-    switch (choice)
-    {
-    case 0:
-      amendLocal(false);
-      break;
-    case 1:
-      sourceRegistry.removeLocalSource(sourceRegistry.getSource(nickname));
-      selectedSources.remove(nickname);
-      Object[][] data = new Object[sourceRegistry.getSources().size()][2];
-      int index = 0, l = table.getRowCount();
-
-      for (int i = 0; i < l; i++)
-      {
-        String nm;
-        if ((nm = (String) table.getValueAt(i, 0)).equals(nickname))
-        {
-          continue;
-        }
-        else
-        {
-          data[index][0] = nm;
-          data[index][1] = new Boolean(selectedSources.contains(nm));
-          index++;
-        }
-      }
-      refreshTableData(data);
-      SwingUtilities.invokeLater(new Runnable()
-      {
-        @Override
-        public void run()
-        {
-          scrollPane.getVerticalScrollBar()
-                  .setValue(scrollPane.getVerticalScrollBar().getMaximum());
-        }
-      });
-
-      break;
-    }
-  }
-
-  @Override
-  public void valueChanged(ListSelectionEvent evt)
-  {
-    // Called when the MainTable selection changes
-    if (evt.getValueIsAdjusting())
-    {
-      return;
-    }
-
-    displayFullDetails(null);
-
-    // Filter the displayed data sources
-
-    ArrayList names = new ArrayList();
-    ArrayList selected = new ArrayList();
-
-    // The features filter is not visible, but we must still
-    // filter the das source list here.
-    // July 2006 - only 6 sources fo not serve features
-    Object[] dummyFeatureList = new Object[] { "features" };
-    List<jalviewSourceI> srcs = sourceRegistry.getSources();
-    for (jalviewSourceI ds : srcs)
-    {
-
-      VERSION v = ds.getVersion();
-      List<COORDINATES> coords = v.getCOORDINATES();
-      if (ds.isLocal() || ((coords == null || coords.size() == 0)
-              && filter1.getSelectedIndex() == 0
-              && filter2.getSelectedIndex() == 0
-              && filter3.getSelectedIndex() == 0))
-      {
-        // THIS IS A FIX FOR LOCAL SOURCES WHICH DO NOT
-        // HAVE COORDINATE SYSTEMS, INFO WHICH AT PRESENT
-        // IS ADDED FROM THE REGISTRY
-        names.add(ds.getTitle());
-        selected.add(new Boolean(selectedSources.contains(ds.getTitle())));
-        continue;
-      }
-
-      if (!selectedInList(dummyFeatureList, ds.getCapabilityList(v))
-              || !selectedInList(filter3.getSelectedValues(),
-                      ds.getLabelsFor(v)))
-      {
-        continue;
-      }
-
-      for (int j = 0; j < coords.size(); j++)
-      {
-        if (selectedInList(filter1.getSelectedValues(),
-                new String[]
-                { coords.get(j).getAuthority() })
-                && selectedInList(filter2.getSelectedValues(), new String[]
-                { coords.get(j).getSource() }))
-        {
-          names.add(ds.getTitle());
-          selected.add(
-                  new Boolean(selectedSources.contains(ds.getTitle())));
-          break;
-        }
-      }
-    }
-
-    int dSize = names.size();
-    Object[][] data = new Object[dSize][2];
-    for (int d = 0; d < dSize; d++)
-    {
-      data[d][0] = names.get(d);
-      data[d][1] = selected.get(d);
-    }
-
-    refreshTableData(data);
-  }
-
-  private boolean selectedInList(Object[] selection, String[] items)
-  {
-    for (int i = 0; i < selection.length; i++)
-    {
-      if (selection[i].equals("Any"))
-      {
-        return true;
-      }
-      if (items == null || items.length == 0)
-      {
-        return false;
-      }
-      String sel = (items[0].startsWith("das1:") ? "das1:" : "")
-              + selection[i];
-      for (int j = 0; j < items.length; j++)
-      {
-        if (sel.equals(items[j]))
-        {
-          return true;
-        }
-      }
-    }
-
-    return false;
-  }
-
-  void setSelectedFromProperties()
-  {
-    String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE",
-            "uniprot");
-    StringTokenizer st = new StringTokenizer(active, "\t");
-    selectedSources = new Vector();
-    while (st.hasMoreTokens())
-    {
-      selectedSources.addElement(st.nextToken());
-    }
-  }
-
-  @Override
-  public void reset_actionPerformed(ActionEvent e)
-  {
-    registryURL.setText(sourceRegistry.getDasRegistryURL());
-  }
-
-  /**
-   * set the DAS source settings in the given jalview properties.
-   * 
-   * @param properties
-   */
-  public void saveProperties(Properties properties)
-  {
-    if (registryURL.getText() == null || registryURL.getText().length() < 1)
-    {
-      properties.remove(jalview.bin.Cache.DAS_REGISTRY_URL);
-    }
-    else
-    {
-      properties.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
-              registryURL.getText());
-    }
-
-    StringBuffer sb = new StringBuffer();
-    for (int r = 0; r < table.getModel().getRowCount(); r++)
-    {
-      if (((Boolean) table.getValueAt(r, 1)).booleanValue())
-      {
-        sb.append(table.getValueAt(r, 0) + "\t");
-      }
-    }
-
-    properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE,
-            sb.toString());
-
-    String sourceprop = sourceRegistry.getLocalSourceString();
-    properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, sourceprop);
-  }
-
-  class DASTableModel extends AbstractTableModel
-  {
-
-    public DASTableModel(Object[][] data)
-    {
-      this.data = data;
-    }
-
-    private String[] columnNames = new String[] {
-        MessageManager.getString("label.nickname"),
-        MessageManager.getString("label.use_source") };
-
-    private Object[][] data;
-
-    @Override
-    public int getColumnCount()
-    {
-      return columnNames.length;
-    }
-
-    @Override
-    public int getRowCount()
-    {
-      return data.length;
-    }
-
-    @Override
-    public String getColumnName(int col)
-    {
-      return columnNames[col];
-    }
-
-    @Override
-    public Object getValueAt(int row, int col)
-    {
-      return data[row][col];
-    }
-
-    /*
-     * JTable uses this method to determine the default renderer/ editor for
-     * each cell. If we didn't implement this method, then the last column would
-     * contain text ("true"/"false"), rather than a check box.
-     */
-    @Override
-    public Class getColumnClass(int c)
-    {
-      return getValueAt(0, c).getClass();
-    }
-
-    /*
-     * Don't need to implement this method unless your table's editable.
-     */
-    @Override
-    public boolean isCellEditable(int row, int col)
-    {
-      // Note that the data/cell address is constant,
-      // no matter where the cell appears onscreen.
-      return col == 1;
-
-    }
-
-    /*
-     * Don't need to implement this method unless your table's data can change.
-     */
-    @Override
-    public void setValueAt(Object value, int row, int col)
-    {
-      data[row][col] = value;
-      fireTableCellUpdated(row, col);
-
-      String name = getValueAt(row, 0).toString();
-      boolean selected = ((Boolean) value).booleanValue();
-
-      if (selectedSources.contains(name) && !selected)
-      {
-        selectedSources.remove(name);
-      }
-
-      if (!selectedSources.contains(name) && selected)
-      {
-        selectedSources.add(name);
-      }
-    }
-  }
-
-  public void initDasSources()
-  {
-
-    Thread thr = new Thread(new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        // this actually initialises the das source list
-        paintComponent(null); // yuk
-      }
-    });
-    thr.start();
-    while (loadingDasSources || sourceRegistry == null)
-    {
-      try
-      {
-        Thread.sleep(10);
-      } catch (Exception e)
-      {
-      }
-      ;
-    }
-  }
-
-  /**
-   * disable or enable the buttons on the source browser
-   * 
-   * @param b
-   */
-  public void setGuiEnabled(boolean b)
-  {
-    refresh.setEnabled(b);
-    addLocal.setEnabled(b);
-  }
-}
index 24ed1f7..bbdddbb 100644 (file)
@@ -32,6 +32,7 @@ import jalview.io.FileFormatException;
 import jalview.io.FileFormatI;
 import jalview.io.FileFormats;
 import jalview.io.FileLoader;
+import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
@@ -68,6 +69,7 @@ import java.awt.dnd.DropTargetEvent;
 import java.awt.dnd.DropTargetListener;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -91,10 +93,13 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Semaphore;
 
 import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.ActionMap;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
 import javax.swing.DefaultDesktopManager;
 import javax.swing.DesktopManager;
+import javax.swing.InputMap;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
@@ -116,6 +121,8 @@ import javax.swing.event.InternalFrameEvent;
 import javax.swing.event.MenuEvent;
 import javax.swing.event.MenuListener;
 
+import org.stackoverflowusers.file.WindowsShortcut;
+
 /**
  * Jalview Desktop
  * 
@@ -512,7 +519,7 @@ public class Desktop extends jalview.jbgui.GDesktop
   {
     final Desktop me = this;
     // Thread off the news reader, in case there are connection problems.
-    addDialogThread(new Runnable()
+    new Thread(new Runnable()
     {
       @Override
       public void run()
@@ -523,13 +530,13 @@ public class Desktop extends jalview.jbgui.GDesktop
         showNews.setVisible(true);
         Cache.log.debug("Completed news thread.");
       }
-    });
+    }).start();
   }
 
   public void getIdentifiersOrgData()
   {
     // Thread off the identifiers fetcher
-    addDialogThread(new Runnable()
+    new Thread(new Runnable()
     {
       @Override
       public void run()
@@ -546,7 +553,8 @@ public class Desktop extends jalview.jbgui.GDesktop
                   + e.getMessage());
         }
       }
-    });
+    }).start();
+    ;
   }
 
   @Override
@@ -919,6 +927,8 @@ public class Desktop extends jalview.jbgui.GDesktop
       }
     });
 
+    setKeyBindings(frame);
+
     desktop.add(frame);
 
     windowMenu.add(menuItem);
@@ -938,6 +948,42 @@ public class Desktop extends jalview.jbgui.GDesktop
     }
   }
 
+  /**
+   * Add key bindings to a JInternalFrame so that Ctrl-W and Cmd-W will close
+   * the window
+   * 
+   * @param frame
+   */
+  private static void setKeyBindings(JInternalFrame frame)
+  {
+    @SuppressWarnings("serial")
+    final Action closeAction = new AbstractAction()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        frame.dispose();
+      }
+    };
+
+    /*
+     * set up key bindings for Ctrl-W and Cmd-W, with the same (Close) action
+     */
+    KeyStroke ctrlWKey = KeyStroke.getKeyStroke(KeyEvent.VK_W,
+            InputEvent.CTRL_DOWN_MASK);
+    KeyStroke cmdWKey = KeyStroke.getKeyStroke(KeyEvent.VK_W,
+            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
+
+    InputMap inputMap = frame
+            .getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+    String ctrlW = ctrlWKey.toString();
+    inputMap.put(ctrlWKey, ctrlW);
+    inputMap.put(cmdWKey, ctrlW);
+
+    ActionMap actionMap = frame.getActionMap();
+    actionMap.put(ctrlW, closeAction);
+  }
+
   @Override
   public void lostOwnership(Clipboard clipboard, Transferable contents)
   {
@@ -1559,9 +1605,10 @@ public class Desktop extends jalview.jbgui.GDesktop
    *          DOCUMENT ME!
    */
   @Override
-  public void saveState_actionPerformed(ActionEvent e)
+  public void saveState_actionPerformed(boolean asCastor)
   {
-    JalviewFileChooser chooser = new JalviewFileChooser("jvp",
+    JalviewFileChooser chooser = new JalviewFileChooser(
+            asCastor ? "jvp" : "jvx",
             "Jalview Project");
 
     chooser.setFileView(new JalviewFileView());
@@ -1590,7 +1637,14 @@ public class Desktop extends jalview.jbgui.GDesktop
           // TODO prevent user from messing with the Desktop whilst we're saving
           try
           {
-            new Jalview2XML().saveState(choice);
+            if (asCastor)
+            {
+              new Jalview2XML().saveState(choice);
+            }
+            else
+            {
+              new jalview.project.Jalview2XML().saveState(choice);
+            }
           } catch (OutOfMemoryError oom)
           {
             new OOMWarning(
@@ -1632,13 +1686,19 @@ public class Desktop extends jalview.jbgui.GDesktop
    *          DOCUMENT ME!
    */
   @Override
-  public void loadState_actionPerformed(ActionEvent e)
-  {
+  public void loadState_actionPerformed(boolean asCastor)
+  {
+    final String[] suffix = asCastor ? new String[] { "jvp", "jar" }
+            : new String[]
+            { "jvx" };
+    final String[] desc = asCastor
+            ? new String[]
+            { "Jalview Project", "Jalview Project (old)" }
+            : new String[]
+            { "Jalview Project" };
     JalviewFileChooser chooser = new JalviewFileChooser(
-            Cache.getProperty("LAST_DIRECTORY"), new String[]
-            { "jvp", "jar" },
-            new String[]
-            { "Jalview Project", "Jalview Project (old)" },
+            Cache.getProperty("LAST_DIRECTORY"), suffix,
+            desc,
             "Jalview Project");
     chooser.setFileView(new JalviewFileView());
     chooser.setDialogTitle(MessageManager.getString("label.restore_state"));
@@ -1661,7 +1721,14 @@ public class Desktop extends jalview.jbgui.GDesktop
                   { choice }), choice.hashCode());
           try
           {
-            new Jalview2XML().loadJalviewAlign(choice);
+            if (asCastor)
+            {
+              new Jalview2XML().loadJalviewAlign(choice);
+            }
+            else
+            {
+              new jalview.project.Jalview2XML().loadJalviewAlign(choice);
+            }
           } catch (OutOfMemoryError oom)
           {
             new OOMWarning("Whilst loading project from " + choice, oom);
@@ -3291,13 +3358,67 @@ public class Desktop extends jalview.jbgui.GDesktop
     return groovyConsole;
   }
 
+  /**
+   * handles the payload of a drag and drop event.
+   * 
+   * TODO refactor to desktop utilities class
+   * 
+   * @param files
+   *          - Data source strings extracted from the drop event
+   * @param protocols
+   *          - protocol for each data source extracted from the drop event
+   * @param evt
+   *          - the drop event
+   * @param t
+   *          - the payload from the drop event
+   * @throws Exception
+   */
   public static void transferFromDropTarget(List<String> files,
           List<DataSourceType> protocols, DropTargetDropEvent evt,
           Transferable t) throws Exception
   {
 
     DataFlavor uriListFlavor = new DataFlavor(
-            "text/uri-list;class=java.lang.String");
+            "text/uri-list;class=java.lang.String"), urlFlavour = null;
+    try
+    {
+      urlFlavour = new DataFlavor(
+              "application/x-java-url; class=java.net.URL");
+    } catch (ClassNotFoundException cfe)
+    {
+      Cache.log.debug("Couldn't instantiate the URL dataflavor.", cfe);
+    }
+
+    if (urlFlavour != null && t.isDataFlavorSupported(urlFlavour))
+    {
+
+      try
+      {
+      java.net.URL url = (URL) t.getTransferData(urlFlavour);
+        // nb: java 8 osx bug https://bugs.openjdk.java.net/browse/JDK-8156099
+        // means url may be null.
+      if (url != null)
+      {
+        protocols.add(DataSourceType.URL);
+        files.add(url.toString());
+        Cache.log.debug("Drop handled as URL dataflavor "
+                + files.get(files.size() - 1));
+          return;
+        }
+        else
+        {
+          if (Platform.isAMac())
+          {
+            System.err.println(
+                    "Please ignore plist error - occurs due to problem with java 8 on OSX");
+          }
+          ;
+      }
+      } catch (Throwable ex)
+      {
+        Cache.log.debug("URL drop handler failed.", ex);
+      }
+    }
     if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
     {
       // Works on Windows and MacOSX
@@ -3325,63 +3446,112 @@ public class Desktop extends jalview.jbgui.GDesktop
         // fallback to text: workaround - on OSX where there's a JVM bug
         Cache.log.debug("standard URIListFlavor failed. Trying text");
         // try text fallback
-        data = (String) t.getTransferData(
-                new DataFlavor("text/plain;class=java.lang.String"));
-        if (Cache.log.isDebugEnabled())
+        DataFlavor textDf = new DataFlavor(
+                "text/plain;class=java.lang.String");
+        if (t.isDataFlavorSupported(textDf))
         {
-          Cache.log.debug("fallback returned " + data);
+          data = (String) t.getTransferData(textDf);
         }
+
+        Cache.log.debug("Plain text drop content returned "
+                + (data == null ? "Null - failed" : data));
+
       }
-      while (protocols.size() < files.size())
-      {
-        Cache.log.debug("Adding missing FILE protocol for "
-                + files.get(protocols.size()));
-        protocols.add(DataSourceType.FILE);
-      }
-      for (java.util.StringTokenizer st = new java.util.StringTokenizer(
-              data, "\r\n"); st.hasMoreTokens();)
+      if (data != null)
       {
-        added = true;
-        String s = st.nextToken();
-        if (s.startsWith("#"))
-        {
-          // the line is a comment (as per the RFC 2483)
-          continue;
-        }
-        java.net.URI uri = new java.net.URI(s);
-        if (uri.getScheme().toLowerCase().startsWith("http"))
+        while (protocols.size() < files.size())
         {
-          protocols.add(DataSourceType.URL);
-          files.add(uri.toString());
+          Cache.log.debug("Adding missing FILE protocol for "
+                  + files.get(protocols.size()));
+          protocols.add(DataSourceType.FILE);
         }
-        else
+        for (java.util.StringTokenizer st = new java.util.StringTokenizer(
+                data, "\r\n"); st.hasMoreTokens();)
         {
-          // otherwise preserve old behaviour: catch all for file objects
-          java.io.File file = new java.io.File(uri);
-          protocols.add(DataSourceType.FILE);
-          files.add(file.toString());
+          added = true;
+          String s = st.nextToken();
+          if (s.startsWith("#"))
+          {
+            // the line is a comment (as per the RFC 2483)
+            continue;
+          }
+          java.net.URI uri = new java.net.URI(s);
+          if (uri.getScheme().toLowerCase().startsWith("http"))
+          {
+            protocols.add(DataSourceType.URL);
+            files.add(uri.toString());
+          }
+          else
+          {
+            // otherwise preserve old behaviour: catch all for file objects
+            java.io.File file = new java.io.File(uri);
+            protocols.add(DataSourceType.FILE);
+            files.add(file.toString());
+          }
         }
       }
+
       if (Cache.log.isDebugEnabled())
       {
         if (data == null || !added)
         {
-          Cache.log.debug(
-                  "Couldn't resolve drop data. Here are the supported flavors:");
-          for (DataFlavor fl : t.getTransferDataFlavors())
+
+          if (t.getTransferDataFlavors() != null
+                  && t.getTransferDataFlavors().length > 0)
           {
             Cache.log.debug(
-                    "Supported transfer dataflavor: " + fl.toString());
-            Object df = t.getTransferData(fl);
-            if (df != null)
+                    "Couldn't resolve drop data. Here are the supported flavors:");
+            for (DataFlavor fl : t.getTransferDataFlavors())
             {
-              Cache.log.debug("Retrieves: " + df);
-            }
-            else
-            {
-              Cache.log.debug("Retrieved nothing");
+              Cache.log.debug(
+                      "Supported transfer dataflavor: " + fl.toString());
+              Object df = t.getTransferData(fl);
+              if (df != null)
+              {
+                Cache.log.debug("Retrieves: " + df);
+              }
+              else
+              {
+                Cache.log.debug("Retrieved nothing");
+              }
             }
           }
+          else
+          {
+            Cache.log.debug("Couldn't resolve dataflavor for drop: "
+                    + t.toString());
+          }
+        }
+      }
+    }
+    if (Platform.isWindows())
+
+    {
+      Cache.log.debug("Scanning dropped content for Windows Link Files");
+
+      // resolve any .lnk files in the file drop
+      for (int f = 0; f < files.size(); f++)
+      {
+        String source = files.get(f).toLowerCase();
+        if (protocols.get(f).equals(DataSourceType.FILE)
+                && (source.endsWith(".lnk") || source.endsWith(".url")
+                        || source.endsWith(".site")))
+        {
+          try {
+            File lf = new File(files.get(f));
+            // process link file to get a URL
+            Cache.log.debug("Found potential link file: " + lf);
+            WindowsShortcut wscfile = new WindowsShortcut(lf);
+            String fullname = wscfile.getRealFilename();
+            protocols.set(f, FormatAdapter.checkProtocol(fullname));
+            files.set(f, fullname);
+            Cache.log.debug("Parsed real filename " + fullname
+                    + " to extract protocol: " + protocols.get(f));
+          }
+          catch (Exception ex)
+          {
+            Cache.log.error("Couldn't parse "+files.get(f)+" as a link file.",ex);
+          }
         }
       }
     }
@@ -3396,4 +3566,41 @@ public class Desktop extends jalview.jbgui.GDesktop
   {
     Cache.setProperty(EXPERIMENTAL_FEATURES, Boolean.toString(selected));
   }
+
+  /**
+   * Answers a (possibly empty) list of any structure viewer frames (currently
+   * for either Jmol or Chimera) which are currently open. This may optionally
+   * be restricted to viewers of a specified class, or viewers linked to a
+   * specified alignment panel.
+   * 
+   * @param apanel
+   *          if not null, only return viewers linked to this panel
+   * @param structureViewerClass
+   *          if not null, only return viewers of this class
+   * @return
+   */
+  public List<StructureViewerBase> getStructureViewers(
+          AlignmentPanel apanel,
+          Class<? extends StructureViewerBase> structureViewerClass)
+  {
+    List<StructureViewerBase> result = new ArrayList<>();
+    JInternalFrame[] frames = Desktop.instance.getAllFrames();
+
+    for (JInternalFrame frame : frames)
+    {
+      if (frame instanceof StructureViewerBase)
+      {
+        if (structureViewerClass == null
+                || structureViewerClass.isInstance(frame))
+        {
+          if (apanel == null
+                  || ((StructureViewerBase) frame).isLinkedWith(apanel))
+          {
+            result.add((StructureViewerBase) frame);
+          }
+        }
+      }
+    }
+    return result;
+  }
 }
index 821454f..90d7c35 100644 (file)
@@ -30,16 +30,14 @@ import jalview.datamodel.features.FeatureMatcherSetI;
 import jalview.gui.Help.HelpId;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
-import jalview.schemabinding.version2.Filter;
-import jalview.schemabinding.version2.JalviewUserColours;
-import jalview.schemabinding.version2.MatcherSet;
 import jalview.schemes.FeatureColour;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
-import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.seqfeatures.FeatureRendererModel.FeatureSettingsBean;
-import jalview.ws.DasSequenceFeatureFetcher;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
+import jalview.xml.binding.jalview.JalviewUserColours;
+import jalview.xml.binding.jalview.JalviewUserColours.Colour;
+import jalview.xml.binding.jalview.JalviewUserColours.Filter;
+import jalview.xml.binding.jalview.ObjectFactory;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -74,7 +72,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Vector;
 
 import javax.help.HelpSetException;
 import javax.swing.AbstractCellEditor;
@@ -96,13 +93,17 @@ import javax.swing.JSlider;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.table.AbstractTableModel;
 import javax.swing.table.TableCellEditor;
 import javax.swing.table.TableCellRenderer;
 import javax.swing.table.TableColumn;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
 
 public class FeatureSettings extends JPanel
         implements FeatureSettingsControllerI
@@ -127,12 +128,6 @@ public class FeatureSettings extends JPanel
 
   private static final int MIN_HEIGHT = 400;
 
-  DasSourceBrowser dassourceBrowser;
-
-  DasSequenceFeatureFetcher dasFeatureFetcher;
-
-  JPanel dasSettingsPane = new JPanel();
-
   final FeatureRenderer fr;
 
   public final AlignFrame af;
@@ -325,9 +320,6 @@ public class FeatureSettings extends JPanel
     // MessageManager.getString("label.feature_settings_click_drag")));
     scrollPane.setViewportView(table);
 
-    dassourceBrowser = new DasSourceBrowser(this);
-    dasSettingsPane.add(dassourceBrowser, BorderLayout.CENTER);
-
     if (af.getViewport().isShowSequenceFeatures() || !fr.hasRenderOrder())
     {
       fr.findAllFeatures(true); // display everything!
@@ -376,7 +368,6 @@ public class FeatureSettings extends JPanel
                       javax.swing.event.InternalFrameEvent evt)
               {
                 fr.removePropertyChangeListener(change);
-                dassourceBrowser.fs = null;
               };
             });
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
@@ -889,30 +880,39 @@ public class FeatureSettings extends JPanel
       InputStreamReader in = new InputStreamReader(
               new FileInputStream(file), "UTF-8");
 
-      JalviewUserColours jucs = JalviewUserColours.unmarshal(in);
+      JAXBContext jc = JAXBContext
+              .newInstance("jalview.xml.binding.jalview");
+      javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+      XMLStreamReader streamReader = XMLInputFactory.newInstance()
+              .createXMLStreamReader(in);
+      JAXBElement<JalviewUserColours> jbe = um.unmarshal(streamReader,
+              JalviewUserColours.class);
+      JalviewUserColours jucs = jbe.getValue();
+
+      // JalviewUserColours jucs = JalviewUserColours.unmarshal(in);
 
       /*
        * load feature colours
        */
-      for (int i = jucs.getColourCount() - 1; i >= 0; i--)
+      for (int i = jucs.getColour().size() - 1; i >= 0; i--)
       {
-        jalview.schemabinding.version2.Colour newcol = jucs.getColour(i);
-        FeatureColourI colour = Jalview2XML.unmarshalColour(newcol);
+        Colour newcol = jucs.getColour().get(i);
+        FeatureColourI colour = jalview.project.Jalview2XML
+                .parseColour(newcol);
         fr.setColour(newcol.getName(), colour);
-        fr.setOrder(newcol.getName(), i / (float) jucs.getColourCount());
+        fr.setOrder(newcol.getName(), i / (float) jucs.getColour().size());
       }
 
       /*
        * load feature filters; loaded filters will replace any that are
        * currently defined, other defined filters are left unchanged 
        */
-      for (int i = 0; i < jucs.getFilterCount(); i++)
+      for (int i = 0; i < jucs.getFilter().size(); i++)
       {
-        jalview.schemabinding.version2.Filter filterModel = jucs
-                .getFilter(i);
+        Filter filterModel = jucs.getFilter().get(i);
         String featureType = filterModel.getFeatureType();
-        FeatureMatcherSetI filter = Jalview2XML.unmarshalFilter(featureType,
-                filterModel.getMatcherSet());
+        FeatureMatcherSetI filter = jalview.project.Jalview2XML
+                .parseFilter(featureType, filterModel.getMatcherSet());
         if (!filter.isEmpty())
         {
           fr.setFeatureFilter(featureType, filter);
@@ -994,9 +994,9 @@ public class FeatureSettings extends JPanel
       for (String featureType : sortedTypes)
       {
         FeatureColourI fcol = fr.getFeatureStyle(featureType);
-        jalview.schemabinding.version2.Colour col = Jalview2XML.marshalColour(
-                featureType, fcol);
-        ucs.addColour(col);
+        Colour col = jalview.project.Jalview2XML.marshalColour(featureType,
+                fcol);
+        ucs.getColour().add(col);
       }
 
       /*
@@ -1009,16 +1009,26 @@ public class FeatureSettings extends JPanel
         {
           Iterator<FeatureMatcherI> iterator = filter.getMatchers().iterator();
           FeatureMatcherI firstMatcher = iterator.next();
-          MatcherSet ms = Jalview2XML.marshalFilter(firstMatcher, iterator,
+          jalview.xml.binding.jalview.FeatureMatcherSet ms = jalview.project.Jalview2XML
+                  .marshalFilter(firstMatcher, iterator,
                   filter.isAnded());
           Filter filterModel = new Filter();
           filterModel.setFeatureType(featureType);
           filterModel.setMatcherSet(ms);
-          ucs.addFilter(filterModel);
+          ucs.getFilter().add(filterModel);
         }
       }
+      JAXBContext jaxbContext = JAXBContext
+              .newInstance(JalviewUserColours.class);
+      Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
+      jaxbMarshaller.marshal(
+              new ObjectFactory().createJalviewUserColours(ucs), out);
+
+      // jaxbMarshaller.marshal(object, pout);
+      // marshaller.marshal(object);
+      out.flush();
 
-      ucs.marshal(out);
+      // ucs.marshal(out);
       out.close();
     } catch (Exception ex)
     {
@@ -1158,8 +1168,6 @@ public class FeatureSettings extends JPanel
     JPanel settingsPane = new JPanel();
     settingsPane.setLayout(new BorderLayout());
 
-    dasSettingsPane.setLayout(new BorderLayout());
-
     JPanel bigPanel = new JPanel();
     bigPanel.setLayout(new BorderLayout());
 
@@ -1314,38 +1322,6 @@ public class FeatureSettings extends JPanel
     transparency.setMaximum(70);
     transparency.setToolTipText(
             MessageManager.getString("label.transparency_tip"));
-    fetchDAS.setText(MessageManager.getString("label.fetch_das_features"));
-    fetchDAS.addActionListener(new ActionListener()
-    {
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        fetchDAS_actionPerformed(e);
-      }
-    });
-    saveDAS.setText(MessageManager.getString("action.save_as_default"));
-    saveDAS.addActionListener(new ActionListener()
-    {
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        saveDAS_actionPerformed(e);
-      }
-    });
-
-    JPanel dasButtonPanel = new JPanel();
-    dasButtonPanel.setBorder(BorderFactory.createEtchedBorder());
-    dasSettingsPane.setBorder(null);
-    cancelDAS.setEnabled(false);
-    cancelDAS.setText(MessageManager.getString("action.cancel_fetch"));
-    cancelDAS.addActionListener(new ActionListener()
-    {
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        cancelDAS_actionPerformed(e);
-      }
-    });
 
     JPanel transPanel = new JPanel(new GridLayout(1, 2));
     bigPanel.add(transPanel, BorderLayout.SOUTH);
@@ -1365,172 +1341,11 @@ public class FeatureSettings extends JPanel
     buttonPanel.add(loadColours);
     buttonPanel.add(saveColours);
     bigPanel.add(scrollPane, BorderLayout.CENTER);
-    dasSettingsPane.add(dasButtonPanel, BorderLayout.SOUTH);
-    dasButtonPanel.add(fetchDAS);
-    dasButtonPanel.add(cancelDAS);
-    dasButtonPanel.add(saveDAS);
     settingsPane.add(bigPanel, BorderLayout.CENTER);
     settingsPane.add(buttonPanel, BorderLayout.SOUTH);
     this.add(settingsPane);
   }
 
-  public void fetchDAS_actionPerformed(ActionEvent e)
-  {
-    fetchDAS.setEnabled(false);
-    cancelDAS.setEnabled(true);
-    dassourceBrowser.setGuiEnabled(false);
-    Vector<jalviewSourceI> selectedSources = dassourceBrowser
-            .getSelectedSources();
-    doDasFeatureFetch(selectedSources, true, true);
-  }
-
-  /**
-   * get the features from selectedSources for all or the current selection
-   * 
-   * @param selectedSources
-   * @param checkDbRefs
-   * @param promptFetchDbRefs
-   */
-  private void doDasFeatureFetch(List<jalviewSourceI> selectedSources,
-          boolean checkDbRefs, boolean promptFetchDbRefs)
-  {
-    SequenceI[] dataset, seqs;
-    int iSize;
-    AlignmentViewport vp = af.getViewport();
-    if (vp.getSelectionGroup() != null
-            && vp.getSelectionGroup().getSize() > 0)
-    {
-      iSize = vp.getSelectionGroup().getSize();
-      dataset = new SequenceI[iSize];
-      seqs = vp.getSelectionGroup().getSequencesInOrder(vp.getAlignment());
-    }
-    else
-    {
-      iSize = vp.getAlignment().getHeight();
-      seqs = vp.getAlignment().getSequencesArray();
-    }
-
-    dataset = new SequenceI[iSize];
-    for (int i = 0; i < iSize; i++)
-    {
-      dataset[i] = seqs[i].getDatasetSequence();
-    }
-
-    cancelDAS.setEnabled(true);
-    dasFeatureFetcher = new jalview.ws.DasSequenceFeatureFetcher(dataset,
-            this, selectedSources, checkDbRefs, promptFetchDbRefs);
-    af.getViewport().setShowSequenceFeatures(true);
-    af.showSeqFeatures.setSelected(true);
-  }
-
-  /**
-   * blocking call to initialise the das source browser
-   */
-  public void initDasSources()
-  {
-    dassourceBrowser.initDasSources();
-  }
-
-  /**
-   * examine the current list of das sources and return any matching the given
-   * nicknames in sources
-   * 
-   * @param sources
-   *          Vector of Strings to resolve to DAS source nicknames.
-   * @return sources that are present in source list.
-   */
-  public List<jalviewSourceI> resolveSourceNicknames(Vector<String> sources)
-  {
-    return dassourceBrowser.sourceRegistry.resolveSourceNicknames(sources);
-  }
-
-  /**
-   * get currently selected das sources. ensure you have called initDasSources
-   * before calling this.
-   * 
-   * @return vector of selected das source nicknames
-   */
-  public Vector<jalviewSourceI> getSelectedSources()
-  {
-    return dassourceBrowser.getSelectedSources();
-  }
-
-  /**
-   * properly initialise DAS fetcher and then initiate a new thread to fetch
-   * features from the named sources (rather than any turned on by default)
-   * 
-   * @param sources
-   * @param block
-   *          if true then runs in same thread, otherwise passes to the Swing
-   *          executor
-   */
-  public void fetchDasFeatures(Vector<String> sources, boolean block)
-  {
-    initDasSources();
-    List<jalviewSourceI> resolved = dassourceBrowser.sourceRegistry
-            .resolveSourceNicknames(sources);
-    if (resolved.size() == 0)
-    {
-      resolved = dassourceBrowser.getSelectedSources();
-    }
-    if (resolved.size() > 0)
-    {
-      final List<jalviewSourceI> dassources = resolved;
-      fetchDAS.setEnabled(false);
-      // cancelDAS.setEnabled(true); doDasFetch does this.
-      Runnable fetcher = new Runnable()
-      {
-
-        @Override
-        public void run()
-        {
-          doDasFeatureFetch(dassources, true, false);
-
-        }
-      };
-      if (block)
-      {
-        fetcher.run();
-      }
-      else
-      {
-        SwingUtilities.invokeLater(fetcher);
-      }
-    }
-  }
-
-  public void saveDAS_actionPerformed(ActionEvent e)
-  {
-    dassourceBrowser
-            .saveProperties(jalview.bin.Cache.applicationProperties);
-  }
-
-  public void complete()
-  {
-    fetchDAS.setEnabled(true);
-    cancelDAS.setEnabled(false);
-    dassourceBrowser.setGuiEnabled(true);
-
-  }
-
-  public void cancelDAS_actionPerformed(ActionEvent e)
-  {
-    if (dasFeatureFetcher != null)
-    {
-      dasFeatureFetcher.cancel();
-    }
-    complete();
-  }
-
-  public void noDasSourceActive()
-  {
-    complete();
-    JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
-            MessageManager.getString("label.no_das_sources_selected_warn"),
-            MessageManager.getString("label.no_das_sources_selected_title"),
-            JvOptionPane.DEFAULT_OPTION, JvOptionPane.INFORMATION_MESSAGE);
-  }
-
   // ///////////////////////////////////////////////////////////////////////
   // http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
   // ///////////////////////////////////////////////////////////////////////
index 6eb583c..e13f6ee 100644 (file)
@@ -1414,7 +1414,7 @@ public class FeatureTypeSettings extends JalviewDialog
      * if a numeric condition is selected, show the value range
      * as a tooltip on the value input field
      */
-    setPatternTooltip(filterBy, selectedCondition, patternField);
+    setNumericHints(filterBy, selectedCondition, patternField);
 
     /*
      * add remove button if filter is populated (non-empty pattern)
@@ -1469,14 +1469,19 @@ public class FeatureTypeSettings extends JalviewDialog
   }
 
   /**
-   * If a numeric comparison condition is selected, retrieve the min-max range for
-   * the value (score or attribute), and set it as a tooltip on the value file
+   * If a numeric comparison condition is selected, retrieves the min-max range
+   * for the value (score or attribute), and sets it as a tooltip on the value
+   * field. If the field is currently empty, then pre-populates it with
+   * <ul>
+   * <li>the minimum value, if condition is > or >=</li>
+   * <li>the maximum value, if condition is < or <=</li>
+   * </ul>
    * 
    * @param attName
    * @param selectedCondition
    * @param patternField
    */
-  private void setPatternTooltip(String attName,
+  private void setNumericHints(String attName,
           Condition selectedCondition, JTextField patternField)
   {
     patternField.setToolTipText("");
@@ -1486,9 +1491,26 @@ public class FeatureTypeSettings extends JalviewDialog
       float[] minMax = getMinMax(attName);
       if (minMax != null)
       {
-        String tip = String.format("(%s - %s)",
-                DECFMT_2_2.format(minMax[0]), DECFMT_2_2.format(minMax[1]));
+        String minFormatted = DECFMT_2_2.format(minMax[0]);
+        String maxFormatted = DECFMT_2_2.format(minMax[1]);
+        String tip = String.format("(%s - %s)", minFormatted, maxFormatted);
         patternField.setToolTipText(tip);
+        if (patternField.getText().isEmpty())
+        {
+          if (selectedCondition == Condition.GE
+                  || selectedCondition == Condition.GT)
+          {
+            patternField.setText(minFormatted);
+          }
+          else
+          {
+            if (selectedCondition == Condition.LE
+                    || selectedCondition == Condition.LT)
+            {
+              patternField.setText(maxFormatted);
+            }
+          }
+        }
       }
     }
   }
@@ -1525,10 +1547,11 @@ public class FeatureTypeSettings extends JalviewDialog
     ItemListener listener = condCombo.getItemListeners()[0];
     condCombo.removeItemListener(listener);
     boolean condIsValid = false;
+
     condCombo.removeAllItems();
     for (Condition c : Condition.values())
     {
-      if ((c.isNumeric() && type != Datatype.Character)
+      if ((c.isNumeric() && type == Datatype.Number)
               || (!c.isNumeric() && type != Datatype.Number))
       {
         condCombo.addItem(c);
@@ -1551,8 +1574,6 @@ public class FeatureTypeSettings extends JalviewDialog
       condCombo.setSelectedIndex(0);
     }
 
-    condCombo.addItemListener(listener);
-
     /*
      * clear pattern if it is now invalid for condition
      */
@@ -1570,6 +1591,11 @@ public class FeatureTypeSettings extends JalviewDialog
         patternField.setText("");
       }
     }
+
+    /*
+     * restore the listener
+     */
+    condCombo.addItemListener(listener);
   }
 
   /**
@@ -1646,7 +1672,7 @@ public class FeatureTypeSettings extends JalviewDialog
     Condition cond = (Condition) condCombo.getSelectedItem();
     String pattern = valueField.getText().trim();
 
-    setPatternTooltip(attName, cond, valueField);
+    setNumericHints(attName, cond, valueField);
 
     if (pattern.length() == 0 && cond.needsAPattern())
     {
index f3c8e8f..92cc4c6 100755 (executable)
@@ -87,7 +87,7 @@ public class FontChooser extends GFontChooser
   public FontChooser(TreePanel treePanel)
   {
     this.tp = treePanel;
-    ap = treePanel.treeCanvas.ap;
+    ap = treePanel.getTreeCanvas().getAssociatedPanel();
     oldFont = treePanel.getTreeFont();
     defaultButton.setVisible(false);
     smoothFont.setEnabled(false);
@@ -134,7 +134,7 @@ public class FontChooser extends GFontChooser
       fontAsCdna.setSelected(ap.av.isProteinFontAsCdna());
     }
 
-    if (tp != null)
+    if (isTreeFont())
     {
       Desktop.addInternalFrame(frame,
               MessageManager.getString("action.change_font_tree_panel"),
@@ -229,7 +229,11 @@ public class FontChooser extends GFontChooser
   @Override
   protected void cancel_actionPerformed()
   {
-    if (ap != null)
+    if (isTreeFont())
+    {
+      tp.setTreeFont(oldFont);
+    }
+    else if (ap != null)
     {
       ap.av.setFont(oldFont, true);
       ap.av.setScaleProteinAsCdna(oldProteinScale);
@@ -250,10 +254,6 @@ public class FontChooser extends GFontChooser
         splitFrame.repaint();
       }
     }
-    else if (tp != null)
-    {
-      tp.setTreeFont(oldFont);
-    }
 
     try
     {
@@ -263,6 +263,11 @@ public class FontChooser extends GFontChooser
     }
   }
 
+  private boolean isTreeFont()
+  {
+    return tp != null;
+  }
+
   /**
    * DOCUMENT ME!
    */
@@ -317,7 +322,7 @@ public class FontChooser extends GFontChooser
       }
       return;
     }
-    if (tp != null)
+    if (isTreeFont())
     {
       tp.setTreeFont(newFont);
     }
index cd7b0b7..cf88c90 100755 (executable)
@@ -63,10 +63,6 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
   List<SequenceI> searchResults;
 
-  FontMetrics fm;
-
-  AnnotationLabels labels = null;
-
   AnnotationPanel ap;
 
   private Font idfont;
@@ -88,7 +84,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
   /**
    * DOCUMENT ME!
    * 
-   * @param gg
+   * @param g
    *          DOCUMENT ME!
    * @param hiddenRows
    *          true - check and display hidden row marker if need be
@@ -101,7 +97,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
    * @param ypos
    *          DOCUMENT ME!
    */
-  public void drawIdString(Graphics2D gg, boolean hiddenRows, SequenceI s,
+  public void drawIdString(Graphics2D g, boolean hiddenRows, SequenceI s,
           int i, int starty, int ypos)
   {
     int xPos = 0;
@@ -110,39 +106,40 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
     if ((searchResults != null) && searchResults.contains(s))
     {
-      gg.setColor(Color.black);
-      gg.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),
+      g.setColor(Color.black);
+      g.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),
               charHeight);
-      gg.setColor(Color.white);
+      g.setColor(Color.white);
     }
     else if ((av.getSelectionGroup() != null)
             && av.getSelectionGroup().getSequences(null).contains(s))
     {
-      gg.setColor(Color.lightGray);
-      gg.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),
+      g.setColor(Color.lightGray);
+      g.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),
               charHeight);
-      gg.setColor(Color.white);
+      g.setColor(Color.white);
     }
     else
     {
-      gg.setColor(av.getSequenceColour(s));
-      gg.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),
+      g.setColor(av.getSequenceColour(s));
+      g.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),
               charHeight);
-      gg.setColor(Color.black);
+      g.setColor(Color.black);
     }
 
     if (av.isRightAlignIds())
     {
+      FontMetrics fm = g.getFontMetrics();
       xPos = panelWidth
               - fm.stringWidth(s.getDisplayId(av.getShowJVSuffix())) - 4;
     }
 
-    gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
+    g.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
             (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
 
     if (hiddenRows)
     {
-      drawMarker(i, starty, ypos);
+      drawMarker(g, av, i, starty, ypos);
     }
 
   }
@@ -199,7 +196,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
     gg.translate(0, transY);
 
-    drawIds(ss, es);
+    drawIds(gg, av, ss, es, searchResults);
 
     gg.translate(0, -transY);
 
@@ -255,159 +252,167 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     gg.setColor(Color.white);
     gg.fillRect(0, 0, getWidth(), imgHeight);
     
-    drawIds(av.getRanges().getStartSeq(), av.getRanges().getEndSeq());
+    drawIds(gg, av, av.getRanges().getStartSeq(), av.getRanges().getEndSeq(), searchResults);
     
     g.drawImage(image, 0, 0, this);
   }
 
   /**
-   * DOCUMENT ME!
+   * Draws sequence ids from sequence index startSeq to endSeq (inclusive), with
+   * the font and other display settings configured on the viewport. Ids of
+   * sequences included in the selection are coloured grey, otherwise the
+   * current id colour for the sequence id is used.
    * 
-   * @param starty
-   *          DOCUMENT ME!
-   * @param endy
-   *          DOCUMENT ME!
+   * @param g
+   * @param alignViewport
+   * @param startSeq
+   * @param endSeq
+   * @param selection
    */
-  void drawIds(int starty, int endy)
+  void drawIds(Graphics2D g, AlignViewport alignViewport, final int startSeq,
+          final int endSeq, List<SequenceI> selection)
   {
-    if (av.isSeqNameItalics())
+    Font font = alignViewport.getFont();
+    if (alignViewport.isSeqNameItalics())
     {
-      setIdfont(new Font(av.getFont().getName(), Font.ITALIC,
-              av.getFont().getSize()));
+      setIdfont(new Font(font.getName(), Font.ITALIC,
+              font.getSize()));
     }
     else
     {
-      setIdfont(av.getFont());
+      setIdfont(font);
     }
 
-    gg.setFont(getIdfont());
-    fm = gg.getFontMetrics();
+    g.setFont(getIdfont());
+    FontMetrics fm = g.getFontMetrics();
 
-    if (av.antiAlias)
+    if (alignViewport.antiAlias)
     {
-      gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+      g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
               RenderingHints.VALUE_ANTIALIAS_ON);
     }
 
     Color currentColor = Color.white;
     Color currentTextColor = Color.black;
 
-    boolean hasHiddenRows = av.hasHiddenRows();
+    boolean hasHiddenRows = alignViewport.hasHiddenRows();
 
-    if (av.getWrapAlignment())
+    if (alignViewport.getWrapAlignment())
     {
-      drawIdsWrapped(starty, hasHiddenRows);
+      drawIdsWrapped(g, alignViewport, startSeq, getHeight());
       return;
     }
 
-    // No need to hang on to labels if we're not wrapped
-    labels = null;
-
     // Now draw the id strings
     int panelWidth = getWidth();
     int xPos = 0;
 
-    SequenceI sequence;
     // Now draw the id strings
-    for (int i = starty; i <= endy; i++)
+    for (int i = startSeq; i <= endSeq; i++)
     {
-      sequence = av.getAlignment().getSequenceAt(i);
+      SequenceI sequence = alignViewport.getAlignment().getSequenceAt(i);
 
       if (sequence == null)
       {
         continue;
       }
 
-      if (hasHiddenRows || av.isDisplayReferenceSeq())
+      if (hasHiddenRows || alignViewport.isDisplayReferenceSeq())
       {
-        setHiddenFont(sequence);
+        g.setFont(getHiddenFont(sequence, alignViewport));
       }
 
       // Selected sequence colours
-      if ((searchResults != null) && searchResults.contains(sequence))
+      if (selection != null && selection.contains(sequence))
       {
         currentColor = Color.black;
         currentTextColor = Color.white;
       }
-      else if ((av.getSelectionGroup() != null) && av.getSelectionGroup()
-              .getSequences(null).contains(sequence))
+      else if ((alignViewport.getSelectionGroup() != null) && alignViewport
+              .getSelectionGroup().getSequences(null).contains(sequence))
       {
         currentColor = Color.lightGray;
         currentTextColor = Color.black;
       }
       else
       {
-        currentColor = av.getSequenceColour(sequence);
+        currentColor = alignViewport.getSequenceColour(sequence);
         currentTextColor = Color.black;
       }
 
-      gg.setColor(currentColor);
+      g.setColor(currentColor);
 
-      gg.fillRect(0, (i - starty) * av.getCharHeight(), getWidth(),
-              av.getCharHeight());
+      int charHeight = alignViewport.getCharHeight();
+      g.fillRect(0, (i - startSeq) * charHeight,
+              getWidth(), charHeight);
 
-      gg.setColor(currentTextColor);
+      g.setColor(currentTextColor);
 
-      String string = sequence.getDisplayId(av.getShowJVSuffix());
+      String string = sequence
+              .getDisplayId(alignViewport.getShowJVSuffix());
 
-      if (av.isRightAlignIds())
+      if (alignViewport.isRightAlignIds())
       {
         xPos = panelWidth - fm.stringWidth(string) - 4;
       }
 
-      gg.drawString(string, xPos,
-              (((i - starty) * av.getCharHeight()) + av.getCharHeight())
-                      - (av.getCharHeight() / 5));
+      g.drawString(string, xPos, (((i - startSeq) * charHeight) + charHeight)
+              - (charHeight / 5));
 
       if (hasHiddenRows)
       {
-        drawMarker(i, starty, 0);
+        drawMarker(g, alignViewport, i, startSeq, 0);
       }
     }
   }
 
   /**
-   * Draws sequence ids in wrapped mode
+   * Draws sequence ids, and annotation labels if annotations are shown, in
+   * wrapped mode
    * 
-   * @param starty
-   * @param hasHiddenRows
+   * @param g
+   * @param alignViewport
+   * @param startSeq
    */
-  protected void drawIdsWrapped(int starty, boolean hasHiddenRows)
+  void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
+          int startSeq, int pageHeight)
   {
-    int maxwidth = av.getAlignment().getWidth();
-    int alheight = av.getAlignment().getHeight();
+    int alignmentWidth = alignViewport.getAlignment().getWidth();
+    final int alheight = alignViewport.getAlignment().getHeight();
 
-    if (av.hasHiddenColumns())
+    if (alignViewport.hasHiddenColumns())
     {
-      maxwidth = av.getAlignment().getHiddenColumns()
-              .absoluteToVisibleColumn(maxwidth) - 1;
+      alignmentWidth = alignViewport.getAlignment().getHiddenColumns()
+              .absoluteToVisibleColumn(alignmentWidth) - 1;
     }
 
     int annotationHeight = 0;
 
-    if (av.isShowAnnotation())
+    AnnotationLabels labels = null;
+    if (alignViewport.isShowAnnotation())
     {
       if (ap == null)
       {
-        ap = new AnnotationPanel(av);
+        ap = new AnnotationPanel(alignViewport);
       }
-
       annotationHeight = ap.adjustPanelHeight();
-      if (labels == null)
-      {
-        labels = new AnnotationLabels(av);
-      }
+      labels = new AnnotationLabels(alignViewport);
     }
 
-    int hgap = av.getCharHeight();
-    if (av.getScaleAboveWrapped())
+    final int charHeight = alignViewport.getCharHeight();
+    int hgap = charHeight;
+    if (alignViewport.getScaleAboveWrapped())
     {
-      hgap += av.getCharHeight();
+      hgap += charHeight;
     }
 
-    int cHeight = alheight * av.getCharHeight() + hgap + annotationHeight;
+    /*
+     * height of alignment + gap + annotations (if shown)
+     */
+    int cHeight = alheight * charHeight + hgap
+            + annotationHeight;
 
-    ViewportRanges ranges = av.getRanges();
+    ViewportRanges ranges = alignViewport.getRanges();
 
     int rowSize = ranges.getViewportWidth();
 
@@ -415,49 +420,58 @@ public class IdCanvas extends JPanel implements ViewportListenerI
      * draw repeating sequence ids until out of sequence data or
      * out of visible space, whichever comes first
      */
+    boolean hasHiddenRows = alignViewport.hasHiddenRows();
     int ypos = hgap;
-    int row = ranges.getStartRes();
-    while ((ypos <= getHeight()) && (row < maxwidth))
+    int rowStartRes = ranges.getStartRes();
+    while ((ypos <= pageHeight) && (rowStartRes < alignmentWidth))
     {
-      for (int i = starty; i < alheight; i++)
+      for (int i = startSeq; i < alheight; i++)
       {
-        SequenceI s = av.getAlignment().getSequenceAt(i);
-        if (hasHiddenRows || av.isDisplayReferenceSeq())
+        SequenceI s = alignViewport.getAlignment().getSequenceAt(i);
+        if (hasHiddenRows || alignViewport.isDisplayReferenceSeq())
         {
-          setHiddenFont(s);
+          g.setFont(getHiddenFont(s, alignViewport));
         }
         else
         {
-          gg.setFont(getIdfont());
+          g.setFont(getIdfont());
         }
-
-        drawIdString(gg, hasHiddenRows, s, i, 0, ypos);
+        drawIdString(g, hasHiddenRows, s, i, 0, ypos);
       }
 
-      if (labels != null && av.isShowAnnotation())
+      if (labels != null && alignViewport.isShowAnnotation())
       {
-        gg.translate(0, ypos + (alheight * av.getCharHeight()));
-        labels.drawComponent(gg, getWidth());
-        gg.translate(0, -ypos - (alheight * av.getCharHeight()));
+        g.translate(0, ypos + (alheight * charHeight));
+        labels.drawComponent(g, getWidth());
+        g.translate(0, -ypos - (alheight * charHeight));
       }
 
       ypos += cHeight;
-      row += rowSize;
+      rowStartRes += rowSize;
     }
   }
 
-  void drawMarker(int i, int starty, int yoffset)
+  /**
+   * Draws a marker (a blue right-pointing triangle) between sequences to
+   * indicate hidden sequences.
+   * 
+   * @param g
+   * @param alignViewport
+   * @param seqIndex
+   * @param starty
+   * @param yoffset
+   */
+  void drawMarker(Graphics2D g, AlignViewport alignViewport, int seqIndex, int starty, int yoffset)
   {
-
-    SequenceI[] hseqs = av.getAlignment()
+    SequenceI[] hseqs = alignViewport.getAlignment()
             .getHiddenSequences().hiddenSequences;
     // Use this method here instead of calling hiddenSeq adjust
     // 3 times.
     int hSize = hseqs.length;
 
-    int hiddenIndex = i;
-    int lastIndex = i - 1;
-    int nextIndex = i + 1;
+    int hiddenIndex = seqIndex;
+    int lastIndex = seqIndex - 1;
+    int nextIndex = seqIndex + 1;
 
     for (int j = 0; j < hSize; j++)
     {
@@ -478,52 +492,56 @@ public class IdCanvas extends JPanel implements ViewportListenerI
       }
     }
 
+    /*
+     * are we below or above the hidden sequences?
+     */
     boolean below = (hiddenIndex > lastIndex + 1);
     boolean above = (nextIndex > hiddenIndex + 1);
 
-    gg.setColor(Color.blue);
+    g.setColor(Color.blue);
+    int charHeight = av.getCharHeight();
+
+    /*
+     * vertices of the triangle, below or above hidden seqs
+     */
+    int[] xPoints = new int[]
+    { getWidth() - charHeight,
+        getWidth() - charHeight, getWidth() };
+    int yShift = seqIndex - starty;
+
     if (below)
     {
-      gg.fillPolygon(
-              new int[]
-              { getWidth() - av.getCharHeight(),
-                  getWidth() - av.getCharHeight(), getWidth() },
-              new int[]
-              { (i - starty) * av.getCharHeight() + yoffset,
-                  (i - starty) * av.getCharHeight() + yoffset
-                          + av.getCharHeight() / 4,
-                  (i - starty) * av.getCharHeight() + yoffset },
-              3);
+      int[] yPoints = new int[] { yShift * charHeight + yoffset,
+          yShift * charHeight + yoffset + charHeight / 4,
+          yShift * charHeight + yoffset };
+      g.fillPolygon(xPoints, yPoints, 3);
     }
     if (above)
     {
-      gg.fillPolygon(
-              new int[]
-              { getWidth() - av.getCharHeight(),
-                  getWidth() - av.getCharHeight(), getWidth() },
-              new int[]
-              { (i - starty + 1) * av.getCharHeight() + yoffset,
-                  (i - starty + 1) * av.getCharHeight() + yoffset
-                          - av.getCharHeight() / 4,
-                  (i - starty + 1) * av.getCharHeight() + yoffset },
-              3);
-
+      yShift++;
+      int[] yPoints = new int[] { yShift * charHeight + yoffset,
+          yShift * charHeight + yoffset - charHeight / 4,
+          yShift * charHeight + yoffset };
+      g.fillPolygon(xPoints, yPoints, 3);
     }
   }
 
-  void setHiddenFont(SequenceI seq)
+  /**
+   * Answers the standard sequence id font, or a bold font if the sequence is
+   * set as reference or a hidden group representative
+   * 
+   * @param seq
+   * @param alignViewport
+   * @return
+   */
+  private Font getHiddenFont(SequenceI seq, AlignViewport alignViewport)
   {
-    Font bold = new Font(av.getFont().getName(), Font.BOLD,
-            av.getFont().getSize());
-
     if (av.isReferenceSeq(seq) || av.isHiddenRepSequence(seq))
     {
-      gg.setFont(bold);
-    }
-    else
-    {
-      gg.setFont(getIdfont());
+      return new Font(av.getFont().getName(), Font.BOLD,
+              av.getFont().getSize());
     }
+    return getIdfont();
   }
 
   /**
index 0a6b9d6..8d62433 100644 (file)
@@ -20,7 +20,6 @@
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
 import jalview.util.MessageManager;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
@@ -42,7 +41,6 @@ import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JButton;
-import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -101,10 +99,10 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
      * identical DB sources, and should be collapsed.
      */
     DefaultMutableTreeNode tn = null, root = new DefaultMutableTreeNode();
-    Hashtable<String, DefaultMutableTreeNode> source = new Hashtable<String, DefaultMutableTreeNode>();
+    Hashtable<String, DefaultMutableTreeNode> source = new Hashtable<>();
     sfetcher = sfetch;
     String dbs[] = sfetch.getSupportedDb();
-    Hashtable<String, String> ht = new Hashtable<String, String>();
+    Hashtable<String, String> ht = new Hashtable<>();
     for (int i = 0; i < dbs.length; i++)
     {
       tn = source.get(dbs[i]);
@@ -370,7 +368,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
 
     tsel = dbviews.getSelectionPaths();
     boolean forcedFirstChild = false;
-    List<DbSourceProxy> srcs = new ArrayList<DbSourceProxy>();
+    List<DbSourceProxy> srcs = new ArrayList<>();
     if (tsel != null)
     {
       for (TreePath tp : tsel)
@@ -489,7 +487,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
       return null;
     }
     StringBuffer sb = new StringBuffer();
-    HashSet<String> hs = new HashSet<String>();
+    HashSet<String> hs = new HashSet<>();
     for (DbSourceProxy dbs : getSelectedSources())
     {
       String tq = dbs.getTestQuery();
@@ -506,7 +504,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
     return sb.toString();
   }
 
-  List<ActionListener> lstners = new Vector<ActionListener>();
+  List<ActionListener> lstners = new Vector<>();
 
   public void addActionListener(ActionListener actionListener)
   {
@@ -518,54 +516,6 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
     lstners.remove(actionListener);
   }
 
-  public static void main(String args[])
-  {
-    Cache.getDasSourceRegistry();
-    JDatabaseTree jdt = new JDatabaseTree(new jalview.ws.SequenceFetcher());
-    JFrame foo = new JFrame();
-    foo.setLayout(new BorderLayout());
-    foo.add(jdt.getDatabaseSelectorButton(), BorderLayout.CENTER);
-    foo.pack();
-    foo.setVisible(true);
-    int nultimes = 5;
-    final Thread us = Thread.currentThread();
-    jdt.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        us.interrupt();
-      }
-    });
-    do
-    {
-      try
-      {
-        Thread.sleep(50);
-      } catch (InterruptedException x)
-      {
-        nultimes--;
-        if (!jdt.hasSelection())
-        {
-          System.out.println("No Selection");
-        }
-        else
-        {
-          System.out.println("Selection: " + jdt.getSelectedItem());
-          int s = 1;
-          for (DbSourceProxy pr : jdt.getSelectedSources())
-          {
-            System.out.println("Source " + s++ + ": " + pr.getDbName()
-                    + " (" + pr.getDbSource() + ") Version "
-                    + pr.getDbVersion() + ". Test:\t" + pr.getTestQuery());
-          }
-          System.out.println("Test queries: " + jdt.getExampleQueries());
-        }
-      }
-    } while (nultimes > 0 && foo.isVisible());
-    foo.setVisible(false);
-  }
 
   @Override
   public void keyPressed(KeyEvent arg0)
@@ -596,4 +546,11 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
     // TODO Auto-generated method stub
 
   }
+
+  @Override
+  public void setVisible(boolean arg0)
+  {
+    System.out.println("setVisible: " + arg0);
+    super.setVisible(arg0);
+  }
 }
index 689261c..42760f3 100644 (file)
@@ -194,6 +194,12 @@ public class Jalview2XML
 
   private static final String UTF_8 = "UTF-8";
 
+  /**
+   * prefix for recovering datasets for alignments with multiple views where
+   * non-existent dataset IDs were written for some views
+   */
+  private static final String UNIQSEQSETID = "uniqueSeqSetId.";
+
   // use this with nextCounter() to make unique names for entities
   private int counter = 0;
 
@@ -1127,13 +1133,13 @@ public class Jalview2XML
           {
             TreePanel tp = (TreePanel) frames[t];
 
-            if (tp.treeCanvas.av.getAlignment() == jal)
+            if (tp.getTreeCanvas().getViewport().getAlignment() == jal)
             {
               Tree tree = new Tree();
               tree.setTitle(tp.getTitle());
               tree.setCurrentTree((av.getCurrentTree() == tp.getTree()));
               tree.setNewick(tp.getTree().print());
-              tree.setThreshold(tp.treeCanvas.threshold);
+              tree.setThreshold(tp.getTreeCanvas().getThreshold());
 
               tree.setFitToWindow(tp.fitToWindow.getState());
               tree.setFontName(tp.getTreeFont().getName());
@@ -1291,7 +1297,7 @@ public class Jalview2XML
       {
         view.setComplementId(av.getCodingComplement().getViewId());
       }
-      view.setViewName(av.viewName);
+      view.setViewName(av.getViewName());
       view.setGatheredViews(av.isGatherViewsHere());
 
       Rectangle size = ap.av.getExplodedGeometry();
@@ -3071,6 +3077,28 @@ public class Jalview2XML
             : null;
 
     // ////////////////////////////////
+    // INITIALISE ALIGNMENT SEQUENCESETID AND VIEWID
+    //
+    //
+    // If we just load in the same jar file again, the sequenceSetId
+    // will be the same, and we end up with multiple references
+    // to the same sequenceSet. We must modify this id on load
+    // so that each load of the file gives a unique id
+
+    /**
+     * used to resolve correct alignment dataset for alignments with multiple
+     * views
+     */
+    String uniqueSeqSetId = null;
+    String viewId = null;
+    if (view != null)
+    {
+      uniqueSeqSetId = view.getSequenceSetId() + uniqueSetSuffix;
+      viewId = (view.getId() == null ? null
+              : view.getId() + uniqueSetSuffix);
+    }
+
+    // ////////////////////////////////
     // LOAD SEQUENCES
 
     List<SequenceI> hiddenSeqs = null;
@@ -3188,7 +3216,7 @@ public class Jalview2XML
 
       // finally, verify all data in vamsasSet is actually present in al
       // passing on flag indicating if it is actually a stored dataset
-      recoverDatasetFor(vamsasSet, al, isdsal);
+      recoverDatasetFor(vamsasSet, al, isdsal, uniqueSeqSetId);
     }
 
     if (referenceseqForView != null)
@@ -3736,13 +3764,6 @@ public class Jalview2XML
     // ///////////////////////////////
     // LOAD VIEWPORT
 
-    // If we just load in the same jar file again, the sequenceSetId
-    // will be the same, and we end up with multiple references
-    // to the same sequenceSet. We must modify this id on load
-    // so that each load of the file gives a unique id
-    String uniqueSeqSetId = view.getSequenceSetId() + uniqueSetSuffix;
-    String viewId = (view.getId() == null ? null
-            : view.getId() + uniqueSetSuffix);
     AlignFrame af = null;
     AlignViewport av = null;
     // now check to see if we really need to create a new viewport.
@@ -3967,10 +3988,11 @@ public class Jalview2XML
           tp.setTitle(tree.getTitle());
           tp.setBounds(new Rectangle(tree.getXpos(), tree.getYpos(),
                   tree.getWidth(), tree.getHeight()));
-          tp.av = av;
-          tp.treeCanvas.av = av; // af.viewport;
-          tp.treeCanvas.ap = ap; // af.alignPanel;
-
+          tp.setViewport(av); // af.viewport; // TODO: verify 'associate with all
+          // views'
+          // works still
+          tp.getTreeCanvas().setViewport(av); // af.viewport;
+          tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
         }
         if (tp == null)
         {
@@ -3997,7 +4019,7 @@ public class Jalview2XML
         tp.showBootstrap(tree.getShowBootstrap());
         tp.showDistances(tree.getShowDistances());
 
-        tp.treeCanvas.threshold = tree.getThreshold();
+        tp.getTreeCanvas().setThreshold(tree.getThreshold());
         tp.treeCanvas.applyToAllViews = tree.isLinkToAllViews();
 
         if (tree.getCurrentTree())
@@ -4731,7 +4753,7 @@ public class Jalview2XML
 
     if (view.getViewName() != null)
     {
-      af.viewport.viewName = view.getViewName();
+      af.viewport.setViewName(view.getViewName());
       af.setInitialTabVisible();
     }
     af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),
@@ -5286,13 +5308,25 @@ public class Jalview2XML
   }
 
   private void recoverDatasetFor(SequenceSet vamsasSet, AlignmentI al,
-          boolean ignoreUnrefed)
+          boolean ignoreUnrefed, String uniqueSeqSetId)
   {
     jalview.datamodel.AlignmentI ds = getDatasetFor(
             vamsasSet.getDatasetId());
     Vector dseqs = null;
     if (ds == null)
     {
+      if (!ignoreUnrefed)
+      {
+        // try to resolve the dataset via uniqueSeqSetId
+        ds = getDatasetFor(UNIQSEQSETID + uniqueSeqSetId);
+        if (ds != null)
+        {
+          addDatasetRef(vamsasSet.getDatasetId(), ds);
+        }
+      }
+    }
+    if (ds == null)
+    {
       // create a list of new dataset sequences
       dseqs = new Vector();
     }
@@ -5315,6 +5349,8 @@ public class Jalview2XML
     if (al.getDataset() == null && !ignoreUnrefed)
     {
       al.setDataset(ds);
+      // register dataset for the alignment's uniqueSeqSetId for legacy projects
+      addDatasetRef(UNIQSEQSETID + uniqueSeqSetId, ds);
     }
   }
 
@@ -5656,6 +5692,9 @@ public class Jalview2XML
     initSeqRefs();
     JalviewModel jm = saveState(ap, null, null, null);
 
+    addDatasetRef(jm.getVamsasModel().getSequenceSet()[0].getDatasetId(),
+            ap.getAlignment().getDataset());
+
     uniqueSetSuffix = "";
     jm.getJalviewModelSequence().getViewport(0).setId(null);
     // we don't overwrite the view we just copied
index 331e738..9548839 100755 (executable)
@@ -493,7 +493,7 @@ public class Jalview2XML_V1
           tp.showBootstrap(tree.getShowBootstrap());
           tp.showDistances(tree.getShowDistances());
 
-          tp.treeCanvas.threshold = tree.getThreshold();
+          tp.getTreeCanvas().setThreshold(tree.getThreshold());
 
           if (tree.getCurrentTree())
           {
index 5ff0881..da1dffe 100644 (file)
@@ -498,8 +498,8 @@ public class PCAPanel extends GPCAPanel
 
     for (int i = 0; i < iSize; i++)
     {
-      final AlignmentPanel panel = aps[i];
-      item = new JRadioButtonMenuItem(panel.av.viewName, panel.av == rc.av);
+      final AlignmentPanel ap = aps[i];
+      item = new JRadioButtonMenuItem(ap.av.getViewName(), ap.av == rc.av);
       buttonGroup.add(item);
       item.addActionListener(new ActionListener()
       {
index 5aab26d..7d02fac 100755 (executable)
@@ -168,8 +168,6 @@ public class Preferences extends GPreferences
 
   JInternalFrame frame;
 
-  DasSourceBrowser dasSource;
-
   private WsPreferences wsPrefs;
 
   private OptionsParam promptEachTimeOpt = new OptionsParam(
@@ -190,8 +188,6 @@ public class Preferences extends GPreferences
     super();
     frame = new JInternalFrame();
     frame.setContentPane(this);
-    dasSource = new DasSourceBrowser();
-    dasTab.add(dasSource, BorderLayout.CENTER);
     wsPrefs = new WsPreferences();
     wsTab.add(wsPrefs, BorderLayout.CENTER);
     int width = 500, height = 450;
@@ -797,7 +793,6 @@ public class Preferences extends GPreferences
     Cache.applicationProperties.setProperty("PAD_GAPS",
             Boolean.toString(padGaps.isSelected()));
 
-    dasSource.saveProperties(Cache.applicationProperties);
     wsPrefs.updateAndRefreshWsMenuConfig(false);
     Cache.saveProperties();
     Desktop.instance.doConfigureStructurePrefs();
index 2d8eb7d..5c404f0 100755 (executable)
@@ -32,7 +32,6 @@ import jalview.util.Comparison;
 import jalview.viewmodel.ViewportListenerI;
 import jalview.viewmodel.ViewportRanges;
 
-import java.awt.AlphaComposite;
 import java.awt.BasicStroke;
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -365,31 +364,27 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
     width -= (width % charWidth);
     height -= (height % charHeight);
     
-    // selectImage is the selection group outline image
-    BufferedImage selectImage = drawSelectionGroup(
-            ranges.getStartRes(), ranges.getEndRes(),
-            ranges.getStartSeq(), ranges.getEndSeq());
-    
     if ((img != null) && (fastPaint
             || (getVisibleRect().width != g.getClipBounds().width)
             || (getVisibleRect().height != g.getClipBounds().height)))
     {
-      BufferedImage lcimg = buildLocalImage(selectImage);
-      g.drawImage(lcimg, 0, 0, this);
+      g.drawImage(img, 0, 0, this);
+
+      drawSelectionGroup((Graphics2D) g, ranges.getStartRes(),
+              ranges.getEndRes(), ranges.getStartSeq(), ranges.getEndSeq());
+
       fastPaint = false;
     }
-    else if ((width > 0) && (height > 0))
+    else if (width > 0 && height > 0)
     {
-      // img is a cached version of the last view we drew, if any
-      // if we have no img or the size has changed, make a new one
+      /*
+       * img is a cached version of the last view we drew, if any
+       * if we have no img or the size has changed, make a new one
+       */
       if (img == null || width != img.getWidth()
               || height != img.getHeight())
       {
-        img = setupImage();
-        if (img == null)
-        {
-          return;
-        }
+        img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
         gg = (Graphics2D) img.getGraphics();
         gg.setFont(av.getFont());
       }
@@ -412,11 +407,11 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
         drawPanel(gg, ranges.getStartRes(), ranges.getEndRes(),
                 ranges.getStartSeq(), ranges.getEndSeq(), 0);
       }
-    
-      // lcimg is a local *copy* of img which we'll draw selectImage on top of
-      BufferedImage lcimg = buildLocalImage(selectImage);
-      g.drawImage(lcimg, 0, 0, this);
 
+      drawSelectionGroup(gg, ranges.getStartRes(),
+              ranges.getEndRes(), ranges.getStartSeq(), ranges.getEndSeq());
+
+      g.drawImage(img, 0, 0, this);
     }
 
     if (av.cursorMode)
@@ -445,14 +440,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
   {
     drawPanel(g1, startRes, endRes, startSeq, endSeq, 0);
 
-    BufferedImage selectImage = drawSelectionGroup(startRes, endRes,
+    drawSelectionGroup((Graphics2D) g1, startRes, endRes,
             startSeq, endSeq);
-    if (selectImage != null)
-    {
-      ((Graphics2D) g1).setComposite(AlphaComposite
-              .getInstance(AlphaComposite.SRC_OVER));
-      g1.drawImage(selectImage, 0, 0, this);
-    }
   }
 
   /**
@@ -470,102 +459,14 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
   public void drawWrappedPanelForPrinting(Graphics g, int canvasWidth,
           int canvasHeight, int startRes)
   {
-    SequenceGroup group = av.getSelectionGroup();
-
     drawWrappedPanel(g, canvasWidth, canvasHeight, startRes);
 
+    SequenceGroup group = av.getSelectionGroup();
     if (group != null)
     {
-      BufferedImage selectImage = null;
-      try
-      {
-        selectImage = new BufferedImage(canvasWidth, canvasHeight,
-                BufferedImage.TYPE_INT_ARGB); // ARGB so alpha compositing works
-      } catch (OutOfMemoryError er)
-      {
-        System.gc();
-        System.err.println("Print image OutOfMemory Error.\n" + er);
-        new OOMWarning("Creating wrapped alignment image for printing", er);
-      }
-      if (selectImage != null)
-      {
-        Graphics2D g2 = selectImage.createGraphics();
-        setupSelectionGroup(g2, selectImage);
-        drawWrappedSelection(g2, group, canvasWidth, canvasHeight,
+      drawWrappedSelection((Graphics2D) g, group, canvasWidth, canvasHeight,
                 startRes);
-
-        g2.setComposite(
-                AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
-        g.drawImage(selectImage, 0, 0, this);
-        g2.dispose();
-      }
-    }
-  }
-
-  /*
-   * Make a local image by combining the cached image img
-   * with any selection
-   */
-  private BufferedImage buildLocalImage(BufferedImage selectImage)
-  {
-    // clone the cached image
-         BufferedImage lcimg = new BufferedImage(img.getWidth(), img.getHeight(),
-                   img.getType());
-
-    // BufferedImage lcimg = new BufferedImage(img.getWidth(), img.getHeight(),
-    // img.getType());
-    Graphics2D g2d = lcimg.createGraphics();
-    g2d.drawImage(img, 0, 0, null);
-
-    // overlay selection group on lcimg
-    if (selectImage != null)
-    {
-      g2d.setComposite(
-              AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
-      g2d.drawImage(selectImage, 0, 0, this);
     }
-
-    g2d.dispose();
-
-    return lcimg;
-  }
-
-  /*
-   * Set up a buffered image of the correct height and size for the sequence canvas
-   */
-  private BufferedImage setupImage()
-  {
-    BufferedImage lcimg = null;
-
-    int charWidth = av.getCharWidth();
-    int charHeight = av.getCharHeight();
-    
-    int width = getWidth();
-    int height = getHeight();
-
-    width -= (width % charWidth);
-    height -= (height % charHeight);
-
-    if ((width < 1) || (height < 1))
-    {
-      return null;
-    }
-
-    try
-    {
-       lcimg = new BufferedImage(width, height,
-                BufferedImage.TYPE_INT_ARGB); // ARGB so alpha compositing works
-    } catch (OutOfMemoryError er)
-    {
-      System.gc();
-      System.err.println(
-              "Group image OutOfMemory Redraw Error.\n" + er);
-      new OOMWarning("Creating alignment image for display", er);
-
-      return null;
-    }
-
-    return lcimg;
   }
 
   /**
@@ -652,8 +553,13 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
     ViewportRanges ranges = av.getRanges();
     ranges.setViewportStartAndWidth(startColumn, wrappedWidthInResidues);
 
+    // we need to call this again to make sure the startColumn +
+    // wrappedWidthInResidues values are used to calculate wrappedVisibleWidths
+    // correctly.
+    calculateWrappedGeometry(canvasWidth, canvasHeight);
+
     /*
-     * draw one width at a time (including any scales or annotation shown),
+     * draw one width at a time (excluding any scales or annotation shown),
      * until we have run out of either alignment or vertical space available
      */
     int ypos = wrappedSpaceAboveAlignment;
@@ -704,7 +610,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
      */
     wrappedRepeatHeightPx = wrappedSpaceAboveAlignment;
     // add sequences
-    wrappedRepeatHeightPx += av.getRanges().getViewportHeight()
+    wrappedRepeatHeightPx += av.getAlignment().getHeight()
             * charHeight;
     // add annotations panel height if shown
     wrappedRepeatHeightPx += getAnnotationHeight();
@@ -959,6 +865,10 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
     // chop the wrapped alignment extent up into panel-sized blocks and treat
     // each block as if it were a block from an unwrapped alignment
+    g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
+            BasicStroke.JOIN_ROUND, 3f, new float[]
+            { 5f, 3f }, 0f));
+    g.setColor(Color.RED);
     while ((ypos <= canvasHeight) && (startx < maxwidth))
     {
       // set end value to be start + width, or maxwidth, whichever is smaller
@@ -983,6 +893,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
       // update horizontal offset
       startx += cWidth;
     }
+    g.setStroke(new BasicStroke());
   }
 
   int getAnnotationHeight()
@@ -1149,14 +1060,21 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
   }
 
+  /**
+   * Draws the outlines of any groups defined on the alignment (excluding the
+   * current selection group, if any)
+   * 
+   * @param g1
+   * @param startRes
+   * @param endRes
+   * @param startSeq
+   * @param endSeq
+   * @param offset
+   */
   void drawGroupsBoundaries(Graphics g1, int startRes, int endRes,
           int startSeq, int endSeq, int offset)
   {
     Graphics2D g = (Graphics2D) g1;
-    //
-    // ///////////////////////////////////
-    // Now outline any areas if necessary
-    // ///////////////////////////////////
 
     SequenceGroup group = null;
     int groupIndex = -1;
@@ -1169,18 +1087,15 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
     if (group != null)
     {
-      g.setStroke(new BasicStroke());
-      g.setColor(group.getOutlineColour());
-      
       do
       {
+        g.setColor(group.getOutlineColour());
+
         drawPartialGroupOutline(g, group, startRes, endRes, startSeq,
                 endSeq, offset);
 
         groupIndex++;
 
-        g.setStroke(new BasicStroke());
-
         if (groupIndex >= av.getAlignment().getGroups().size())
         {
           break;
@@ -1194,33 +1109,28 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
   }
 
-
-  /*
-   * Draw the selection group as a separate image and overlay
+  /**
+   * Draws the outline of the current selection group (if any)
+   * 
+   * @param g
+   * @param startRes
+   * @param endRes
+   * @param startSeq
+   * @param endSeq
    */
-  private BufferedImage drawSelectionGroup(int startRes, int endRes,
+  private void drawSelectionGroup(Graphics2D g, int startRes, int endRes,
           int startSeq, int endSeq)
   {
-    // get a new image of the correct size
-    BufferedImage selectionImage = setupImage();
-
-    if (selectionImage == null)
-    {
-      return null;
-    }
-
     SequenceGroup group = av.getSelectionGroup();
     if (group == null)
     {
-      // nothing to draw
-      return null;
+      return;
     }
 
-    // set up drawing colour
-    Graphics2D g = (Graphics2D) selectionImage.getGraphics();
-
-    setupSelectionGroup(g, selectionImage);
-
+    g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
+            BasicStroke.JOIN_ROUND, 3f, new float[]
+            { 5f, 3f }, 0f));
+    g.setColor(Color.RED);
     if (!av.getWrapAlignment())
     {
       drawUnwrappedSelection(g, group, startRes, endRes, startSeq, endSeq,
@@ -1231,9 +1141,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
       drawWrappedSelection(g, group, getWidth(), getHeight(),
               av.getRanges().getStartRes());
     }
-
-    g.dispose();
-    return selectionImage;
+    g.setStroke(new BasicStroke());
   }
 
   /**
@@ -1324,33 +1232,23 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
   }
 
 
-  /*
-   * Set up graphics for selection group
-   */
-  private void setupSelectionGroup(Graphics2D g,
-          BufferedImage selectionImage)
-  {
-    // set background to transparent
-    g.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
-    g.fillRect(0, 0, selectionImage.getWidth(), selectionImage.getHeight());
-
-    // set up foreground to draw red dashed line
-    g.setComposite(AlphaComposite.Src);
-    g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
-            BasicStroke.JOIN_ROUND, 3f, new float[]
-    { 5f, 3f }, 0f));
-    g.setColor(Color.RED);
-  }
-
-  /*
+  /**
    * Draw a selection group over an unwrapped alignment
-   * @param g graphics object to draw with
-   * @param group selection group
-   * @param startRes start residue of area to draw
-   * @param endRes end residue of area to draw
-   * @param startSeq start sequence of area to draw
-   * @param endSeq end sequence of area to draw
-   * @param offset vertical offset (used when called from wrapped alignment code)
+   * 
+   * @param g
+   *          graphics object to draw with
+   * @param group
+   *          selection group
+   * @param startRes
+   *          start residue of area to draw
+   * @param endRes
+   *          end residue of area to draw
+   * @param startSeq
+   *          start sequence of area to draw
+   * @param endSeq
+   *          end sequence of area to draw
+   * @param offset
+   *          vertical offset (used when called from wrapped alignment code)
    */
   private void drawUnwrappedSelection(Graphics2D g, SequenceGroup group,
           int startRes, int endRes, int startSeq, int endSeq, int offset)
@@ -1388,8 +1286,16 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
     }
   }
 
-  /*
-   * Draw the selection group as a separate image and overlay
+  /**
+   * Draws part of a selection group outline
+   * 
+   * @param g
+   * @param group
+   * @param startRes
+   * @param endRes
+   * @param startSeq
+   * @param endSeq
+   * @param verticalOffset
    */
   private void drawPartialGroupOutline(Graphics2D g, SequenceGroup group,
           int startRes, int endRes, int startSeq, int endSeq,
index 12091a1..8b2e7bc 100644 (file)
@@ -2292,4 +2292,13 @@ public class SeqPanel extends JPanel
 
     return true;
   }
+
+  /**
+   * 
+   * @return null or last search results handled by this panel
+   */
+  public SearchResultsI getLastSearchResults()
+  {
+    return lastSearchResults;
+  }
 }
index 8d46792..8754fbb 100755 (executable)
@@ -34,7 +34,6 @@ import jalview.io.gff.SequenceOntologyI;
 import jalview.util.DBRefUtils;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
 import java.awt.BorderLayout;
@@ -111,10 +110,6 @@ public class SequenceFetcher extends JPanel implements Runnable
 
   private static jalview.ws.SequenceFetcher sfetch = null;
 
-  private static long lastDasSourceRegistry = -3;
-
-  private static DasSourceRegistryI dasRegistry = null;
-
   private static boolean _initingFetcher = false;
 
   private static Thread initingThread = null;
@@ -165,11 +160,7 @@ public class SequenceFetcher extends JPanel implements Runnable
                 Thread.currentThread().hashCode());
       }
     }
-    if (sfetch == null || dasRegistry != Cache.getDasSourceRegistry()
-            || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
-                    .getDasRegistryURL()
-                    + Cache.getDasSourceRegistry().getLocalSourceString())
-                            .hashCode())
+    if (sfetch == null)
     {
       _initingFetcher = true;
       initingThread = Thread.currentThread();
@@ -183,16 +174,12 @@ public class SequenceFetcher extends JPanel implements Runnable
                         "status.init_sequence_database_fetchers"),
                 Thread.currentThread().hashCode());
       }
-      dasRegistry = Cache.getDasSourceRegistry();
-      dasRegistry.refreshSources();
 
       jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
       if (guiWindow != null)
       {
         guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
       }
-      lastDasSourceRegistry = (dasRegistry.getDasRegistryURL()
-              + dasRegistry.getLocalSourceString()).hashCode();
       sfetch = sf;
       _initingFetcher = false;
       initingThread = null;
@@ -273,7 +260,7 @@ public class SequenceFetcher extends JPanel implements Runnable
         return Collections.emptyList();
       }
     }
-    sf.newAlframes = new ArrayList<AlignFrame>();
+    sf.newAlframes = new ArrayList<>();
     sf.run();
     return sf.newAlframes;
   }
@@ -564,15 +551,10 @@ public class SequenceFetcher extends JPanel implements Runnable
       dbeg.setText(MessageManager.formatMessage("label.example_query_param",
               new String[]
               { eq }));
+      // TODO this should be a property of the SequenceFetcher whether commas are and
+      // colons are allowed in the IDs...
+
       boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
-      for (DbSourceProxy dbs : database.getSelectedSources())
-      {
-        if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
-        {
-          enablePunct = false;
-          break;
-        }
-      }
       replacePunctuation.setEnabled(enablePunct);
 
     } catch (Exception ex)
@@ -674,10 +656,10 @@ public class SequenceFetcher extends JPanel implements Runnable
     // TODO: Refactor to GUI independent code and write tests.
     // indicate if successive sources should be merged into one alignment.
     boolean addToLast = false;
-    List<String> aresultq = new ArrayList<String>();
-    List<String> presultTitle = new ArrayList<String>();
-    List<AlignmentI> presult = new ArrayList<AlignmentI>();
-    List<AlignmentI> aresult = new ArrayList<AlignmentI>();
+    List<String> aresultq = new ArrayList<>();
+    List<String> presultTitle = new ArrayList<>();
+    List<AlignmentI> presult = new ArrayList<>();
+    List<AlignmentI> aresult = new ArrayList<>();
     Iterator<DbSourceProxy> proxies = database.getSelectedSources()
             .iterator();
     String[] qries;
@@ -695,7 +677,7 @@ public class SequenceFetcher extends JPanel implements Runnable
         nqueries = nextFetch.size();
         // save the remaining queries in the original array
         qries = nextFetch.toArray(new String[nqueries]);
-        nextFetch = new ArrayList<String>();
+        nextFetch = new ArrayList<>();
       }
 
       DbSourceProxy proxy = proxies.next();
@@ -861,7 +843,7 @@ public class SequenceFetcher extends JPanel implements Runnable
           List<AlignmentI> aresult, List<String> nextFetch) throws Exception
   {
     StringBuilder multiacc = new StringBuilder();
-    List<String> tosend = new ArrayList<String>();
+    List<String> tosend = new ArrayList<>();
     while (accessions.hasNext())
     {
       String nel = accessions.next();
index 5bff407..a0d31cf 100644 (file)
@@ -539,7 +539,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI
       topFrame.setDisplayedView(newTopPanel);
     }
 
-    newBottomPanel.av.viewName = newTopPanel.av.viewName;
+    newBottomPanel.av.setViewName(newTopPanel.av.getViewName());
     newTopPanel.av.setCodingComplement(newBottomPanel.av);
 
     /*
index 198aa62..e18d6af 100644 (file)
@@ -22,6 +22,7 @@
 package jalview.gui;
 
 import jalview.api.structures.JalviewStructureDisplayI;
+import jalview.bin.Cache;
 import jalview.bin.Jalview;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
@@ -68,6 +69,8 @@ import javax.swing.table.AbstractTableModel;
 public class StructureChooser extends GStructureChooser
         implements IProgressIndicator
 {
+  private static final String AUTOSUPERIMPOSE = "AUTOSUPERIMPOSE";
+
   private static int MAX_QLENGTH = 7820;
 
   private SequenceI selectedSequence;
@@ -88,6 +91,8 @@ public class StructureChooser extends GStructureChooser
 
   private boolean cachedPDBExists;
 
+  private static StructureViewer lastTargetedView = null;
+
   public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
           AlignmentPanel ap)
   {
@@ -101,13 +106,15 @@ public class StructureChooser extends GStructureChooser
   /**
    * Initializes parameters used by the Structure Chooser Panel
    */
-  public void init()
+  protected void init()
   {
     if (!Jalview.isHeadlessMode())
     {
       progressBar = new ProgressBar(this.statusPanel, this.statusBar);
     }
 
+    chk_superpose.setSelected(Cache.getDefault(AUTOSUPERIMPOSE, true));
+
     // ensure a filter option is in force for search
     populateFilterComboBox(true, cachedPDBExists);
     Thread discoverPDBStructuresThread = new Thread(new Runnable()
@@ -125,6 +132,7 @@ public class StructureChooser extends GStructureChooser
         fetchStructuresMetaData();
         // revise filter options if no results were found
         populateFilterComboBox(isStructuresDiscovered(), cachedPDBExists);
+        discoverStructureViews();
         updateProgressIndicator(null, startTime);
         mainFrame.setVisible(true);
         updateCurrentView();
@@ -134,6 +142,59 @@ public class StructureChooser extends GStructureChooser
   }
 
   /**
+   * Builds a drop-down choice list of existing structure viewers to which new
+   * structures may be added. If this list is empty then it, and the 'Add'
+   * button, are hidden.
+   */
+  private void discoverStructureViews()
+  {
+    if (Desktop.instance != null)
+    {
+      targetView.removeAllItems();
+      if (lastTargetedView != null && !lastTargetedView.isVisible())
+      {
+        lastTargetedView = null;
+      }
+      int linkedViewsAt = 0;
+      for (StructureViewerBase view : Desktop.instance
+              .getStructureViewers(null, null))
+      {
+        StructureViewer viewHandler = (lastTargetedView != null
+                && lastTargetedView.sview == view) ? lastTargetedView
+                        : StructureViewer.reconfigure(view);
+
+        if (view.isLinkedWith(ap))
+        {
+          targetView.insertItemAt(viewHandler,
+                  linkedViewsAt++);
+        }
+        else
+        {
+          targetView.addItem(viewHandler);
+        }
+      }
+
+      /*
+       * show option to Add to viewer if at least 1 viewer found
+       */
+      targetView.setVisible(false);
+      if (targetView.getItemCount() > 0)
+      {
+        targetView.setVisible(true);
+        if (lastTargetedView != null)
+        {
+          targetView.setSelectedItem(lastTargetedView);
+        }
+        else
+        {
+          targetView.setSelectedIndex(0);
+        }
+      }
+      btn_add.setVisible(targetView.isVisible());
+    }
+  }
+
+  /**
    * Updates the progress indicator with the specified message
    * 
    * @param message
@@ -141,7 +202,7 @@ public class StructureChooser extends GStructureChooser
    * @param id
    *          unique handle for this indicator
    */
-  public void updateProgressIndicator(String message, long id)
+  protected void updateProgressIndicator(String message, long id)
   {
     if (progressIndicator != null)
     {
@@ -153,7 +214,7 @@ public class StructureChooser extends GStructureChooser
    * Retrieve meta-data for all the structure(s) for a given sequence(s) in a
    * selection group
    */
-  public void fetchStructuresMetaData()
+  void fetchStructuresMetaData()
   {
     long startTime = System.currentTimeMillis();
     pdbRestCleint = PDBFTSRestClient.getInstance();
@@ -224,7 +285,7 @@ public class StructureChooser extends GStructureChooser
     }
   }
 
-  public void loadLocalCachedPDBEntries()
+  protected void loadLocalCachedPDBEntries()
   {
     ArrayList<CachedPDB> entries = new ArrayList<>();
     for (SequenceI seq : selectedSequences)
@@ -255,7 +316,7 @@ public class StructureChooser extends GStructureChooser
    * @return the built query string
    */
 
-  public static String buildQuery(SequenceI seq)
+  static String buildQuery(SequenceI seq)
   {
     boolean isPDBRefsFound = false;
     boolean isUniProtRefsFound = false;
@@ -357,7 +418,7 @@ public class StructureChooser extends GStructureChooser
    * @param seqName
    * @return
    */
-  public static boolean isValidSeqName(String seqName)
+  static boolean isValidSeqName(String seqName)
   {
     // System.out.println("seqName : " + seqName);
     String ignoreList = "pdb,uniprot,swiss-prot";
@@ -380,7 +441,7 @@ public class StructureChooser extends GStructureChooser
     return true;
   }
 
-  public static String getDBRefId(DBRefEntry dbRef)
+  static String getDBRefId(DBRefEntry dbRef)
   {
     String ref = dbRef.getAccessionId().replaceAll("GO:", "");
     return ref;
@@ -392,7 +453,7 @@ public class StructureChooser extends GStructureChooser
    * @param fieldToFilterBy
    *          the field to filter by
    */
-  public void filterResultSet(final String fieldToFilterBy)
+  void filterResultSet(final String fieldToFilterBy)
   {
     Thread filterThread = new Thread(new Runnable()
     {
@@ -502,7 +563,7 @@ public class StructureChooser extends GStructureChooser
    * Handles action event for btn_pdbFromFile
    */
   @Override
-  public void pdbFromFile_actionPerformed()
+  protected void pdbFromFile_actionPerformed()
   {
     jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
@@ -603,28 +664,37 @@ public class StructureChooser extends GStructureChooser
   }
 
   /**
-   * Validates user selection and activates the view button if all parameters
-   * are correct
+   * Validates user selection and enables the 'Add' and 'New View' buttons if
+   * all parameters are correct (the Add button will only be visible if there is
+   * at least one existing structure viewer open). This basically means at least
+   * one structure selected and no error messages.
+   * <p>
+   * The 'Superpose Structures' option is enabled if either more than one
+   * structure is selected, or the 'Add' to existing view option is enabled, and
+   * disabled if the only option is to open a new view of a single structure.
    */
   @Override
-  public void validateSelections()
+  protected void validateSelections()
   {
     FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
             .getSelectedItem());
-    btn_view.setEnabled(false);
+    btn_add.setEnabled(false);
     String currentView = selectedFilterOpt.getView();
+    int selectedCount = 0;
     if (currentView == VIEWS_FILTER)
     {
-      if (getResultTable().getSelectedRows().length > 0)
+      selectedCount = getResultTable().getSelectedRows().length;
+      if (selectedCount > 0)
       {
-        btn_view.setEnabled(true);
+        btn_add.setEnabled(true);
       }
     }
     else if (currentView == VIEWS_LOCAL_PDB)
     {
-      if (tbl_local_pdb.getSelectedRows().length > 0)
+      selectedCount = tbl_local_pdb.getSelectedRows().length;
+      if (selectedCount > 0)
       {
-        btn_view.setEnabled(true);
+        btn_add.setEnabled(true);
       }
     }
     else if (currentView == VIEWS_ENTER_ID)
@@ -635,12 +705,21 @@ public class StructureChooser extends GStructureChooser
     {
       validateAssociationFromFile();
     }
+
+    btn_newView.setEnabled(btn_add.isEnabled());
+
+    /*
+     * enable 'Superpose' option if more than one structure is selected,
+     * or there are view(s) available to add structure(s) to
+     */
+    chk_superpose
+            .setEnabled(selectedCount > 1 || targetView.getItemCount() > 0);
   }
 
   /**
    * Validates inputs from the Manual PDB entry panel
    */
-  public void validateAssociationEnterPdb()
+  protected void validateAssociationEnterPdb()
   {
     AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
             .getCmb_assSeq().getSelectedItem();
@@ -666,7 +745,7 @@ public class StructureChooser extends GStructureChooser
       txt_search.setEnabled(true);
       if (isValidPBDEntry)
       {
-        btn_view.setEnabled(true);
+        btn_add.setEnabled(true);
         lbl_pdbManualFetchStatus.setToolTipText("");
         lbl_pdbManualFetchStatus.setIcon(goodImage);
       }
@@ -681,7 +760,7 @@ public class StructureChooser extends GStructureChooser
   /**
    * Validates inputs for the manual PDB file selection options
    */
-  public void validateAssociationFromFile()
+  protected void validateAssociationFromFile()
   {
     AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
             .getCmb_assSeq().getSelectedItem();
@@ -692,7 +771,7 @@ public class StructureChooser extends GStructureChooser
       btn_pdbFromFile.setEnabled(true);
       if (selectedPdbFileName != null && selectedPdbFileName.length() > 0)
       {
-        btn_view.setEnabled(true);
+        btn_add.setEnabled(true);
         lbl_fromFileStatus.setIcon(goodImage);
       }
     }
@@ -704,7 +783,7 @@ public class StructureChooser extends GStructureChooser
   }
 
   @Override
-  public void cmbAssSeqStateChanged()
+  protected void cmbAssSeqStateChanged()
   {
     validateSelections();
   }
@@ -768,11 +847,22 @@ public class StructureChooser extends GStructureChooser
     }
     return found;
   }
+  
+  /**
+   * Handles the 'New View' action
+   */
+  @Override
+  protected void newView_ActionPerformed()
+  {
+    targetView.setSelectedItem(null);
+    showStructures(false);
+  }
+
   /**
-   * Handles action event for btn_ok
+   * Handles the 'Add to existing viewer' action
    */
   @Override
-  public void ok_ActionPerformed()
+  protected void add_ActionPerformed()
   {
     showStructures(false);
   }
@@ -957,6 +1047,30 @@ public class StructureChooser extends GStructureChooser
     return foundEntry;
   }
 
+  /**
+   * Answers a structure viewer (new or existing) configured to superimpose
+   * added structures or not according to the user's choice
+   * 
+   * @param ssm
+   * @return
+   */
+  StructureViewer getTargetedStructureViewer(
+          StructureSelectionManager ssm)
+  {
+    Object sv = targetView.getSelectedItem();
+
+    return sv == null ? new StructureViewer(ssm) : (StructureViewer) sv;
+  }
+
+  /**
+   * Adds PDB structures to a new or existing structure viewer
+   * 
+   * @param ssm
+   * @param pdbEntriesToView
+   * @param alignPanel
+   * @param sequences
+   * @return
+   */
   private StructureViewer launchStructureViewer(
           StructureSelectionManager ssm,
           final PDBEntry[] pdbEntriesToView,
@@ -965,9 +1079,17 @@ public class StructureChooser extends GStructureChooser
     long progressId = sequences.hashCode();
     setProgressBar(MessageManager
             .getString("status.launching_3d_structure_viewer"), progressId);
-    final StructureViewer sViewer = new StructureViewer(ssm);
-    setProgressBar(null, progressId);
+    final StructureViewer theViewer = getTargetedStructureViewer(ssm);
+    boolean superimpose = chk_superpose.isSelected();
+    theViewer.setSuperpose(superimpose);
+
+    /*
+     * remember user's choice of superimpose or not
+     */
+    Cache.setProperty(AUTOSUPERIMPOSE,
+            Boolean.valueOf(superimpose).toString());
 
+    setProgressBar(null, progressId);
     if (SiftsSettings.isMapWithSifts())
     {
       List<SequenceI> seqsWithoutSourceDBRef = new ArrayList<>();
@@ -992,7 +1114,7 @@ public class StructureChooser extends GStructureChooser
             }
           }
         }
-        if (seq.getPrimaryDBRefs().size() == 0)
+        if (seq.getPrimaryDBRefs().isEmpty())
         {
           seqsWithoutSourceDBRef.add(seq);
           continue;
@@ -1004,13 +1126,8 @@ public class StructureChooser extends GStructureChooser
         setProgressBar(MessageManager.formatMessage(
                 "status.fetching_dbrefs_for_sequences_without_valid_refs",
                 y), progressId);
-        SequenceI[] seqWithoutSrcDBRef = new SequenceI[y];
-        int x = 0;
-        for (SequenceI fSeq : seqsWithoutSourceDBRef)
-        {
-          seqWithoutSrcDBRef[x++] = fSeq;
-        }
-
+        SequenceI[] seqWithoutSrcDBRef = seqsWithoutSourceDBRef
+                .toArray(new SequenceI[y]);
         DBRefFetcher dbRefFetcher = new DBRefFetcher(seqWithoutSrcDBRef);
         dbRefFetcher.fetchDBRefs(true);
 
@@ -1022,17 +1139,19 @@ public class StructureChooser extends GStructureChooser
       setProgressBar(MessageManager.getString(
               "status.fetching_3d_structures_for_selected_entries"),
               progressId);
-      sViewer.viewStructures(pdbEntriesToView, sequences, alignPanel);
+      theViewer.viewStructures(pdbEntriesToView, sequences, alignPanel);
     }
     else
     {
       setProgressBar(MessageManager.formatMessage(
               "status.fetching_3d_structures_for",
               pdbEntriesToView[0].getId()),progressId);
-      sViewer.viewStructures(pdbEntriesToView[0], sequences, alignPanel);
+      theViewer.viewStructures(pdbEntriesToView[0], sequences, alignPanel);
     }
     setProgressBar(null, progressId);
-    return sViewer;
+    // remember the last viewer we used...
+    lastTargetedView = theViewer;
+    return theViewer;
   }
 
   /**
@@ -1040,7 +1159,7 @@ public class StructureChooser extends GStructureChooser
    * a unique sequence when more than one sequence selection is made.
    */
   @Override
-  public void populateCmbAssociateSeqOptions(
+  protected void populateCmbAssociateSeqOptions(
           JComboBox<AssociateSeqOptions> cmb_assSeq,
           JLabel lbl_associateSeq)
   {
@@ -1065,17 +1184,12 @@ public class StructureChooser extends GStructureChooser
     }
   }
 
-  public boolean isStructuresDiscovered()
+  protected boolean isStructuresDiscovered()
   {
     return discoveredStructuresSet != null
             && !discoveredStructuresSet.isEmpty();
   }
 
-  public Collection<FTSData> getDiscoveredStructuresSet()
-  {
-    return discoveredStructuresSet;
-  }
-
   @Override
   protected void txt_search_ActionPerformed()
   {
@@ -1125,7 +1239,7 @@ public class StructureChooser extends GStructureChooser
   }
 
   @Override
-  public void tabRefresh()
+  protected void tabRefresh()
   {
     if (selectedSequences != null)
     {
index f37df71..0c8354b 100644 (file)
@@ -49,6 +49,11 @@ public class StructureViewer
 
   StructureSelectionManager ssm;
 
+  /**
+   * decide if new structures are aligned to existing ones
+   */
+  private boolean superposeAdded = true;
+
   public enum ViewerType
   {
     JMOL, CHIMERA
@@ -64,6 +69,27 @@ public class StructureViewer
     ssm = structureSelectionManager;
   }
 
+  /**
+   * Factory to create a proxy for modifying existing structure viewer
+   * 
+   */
+  public static StructureViewer reconfigure(
+          JalviewStructureDisplayI display)
+  {
+    StructureViewer sv = new StructureViewer(display.getBinding().getSsm());
+    sv.sview = display;
+    return sv;
+  }
+
+  @Override
+  public String toString()
+  {
+    if (sview != null)
+    {
+      return sview.toString();
+    }
+    return "New View";
+  }
   public ViewerType getViewerType()
   {
     String viewType = Cache.getDefault(Preferences.STRUCTURE_DISPLAY,
@@ -104,14 +130,40 @@ public class StructureViewer
             new PDBEntry[seqsForPdbs.size()]);
     SequenceI[][] theSeqs = seqsForPdbs.values().toArray(
             new SequenceI[seqsForPdbs.size()][]);
+    if (sview != null)
+    {
+      sview.setAlignAddedStructures(superposeAdded);
+      new Thread(new Runnable()
+      {
+        @Override
+        public void run()
+        {
+
+          for (int pdbep = 0; pdbep < pdbsForFile.length; pdbep++)
+          {
+            PDBEntry pdb = pdbsForFile[pdbep];
+            if (!sview.addAlreadyLoadedFile(theSeqs[pdbep], null, ap,
+                    pdb.getId()))
+            {
+              sview.addToExistingViewer(pdb, theSeqs[pdbep], null, ap,
+                      pdb.getId());
+            }
+          }
+
+          sview.updateTitleAndMenus();
+        }
+      }).start();
+      return sview;
+    }
 
     if (viewerType.equals(ViewerType.JMOL))
     {
-      sview = new AppJmol(ap, pdbsForFile, theSeqs);
+      sview = new AppJmol(ap, superposeAdded, pdbsForFile, theSeqs);
     }
     else if (viewerType.equals(ViewerType.CHIMERA))
     {
-      sview = new ChimeraViewFrame(pdbsForFile, theSeqs, ap);
+      sview = new ChimeraViewFrame(pdbsForFile, superposeAdded, theSeqs,
+              ap);
     }
     else
     {
@@ -232,6 +284,18 @@ public class StructureViewer
   public JalviewStructureDisplayI viewStructures(PDBEntry pdb,
           SequenceI[] seqsForPdb, AlignmentPanel ap)
   {
+    if (sview != null)
+    {
+      sview.setAlignAddedStructures(superposeAdded);
+      String pdbId = pdb.getId();
+      if (!sview.addAlreadyLoadedFile(seqsForPdb, null, ap, pdbId))
+      {
+        sview.addToExistingViewer(pdb, seqsForPdb, null, ap, pdbId);
+      }
+      sview.updateTitleAndMenus();
+      sview.raiseViewer();
+      return sview;
+    }
     ViewerType viewerType = getViewerType();
     if (viewerType.equals(ViewerType.JMOL))
     {
@@ -299,4 +363,29 @@ public class StructureViewer
     return false;
   }
 
+  /**
+   * 
+   * @param pDBid
+   * @return true if view is already showing PDBid
+   */
+  public boolean hasPdbId(String pDBid)
+  {
+    if (sview == null)
+    {
+      return false;
+    }
+
+    return sview.getBinding().hasPdbId(pDBid);
+  }
+
+  public boolean isVisible()
+  {
+    return sview != null && sview.isVisible();
+  }
+
+  public void setSuperpose(boolean alignAddedStructures)
+  {
+    superposeAdded = alignAddedStructures;
+  }
+
 }
index 93d675a..72b0bcc 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import jalview.api.AlignmentViewPanel;
 import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
@@ -129,6 +130,26 @@ public abstract class StructureViewerBase extends GStructureViewer
   }
 
   /**
+   * @return true if added structures should be aligned to existing one(s)
+   */
+  @Override
+  public boolean isAlignAddedStructures()
+  {
+    return alignAddedStructures;
+  }
+
+  /**
+   * 
+   * @param true
+   *          if added structures should be aligned to existing one(s)
+   */
+  @Override
+  public void setAlignAddedStructures(boolean alignAdded)
+  {
+    alignAddedStructures = alignAdded;
+  }
+
+  /**
    * 
    * @param ap2
    * @return true if this Jmol instance is linked with the given alignPanel
@@ -334,7 +355,7 @@ public abstract class StructureViewerBase extends GStructureViewer
    */
   protected void addStructure(final PDBEntry pdbentry,
           final SequenceI[] seqs, final String[] chains,
-          final boolean align, final IProgressIndicator alignFrame)
+          final IProgressIndicator alignFrame)
   {
     if (pdbentry.getFile() == null)
     {
@@ -358,7 +379,7 @@ public abstract class StructureViewerBase extends GStructureViewer
               }
             }
             // and call ourselves again.
-            addStructure(pdbentry, seqs, chains, align, alignFrame);
+            addStructure(pdbentry, seqs, chains, alignFrame);
           }
         }).start();
         return;
@@ -370,87 +391,42 @@ public abstract class StructureViewerBase extends GStructureViewer
             { seqs }, new String[][] { chains });
     addingStructures = true;
     _started = false;
-    alignAddedStructures = align;
     worker = new Thread(this);
     worker.start();
     return;
   }
 
-  /**
-   * Presents a dialog with the option to add an align a structure to an
-   * existing structure view
-   * 
-   * @param pdbId
-   * @param view
-   * @return YES, NO or CANCEL JvOptionPane code
-   */
-  protected int chooseAlignStructureToViewer(String pdbId,
-          StructureViewerBase view)
-  {
-    int option = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
-            MessageManager.formatMessage("label.add_pdbentry_to_view",
-                    new Object[]
-                    { pdbId, view.getTitle() }),
-            MessageManager
-                    .getString("label.align_to_existing_structure_view"),
-            JvOptionPane.YES_NO_CANCEL_OPTION);
-    return option;
-  }
-
   protected boolean hasPdbId(String pdbId)
   {
     return getBinding().hasPdbId(pdbId);
   }
 
-  protected abstract List<StructureViewerBase> getViewersFor(
-          AlignmentPanel alp);
-
   /**
-   * Check for any existing views involving this alignment and give user the
-   * option to add and align this molecule to one of them
-   * 
-   * @param pdbentry
-   * @param seq
-   * @param chains
-   * @param apanel
-   * @param pdbId
-   * @return true if user adds to a view, or cancels entirely, else false
+   * Returns a list of any viewer of the instantiated type. The list is
+   * restricted to those linked to the given alignment panel if it is not null.
    */
-  protected boolean addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
-          String[] chains, final AlignmentPanel apanel, String pdbId)
+  protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp)
   {
-    for (StructureViewerBase view : getViewersFor(apanel))
-    {
-      // TODO: highlight the view somehow
-      /*
-       * JAL-1742 exclude view with this structure already mapped (don't offer
-       * to align chain B to chain A of the same structure)
-       */
-      if (view.hasPdbId(pdbId))
-      {
-        continue;
-      }
-      int option = chooseAlignStructureToViewer(pdbId, view);
-      if (option == JvOptionPane.CANCEL_OPTION)
-      {
-        return true;
-      }
-      else if (option == JvOptionPane.YES_OPTION)
-      {
-        view.useAlignmentPanelForSuperposition(apanel);
-        view.addStructure(pdbentry, seq, chains, true, apanel.alignFrame);
-        return true;
-      }
-      else
-      {
-        // NO_OPTION - offer the next viewer if any
-      }
-    }
+    return Desktop.instance.getStructureViewers(alp, this.getClass());
+  }
 
+  @Override
+  public void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
+          String[] chains, final AlignmentViewPanel apanel, String pdbId)
+  {
     /*
-     * nothing offered and selected
+     * JAL-1742 exclude view with this structure already mapped (don't offer
+     * to align chain B to chain A of the same structure); code may defend
+     * against this possibility before we reach here
      */
-    return false;
+    if (hasPdbId(pdbId))
+    {
+      return;
+    }
+    AlignmentPanel alignPanel = (AlignmentPanel) apanel; // Implementation error if this
+                                                 // cast fails
+    useAlignmentPanelForSuperposition(alignPanel);
+    addStructure(pdbentry, seq, chains, alignPanel.alignFrame);
   }
 
   /**
@@ -462,9 +438,12 @@ public abstract class StructureViewerBase extends GStructureViewer
    * @param apanel
    * @param pdbFilename
    */
-  protected void addSequenceMappingsToStructure(SequenceI[] seq,
-          String[] chains, final AlignmentPanel apanel, String pdbFilename)
+  public void addSequenceMappingsToStructure(SequenceI[] seq,
+          String[] chains, final AlignmentViewPanel alpanel,
+          String pdbFilename)
   {
+    AlignmentPanel apanel = (AlignmentPanel) alpanel;
+
     // TODO : Fix multiple seq to one chain issue here.
     /*
      * create the mappings
@@ -511,47 +490,20 @@ public abstract class StructureViewerBase extends GStructureViewer
     }
   }
 
-  /**
-   * Check if the PDB file is already loaded, if so offer to add it to the
-   * existing viewer
-   * 
-   * @param seq
-   * @param chains
-   * @param apanel
-   * @param pdbId
-   * @return true if the user chooses to add to a viewer, or to cancel entirely
-   */
-  protected boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
-          final AlignmentPanel apanel, String pdbId)
+  @Override
+  public boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
+          final AlignmentViewPanel apanel, String pdbId)
   {
-    boolean finished = false;
     String alreadyMapped = apanel.getStructureSelectionManager()
             .alreadyMappedToFile(pdbId);
 
-    if (alreadyMapped != null)
+    if (alreadyMapped == null)
     {
-      /*
-       * the PDB file is already loaded
-       */
-      int option = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
-              MessageManager.formatMessage(
-                      "label.pdb_entry_is_already_displayed", new Object[]
-                      { pdbId }),
-              MessageManager.formatMessage(
-                      "label.map_sequences_to_visible_window", new Object[]
-                      { pdbId }),
-              JvOptionPane.YES_NO_CANCEL_OPTION);
-      if (option == JvOptionPane.CANCEL_OPTION)
-      {
-        finished = true;
-      }
-      else if (option == JvOptionPane.YES_OPTION)
-      {
-        addSequenceMappingsToStructure(seq, chains, apanel, alreadyMapped);
-        finished = true;
-      }
+      return false;
     }
-    return finished;
+
+    addSequenceMappingsToStructure(seq, chains, apanel, alreadyMapped);
+    return true;
   }
 
   void setChainMenuItems(List<String> chainNames)
@@ -831,11 +783,11 @@ public abstract class StructureViewerBase extends GStructureViewer
       int[] alm = new int[_alignwith.size()];
       int a = 0;
 
-      for (AlignmentPanel ap : _alignwith)
+      for (AlignmentPanel alignPanel : _alignwith)
       {
-        als[a] = ap.av.getAlignment();
+        als[a] = alignPanel.av.getAlignment();
         alm[a] = -1;
-        alc[a++] = ap.av.getAlignment().getHiddenColumns();
+        alc[a++] = alignPanel.av.getAlignment().getHiddenColumns();
       }
       reply = getBinding().superposeStructures(als, alm, alc);
       if (reply != null)
@@ -847,9 +799,9 @@ public abstract class StructureViewerBase extends GStructureViewer
     } catch (Exception e)
     {
       StringBuffer sp = new StringBuffer();
-      for (AlignmentPanel ap : _alignwith)
+      for (AlignmentPanel alignPanel : _alignwith)
       {
-        sp.append("'" + ap.alignFrame.getTitle() + "' ");
+        sp.append("'" + alignPanel.alignFrame.getTitle() + "' ");
       }
       Cache.log.info("Couldn't align structures with the " + sp.toString()
               + "associated alignment panels.", e);
@@ -913,9 +865,9 @@ public abstract class StructureViewerBase extends GStructureViewer
         }
       }
       // Set the colour using the current view for the associated alignframe
-      for (AlignmentPanel ap : _colourwith)
+      for (AlignmentPanel alignPanel : _colourwith)
       {
-        binding.colourBySequence(ap);
+        binding.colourBySequence(alignPanel);
       }
       seqColoursApplied = true;
     }
@@ -997,6 +949,7 @@ public abstract class StructureViewerBase extends GStructureViewer
   /**
    * Configures the title and menu items of the viewer panel.
    */
+  @Override
   public void updateTitleAndMenus()
   {
     AAStructureBindingModel binding = getBinding();
@@ -1039,6 +992,12 @@ public abstract class StructureViewerBase extends GStructureViewer
   }
 
   @Override
+  public String toString()
+  {
+    return getTitle();
+  }
+
+  @Override
   public boolean hasMapping()
   {
     if (worker != null && (addingStructures || _started))
@@ -1075,4 +1034,10 @@ public abstract class StructureViewerBase extends GStructureViewer
     return seqColoursApplied;
   }
 
+  @Override
+  public void raiseViewer()
+  {
+    toFront();
+  }
+
 }
index 7dc1a99..45def89 100755 (executable)
@@ -80,9 +80,9 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
   TreePanel tp;
 
-  AlignViewport av;
+  private AlignViewport av;
 
-  AlignmentPanel ap;
+  private AlignmentPanel ap;
 
   Font font;
 
@@ -100,7 +100,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
   int offy;
 
-  float threshold;
+  private float threshold;
 
   String longestName;
 
@@ -130,7 +130,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
   {
     this.tp = tp;
     this.av = ap.av;
-    this.ap = ap;
+    this.setAssociatedPanel(ap);
     font = av.getFont();
     scrollPane = scroller;
     addMouseListener(this);
@@ -847,7 +847,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     if (col != null)
     {
       setColor(highlightNode, col);
-      PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+      PaintRefresher.Refresh(tp, getAssociatedPanel().av.getSequenceSetId());
       repaint();
     }
   }
@@ -928,7 +928,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     if (ob instanceof SequenceI)
     {
       treeSelectionChanged((Sequence) ob);
-      PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+      PaintRefresher.Refresh(tp, getAssociatedPanel().av.getSequenceSetId());
       repaint();
       av.sendSelection();
       return;
@@ -962,9 +962,18 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
           }
         }
         colourGroups(groups);
+
+        /*
+         * clear partition (don't show vertical line) if
+         * it is to the right of all nodes
+         */
+        if (groups.isEmpty())
+        {
+          threshold = 0f;
+        }
       }
 
-      PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+      PaintRefresher.Refresh(tp, getAssociatedPanel().av.getSequenceSetId());
       repaint();
     }
 
@@ -981,7 +990,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
       Vector<SequenceNode> l = tree.findLeaves(groups.get(i));
 
-      Vector<SequenceI> sequences = new Vector<SequenceI>();
+      Vector<SequenceI> sequences = new Vector<>();
 
       for (int j = 0; j < l.size(); j++)
       {
@@ -1118,7 +1127,37 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     }
     else
     {
-      return new AlignmentPanel[] { ap };
+      return new AlignmentPanel[] { getAssociatedPanel() };
     }
   }
+
+  public AlignmentPanel getAssociatedPanel()
+  {
+    return ap;
+  }
+
+  public void setAssociatedPanel(AlignmentPanel ap)
+  {
+    this.ap = ap;
+  }
+
+  public AlignViewport getViewport()
+  {
+    return av;
+  }
+
+  public void setViewport(AlignViewport av)
+  {
+    this.av = av;
+  }
+
+  public float getThreshold()
+  {
+    return threshold;
+  }
+
+  public void setThreshold(float threshold)
+  {
+    this.threshold = threshold;
+  }
 }
index e7e4ef8..ca4f84e 100755 (executable)
@@ -85,11 +85,11 @@ public class TreePanel extends GTreePanel
 
   SimilarityParamsI similarityParams;
 
-  TreeCanvas treeCanvas;
+  private TreeCanvas treeCanvas;
 
   TreeModel tree;
 
-  AlignViewport av;
+  private AlignViewport av;
 
   /**
    * Creates a new TreePanel object.
@@ -121,24 +121,24 @@ public class TreePanel extends GTreePanel
 
   public AlignmentI getAlignment()
   {
-    return treeCanvas.av.getAlignment();
+    return getTreeCanvas().getViewport().getAlignment();
   }
 
   public AlignmentViewport getViewPort()
   {
-    return treeCanvas.av;
+    return getTreeCanvas().getViewport();
   }
 
   void initTreePanel(AlignmentPanel ap, String type, String modelName,
           NewickFile newTree, AlignmentView inputData)
   {
 
-    av = ap.av;
+    setViewport(ap.av);
     this.treeType = type;
     this.scoreModelName = modelName;
 
     treeCanvas = new TreeCanvas(this, ap, scrollPane);
-    scrollPane.setViewportView(treeCanvas);
+    scrollPane.setViewportView(getTreeCanvas());
 
     PaintRefresher.Register(this, ap.av.getSequenceSetId());
 
@@ -155,9 +155,9 @@ public class TreePanel extends GTreePanel
       @Override
       public void internalFrameClosed(InternalFrameEvent evt)
       {
-        if (av != null)
+        if (getViewport() != null)
         {
-          av.removePropertyChangeListener(listener);
+          getViewport().removePropertyChangeListener(listener);
         }
       }
     });
@@ -194,13 +194,13 @@ public class TreePanel extends GTreePanel
           }
 
           tree.updatePlaceHolders((List<SequenceI>) evt.getNewValue());
-          treeCanvas.nameHash.clear(); // reset the mapping between canvas
+          getTreeCanvas().nameHash.clear(); // reset the mapping between canvas
           // rectangles and leafnodes
           repaint();
         }
       }
     };
-    av.addPropertyChangeListener(listener);
+    getViewport().addPropertyChangeListener(listener);
     return listener;
   }
 
@@ -213,8 +213,8 @@ public class TreePanel extends GTreePanel
   void buildAssociatedViewMenu()
   {
     AlignmentPanel[] aps = PaintRefresher
-            .getAssociatedPanels(av.getSequenceSetId());
-    if (aps.length == 1 && treeCanvas.ap == aps[0])
+            .getAssociatedPanels(getViewport().getSequenceSetId());
+    if (aps.length == 1 && getTreeCanvas().getAssociatedPanel() == aps[0])
     {
       associateLeavesMenu.setVisible(false);
       return;
@@ -237,16 +237,16 @@ public class TreePanel extends GTreePanel
     for (i = 0; i < iSize; i++)
     {
       final AlignmentPanel ap = aps[i];
-      item = new JRadioButtonMenuItem(ap.av.viewName, ap == treeCanvas.ap);
+      item = new JRadioButtonMenuItem(ap.av.getViewName(), ap == getTreeCanvas().getAssociatedPanel());
       buttonGroup.add(item);
       item.addActionListener(new ActionListener()
       {
         @Override
         public void actionPerformed(ActionEvent evt)
         {
-          treeCanvas.applyToAllViews = false;
-          treeCanvas.ap = ap;
-          treeCanvas.av = ap.av;
+          getTreeCanvas().applyToAllViews = false;
+          getTreeCanvas().setAssociatedPanel(ap);
+          getTreeCanvas().setViewport(ap.av);
           PaintRefresher.Register(thisTreePanel, ap.av.getSequenceSetId());
         }
       });
@@ -257,13 +257,13 @@ public class TreePanel extends GTreePanel
     final JRadioButtonMenuItem itemf = new JRadioButtonMenuItem(
             MessageManager.getString("label.all_views"));
     buttonGroup.add(itemf);
-    itemf.setSelected(treeCanvas.applyToAllViews);
+    itemf.setSelected(getTreeCanvas().applyToAllViews);
     itemf.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent evt)
       {
-        treeCanvas.applyToAllViews = itemf.isSelected();
+        getTreeCanvas().applyToAllViews = itemf.isSelected();
       }
     });
     associateLeavesMenu.add(itemf);
@@ -296,7 +296,7 @@ public class TreePanel extends GTreePanel
 
       if (newtree != null)
       {
-        tree = new TreeModel(av.getAlignment().getSequencesArray(), odata,
+        tree = new TreeModel(getViewport().getAlignment().getSequencesArray(), odata,
                 newtree);
         if (tree.getOriginalData() == null)
         {
@@ -306,20 +306,20 @@ public class TreePanel extends GTreePanel
       else
       {
         ScoreModelI sm = ScoreModels.getInstance()
-                .getScoreModel(scoreModelName, treeCanvas.ap);
+                .getScoreModel(scoreModelName, getTreeCanvas().getAssociatedPanel());
         TreeBuilder njtree = treeType.equals(TreeBuilder.NEIGHBOUR_JOINING)
-                ? new NJTree(av, sm, similarityParams)
-                : new AverageDistanceTree(av, sm, similarityParams);
+                ? new NJTree(getViewport(), sm, similarityParams)
+                : new AverageDistanceTree(getViewport(), sm, similarityParams);
         tree = new TreeModel(njtree);
         showDistances(true);
       }
 
       tree.reCount(tree.getTopNode());
       tree.findHeight(tree.getTopNode());
-      treeCanvas.setTree(tree);
-      treeCanvas.repaint();
-      av.setCurrentTree(tree);
-      if (av.getSortByTree())
+      getTreeCanvas().setTree(tree);
+      getTreeCanvas().repaint();
+      getViewport().setCurrentTree(tree);
+      if (getViewport().getSortByTree())
       {
         sortByTree_actionPerformed();
       }
@@ -328,20 +328,20 @@ public class TreePanel extends GTreePanel
 
   public void showDistances(boolean b)
   {
-    treeCanvas.setShowDistances(b);
+    getTreeCanvas().setShowDistances(b);
     distanceMenu.setSelected(b);
   }
 
   public void showBootstrap(boolean b)
   {
-    treeCanvas.setShowBootstrap(b);
+    getTreeCanvas().setShowBootstrap(b);
     bootstrapMenu.setSelected(b);
   }
 
   public void showPlaceholders(boolean b)
   {
     placeholdersMenu.setState(b);
-    treeCanvas.setMarkPlaceholders(b);
+    getTreeCanvas().setMarkPlaceholders(b);
   }
 
   /**
@@ -432,7 +432,7 @@ public class TreePanel extends GTreePanel
   public void printMenu_actionPerformed(ActionEvent e)
   {
     // Putting in a thread avoids Swing painting problems
-    treeCanvas.startPrinting();
+    getTreeCanvas().startPrinting();
   }
 
   @Override
@@ -456,7 +456,7 @@ public class TreePanel extends GTreePanel
     {
       // we try to get the associated view's gap character
       // but this may fail if the view was closed...
-      gc = av.getGapCharacter();
+      gc = getViewport().getGapCharacter();
 
     } catch (Exception ex)
     {
@@ -469,8 +469,8 @@ public class TreePanel extends GTreePanel
       // AlignmentOrder origorder = new AlignmentOrder(alAndColsel[0]);
 
       AlignmentI al = new Alignment((SequenceI[]) alAndColsel[0]);
-      AlignmentI dataset = (av != null && av.getAlignment() != null)
-              ? av.getAlignment().getDataset()
+      AlignmentI dataset = (getViewport() != null && getViewport().getAlignment() != null)
+              ? getViewport().getAlignment().getDataset()
               : null;
       if (dataset != null)
       {
@@ -507,7 +507,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void fitToWindow_actionPerformed(ActionEvent e)
   {
-    treeCanvas.fitToWindow = fitToWindow.isSelected();
+    getTreeCanvas().fitToWindow = fitToWindow.isSelected();
     repaint();
   }
 
@@ -520,15 +520,15 @@ public class TreePanel extends GTreePanel
   public void sortByTree_actionPerformed()
   {
 
-    if (treeCanvas.applyToAllViews)
+    if (getTreeCanvas().applyToAllViews)
     {
       final ArrayList<CommandI> commands = new ArrayList<>();
       for (AlignmentPanel ap : PaintRefresher
-              .getAssociatedPanels(av.getSequenceSetId()))
+              .getAssociatedPanels(getViewport().getSequenceSetId()))
       {
         commands.add(sortAlignmentIn(ap.av.getAlignPanel()));
       }
-      av.getAlignPanel().alignFrame.addHistoryItem(new CommandI()
+      getViewport().getAlignPanel().alignFrame.addHistoryItem(new CommandI()
       {
 
         @Override
@@ -563,7 +563,7 @@ public class TreePanel extends GTreePanel
         }
       });
       for (AlignmentPanel ap : PaintRefresher
-              .getAssociatedPanels(av.getSequenceSetId()))
+              .getAssociatedPanels(getViewport().getSequenceSetId()))
       {
         // ensure all the alignFrames refresh their GI after adding an undo item
         ap.alignFrame.updateEditMenuBar();
@@ -571,8 +571,8 @@ public class TreePanel extends GTreePanel
     }
     else
     {
-      treeCanvas.ap.alignFrame
-              .addHistoryItem(sortAlignmentIn(treeCanvas.ap));
+      getTreeCanvas().getAssociatedPanel().alignFrame
+              .addHistoryItem(sortAlignmentIn(getTreeCanvas().getAssociatedPanel()));
     }
 
   }
@@ -599,7 +599,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void font_actionPerformed(ActionEvent e)
   {
-    if (treeCanvas == null)
+    if (getTreeCanvas() == null)
     {
       return;
     }
@@ -609,14 +609,14 @@ public class TreePanel extends GTreePanel
 
   public Font getTreeFont()
   {
-    return treeCanvas.font;
+    return getTreeCanvas().font;
   }
 
   public void setTreeFont(Font f)
   {
-    if (treeCanvas != null)
+    if (getTreeCanvas() != null)
     {
-      treeCanvas.setFont(f);
+      getTreeCanvas().setFont(f);
     }
   }
 
@@ -629,7 +629,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void distanceMenu_actionPerformed(ActionEvent e)
   {
-    treeCanvas.setShowDistances(distanceMenu.isSelected());
+    getTreeCanvas().setShowDistances(distanceMenu.isSelected());
   }
 
   /**
@@ -641,7 +641,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void bootstrapMenu_actionPerformed(ActionEvent e)
   {
-    treeCanvas.setShowBootstrap(bootstrapMenu.isSelected());
+    getTreeCanvas().setShowBootstrap(bootstrapMenu.isSelected());
   }
 
   /**
@@ -653,7 +653,7 @@ public class TreePanel extends GTreePanel
   @Override
   public void placeholdersMenu_actionPerformed(ActionEvent e)
   {
-    treeCanvas.setMarkPlaceholders(placeholdersMenu.isSelected());
+    getTreeCanvas().setMarkPlaceholders(placeholdersMenu.isSelected());
   }
 
   /**
@@ -691,8 +691,8 @@ public class TreePanel extends GTreePanel
       accurateText = false;
     }
 
-    int width = treeCanvas.getWidth();
-    int height = treeCanvas.getHeight();
+    int width = getTreeCanvas().getWidth();
+    int height = getTreeCanvas().getHeight();
 
     try
     {
@@ -720,7 +720,7 @@ public class TreePanel extends GTreePanel
 
       pg.setAccurateTextMode(accurateText);
 
-      treeCanvas.draw(pg, width, height);
+      getTreeCanvas().draw(pg, width, height);
 
       pg.flush();
       pg.close();
@@ -739,8 +739,8 @@ public class TreePanel extends GTreePanel
   @Override
   public void pngTree_actionPerformed(ActionEvent e)
   {
-    int width = treeCanvas.getWidth();
-    int height = treeCanvas.getHeight();
+    int width = getTreeCanvas().getWidth();
+    int height = getTreeCanvas().getHeight();
 
     try
     {
@@ -769,7 +769,7 @@ public class TreePanel extends GTreePanel
               BufferedImage.TYPE_INT_RGB);
       Graphics png = bi.getGraphics();
 
-      treeCanvas.draw(png, width, height);
+      getTreeCanvas().draw(png, width, height);
 
       ImageIO.write(bi, "png", out);
       out.close();
@@ -883,4 +883,19 @@ public class TreePanel extends GTreePanel
             treecalcnm, smn);
     return ttl;
   }
+
+  public AlignViewport getViewport()
+  {
+    return av;
+  }
+
+  public void setViewport(AlignViewport av)
+  {
+    this.av = av;
+  }
+
+  public TreeCanvas getTreeCanvas()
+  {
+    return treeCanvas;
+  }
 }
index 3290500..b1f6d1b 100755 (executable)
@@ -24,8 +24,6 @@ import jalview.bin.Cache;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
 import jalview.jbgui.GUserDefinedColours;
-import jalview.schemabinding.version2.Colour;
-import jalview.schemabinding.version2.JalviewUserColours;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeLoader;
 import jalview.schemes.ColourSchemes;
@@ -34,6 +32,9 @@ import jalview.schemes.UserColourScheme;
 import jalview.util.ColorUtils;
 import jalview.util.Format;
 import jalview.util.MessageManager;
+import jalview.xml.binding.jalview.JalviewUserColours;
+import jalview.xml.binding.jalview.JalviewUserColours.Colour;
+import jalview.xml.binding.jalview.ObjectFactory;
 
 import java.awt.Color;
 import java.awt.Font;
@@ -51,6 +52,8 @@ import javax.swing.JButton;
 import javax.swing.JInternalFrame;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
 
 /**
  * This panel allows the user to assign colours to Amino Acid residue codes, and
@@ -858,9 +861,14 @@ public class UserDefinedColours extends GUserDefinedColours
         Colour col = new Colour();
         col.setName(button.getText());
         col.setRGB(Format.getHexString(button.getBackground()));
-        ucs.addColour(col);
+        ucs.getColour().add(col);
       }
-      ucs.marshal(out);
+      JAXBContext jaxbContext = JAXBContext
+              .newInstance(JalviewUserColours.class);
+      Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
+      jaxbMarshaller.marshal(
+              new ObjectFactory().createJalviewUserColours(ucs), out);
+      // ucs.marshal(out);
       out.close();
     } catch (Exception ex)
     {
index 973cfe8..c094b1c 100644 (file)
@@ -484,8 +484,8 @@ public class VamsasApplication implements SelectionSource, VamsasSource
               errorsDuringUpdate = true;
               Cache.log.error("Exception synchronizing " + af.getTitle()
                       + " "
-                      + (af.getViewport().viewName == null ? ""
-                              : " view " + af.getViewport().viewName)
+                      + (af.getViewport().getViewName() == null ? ""
+                              : " view " + af.getViewport().getViewName())
                       + " to document.", e);
               stored = false;
             }
index d91775c..cb98856 100644 (file)
@@ -27,8 +27,11 @@ import jalview.util.MessageManager;
 import jalview.ws.params.ParamDatastoreI;
 import jalview.ws.params.ParamManager;
 import jalview.ws.params.WsParamSetI;
+import jalview.xml.binding.jalview.ObjectFactory;
+import jalview.xml.binding.jalview.WebServiceParameterSet;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -39,6 +42,12 @@ import java.util.Hashtable;
 import java.util.List;
 import java.util.StringTokenizer;
 
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
 /**
  * store and retrieve web service parameter sets.
  * 
@@ -47,7 +56,7 @@ import java.util.StringTokenizer;
  */
 public class WsParamSetManager implements ParamManager
 {
-  Hashtable<String, ParamDatastoreI> paramparsers = new Hashtable<String, ParamDatastoreI>();
+  Hashtable<String, ParamDatastoreI> paramparsers = new Hashtable<>();
 
   @Override
   public WsParamSetI[] getParameterSet(String name, String serviceUrl,
@@ -60,7 +69,7 @@ public class WsParamSetManager implements ParamManager
     }
     StringTokenizer st = new StringTokenizer(files, "|");
     String pfile = null;
-    ArrayList<WsParamSetI> params = new ArrayList<WsParamSetI>();
+    List<WsParamSetI> params = new ArrayList<>();
     while (st.hasMoreTokens())
     {
       pfile = st.nextToken();
@@ -107,33 +116,39 @@ public class WsParamSetManager implements ParamManager
 
   private WsParamSetI[] parseParamFile(String filename) throws IOException
   {
-    List<WsParamSetI> psets = new ArrayList<WsParamSetI>();
+    List<WsParamSetI> psets = new ArrayList<>();
     InputStreamReader is = new InputStreamReader(
-            new java.io.FileInputStream(new File(filename)), "UTF-8");
-
-    jalview.schemabinding.version2.WebServiceParameterSet wspset = new jalview.schemabinding.version2.WebServiceParameterSet();
+            new FileInputStream(new File(filename)), "UTF-8");
 
-    org.exolab.castor.xml.Unmarshaller unmar = new org.exolab.castor.xml.Unmarshaller(
-            wspset);
-    unmar.setWhitespacePreserve(true);
+    WebServiceParameterSet wspset = null;
     try
     {
-      wspset = (jalview.schemabinding.version2.WebServiceParameterSet) unmar
-              .unmarshal(is);
+      JAXBContext jc = JAXBContext
+              .newInstance("jalview.xml.binding.jalview");
+      javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+      XMLStreamReader streamReader = XMLInputFactory.newInstance()
+              .createXMLStreamReader(is);
+      JAXBElement<WebServiceParameterSet> jbe = um.unmarshal(streamReader,
+              WebServiceParameterSet.class);
+      wspset = jbe.getValue();
     } catch (Exception ex)
     {
       throw new IOException(ex);
     }
+
     if (wspset != null && wspset.getParameters().length() > 0)
     {
-      for (String url : wspset.getServiceURL())
+      List<String> urls = wspset.getServiceURL();
+      final String[] urlArray = urls.toArray(new String[urls.size()]);
+
+      for (String url : urls)
       {
         ParamDatastoreI parser = paramparsers.get(url);
         if (parser != null)
         {
           WsParamSetI pset = parser.parseServiceParameterFile(
                   wspset.getName(), wspset.getDescription(),
-                  wspset.getServiceURL(), wspset.getParameters());
+                  urlArray, wspset.getParameters());
           if (pset != null)
           {
             pset.setSourceFile(filename);
@@ -190,8 +205,7 @@ public class WsParamSetManager implements ParamManager
       if (value == JalviewFileChooser.APPROVE_OPTION)
       {
         outfile = chooser.getSelectedFile();
-        jalview.bin.Cache.setProperty("LAST_DIRECTORY",
-                outfile.getParent());
+        Cache.setProperty("LAST_DIRECTORY", outfile.getParent());
         filename = outfile.getAbsolutePath();
         if (!filename.endsWith(".wsparams"))
         {
@@ -212,13 +226,16 @@ public class WsParamSetManager implements ParamManager
         }
         paramFiles = paramFiles.concat(filename);
       }
-      jalview.bin.Cache.setProperty("WS_PARAM_FILES", paramFiles);
+      Cache.setProperty("WS_PARAM_FILES", paramFiles);
 
-      jalview.schemabinding.version2.WebServiceParameterSet paramxml = new jalview.schemabinding.version2.WebServiceParameterSet();
+      WebServiceParameterSet paramxml = new WebServiceParameterSet();
 
       paramxml.setName(parameterSet.getName());
       paramxml.setDescription(parameterSet.getDescription());
-      paramxml.setServiceURL(parameterSet.getApplicableUrls().clone());
+      for (String url : parameterSet.getApplicableUrls())
+      {
+        paramxml.getServiceURL().add(url);
+      }
       paramxml.setVersion("1.0");
       try
       {
@@ -226,7 +243,12 @@ public class WsParamSetManager implements ParamManager
                 parser.generateServiceParameterFile(parameterSet));
         PrintWriter out = new PrintWriter(new OutputStreamWriter(
                 new FileOutputStream(outfile), "UTF-8"));
-        paramxml.marshal(out);
+        JAXBContext jaxbContext = JAXBContext
+                .newInstance(WebServiceParameterSet.class);
+        Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
+        jaxbMarshaller.marshal(
+                new ObjectFactory().createWebServiceParameterSet(paramxml),
+                out);
         out.close();
         parameterSet.setSourceFile(filename);
       } catch (Exception e)
index 2340283..497f0a5 100755 (executable)
@@ -72,7 +72,20 @@ public abstract class AlignFile extends FileParse
 
   long end;
 
-  private boolean parseCalled;
+  /**
+   * true if parse() has been called
+   */
+  private boolean parseCalled = false;
+
+  private boolean parseImmediately = true;
+
+  /**
+   * @return if doParse() was called at construction time
+   */
+  protected boolean isParseImmediately()
+  {
+    return parseImmediately;
+  }
 
   /**
    * Creates a new AlignFile object.
@@ -153,6 +166,11 @@ public abstract class AlignFile extends FileParse
   {
     super(source);
     initData();
+
+    // stash flag in case parse needs to know if it has to autoconfigure or was
+    // configured after construction
+    this.parseImmediately = parseImmediately;
+
     if (parseImmediately)
     {
       doParse();
index c21b02c..afb2009 100755 (executable)
@@ -26,7 +26,8 @@ import jalview.datamodel.SequenceI;
 import jalview.util.Format;
 
 import java.io.IOException;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
@@ -59,12 +60,11 @@ public class ClustalFile extends AlignFile
   {
     int i = 0;
     boolean flag = false;
-    boolean rna = false;
     boolean top = false;
-    StringBuffer pssecstr = new StringBuffer(),
-            consstr = new StringBuffer();
-    Vector headers = new Vector();
-    Hashtable seqhash = new Hashtable();
+    StringBuffer pssecstr = new StringBuffer();
+    StringBuffer consstr = new StringBuffer();
+    Vector<String> headers = new Vector<>();
+    Map<String, StringBuffer> seqhash = new HashMap<>();
     StringBuffer tempseq;
     String line, id;
     StringTokenizer str;
@@ -77,9 +77,11 @@ public class ClustalFile extends AlignFile
         {
           top = true;
         }
-        if (line.indexOf(" ") != 0)
+        boolean isConservation = line.startsWith(SPACE)
+                || line.startsWith(TAB);
+        if (!isConservation)
         {
-          str = new StringTokenizer(line, " ");
+          str = new StringTokenizer(line);
 
           if (str.hasMoreTokens())
           {
@@ -95,7 +97,7 @@ public class ClustalFile extends AlignFile
               {
                 if (seqhash.containsKey(id))
                 {
-                  tempseq = (StringBuffer) seqhash.get(id);
+                  tempseq = seqhash.get(id);
                 }
                 else
                 {
@@ -173,7 +175,7 @@ public class ClustalFile extends AlignFile
       AlignmentAnnotation lastssa = null;
       if (pssecstr.length() == maxLength)
       {
-        Vector ss = new Vector();
+        Vector<AlignmentAnnotation> ss = new Vector<>();
         AlignmentAnnotation ssa = lastssa = StockholmFile
                 .parseAnnotationRow(ss, "secondary structure",
                         pssecstr.toString());
@@ -182,7 +184,7 @@ public class ClustalFile extends AlignFile
       }
       if (consstr.length() == maxLength)
       {
-        Vector ss = new Vector();
+        Vector<AlignmentAnnotation> ss = new Vector<>();
         AlignmentAnnotation ssa = StockholmFile.parseAnnotationRow(ss,
                 "secondary structure", consstr.toString());
         ssa.label = "Consensus Secondary Structure";
@@ -238,19 +240,19 @@ public class ClustalFile extends AlignFile
         out.append(new Format("%-" + maxid + "s")
                 .form(printId(s[j], jvsuffix) + " "));
 
-        int start = i * len;
-        int end = start + len;
+        int chunkStart = i * len;
+        int chunkEnd = chunkStart + len;
 
         int length = s[j].getLength();
-        if ((end < length) && (start < length))
+        if ((chunkEnd < length) && (chunkStart < length))
         {
-          out.append(s[j].getSequenceAsString(start, end));
+          out.append(s[j].getSequenceAsString(chunkStart, chunkEnd));
         }
         else
         {
-          if (start < length)
+          if (chunkStart < length)
           {
-            out.append(s[j].getSequenceAsString().substring(start));
+            out.append(s[j].getSequenceAsString().substring(chunkStart));
           }
         }
 
index 99663c8..169da5a 100755 (executable)
@@ -84,8 +84,6 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI
 
   private static final String NOTE = "Note";
 
-  protected static final String TAB = "\t";
-
   protected static final String GFF_VERSION = "##gff-version";
 
   private AlignmentI lastmatchedAl = null;
index 4b33dbf..e94e1ce 100644 (file)
@@ -347,7 +347,7 @@ public enum FileFormat implements FileFormatI
       return true;
     }
   },
-  Jalview("Jalview", "jar,jvp", true, true)
+  Jalview("Jalview", "jvp, jar", true, true)
   {
     @Override
     public AlignmentFileReaderI getReader(FileParse source)
index f26d6da..2a18b0b 100755 (executable)
@@ -33,9 +33,9 @@ import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
 import jalview.gui.AlignViewport;
 import jalview.gui.Desktop;
-import jalview.gui.Jalview2XML;
 import jalview.gui.JvOptionPane;
 import jalview.json.binding.biojson.v1.ColourSchemeMapper;
+import jalview.project.Jalview2XML;
 import jalview.schemes.ColourSchemeI;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
index c0328d5..7117d0f 100755 (executable)
@@ -45,6 +45,10 @@ import java.util.zip.GZIPInputStream;
  */
 public class FileParse
 {
+  protected static final String SPACE = " ";
+
+  protected static final String TAB = "\t";
+
   /**
    * text specifying source of data. usually filename or url.
    */
index c49e34f..7a21c16 100755 (executable)
@@ -68,8 +68,8 @@ public class JalviewFileChooser extends JFileChooser
   public static JalviewFileChooser forRead(String directory,
           String selected)
   {
-    List<String> extensions = new ArrayList<String>();
-    List<String> descs = new ArrayList<String>();
+    List<String> extensions = new ArrayList<>();
+    List<String> descs = new ArrayList<>();
     for (FileFormatI format : FileFormats.getInstance().getFormats())
     {
       if (format.isReadable())
@@ -96,8 +96,8 @@ public class JalviewFileChooser extends JFileChooser
   {
     // TODO in Java 8, forRead and forWrite can be a single method
     // with a lambda expression parameter for isReadable/isWritable
-    List<String> extensions = new ArrayList<String>();
-    List<String> descs = new ArrayList<String>();
+    List<String> extensions = new ArrayList<>();
+    List<String> descs = new ArrayList<>();
     for (FileFormatI format : FileFormats.getInstance().getFormats())
     {
       if (format.isWritable())
@@ -142,7 +142,7 @@ public class JalviewFileChooser extends JFileChooser
     super(safePath(dir));
     if (extensions.length == descs.length)
     {
-      List<String[]> formats = new ArrayList<String[]>();
+      List<String[]> formats = new ArrayList<>();
       for (int i = 0; i < extensions.length; i++)
       {
         formats.add(new String[] { extensions[i], descs[i] });
@@ -278,6 +278,19 @@ public class JalviewFileChooser extends JFileChooser
     return null;
   }
 
+  File ourselectedFile = null;
+
+  @Override
+  public File getSelectedFile()
+  {
+    File selfile = super.getSelectedFile();
+    if (selfile == null && ourselectedFile != null)
+    {
+      return ourselectedFile;
+    }
+    return selfile;
+  }
+
   @Override
   public int showSaveDialog(Component parent) throws HeadlessException
   {
@@ -285,23 +298,48 @@ public class JalviewFileChooser extends JFileChooser
 
     setDialogType(SAVE_DIALOG);
 
+    this.setSelectedFile(null);
     int ret = showDialog(parent, MessageManager.getString("action.save"));
+    ourselectedFile = getSelectedFile();
 
+    if (getSelectedFile() == null)
+    {
+      // Workaround for Java 9,10 on OSX - no selected file, but there is a
+      // filename typed in
+      try
+      {
+        String filename = ((BasicFileChooserUI) getUI()).getFileName();
+        if (filename != null && filename.length() > 0)
+        {
+          ourselectedFile = new File(getCurrentDirectory(), filename);
+        }
+      } catch (Throwable x)
+      {
+        System.err.println(
+                "Unexpected exception when trying to get filename.");
+        x.printStackTrace();
+      }
+    }
+    if (ourselectedFile == null)
+    {
+      return JalviewFileChooser.CANCEL_OPTION;
+    }
     if (getFileFilter() instanceof JalviewFileFilter)
     {
       JalviewFileFilter jvf = (JalviewFileFilter) getFileFilter();
 
-      if (!jvf.accept(getSelectedFile()))
+      if (!jvf.accept(ourselectedFile))
       {
-        String withExtension = getSelectedFile() + "."
+        String withExtension = getSelectedFile().getName() + "."
                 + jvf.getAcceptableExtension();
-        setSelectedFile(new File(withExtension));
+        ourselectedFile = (new File(getCurrentDirectory(), withExtension));
+        setSelectedFile(ourselectedFile);
       }
     }
     // TODO: ENSURE THAT FILES SAVED WITH A ':' IN THE NAME ARE REFUSED AND THE
     // USER PROMPTED FOR A NEW FILENAME
     if ((ret == JalviewFileChooser.APPROVE_OPTION)
-            && getSelectedFile().exists())
+            && ourselectedFile.exists())
     {
       int confirm = JvOptionPane.showConfirmDialog(parent,
               MessageManager.getString("label.overwrite_existing_file"),
index d59e88a..21f5b0f 100755 (executable)
 package jalview.io;
 
 import java.io.File;
-import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.StringTokenizer;
 
 import javax.swing.filechooser.FileFilter;
@@ -31,7 +33,7 @@ public class JalviewFileFilter extends FileFilter
 {
   public static Hashtable suffixHash = new Hashtable();
 
-  private Hashtable filters = null;
+  private Map<String, JalviewFileFilter> filters = null;
 
   private String description = "no description";
 
@@ -72,10 +74,11 @@ public class JalviewFileFilter extends FileFilter
 
   public String getAcceptableExtension()
   {
-    return filters.keys().nextElement().toString();
+    return filters.keySet().iterator().next().toString();
   }
 
   // takes account of the fact that database is a directory
+  @Override
   public boolean accept(File f)
   {
     if (f != null)
@@ -87,7 +90,7 @@ public class JalviewFileFilter extends FileFilter
         return true;
       }
 
-      if ((extension != null) && (filters.get(getExtension(f)) != null))
+      if ((extension != null) && (filters.get(extension) != null))
       {
         return true;
       }
@@ -118,13 +121,14 @@ public class JalviewFileFilter extends FileFilter
   {
     if (filters == null)
     {
-      filters = new Hashtable(5);
+      filters = new LinkedHashMap<>(5);
     }
 
     filters.put(extension.toLowerCase(), this);
     fullDescription = null;
   }
 
+  @Override
   public String getDescription()
   {
     if (fullDescription == null)
@@ -135,15 +139,15 @@ public class JalviewFileFilter extends FileFilter
                 : (description + " (");
 
         // build the description from the extension list
-        Enumeration extensions = filters.keys();
+        Iterator<String> extensions = filters.keySet().iterator();
 
         if (extensions != null)
         {
-          fullDescription += ("." + (String) extensions.nextElement());
+          fullDescription += ("." + extensions.next());
 
-          while (extensions.hasMoreElements())
+          while (extensions.hasNext())
           {
-            fullDescription += (", " + (String) extensions.nextElement());
+            fullDescription += (", " + extensions.next());
           }
         }
 
index b2fe587..18114f3 100755 (executable)
@@ -37,14 +37,15 @@ public class JalviewFileView extends FileView
 
   private void loadExtensions()
   {
-    extensions = new HashMap<String, String>();
+    extensions = new HashMap<>();
     for (FileFormatI ff : FileFormats.getInstance().getFormats())
     {
       String desc = ff.getName() + " file";
       String exts = ff.getExtensions();
       for (String ext : exts.split(","))
       {
-        extensions.put(ext.trim().toLowerCase(),
+        ext = ext.trim().toLowerCase();
+        extensions.put(ext,
                 desc + ("jar".equals(ext) ? " (old)" : ""));
       }
     }
@@ -124,7 +125,7 @@ public class JalviewFileView extends FileView
     {
       if (icons == null)
       {
-        icons = new HashMap<String, ImageIcon>();
+        icons = new HashMap<>();
       }
       if (!icons.containsKey(filePath))
       {
index f5b5177..0e73af1 100644 (file)
@@ -83,6 +83,14 @@ public class StockholmFile extends AlignFile
   public static final Regex DETECT_BRACKETS = new Regex(
           "(<|>|\\[|\\]|\\(|\\)|\\{|\\})");
 
+  // WUSS extended symbols. Avoid ambiguity with protein SS annotations by using NOT_RNASS first.
+  public static final String RNASS_BRACKETS = "<>[](){}AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
+
+  // use the following regex to decide an annotations (whole) line is NOT an RNA
+  // SS (it contains only E,H,e,h and other non-brace/non-alpha chars)
+  private static final Regex NOT_RNASS = new Regex(
+          "^[^<>[\\](){}A-DF-Za-df-z]*$");
+
   StringBuffer out; // output buffer
 
   AlignmentI al;
@@ -197,7 +205,7 @@ public class StockholmFile extends AlignFile
     String version;
     // String id;
     Hashtable seqAnn = new Hashtable(); // Sequence related annotations
-    LinkedHashMap<String, String> seqs = new LinkedHashMap<String, String>();
+    LinkedHashMap<String, String> seqs = new LinkedHashMap<>();
     Regex p, r, rend, s, x;
     // Temporary line for processing RNA annotation
     // String RNAannot = "";
@@ -658,7 +666,7 @@ public class StockholmFile extends AlignFile
               strucAnn = new Hashtable();
             }
 
-            Vector<AlignmentAnnotation> newStruc = new Vector<AlignmentAnnotation>();
+            Vector<AlignmentAnnotation> newStruc = new Vector<>();
             parseAnnotationRow(newStruc, type, ns);
             for (AlignmentAnnotation alan : newStruc)
             {
@@ -710,7 +718,7 @@ public class StockholmFile extends AlignFile
   private void guessDatabaseFor(Sequence seqO, String dbr, String dbsource)
   {
     DBRefEntry dbrf = null;
-    List<DBRefEntry> dbrs = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> dbrs = new ArrayList<>();
     String seqdb = "Unknown", sdbac = "" + dbr;
     int st = -1, en = -1, p;
     if ((st = sdbac.indexOf("/")) > -1)
@@ -824,9 +832,14 @@ public class StockholmFile extends AlignFile
     }
     boolean ss = false, posterior = false;
     type = id2type(type);
+
+    boolean isrnass = false;
     if (type.equalsIgnoreCase("secondary structure"))
     {
       ss = true;
+      isrnass = !NOT_RNASS.search(annots); // sorry about the double negative
+                                           // here (it's easier for dealing with
+                                           // other non-alpha-non-brace chars)
     }
     if (type.equalsIgnoreCase("posterior probability"))
     {
@@ -844,7 +857,7 @@ public class StockholmFile extends AlignFile
       {
         // if (" .-_".indexOf(pos) == -1)
         {
-          if (DETECT_BRACKETS.search(pos))
+          if (isrnass && RNASS_BRACKETS.indexOf(pos) >= 0)
           {
             ann.secondaryStructure = Rna.getRNASecStrucState(pos).charAt(0);
             ann.displayCharacter = "" + pos.charAt(0);
@@ -1114,22 +1127,36 @@ public class StockholmFile extends AlignFile
     String ch = (annot == null)
             ? ((sequenceI == null) ? "-"
                     : Character.toString(sequenceI.getCharAt(k)))
-            : annot.displayCharacter;
+            : (annot.displayCharacter == null
+                    ? String.valueOf(annot.secondaryStructure)
+                    : annot.displayCharacter);
+    if (ch == null)
+    {
+      ch = " ";
+    }
     if (key != null && key.equals("SS"))
     {
+      char ssannotchar = ' ';
+      boolean charset = false;
       if (annot == null)
       {
         // sensible gap character
-        return ' ';
+        ssannotchar = ' ';
+        charset = true;
       }
       else
       {
         // valid secondary structure AND no alternative label (e.g. ' B')
         if (annot.secondaryStructure > ' ' && ch.length() < 2)
         {
-          return annot.secondaryStructure;
+          ssannotchar = annot.secondaryStructure;
+          charset = true;
         }
       }
+      if (charset)
+      {
+        return (ssannotchar == ' ' && isrna) ? '.' : ssannotchar;
+      }
     }
 
     if (ch.length() == 0)
@@ -1144,7 +1171,9 @@ public class StockholmFile extends AlignFile
     {
       seq = ch.charAt(1);
     }
-    return seq;
+
+    return (seq == ' ' && key != null && key.equals("SS") && isrna) ? '.'
+            : seq;
   }
 
   public String print()
index a837512..beef3e7 100644 (file)
@@ -23,8 +23,6 @@ package jalview.io.cache;
 import jalview.bin.Cache;
 import jalview.util.MessageManager;
 
-import java.awt.Color;
-import java.awt.Dimension;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
@@ -36,37 +34,22 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
-import javax.swing.BorderFactory;
 import javax.swing.JComboBox;
-import javax.swing.JLabel;
 import javax.swing.JMenuItem;
-import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
-import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.PlainDocument;
 
 public class JvCacheableInputBox<E> extends JComboBox<String>
 {
 
   private static final long serialVersionUID = 5774610435079326695L;
 
-  private static final int INPUT_LIMIT = 2;
-
   private static final int LEFT_BOARDER_WIDTH = 16;
 
   private String cacheKey;
 
   private AppCache appCache;
 
-  private JPanel pnlDefaultCache = new JPanel();
-
-  private JLabel lblDefaultCacheSize = new JLabel();
-
-  private JTextField txtDefaultCacheSize = new JTextField();
-
   private JPopupMenu popup = new JPopupMenu();
 
   private JMenuItem menuItemClearCache = new JMenuItem();
@@ -123,8 +106,8 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
   }
 
   /**
-   * Method for initialising cache items for a given cache key and populating
-   * the in-memory cache with persisted cache items
+   * Method for initialising cache items for a given cache key and populating the
+   * in-memory cache with persisted cache items
    * 
    * @param cacheKey
    */
@@ -144,7 +127,7 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
             .getAllCachedItemsFor(cacheKey);
     if (foundCacheItems == null)
     {
-      foundCacheItems = new LinkedHashSet<String>();
+      foundCacheItems = new LinkedHashSet<>();
     }
     // populate memory cache
     for (String cacheItem : persistedCacheItems)
@@ -159,48 +142,7 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
    */
   private void initCachePopupMenu()
   {
-    pnlDefaultCache.setBackground(Color.WHITE);
-    // pad panel so as to align with other menu items
-    pnlDefaultCache.setBorder(
-            BorderFactory.createEmptyBorder(0, LEFT_BOARDER_WIDTH, 0, 0));
-    txtDefaultCacheSize.setPreferredSize(new Dimension(45, 20));
-    txtDefaultCacheSize.setFont(new java.awt.Font("Verdana", 0, 12));
-    lblDefaultCacheSize
-            .setText(MessageManager.getString("label.default_cache_size"));
-    lblDefaultCacheSize.setFont(new java.awt.Font("Verdana", 0, 12));
-    // Force input to accept only Integer entries up to length - INPUT_LIMIT
-    txtDefaultCacheSize.setDocument(new PlainDocument()
-    {
-      private static final long serialVersionUID = 1L;
-
-      @Override
-      public void insertString(int offs, String str, AttributeSet a)
-              throws BadLocationException
-      {
-        if (getLength() + str.length() <= INPUT_LIMIT && isInteger(str))
-        {
-          super.insertString(offs, str, a);
-        }
-      }
-    });
-    txtDefaultCacheSize.addKeyListener(new java.awt.event.KeyAdapter()
-    {
-      @Override
-      public void keyPressed(KeyEvent e)
-      {
-        if (e.getKeyCode() == KeyEvent.VK_ENTER)
-        {
-          e.consume();
-          updateCache();
-          closePopup();
-        }
-      }
-    });
-
-    txtDefaultCacheSize.setText(appCache.getCacheLimit(cacheKey));
-    pnlDefaultCache.add(lblDefaultCacheSize);
     menuItemClearCache.setFont(new java.awt.Font("Verdana", 0, 12));
-    pnlDefaultCache.add(txtDefaultCacheSize);
     menuItemClearCache
             .setText(MessageManager.getString("action.clear_cached_items"));
     menuItemClearCache.addActionListener(new ActionListener()
@@ -215,18 +157,11 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
       }
     });
 
-    popup.insert(pnlDefaultCache, 0);
     popup.add(menuItemClearCache);
     setComponentPopupMenu(popup);
     add(popup);
   }
 
-  private void closePopup()
-  {
-    popup.setVisible(false);
-    popup.transferFocus();
-  }
-
   /**
    * Answers true if input text is an integer
    * 
@@ -255,10 +190,7 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
       @Override
       public void run()
       {
-        int userLimit = txtDefaultCacheSize.getText().trim().isEmpty()
-                ? Integer.valueOf(AppCache.DEFAULT_LIMIT)
-                : Integer.valueOf(txtDefaultCacheSize.getText());
-        int cacheLimit = appCache.updateCacheLimit(cacheKey, userLimit);
+        int cacheLimit = Integer.parseInt(appCache.getCacheLimit(cacheKey));
         String userInput = getUserInput();
         if (userInput != null && !userInput.isEmpty())
         {
@@ -277,7 +209,7 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
           removeAllItems();
         }
         Set<String> cacheItems = appCache.getAllCachedItemsFor(cacheKey);
-        List<String> reversedCacheItems = new ArrayList<String>();
+        List<String> reversedCacheItems = new ArrayList<>();
         reversedCacheItems.addAll(cacheItems);
         cacheItems = null;
         Collections.reverse(reversedCacheItems);
@@ -326,10 +258,6 @@ public class JvCacheableInputBox<E> extends JComboBox<String>
   public void persistCache()
   {
     appCache.persistCache(cacheKey);
-    int userLimit = txtDefaultCacheSize.getText().trim().isEmpty()
-            ? Integer.valueOf(AppCache.DEFAULT_LIMIT)
-            : Integer.valueOf(txtDefaultCacheSize.getText());
-    appCache.updateCacheLimit(cacheKey, userLimit);
   }
 
   /**
index a4afb74..290c4a4 100755 (executable)
@@ -245,7 +245,16 @@ public class GDesktop extends JFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        saveState_actionPerformed(e);
+        saveState_actionPerformed(true);
+      }
+    });
+    JMenuItem saveAsJaxb = new JMenuItem("Save Project as JAXB");
+    saveAsJaxb.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        saveState_actionPerformed(false);
       }
     });
     loadState.setText(MessageManager.getString("action.load_project"));
@@ -254,7 +263,16 @@ public class GDesktop extends JFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        loadState_actionPerformed(e);
+        loadState_actionPerformed(true);
+      }
+    });
+    JMenuItem loadAsJaxb = new JMenuItem("Load Project as JAXB");
+    loadAsJaxb.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        loadState_actionPerformed(false);
       }
     });
     inputMenu.setText(MessageManager.getString("label.input_alignment"));
@@ -424,7 +442,9 @@ public class GDesktop extends JFrame
     FileMenu.add(inputSequence);
     FileMenu.addSeparator();
     FileMenu.add(saveState);
+    FileMenu.add(saveAsJaxb);
     FileMenu.add(loadState);
+    FileMenu.add(loadAsJaxb);
     FileMenu.addSeparator();
     FileMenu.add(quit);
     HelpMenu.add(aboutMenuItem);
@@ -586,7 +606,7 @@ public class GDesktop extends JFrame
    * @param e
    *          DOCUMENT ME!
    */
-  public void saveState_actionPerformed(ActionEvent e)
+  public void saveState_actionPerformed(boolean asCastor)
   {
   }
 
@@ -596,7 +616,7 @@ public class GDesktop extends JFrame
    * @param e
    *          DOCUMENT ME!
    */
-  public void loadState_actionPerformed(ActionEvent e)
+  public void loadState_actionPerformed(boolean asCastor)
   {
   }
 
index 1ca0802..6807382 100755 (executable)
@@ -264,10 +264,6 @@ public class GPreferences extends JPanel
 
   protected JCheckBox sortByTree = new JCheckBox();
 
-  /*
-   * DAS Settings tab
-   */
-  protected JPanel dasTab = new JPanel();
 
   /*
    * Web Services tab
@@ -326,12 +322,6 @@ public class GPreferences extends JPanel
             MessageManager.getString("label.editing"));
 
     /*
-     * See DasSourceBrowser for the real work of configuring this tab.
-     */
-    dasTab.setLayout(new BorderLayout());
-    tabbedPane.add(dasTab, MessageManager.getString("label.das_settings"));
-
-    /*
      * See WsPreferences for the real work of configuring this tab.
      */
     wsTab.setLayout(new BorderLayout());
@@ -524,7 +514,9 @@ public class GPreferences extends JPanel
             MessageManager.getString("label.default_browser_unix"));
     defaultBrowser.setFont(LABEL_FONT);
     defaultBrowser.setText("");
-
+    final String tooltip = JvSwingUtils.wrapTooltip(true,
+            MessageManager.getString("label.double_click_to_browse"));
+    defaultBrowser.setToolTipText(tooltip);
     defaultBrowser.addMouseListener(new MouseAdapter()
     {
       @Override
@@ -1206,14 +1198,14 @@ public class GPreferences extends JPanel
     pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
     pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
     pathLabel.setText(MessageManager.getString("label.chimera_path"));
-    final String tooltip = JvSwingUtils.wrapTooltip(true,
-            MessageManager.getString("label.chimera_path_tip"));
-    pathLabel.setToolTipText(tooltip);
     pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
     structureTab.add(pathLabel);
 
     chimeraPath.setFont(LABEL_FONT);
     chimeraPath.setText("");
+    final String tooltip = JvSwingUtils.wrapTooltip(true,
+            MessageManager.getString("label.chimera_path_tip"));
+    chimeraPath.setToolTipText(tooltip);
     chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
     chimeraPath.addMouseListener(new MouseAdapter()
     {
@@ -1512,6 +1504,9 @@ public class GPreferences extends JPanel
     startupCheckbox.setSelected(true);
     startupFileTextfield.setFont(LABEL_FONT);
     startupFileTextfield.setBounds(new Rectangle(172, 310, 330, 20));
+    final String tooltip = JvSwingUtils.wrapTooltip(true,
+            MessageManager.getString("label.double_click_to_browse"));
+    startupFileTextfield.setToolTipText(tooltip);
     startupFileTextfield.addMouseListener(new MouseAdapter()
     {
       @Override
index 9bcaa5a..240e1fd 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -29,6 +29,7 @@ import jalview.fts.service.pdb.PDBFTSRestClient;
 import jalview.gui.AlignmentPanel;
 import jalview.gui.Desktop;
 import jalview.gui.JvSwingUtils;
+import jalview.gui.StructureViewer;
 import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
@@ -36,6 +37,7 @@ import java.awt.CardLayout;
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
+import java.awt.Font;
 import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ItemEvent;
@@ -70,6 +72,8 @@ import javax.swing.event.DocumentListener;
 import javax.swing.event.InternalFrameEvent;
 import javax.swing.table.TableColumn;
 
+import net.miginfocom.swing.MigLayout;
+
 @SuppressWarnings("serial")
 /**
  * GUI layout for structure chooser
@@ -80,12 +84,23 @@ import javax.swing.table.TableColumn;
 public abstract class GStructureChooser extends JPanel
         implements ItemListener
 {
+  private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
+
+  protected static final String VIEWS_FILTER = "VIEWS_FILTER";
+
+  protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
+
+  protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID";
+
+  /*
+   * 'cached' structure view
+   */
+  protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
+
   protected JPanel statusPanel = new JPanel();
 
   public JLabel statusBar = new JLabel();
 
-  private JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout());
-
   protected String frameTitle = MessageManager
           .getString("label.structure_chooser");
 
@@ -97,41 +112,22 @@ public abstract class GStructureChooser extends JPanel
 
   protected StringBuilder errorWarning = new StringBuilder();
 
-  protected JLabel lbl_result = new JLabel(
-          MessageManager.getString("label.select"));
-
-  protected JButton btn_view = new JButton();
+  protected JButton btn_add;
 
-  protected JButton btn_cancel = new JButton();
+  protected JButton btn_newView;
 
   protected JButton btn_pdbFromFile = new JButton();
 
-  protected JTextField txt_search = new JTextField(14);
-
-  private JPanel pnl_actions = new JPanel();
-
-  private JPanel pnl_main = new JPanel();
-
-  private JPanel pnl_idInput = new JPanel(new FlowLayout());
+  protected JCheckBox chk_superpose = new JCheckBox(
+          MessageManager.getString("label.superpose_structures"));
 
-  private JPanel pnl_fileChooser = new JPanel(new FlowLayout());
-
-  private JPanel pnl_idInputBL = new JPanel(new BorderLayout());
-
-  private JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
-
-  private JPanel pnl_locPDB = new JPanel(new BorderLayout());
+  protected JTextField txt_search = new JTextField(14);
 
   protected JPanel pnl_switchableViews = new JPanel(new CardLayout());
 
   protected CardLayout layout_switchableViews = (CardLayout) (pnl_switchableViews
           .getLayout());
 
-  private BorderLayout mainLayout = new BorderLayout();
-
-  protected JCheckBox chk_rememberSettings = new JCheckBox(
-          MessageManager.getString("label.dont_ask_me_again"));
-
   protected JCheckBox chk_invertFilter = new JCheckBox(
           MessageManager.getString("label.invert"));
 
@@ -147,33 +143,20 @@ public abstract class GStructureChooser extends JPanel
   protected ImageIcon warningImage = new ImageIcon(
           getClass().getResource("/images/warning.gif"));
 
-  protected JLabel lbl_warning = new JLabel(warningImage);
-
   protected JLabel lbl_loading = new JLabel(loadingImage);
 
   protected JLabel lbl_pdbManualFetchStatus = new JLabel(errorImage);
 
   protected JLabel lbl_fromFileStatus = new JLabel(errorImage);
 
-  protected AssciateSeqPanel idInputAssSeqPanel = new AssciateSeqPanel();
-
-  protected AssciateSeqPanel fileChooserAssSeqPanel = new AssciateSeqPanel();
-
-  protected static final String VIEWS_FILTER = "VIEWS_FILTER";
+  protected AssociateSeqPanel idInputAssSeqPanel = new AssociateSeqPanel();
 
-  protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
+  protected AssociateSeqPanel fileChooserAssSeqPanel = new AssociateSeqPanel();
 
-  protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID";
-
-  /**
-   * 'cached' structure view
-   */
-  protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
+  protected JComboBox<StructureViewer> targetView = new JComboBox<>();
 
   protected JTable tbl_local_pdb = new JTable();
 
-  protected JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb);
-
   protected JTabbedPane pnl_filter = new JTabbedPane();
 
   protected FTSDataColumnPreferences pdbDocFieldPrefs = new FTSDataColumnPreferences(
@@ -262,8 +245,6 @@ public abstract class GStructureChooser extends JPanel
     }
   };
 
-  protected JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary);
-
   public GStructureChooser()
   {
     try
@@ -319,9 +300,9 @@ public abstract class GStructureChooser extends JPanel
           mainFrame.dispose();
           break;
         case KeyEvent.VK_ENTER: // enter key
-          if (btn_view.isEnabled())
+          if (btn_add.isEnabled())
           {
-            ok_ActionPerformed();
+            add_ActionPerformed();
           }
           break;
         case KeyEvent.VK_TAB: // tab key
@@ -331,7 +312,7 @@ public abstract class GStructureChooser extends JPanel
           }
           else
           {
-            btn_view.requestFocus();
+            btn_add.requestFocus();
           }
           evt.consume();
           break;
@@ -340,6 +321,30 @@ public abstract class GStructureChooser extends JPanel
         }
       }
     });
+
+    JButton btn_cancel = new JButton(
+            MessageManager.getString("action.cancel"));
+    btn_cancel.setFont(VERDANA_12);
+    btn_cancel.addActionListener(new java.awt.event.ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        closeAction(pnl_filter.getHeight());
+      }
+    });
+    btn_cancel.addKeyListener(new KeyAdapter()
+    {
+      @Override
+      public void keyPressed(KeyEvent evt)
+      {
+        if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+        {
+          closeAction(pnl_filter.getHeight());
+        }
+      }
+    });
+
     tbl_local_pdb.setAutoCreateRowSorter(true);
     tbl_local_pdb.getTableHeader().setReorderingAllowed(false);
     tbl_local_pdb.addMouseListener(new MouseAdapter()
@@ -368,9 +373,9 @@ public abstract class GStructureChooser extends JPanel
           mainFrame.dispose();
           break;
         case KeyEvent.VK_ENTER: // enter key
-          if (btn_view.isEnabled())
+          if (btn_add.isEnabled())
           {
-            ok_ActionPerformed();
+            add_ActionPerformed();
           }
           break;
         case KeyEvent.VK_TAB: // tab key
@@ -380,9 +385,9 @@ public abstract class GStructureChooser extends JPanel
           }
           else
           {
-            if (btn_view.isEnabled())
+            if (btn_add.isEnabled())
             {
-              btn_view.requestFocus();
+              btn_add.requestFocus();
             }
             else
             {
@@ -396,51 +401,52 @@ public abstract class GStructureChooser extends JPanel
         }
       }
     });
-    btn_view.setFont(new java.awt.Font("Verdana", 0, 12));
-    btn_view.setText(MessageManager.getString("action.view"));
-    btn_view.addActionListener(new java.awt.event.ActionListener()
+
+    btn_newView = new JButton(MessageManager.getString("action.new_view"));
+    btn_newView.setFont(VERDANA_12);
+    btn_newView.addActionListener(new java.awt.event.ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        ok_ActionPerformed();
+        newView_ActionPerformed();
       }
     });
-    btn_view.addKeyListener(new KeyAdapter()
+    btn_newView.addKeyListener(new KeyAdapter()
     {
       @Override
       public void keyPressed(KeyEvent evt)
       {
         if (evt.getKeyCode() == KeyEvent.VK_ENTER)
         {
-          ok_ActionPerformed();
+          newView_ActionPerformed();
         }
       }
     });
 
-    btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
-    btn_cancel.setText(MessageManager.getString("action.cancel"));
-    btn_cancel.addActionListener(new java.awt.event.ActionListener()
+    btn_add = new JButton(MessageManager.getString("action.add"));
+    btn_add.setFont(VERDANA_12);
+    btn_add.addActionListener(new java.awt.event.ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        closeAction(pnl_filter.getHeight());
+        add_ActionPerformed();
       }
     });
-    btn_cancel.addKeyListener(new KeyAdapter()
+    btn_add.addKeyListener(new KeyAdapter()
     {
       @Override
       public void keyPressed(KeyEvent evt)
       {
         if (evt.getKeyCode() == KeyEvent.VK_ENTER)
         {
-          closeAction(pnl_filter.getHeight());
+          add_ActionPerformed();
         }
       }
     });
 
-    btn_pdbFromFile.setFont(new java.awt.Font("Verdana", 0, 12));
+    btn_pdbFromFile.setFont(VERDANA_12);
     String btn_title = MessageManager.getString("label.select_pdb_file");
     btn_pdbFromFile.setText(btn_title + "              ");
     btn_pdbFromFile.addActionListener(new java.awt.event.ActionListener()
@@ -463,20 +469,17 @@ public abstract class GStructureChooser extends JPanel
       }
     });
 
+    JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary);
     scrl_foundStructures.setPreferredSize(new Dimension(width, height));
 
+    JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb);
     scrl_localPDB.setPreferredSize(new Dimension(width, height));
     scrl_localPDB.setHorizontalScrollBarPolicy(
             JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
 
-    cmb_filterOption.setFont(new java.awt.Font("Verdana", 0, 12));
-    chk_invertFilter.setFont(new java.awt.Font("Verdana", 0, 12));
-    chk_rememberSettings.setFont(new java.awt.Font("Verdana", 0, 12));
-    chk_rememberSettings.setVisible(false);
+    chk_invertFilter.setFont(VERDANA_12);
     txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true,
             MessageManager.getString("label.enter_pdb_id_tip")));
-    cmb_filterOption.setToolTipText(
-            MessageManager.getString("info.select_filter_option"));
     txt_search.getDocument().addDocumentListener(new DocumentListener()
     {
       @Override
@@ -498,8 +501,10 @@ public abstract class GStructureChooser extends JPanel
       }
     });
 
+    cmb_filterOption.setFont(VERDANA_12);
+    cmb_filterOption.setToolTipText(
+            MessageManager.getString("info.select_filter_option"));
     cmb_filterOption.addItemListener(this);
-
     // add CustomComboSeparatorsRenderer to filter option combo-box
     cmb_filterOption.setRenderer(new CustomComboSeparatorsRenderer(
             (ListCellRenderer<Object>) cmb_filterOption.getRenderer())
@@ -514,23 +519,33 @@ public abstract class GStructureChooser extends JPanel
 
     chk_invertFilter.addItemListener(this);
 
-    pnl_actions.add(chk_rememberSettings);
-    pnl_actions.add(btn_view);
-    pnl_actions.add(btn_cancel);
+    targetView.setVisible(false);
 
-    // pnl_filter.add(lbl_result);
+    JPanel actionsPanel = new JPanel(new MigLayout());
+    actionsPanel.add(targetView, "left");
+    actionsPanel.add(btn_add, "wrap");
+    actionsPanel.add(chk_superpose, "left");
+    actionsPanel.add(btn_newView);
+    actionsPanel.add(btn_cancel, "right");
+
+    JPanel pnl_main = new JPanel();
     pnl_main.add(cmb_filterOption);
     pnl_main.add(lbl_loading);
     pnl_main.add(chk_invertFilter);
     lbl_loading.setVisible(false);
 
+    JPanel pnl_fileChooser = new JPanel(new FlowLayout());
     pnl_fileChooser.add(btn_pdbFromFile);
     pnl_fileChooser.add(lbl_fromFileStatus);
+    JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
     pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.NORTH);
     pnl_fileChooserBL.add(pnl_fileChooser, BorderLayout.CENTER);
 
+    JPanel pnl_idInput = new JPanel(new FlowLayout());
     pnl_idInput.add(txt_search);
     pnl_idInput.add(lbl_pdbManualFetchStatus);
+
+    JPanel pnl_idInputBL = new JPanel(new BorderLayout());
     pnl_idInputBL.add(idInputAssSeqPanel, BorderLayout.NORTH);
     pnl_idInputBL.add(pnl_idInput, BorderLayout.CENTER);
 
@@ -546,13 +561,15 @@ public abstract class GStructureChooser extends JPanel
         JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
                 .getSource();
         int index = sourceTabbedPane.getSelectedIndex();
-        btn_view.setVisible(true);
+        btn_add.setVisible(targetView.isVisible());
+        btn_newView.setVisible(true);
         btn_cancel.setVisible(true);
         if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
         {
-          btn_view.setEnabled(false);
+          btn_add.setEnabled(false);
           btn_cancel.setEnabled(false);
-          btn_view.setVisible(false);
+          btn_add.setVisible(false);
+          btn_newView.setEnabled(false);
           btn_cancel.setVisible(false);
           previousWantedFields = pdbDocFieldPrefs
                   .getStructureSummaryFields()
@@ -578,6 +595,7 @@ public abstract class GStructureChooser extends JPanel
     pnl_filter.add(foundStructureSummary, scrl_foundStructures);
     pnl_filter.add(configureCols, pdbDocFieldPrefs);
 
+    JPanel pnl_locPDB = new JPanel(new BorderLayout());
     pnl_locPDB.add(scrl_localPDB);
 
     pnl_switchableViews.add(pnl_fileChooserBL, VIEWS_FROM_FILE);
@@ -585,12 +603,14 @@ public abstract class GStructureChooser extends JPanel
     pnl_switchableViews.add(pnl_filter, VIEWS_FILTER);
     pnl_switchableViews.add(pnl_locPDB, VIEWS_LOCAL_PDB);
 
-    this.setLayout(mainLayout);
+    this.setLayout(new BorderLayout());
     this.add(pnl_main, java.awt.BorderLayout.NORTH);
     this.add(pnl_switchableViews, java.awt.BorderLayout.CENTER);
     // this.add(pnl_actions, java.awt.BorderLayout.SOUTH);
     statusPanel.setLayout(new GridLayout());
-    pnl_actionsAndStatus.add(pnl_actions, BorderLayout.CENTER);
+
+    JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout());
+    pnl_actionsAndStatus.add(actionsPanel, BorderLayout.CENTER);
     pnl_actionsAndStatus.add(statusPanel, BorderLayout.SOUTH);
     statusPanel.add(statusBar, null);
     this.add(pnl_actionsAndStatus, java.awt.BorderLayout.SOUTH);
@@ -801,13 +821,13 @@ public abstract class GStructureChooser extends JPanel
    * @author tcnofoegbu
    *
    */
-  public class AssciateSeqPanel extends JPanel implements ItemListener
+  public class AssociateSeqPanel extends JPanel implements ItemListener
   {
     private JComboBox<AssociateSeqOptions> cmb_assSeq = new JComboBox<>();
 
     private JLabel lbl_associateSeq = new JLabel();
 
-    public AssciateSeqPanel()
+    public AssociateSeqPanel()
     {
       this.setLayout(new FlowLayout());
       this.add(cmb_assSeq);
@@ -901,19 +921,21 @@ public abstract class GStructureChooser extends JPanel
 
   protected abstract void stateChanged(ItemEvent e);
 
-  protected abstract void ok_ActionPerformed();
+  protected abstract void add_ActionPerformed();
+
+  protected abstract void newView_ActionPerformed();
 
   protected abstract void pdbFromFile_actionPerformed();
 
   protected abstract void txt_search_ActionPerformed();
 
-  public abstract void populateCmbAssociateSeqOptions(
+  protected abstract void populateCmbAssociateSeqOptions(
           JComboBox<AssociateSeqOptions> cmb_assSeq,
           JLabel lbl_associateSeq);
 
-  public abstract void cmbAssSeqStateChanged();
+  protected abstract void cmbAssSeqStateChanged();
 
-  public abstract void tabRefresh();
+  protected abstract void tabRefresh();
 
-  public abstract void validateSelections();
+  protected abstract void validateSelections();
 }
\ No newline at end of file
diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java
new file mode 100644 (file)
index 0000000..90c09d7
--- /dev/null
@@ -0,0 +1,6241 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.project;
+
+import jalview.analysis.Conservation;
+import jalview.api.FeatureColourI;
+import jalview.api.ViewStyleI;
+import jalview.api.structures.JalviewStructureDisplayI;
+import jalview.bin.Cache;
+import jalview.datamodel.AlignedCodonFrame;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.GraphLine;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.RnaViewerModel;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.datamodel.StructureViewerModel;
+import jalview.datamodel.StructureViewerModel.StructureData;
+import jalview.datamodel.features.FeatureMatcher;
+import jalview.datamodel.features.FeatureMatcherI;
+import jalview.datamodel.features.FeatureMatcherSet;
+import jalview.datamodel.features.FeatureMatcherSetI;
+import jalview.ext.varna.RnaModel;
+import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
+import jalview.gui.AlignmentPanel;
+import jalview.gui.AppVarna;
+import jalview.gui.ChimeraViewFrame;
+import jalview.gui.Desktop;
+import jalview.gui.FeatureRenderer;
+import jalview.gui.Jalview2XML_V1;
+import jalview.gui.JvOptionPane;
+import jalview.gui.OOMWarning;
+import jalview.gui.PaintRefresher;
+import jalview.gui.SplitFrame;
+import jalview.gui.StructureViewer;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.gui.StructureViewerBase;
+import jalview.gui.TreePanel;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
+import jalview.io.NewickFile;
+import jalview.renderer.ResidueShaderI;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.FeatureColour;
+import jalview.schemes.ResidueProperties;
+import jalview.schemes.UserColourScheme;
+import jalview.structure.StructureSelectionManager;
+import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.Format;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.util.StringUtils;
+import jalview.util.jarInputStreamProvider;
+import jalview.util.matcher.Condition;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.viewmodel.ViewportRanges;
+import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
+import jalview.viewmodel.seqfeatures.FeaturesDisplayed;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.dm.AAConSettings;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.AutoCalcSetting;
+import jalview.ws.params.WsParamSetI;
+import jalview.xml.binding.jalview.AlcodonFrame;
+import jalview.xml.binding.jalview.AlcodonFrame.AlcodMap;
+import jalview.xml.binding.jalview.Annotation;
+import jalview.xml.binding.jalview.Annotation.ThresholdLine;
+import jalview.xml.binding.jalview.AnnotationColourScheme;
+import jalview.xml.binding.jalview.AnnotationElement;
+import jalview.xml.binding.jalview.Feature;
+import jalview.xml.binding.jalview.Feature.OtherData;
+import jalview.xml.binding.jalview.FeatureMatcherSet.CompoundMatcher;
+import jalview.xml.binding.jalview.FilterBy;
+import jalview.xml.binding.jalview.JalviewModel;
+import jalview.xml.binding.jalview.JalviewModel.FeatureSettings;
+import jalview.xml.binding.jalview.JalviewModel.FeatureSettings.Group;
+import jalview.xml.binding.jalview.JalviewModel.FeatureSettings.Setting;
+import jalview.xml.binding.jalview.JalviewModel.JGroup;
+import jalview.xml.binding.jalview.JalviewModel.JSeq;
+import jalview.xml.binding.jalview.JalviewModel.JSeq.Pdbids;
+import jalview.xml.binding.jalview.JalviewModel.JSeq.Pdbids.StructureState;
+import jalview.xml.binding.jalview.JalviewModel.JSeq.RnaViewer;
+import jalview.xml.binding.jalview.JalviewModel.JSeq.RnaViewer.SecondaryStructure;
+import jalview.xml.binding.jalview.JalviewModel.Tree;
+import jalview.xml.binding.jalview.JalviewModel.UserColours;
+import jalview.xml.binding.jalview.JalviewModel.Viewport;
+import jalview.xml.binding.jalview.JalviewModel.Viewport.CalcIdParam;
+import jalview.xml.binding.jalview.JalviewModel.Viewport.HiddenColumns;
+import jalview.xml.binding.jalview.JalviewUserColours;
+import jalview.xml.binding.jalview.JalviewUserColours.Colour;
+import jalview.xml.binding.jalview.MapListType.MapListFrom;
+import jalview.xml.binding.jalview.MapListType.MapListTo;
+import jalview.xml.binding.jalview.Mapping;
+import jalview.xml.binding.jalview.NoValueColour;
+import jalview.xml.binding.jalview.ObjectFactory;
+import jalview.xml.binding.jalview.Pdbentry.Property;
+import jalview.xml.binding.jalview.Sequence;
+import jalview.xml.binding.jalview.Sequence.DBRef;
+import jalview.xml.binding.jalview.SequenceSet;
+import jalview.xml.binding.jalview.SequenceSet.SequenceSetProperties;
+import jalview.xml.binding.jalview.ThresholdType;
+import jalview.xml.binding.jalview.VAMSAS;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Rectangle;
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.math.BigInteger;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.Vector;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Write out the current jalview desktop state as a Jalview XML stream.
+ * 
+ * Note: the vamsas objects referred to here are primitive versions of the
+ * VAMSAS project schema elements - they are not the same and most likely never
+ * will be :)
+ * 
+ * @author $author$
+ * @version $Revision: 1.134 $
+ */
+public class Jalview2XML
+{
+  private static final String VIEWER_PREFIX = "viewer_";
+
+  private static final String RNA_PREFIX = "rna_";
+
+  private static final String UTF_8 = "UTF-8";
+
+  /**
+   * prefix for recovering datasets for alignments with multiple views where
+   * non-existent dataset IDs were written for some views
+   */
+  private static final String UNIQSEQSETID = "uniqueSeqSetId.";
+
+  // use this with nextCounter() to make unique names for entities
+  private int counter = 0;
+
+  /*
+   * SequenceI reference -> XML ID string in jalview XML. Populated as XML reps
+   * of sequence objects are created.
+   */
+  IdentityHashMap<SequenceI, String> seqsToIds = null;
+
+  /**
+   * jalview XML Sequence ID to jalview sequence object reference (both dataset
+   * and alignment sequences. Populated as XML reps of sequence objects are
+   * created.)
+   */
+  Map<String, SequenceI> seqRefIds = null;
+
+  Map<String, SequenceI> incompleteSeqs = null;
+
+  List<SeqFref> frefedSequence = null;
+
+  boolean raiseGUI = true; // whether errors are raised in dialog boxes or not
+
+  /*
+   * Map of reconstructed AlignFrame objects that appear to have come from
+   * SplitFrame objects (have a dna/protein complement view).
+   */
+  private Map<Viewport, AlignFrame> splitFrameCandidates = new HashMap<>();
+
+  /*
+   * Map from displayed rna structure models to their saved session state jar
+   * entry names
+   */
+  private Map<RnaModel, String> rnaSessions = new HashMap<>();
+
+  /**
+   * A helper method for safely using the value of an optional attribute that
+   * may be null if not present in the XML. Answers the boolean value, or false
+   * if null.
+   * 
+   * @param b
+   * @return
+   */
+  public static boolean safeBoolean(Boolean b)
+  {
+    return b == null ? false : b.booleanValue();
+  }
+
+  /**
+   * A helper method for safely using the value of an optional attribute that
+   * may be null if not present in the XML. Answers the integer value, or zero
+   * if null.
+   * 
+   * @param i
+   * @return
+   */
+  public static int safeInt(Integer i)
+  {
+    return i == null ? 0 : i.intValue();
+  }
+
+  /**
+   * A helper method for safely using the value of an optional attribute that
+   * may be null if not present in the XML. Answers the float value, or zero if
+   * null.
+   * 
+   * @param f
+   * @return
+   */
+  public static float safeFloat(Float f)
+  {
+    return f == null ? 0f : f.floatValue();
+  }
+
+  /**
+   * create/return unique hash string for sq
+   * 
+   * @param sq
+   * @return new or existing unique string for sq
+   */
+  String seqHash(SequenceI sq)
+  {
+    if (seqsToIds == null)
+    {
+      initSeqRefs();
+    }
+    if (seqsToIds.containsKey(sq))
+    {
+      return seqsToIds.get(sq);
+    }
+    else
+    {
+      // create sequential key
+      String key = "sq" + (seqsToIds.size() + 1);
+      key = makeHashCode(sq, key); // check we don't have an external reference
+      // for it already.
+      seqsToIds.put(sq, key);
+      return key;
+    }
+  }
+
+  void initSeqRefs()
+  {
+    if (seqsToIds == null)
+    {
+      seqsToIds = new IdentityHashMap<>();
+    }
+    if (seqRefIds == null)
+    {
+      seqRefIds = new HashMap<>();
+    }
+    if (incompleteSeqs == null)
+    {
+      incompleteSeqs = new HashMap<>();
+    }
+    if (frefedSequence == null)
+    {
+      frefedSequence = new ArrayList<>();
+    }
+  }
+
+  public Jalview2XML()
+  {
+  }
+
+  public Jalview2XML(boolean raiseGUI)
+  {
+    this.raiseGUI = raiseGUI;
+  }
+
+  /**
+   * base class for resolving forward references to sequences by their ID
+   * 
+   * @author jprocter
+   *
+   */
+  abstract class SeqFref
+  {
+    String sref;
+
+    String type;
+
+    public SeqFref(String _sref, String type)
+    {
+      sref = _sref;
+      this.type = type;
+    }
+
+    public String getSref()
+    {
+      return sref;
+    }
+
+    public SequenceI getSrefSeq()
+    {
+      return seqRefIds.get(sref);
+    }
+
+    public boolean isResolvable()
+    {
+      return seqRefIds.get(sref) != null;
+    }
+
+    public SequenceI getSrefDatasetSeq()
+    {
+      SequenceI sq = seqRefIds.get(sref);
+      if (sq != null)
+      {
+        while (sq.getDatasetSequence() != null)
+        {
+          sq = sq.getDatasetSequence();
+        }
+      }
+      return sq;
+    }
+
+    /**
+     * @return true if the forward reference was fully resolved
+     */
+    abstract boolean resolve();
+
+    @Override
+    public String toString()
+    {
+      return type + " reference to " + sref;
+    }
+  }
+
+  /**
+   * create forward reference for a mapping
+   * 
+   * @param sref
+   * @param _jmap
+   * @return
+   */
+  public SeqFref newMappingRef(final String sref,
+          final jalview.datamodel.Mapping _jmap)
+  {
+    SeqFref fref = new SeqFref(sref, "Mapping")
+    {
+      public jalview.datamodel.Mapping jmap = _jmap;
+
+      @Override
+      boolean resolve()
+      {
+        SequenceI seq = getSrefDatasetSeq();
+        if (seq == null)
+        {
+          return false;
+        }
+        jmap.setTo(seq);
+        return true;
+      }
+    };
+    return fref;
+  }
+
+  public SeqFref newAlcodMapRef(final String sref,
+          final AlignedCodonFrame _cf,
+          final jalview.datamodel.Mapping _jmap)
+  {
+
+    SeqFref fref = new SeqFref(sref, "Codon Frame")
+    {
+      AlignedCodonFrame cf = _cf;
+
+      public jalview.datamodel.Mapping mp = _jmap;
+
+      @Override
+      public boolean isResolvable()
+      {
+        return super.isResolvable() && mp.getTo() != null;
+      };
+
+      @Override
+      boolean resolve()
+      {
+        SequenceI seq = getSrefDatasetSeq();
+        if (seq == null)
+        {
+          return false;
+        }
+        cf.addMap(seq, mp.getTo(), mp.getMap());
+        return true;
+      }
+    };
+    return fref;
+  }
+
+  public void resolveFrefedSequences()
+  {
+    Iterator<SeqFref> nextFref = frefedSequence.iterator();
+    int toresolve = frefedSequence.size();
+    int unresolved = 0, failedtoresolve = 0;
+    while (nextFref.hasNext())
+    {
+      SeqFref ref = nextFref.next();
+      if (ref.isResolvable())
+      {
+        try
+        {
+          if (ref.resolve())
+          {
+            nextFref.remove();
+          }
+          else
+          {
+            failedtoresolve++;
+          }
+        } catch (Exception x)
+        {
+          System.err.println(
+                  "IMPLEMENTATION ERROR: Failed to resolve forward reference for sequence "
+                          + ref.getSref());
+          x.printStackTrace();
+          failedtoresolve++;
+        }
+      }
+      else
+      {
+        unresolved++;
+      }
+    }
+    if (unresolved > 0)
+    {
+      System.err.println("Jalview Project Import: There were " + unresolved
+              + " forward references left unresolved on the stack.");
+    }
+    if (failedtoresolve > 0)
+    {
+      System.err.println("SERIOUS! " + failedtoresolve
+              + " resolvable forward references failed to resolve.");
+    }
+    if (incompleteSeqs != null && incompleteSeqs.size() > 0)
+    {
+      System.err.println(
+              "Jalview Project Import: There are " + incompleteSeqs.size()
+                      + " sequences which may have incomplete metadata.");
+      if (incompleteSeqs.size() < 10)
+      {
+        for (SequenceI s : incompleteSeqs.values())
+        {
+          System.err.println(s.toString());
+        }
+      }
+      else
+      {
+        System.err.println(
+                "Too many to report. Skipping output of incomplete sequences.");
+      }
+    }
+  }
+
+  /**
+   * This maintains a map of viewports, the key being the seqSetId. Important to
+   * set historyItem and redoList for multiple views
+   */
+  Map<String, AlignViewport> viewportsAdded = new HashMap<>();
+
+  Map<String, AlignmentAnnotation> annotationIds = new HashMap<>();
+
+  String uniqueSetSuffix = "";
+
+  /**
+   * List of pdbfiles added to Jar
+   */
+  List<String> pdbfiles = null;
+
+  // SAVES SEVERAL ALIGNMENT WINDOWS TO SAME JARFILE
+  public void saveState(File statefile)
+  {
+    FileOutputStream fos = null;
+    try
+    {
+      fos = new FileOutputStream(statefile);
+      JarOutputStream jout = new JarOutputStream(fos);
+      saveState(jout);
+
+    } catch (Exception e)
+    {
+      // TODO: inform user of the problem - they need to know if their data was
+      // not saved !
+      if (errorMessage == null)
+      {
+        errorMessage = "Couldn't write Jalview Archive to output file '"
+                + statefile + "' - See console error log for details";
+      }
+      else
+      {
+        errorMessage += "(output file was '" + statefile + "')";
+      }
+      e.printStackTrace();
+    } finally
+    {
+      if (fos != null)
+      {
+        try
+        {
+          fos.close();
+        } catch (IOException e)
+        {
+          // ignore
+        }
+      }
+    }
+    reportErrors();
+  }
+
+  /**
+   * Writes a jalview project archive to the given Jar output stream.
+   * 
+   * @param jout
+   */
+  public void saveState(JarOutputStream jout)
+  {
+    AlignFrame[] frames = Desktop.getAlignFrames();
+
+    if (frames == null)
+    {
+      return;
+    }
+    saveAllFrames(Arrays.asList(frames), jout);
+  }
+
+  /**
+   * core method for storing state for a set of AlignFrames.
+   * 
+   * @param frames
+   *          - frames involving all data to be exported (including containing
+   *          splitframes)
+   * @param jout
+   *          - project output stream
+   */
+  private void saveAllFrames(List<AlignFrame> frames, JarOutputStream jout)
+  {
+    Hashtable<String, AlignFrame> dsses = new Hashtable<>();
+
+    /*
+     * ensure cached data is clear before starting
+     */
+    // todo tidy up seqRefIds, seqsToIds initialisation / reset
+    rnaSessions.clear();
+    splitFrameCandidates.clear();
+
+    try
+    {
+
+      // NOTE UTF-8 MUST BE USED FOR WRITING UNICODE CHARS
+      // //////////////////////////////////////////////////
+
+      List<String> shortNames = new ArrayList<>();
+      List<String> viewIds = new ArrayList<>();
+
+      // REVERSE ORDER
+      for (int i = frames.size() - 1; i > -1; i--)
+      {
+        AlignFrame af = frames.get(i);
+        // skip ?
+        if (skipList != null && skipList
+                .containsKey(af.getViewport().getSequenceSetId()))
+        {
+          continue;
+        }
+
+        String shortName = makeFilename(af, shortNames);
+
+        int apSize = af.getAlignPanels().size();
+
+        for (int ap = 0; ap < apSize; ap++)
+        {
+          AlignmentPanel apanel = (AlignmentPanel) af.getAlignPanels()
+                  .get(ap);
+          String fileName = apSize == 1 ? shortName : ap + shortName;
+          if (!fileName.endsWith(".xml"))
+          {
+            fileName = fileName + ".xml";
+          }
+
+          saveState(apanel, fileName, jout, viewIds);
+
+          String dssid = getDatasetIdRef(
+                  af.getViewport().getAlignment().getDataset());
+          if (!dsses.containsKey(dssid))
+          {
+            dsses.put(dssid, af);
+          }
+        }
+      }
+
+      writeDatasetFor(dsses, "" + jout.hashCode() + " " + uniqueSetSuffix,
+              jout);
+
+      try
+      {
+        jout.flush();
+      } catch (Exception foo)
+      {
+      }
+      ;
+      jout.close();
+    } catch (Exception ex)
+    {
+      // TODO: inform user of the problem - they need to know if their data was
+      // not saved !
+      if (errorMessage == null)
+      {
+        errorMessage = "Couldn't write Jalview Archive - see error output for details";
+      }
+      ex.printStackTrace();
+    }
+  }
+
+  /**
+   * Generates a distinct file name, based on the title of the AlignFrame, by
+   * appending _n for increasing n until an unused name is generated. The new
+   * name (without its extension) is added to the list.
+   * 
+   * @param af
+   * @param namesUsed
+   * @return the generated name, with .xml extension
+   */
+  protected String makeFilename(AlignFrame af, List<String> namesUsed)
+  {
+    String shortName = af.getTitle();
+
+    if (shortName.indexOf(File.separatorChar) > -1)
+    {
+      shortName = shortName
+              .substring(shortName.lastIndexOf(File.separatorChar) + 1);
+    }
+
+    int count = 1;
+
+    while (namesUsed.contains(shortName))
+    {
+      if (shortName.endsWith("_" + (count - 1)))
+      {
+        shortName = shortName.substring(0, shortName.lastIndexOf("_"));
+      }
+
+      shortName = shortName.concat("_" + count);
+      count++;
+    }
+
+    namesUsed.add(shortName);
+
+    if (!shortName.endsWith(".xml"))
+    {
+      shortName = shortName + ".xml";
+    }
+    return shortName;
+  }
+
+  // USE THIS METHOD TO SAVE A SINGLE ALIGNMENT WINDOW
+  public boolean saveAlignment(AlignFrame af, String jarFile,
+          String fileName)
+  {
+    try
+    {
+      FileOutputStream fos = new FileOutputStream(jarFile);
+      JarOutputStream jout = new JarOutputStream(fos);
+      List<AlignFrame> frames = new ArrayList<>();
+
+      // resolve splitframes
+      if (af.getViewport().getCodingComplement() != null)
+      {
+        frames = ((SplitFrame) af.getSplitViewContainer()).getAlignFrames();
+      }
+      else
+      {
+        frames.add(af);
+      }
+      saveAllFrames(frames, jout);
+      try
+      {
+        jout.flush();
+      } catch (Exception foo)
+      {
+      }
+      ;
+      jout.close();
+      return true;
+    } catch (Exception ex)
+    {
+      errorMessage = "Couldn't Write alignment view to Jalview Archive - see error output for details";
+      ex.printStackTrace();
+      return false;
+    }
+  }
+
+  private void writeDatasetFor(Hashtable<String, AlignFrame> dsses,
+          String fileName, JarOutputStream jout)
+  {
+
+    for (String dssids : dsses.keySet())
+    {
+      AlignFrame _af = dsses.get(dssids);
+      String jfileName = fileName + " Dataset for " + _af.getTitle();
+      if (!jfileName.endsWith(".xml"))
+      {
+        jfileName = jfileName + ".xml";
+      }
+      saveState(_af.alignPanel, jfileName, true, jout, null);
+    }
+  }
+
+  /**
+   * create a JalviewModel from an alignment view and marshall it to a
+   * JarOutputStream
+   * 
+   * @param ap
+   *          panel to create jalview model for
+   * @param fileName
+   *          name of alignment panel written to output stream
+   * @param jout
+   *          jar output stream
+   * @param viewIds
+   * @param out
+   *          jar entry name
+   */
+  public JalviewModel saveState(AlignmentPanel ap, String fileName,
+          JarOutputStream jout, List<String> viewIds)
+  {
+    return saveState(ap, fileName, false, jout, viewIds);
+  }
+
+  /**
+   * create a JalviewModel from an alignment view and marshall it to a
+   * JarOutputStream
+   * 
+   * @param ap
+   *          panel to create jalview model for
+   * @param fileName
+   *          name of alignment panel written to output stream
+   * @param storeDS
+   *          when true, only write the dataset for the alignment, not the data
+   *          associated with the view.
+   * @param jout
+   *          jar output stream
+   * @param out
+   *          jar entry name
+   */
+  public JalviewModel saveState(AlignmentPanel ap, String fileName,
+          boolean storeDS, JarOutputStream jout, List<String> viewIds)
+  {
+    if (viewIds == null)
+    {
+      viewIds = new ArrayList<>();
+    }
+
+    initSeqRefs();
+
+    List<UserColourScheme> userColours = new ArrayList<>();
+
+    AlignViewport av = ap.av;
+    ViewportRanges vpRanges = av.getRanges();
+
+    final ObjectFactory objectFactory = new ObjectFactory();
+    JalviewModel object = objectFactory.createJalviewModel();
+    object.setVamsasModel(new VAMSAS());
+
+    // object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
+    try
+    {
+      GregorianCalendar c = new GregorianCalendar();
+      DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
+      XMLGregorianCalendar now = datatypeFactory.newXMLGregorianCalendar(c);// gregorianCalendar);
+      object.setCreationDate(now);
+    } catch (DatatypeConfigurationException e)
+    {
+      System.err.println("error writing date: " + e.toString());
+    }
+    object.setVersion(
+            jalview.bin.Cache.getDefault("VERSION", "Development Build"));
+
+    /**
+     * rjal is full height alignment, jal is actual alignment with full metadata
+     * but excludes hidden sequences.
+     */
+    jalview.datamodel.AlignmentI rjal = av.getAlignment(), jal = rjal;
+
+    if (av.hasHiddenRows())
+    {
+      rjal = jal.getHiddenSequences().getFullAlignment();
+    }
+
+    SequenceSet vamsasSet = new SequenceSet();
+    Sequence vamsasSeq;
+    // JalviewModelSequence jms = new JalviewModelSequence();
+
+    vamsasSet.setGapChar(jal.getGapCharacter() + "");
+
+    if (jal.getDataset() != null)
+    {
+      // dataset id is the dataset's hashcode
+      vamsasSet.setDatasetId(getDatasetIdRef(jal.getDataset()));
+      if (storeDS)
+      {
+        // switch jal and the dataset
+        jal = jal.getDataset();
+        rjal = jal;
+      }
+    }
+    if (jal.getProperties() != null)
+    {
+      Enumeration en = jal.getProperties().keys();
+      while (en.hasMoreElements())
+      {
+        String key = en.nextElement().toString();
+        SequenceSetProperties ssp = new SequenceSetProperties();
+        ssp.setKey(key);
+        ssp.setValue(jal.getProperties().get(key).toString());
+        // vamsasSet.addSequenceSetProperties(ssp);
+        vamsasSet.getSequenceSetProperties().add(ssp);
+      }
+    }
+
+    JSeq jseq;
+    Set<String> calcIdSet = new HashSet<>();
+    // record the set of vamsas sequence XML POJO we create.
+    HashMap<String, Sequence> vamsasSetIds = new HashMap<>();
+    // SAVE SEQUENCES
+    for (final SequenceI jds : rjal.getSequences())
+    {
+      final SequenceI jdatasq = jds.getDatasetSequence() == null ? jds
+              : jds.getDatasetSequence();
+      String id = seqHash(jds);
+      if (vamsasSetIds.get(id) == null)
+      {
+        if (seqRefIds.get(id) != null && !storeDS)
+        {
+          // This happens for two reasons: 1. multiple views are being
+          // serialised.
+          // 2. the hashCode has collided with another sequence's code. This
+          // DOES
+          // HAPPEN! (PF00072.15.stk does this)
+          // JBPNote: Uncomment to debug writing out of files that do not read
+          // back in due to ArrayOutOfBoundExceptions.
+          // System.err.println("vamsasSeq backref: "+id+"");
+          // System.err.println(jds.getName()+"
+          // "+jds.getStart()+"-"+jds.getEnd()+" "+jds.getSequenceAsString());
+          // System.err.println("Hashcode: "+seqHash(jds));
+          // SequenceI rsq = (SequenceI) seqRefIds.get(id + "");
+          // System.err.println(rsq.getName()+"
+          // "+rsq.getStart()+"-"+rsq.getEnd()+" "+rsq.getSequenceAsString());
+          // System.err.println("Hashcode: "+seqHash(rsq));
+        }
+        else
+        {
+          vamsasSeq = createVamsasSequence(id, jds);
+//          vamsasSet.addSequence(vamsasSeq);
+          vamsasSet.getSequence().add(vamsasSeq);
+          vamsasSetIds.put(id, vamsasSeq);
+          seqRefIds.put(id, jds);
+        }
+      }
+      jseq = new JSeq();
+      jseq.setStart(jds.getStart());
+      jseq.setEnd(jds.getEnd());
+      jseq.setColour(av.getSequenceColour(jds).getRGB());
+
+      jseq.setId(id); // jseq id should be a string not a number
+      if (!storeDS)
+      {
+        // Store any sequences this sequence represents
+        if (av.hasHiddenRows())
+        {
+          // use rjal, contains the full height alignment
+          jseq.setHidden(
+                  av.getAlignment().getHiddenSequences().isHidden(jds));
+
+          if (av.isHiddenRepSequence(jds))
+          {
+            jalview.datamodel.SequenceI[] reps = av
+                    .getRepresentedSequences(jds).getSequencesInOrder(rjal);
+
+            for (int h = 0; h < reps.length; h++)
+            {
+              if (reps[h] != jds)
+              {
+                // jseq.addHiddenSequences(rjal.findIndex(reps[h]));
+                jseq.getHiddenSequences().add(rjal.findIndex(reps[h]));
+              }
+            }
+          }
+        }
+        // mark sequence as reference - if it is the reference for this view
+        if (jal.hasSeqrep())
+        {
+          jseq.setViewreference(jds == jal.getSeqrep());
+        }
+      }
+
+      // TODO: omit sequence features from each alignment view's XML dump if we
+      // are storing dataset
+      List<SequenceFeature> sfs = jds.getSequenceFeatures();
+      for (SequenceFeature sf : sfs)
+      {
+        // Features features = new Features();
+        Feature features = new Feature();
+
+        features.setBegin(sf.getBegin());
+        features.setEnd(sf.getEnd());
+        features.setDescription(sf.getDescription());
+        features.setType(sf.getType());
+        features.setFeatureGroup(sf.getFeatureGroup());
+        features.setScore(sf.getScore());
+        if (sf.links != null)
+        {
+          for (int l = 0; l < sf.links.size(); l++)
+          {
+            OtherData keyValue = new OtherData();
+            keyValue.setKey("LINK_" + l);
+            keyValue.setValue(sf.links.elementAt(l).toString());
+            // features.addOtherData(keyValue);
+            features.getOtherData().add(keyValue);
+          }
+        }
+        if (sf.otherDetails != null)
+        {
+          /*
+           * save feature attributes, which may be simple strings or
+           * map valued (have sub-attributes)
+           */
+          for (Entry<String, Object> entry : sf.otherDetails.entrySet())
+          {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+            if (value instanceof Map<?, ?>)
+            {
+              for (Entry<String, Object> subAttribute : ((Map<String, Object>) value)
+                      .entrySet())
+              {
+                OtherData otherData = new OtherData();
+                otherData.setKey(key);
+                otherData.setKey2(subAttribute.getKey());
+                otherData.setValue(subAttribute.getValue().toString());
+                // features.addOtherData(otherData);
+                features.getOtherData().add(otherData);
+              }
+            }
+            else
+            {
+              OtherData otherData = new OtherData();
+              otherData.setKey(key);
+              otherData.setValue(value.toString());
+              // features.addOtherData(otherData);
+              features.getOtherData().add(otherData);
+            }
+          }
+        }
+
+        // jseq.addFeatures(features);
+        jseq.getFeatures().add(features);
+      }
+
+      if (jdatasq.getAllPDBEntries() != null)
+      {
+        Enumeration<PDBEntry> en = jdatasq.getAllPDBEntries().elements();
+        while (en.hasMoreElements())
+        {
+          Pdbids pdb = new Pdbids();
+          jalview.datamodel.PDBEntry entry = en.nextElement();
+
+          String pdbId = entry.getId();
+          pdb.setId(pdbId);
+          pdb.setType(entry.getType());
+
+          /*
+           * Store any structure views associated with this sequence. This
+           * section copes with duplicate entries in the project, so a dataset
+           * only view *should* be coped with sensibly.
+           */
+          // This must have been loaded, is it still visible?
+          JInternalFrame[] frames = Desktop.desktop.getAllFrames();
+          String matchedFile = null;
+          for (int f = frames.length - 1; f > -1; f--)
+          {
+            if (frames[f] instanceof StructureViewerBase)
+            {
+              StructureViewerBase viewFrame = (StructureViewerBase) frames[f];
+              matchedFile = saveStructureState(ap, jds, pdb, entry, viewIds,
+                      matchedFile, viewFrame);
+              /*
+               * Only store each structure viewer's state once in the project
+               * jar. First time through only (storeDS==false)
+               */
+              String viewId = viewFrame.getViewId();
+              if (!storeDS && !viewIds.contains(viewId))
+              {
+                viewIds.add(viewId);
+                try
+                {
+                  String viewerState = viewFrame.getStateInfo();
+                  writeJarEntry(jout, getViewerJarEntryName(viewId),
+                          viewerState.getBytes());
+                } catch (IOException e)
+                {
+                  System.err.println(
+                          "Error saving viewer state: " + e.getMessage());
+                }
+              }
+            }
+          }
+
+          if (matchedFile != null || entry.getFile() != null)
+          {
+            if (entry.getFile() != null)
+            {
+              // use entry's file
+              matchedFile = entry.getFile();
+            }
+            pdb.setFile(matchedFile); // entry.getFile());
+            if (pdbfiles == null)
+            {
+              pdbfiles = new ArrayList<>();
+            }
+
+            if (!pdbfiles.contains(pdbId))
+            {
+              pdbfiles.add(pdbId);
+              copyFileToJar(jout, matchedFile, pdbId);
+            }
+          }
+
+          Enumeration<String> props = entry.getProperties();
+          if (props.hasMoreElements())
+          {
+            // PdbentryItem item = new PdbentryItem();
+            while (props.hasMoreElements())
+            {
+              Property prop = new Property();
+              String key = props.nextElement();
+              prop.setName(key);
+              prop.setValue(entry.getProperty(key).toString());
+              // item.addProperty(prop);
+              pdb.getProperty().add(prop);
+            }
+            // pdb.addPdbentryItem(item);
+          }
+
+          // jseq.addPdbids(pdb);
+          jseq.getPdbids().add(pdb);
+        }
+      }
+
+      saveRnaViewers(jout, jseq, jds, viewIds, ap, storeDS);
+
+      // jms.addJSeq(jseq);
+      object.getJSeq().add(jseq);
+    }
+
+    if (!storeDS && av.hasHiddenRows())
+    {
+      jal = av.getAlignment();
+    }
+    // SAVE MAPPINGS
+    // FOR DATASET
+    if (storeDS && jal.getCodonFrames() != null)
+    {
+      List<AlignedCodonFrame> jac = jal.getCodonFrames();
+      for (AlignedCodonFrame acf : jac)
+      {
+        AlcodonFrame alc = new AlcodonFrame();
+        if (acf.getProtMappings() != null
+                && acf.getProtMappings().length > 0)
+        {
+          boolean hasMap = false;
+          SequenceI[] dnas = acf.getdnaSeqs();
+          jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
+          for (int m = 0; m < pmaps.length; m++)
+          {
+            AlcodMap alcmap = new AlcodMap();
+            alcmap.setDnasq(seqHash(dnas[m]));
+            alcmap.setMapping(
+                    createVamsasMapping(pmaps[m], dnas[m], null, false));
+            // alc.addAlcodMap(alcmap);
+            alc.getAlcodMap().add(alcmap);
+            hasMap = true;
+          }
+          if (hasMap)
+          {
+            // vamsasSet.addAlcodonFrame(alc);
+            vamsasSet.getAlcodonFrame().add(alc);
+          }
+        }
+        // TODO: delete this ? dead code from 2.8.3->2.9 ?
+        // {
+        // AlcodonFrame alc = new AlcodonFrame();
+        // vamsasSet.addAlcodonFrame(alc);
+        // for (int p = 0; p < acf.aaWidth; p++)
+        // {
+        // Alcodon cmap = new Alcodon();
+        // if (acf.codons[p] != null)
+        // {
+        // // Null codons indicate a gapped column in the translated peptide
+        // // alignment.
+        // cmap.setPos1(acf.codons[p][0]);
+        // cmap.setPos2(acf.codons[p][1]);
+        // cmap.setPos3(acf.codons[p][2]);
+        // }
+        // alc.addAlcodon(cmap);
+        // }
+        // if (acf.getProtMappings() != null
+        // && acf.getProtMappings().length > 0)
+        // {
+        // SequenceI[] dnas = acf.getdnaSeqs();
+        // jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
+        // for (int m = 0; m < pmaps.length; m++)
+        // {
+        // AlcodMap alcmap = new AlcodMap();
+        // alcmap.setDnasq(seqHash(dnas[m]));
+        // alcmap.setMapping(createVamsasMapping(pmaps[m], dnas[m], null,
+        // false));
+        // alc.addAlcodMap(alcmap);
+        // }
+        // }
+      }
+    }
+
+    // SAVE TREES
+    // /////////////////////////////////
+    if (!storeDS && av.getCurrentTree() != null)
+    {
+      // FIND ANY ASSOCIATED TREES
+      // NOT IMPLEMENTED FOR HEADLESS STATE AT PRESENT
+      if (Desktop.desktop != null)
+      {
+        JInternalFrame[] frames = Desktop.desktop.getAllFrames();
+
+        for (int t = 0; t < frames.length; t++)
+        {
+          if (frames[t] instanceof TreePanel)
+          {
+            TreePanel tp = (TreePanel) frames[t];
+
+            if (tp.getTreeCanvas().getViewport().getAlignment() == jal)
+            {
+              JalviewModel.Tree tree = new JalviewModel.Tree();
+              tree.setTitle(tp.getTitle());
+              tree.setCurrentTree((av.getCurrentTree() == tp.getTree()));
+              tree.setNewick(tp.getTree().print());
+              tree.setThreshold(tp.getTreeCanvas().getThreshold());
+
+              tree.setFitToWindow(tp.fitToWindow.getState());
+              tree.setFontName(tp.getTreeFont().getName());
+              tree.setFontSize(tp.getTreeFont().getSize());
+              tree.setFontStyle(tp.getTreeFont().getStyle());
+              tree.setMarkUnlinked(tp.placeholdersMenu.getState());
+
+              tree.setShowBootstrap(tp.bootstrapMenu.getState());
+              tree.setShowDistances(tp.distanceMenu.getState());
+
+              tree.setHeight(tp.getHeight());
+              tree.setWidth(tp.getWidth());
+              tree.setXpos(tp.getX());
+              tree.setYpos(tp.getY());
+              tree.setId(makeHashCode(tp, null));
+              // jms.addTree(tree);
+              object.getTree().add(tree);
+            }
+          }
+        }
+      }
+    }
+
+    // SAVE ANNOTATIONS
+    /**
+     * store forward refs from an annotationRow to any groups
+     */
+    IdentityHashMap<SequenceGroup, String> groupRefs = new IdentityHashMap<>();
+    if (storeDS)
+    {
+      for (SequenceI sq : jal.getSequences())
+      {
+        // Store annotation on dataset sequences only
+        AlignmentAnnotation[] aa = sq.getAnnotation();
+        if (aa != null && aa.length > 0)
+        {
+          storeAlignmentAnnotation(aa, groupRefs, av, calcIdSet, storeDS,
+                  vamsasSet);
+        }
+      }
+    }
+    else
+    {
+      if (jal.getAlignmentAnnotation() != null)
+      {
+        // Store the annotation shown on the alignment.
+        AlignmentAnnotation[] aa = jal.getAlignmentAnnotation();
+        storeAlignmentAnnotation(aa, groupRefs, av, calcIdSet, storeDS,
+                vamsasSet);
+      }
+    }
+    // SAVE GROUPS
+    if (jal.getGroups() != null)
+    {
+      JGroup[] groups = new JGroup[jal.getGroups().size()];
+      int i = -1;
+      for (jalview.datamodel.SequenceGroup sg : jal.getGroups())
+      {
+        JGroup jGroup = new JGroup();
+        groups[++i] = jGroup;
+
+        jGroup.setStart(sg.getStartRes());
+        jGroup.setEnd(sg.getEndRes());
+        jGroup.setName(sg.getName());
+        if (groupRefs.containsKey(sg))
+        {
+          // group has references so set its ID field
+          jGroup.setId(groupRefs.get(sg));
+        }
+        ColourSchemeI colourScheme = sg.getColourScheme();
+        if (colourScheme != null)
+        {
+          ResidueShaderI groupColourScheme = sg.getGroupColourScheme();
+          if (groupColourScheme.conservationApplied())
+          {
+            jGroup.setConsThreshold(groupColourScheme.getConservationInc());
+
+            if (colourScheme instanceof jalview.schemes.UserColourScheme)
+            {
+              jGroup.setColour(
+                      setUserColourScheme(colourScheme, userColours,
+                              object));
+            }
+            else
+            {
+              jGroup.setColour(colourScheme.getSchemeName());
+            }
+          }
+          else if (colourScheme instanceof jalview.schemes.AnnotationColourGradient)
+          {
+            jGroup.setColour("AnnotationColourGradient");
+            jGroup.setAnnotationColours(constructAnnotationColours(
+                    (jalview.schemes.AnnotationColourGradient) colourScheme,
+                    userColours, object));
+          }
+          else if (colourScheme instanceof jalview.schemes.UserColourScheme)
+          {
+            jGroup.setColour(
+                    setUserColourScheme(colourScheme, userColours, object));
+          }
+          else
+          {
+            jGroup.setColour(colourScheme.getSchemeName());
+          }
+
+          jGroup.setPidThreshold(groupColourScheme.getThreshold());
+        }
+
+        jGroup.setOutlineColour(sg.getOutlineColour().getRGB());
+        jGroup.setDisplayBoxes(sg.getDisplayBoxes());
+        jGroup.setDisplayText(sg.getDisplayText());
+        jGroup.setColourText(sg.getColourText());
+        jGroup.setTextCol1(sg.textColour.getRGB());
+        jGroup.setTextCol2(sg.textColour2.getRGB());
+        jGroup.setTextColThreshold(sg.thresholdTextColour);
+        jGroup.setShowUnconserved(sg.getShowNonconserved());
+        jGroup.setIgnoreGapsinConsensus(sg.getIgnoreGapsConsensus());
+        jGroup.setShowConsensusHistogram(sg.isShowConsensusHistogram());
+        jGroup.setShowSequenceLogo(sg.isShowSequenceLogo());
+        jGroup.setNormaliseSequenceLogo(sg.isNormaliseSequenceLogo());
+        for (SequenceI seq : sg.getSequences())
+        {
+          // jGroup.addSeq(seqHash(seq));
+          jGroup.getSeq().add(seqHash(seq));
+        }
+      }
+
+      //jms.setJGroup(groups);
+      Object group;
+      for (JGroup grp : groups)
+      {
+        object.getJGroup().add(grp);
+      }
+    }
+    if (!storeDS)
+    {
+      // /////////SAVE VIEWPORT
+      Viewport view = new Viewport();
+      view.setTitle(ap.alignFrame.getTitle());
+      view.setSequenceSetId(
+              makeHashCode(av.getSequenceSetId(), av.getSequenceSetId()));
+      view.setId(av.getViewId());
+      if (av.getCodingComplement() != null)
+      {
+        view.setComplementId(av.getCodingComplement().getViewId());
+      }
+      view.setViewName(av.getViewName());
+      view.setGatheredViews(av.isGatherViewsHere());
+
+      Rectangle size = ap.av.getExplodedGeometry();
+      Rectangle position = size;
+      if (size == null)
+      {
+        size = ap.alignFrame.getBounds();
+        if (av.getCodingComplement() != null)
+        {
+          position = ((SplitFrame) ap.alignFrame.getSplitViewContainer())
+                  .getBounds();
+        }
+        else
+        {
+          position = size;
+        }
+      }
+      view.setXpos(position.x);
+      view.setYpos(position.y);
+
+      view.setWidth(size.width);
+      view.setHeight(size.height);
+
+      view.setStartRes(vpRanges.getStartRes());
+      view.setStartSeq(vpRanges.getStartSeq());
+
+      if (av.getGlobalColourScheme() instanceof jalview.schemes.UserColourScheme)
+      {
+        view.setBgColour(setUserColourScheme(av.getGlobalColourScheme(),
+                userColours, object));
+      }
+      else if (av
+              .getGlobalColourScheme() instanceof jalview.schemes.AnnotationColourGradient)
+      {
+        AnnotationColourScheme ac = constructAnnotationColours(
+                (jalview.schemes.AnnotationColourGradient) av
+                        .getGlobalColourScheme(),
+                userColours, object);
+
+        view.setAnnotationColours(ac);
+        view.setBgColour("AnnotationColourGradient");
+      }
+      else
+      {
+        view.setBgColour(ColourSchemeProperty
+                .getColourName(av.getGlobalColourScheme()));
+      }
+
+      ResidueShaderI vcs = av.getResidueShading();
+      ColourSchemeI cs = av.getGlobalColourScheme();
+
+      if (cs != null)
+      {
+        if (vcs.conservationApplied())
+        {
+          view.setConsThreshold(vcs.getConservationInc());
+          if (cs instanceof jalview.schemes.UserColourScheme)
+          {
+            view.setBgColour(setUserColourScheme(cs, userColours, object));
+          }
+        }
+        view.setPidThreshold(vcs.getThreshold());
+      }
+
+      view.setConservationSelected(av.getConservationSelected());
+      view.setPidSelected(av.getAbovePIDThreshold());
+      final Font font = av.getFont();
+      view.setFontName(font.getName());
+      view.setFontSize(font.getSize());
+      view.setFontStyle(font.getStyle());
+      view.setScaleProteinAsCdna(av.getViewStyle().isScaleProteinAsCdna());
+      view.setRenderGaps(av.isRenderGaps());
+      view.setShowAnnotation(av.isShowAnnotation());
+      view.setShowBoxes(av.getShowBoxes());
+      view.setShowColourText(av.getColourText());
+      view.setShowFullId(av.getShowJVSuffix());
+      view.setRightAlignIds(av.isRightAlignIds());
+      view.setShowSequenceFeatures(av.isShowSequenceFeatures());
+      view.setShowText(av.getShowText());
+      view.setShowUnconserved(av.getShowUnconserved());
+      view.setWrapAlignment(av.getWrapAlignment());
+      view.setTextCol1(av.getTextColour().getRGB());
+      view.setTextCol2(av.getTextColour2().getRGB());
+      view.setTextColThreshold(av.getThresholdTextColour());
+      view.setShowConsensusHistogram(av.isShowConsensusHistogram());
+      view.setShowSequenceLogo(av.isShowSequenceLogo());
+      view.setNormaliseSequenceLogo(av.isNormaliseSequenceLogo());
+      view.setShowGroupConsensus(av.isShowGroupConsensus());
+      view.setShowGroupConservation(av.isShowGroupConservation());
+      view.setShowNPfeatureTooltip(av.isShowNPFeats());
+      view.setShowDbRefTooltip(av.isShowDBRefs());
+      view.setFollowHighlight(av.isFollowHighlight());
+      view.setFollowSelection(av.followSelection);
+      view.setIgnoreGapsinConsensus(av.isIgnoreGapsConsensus());
+      if (av.getFeaturesDisplayed() != null)
+      {
+        FeatureSettings fs = new FeatureSettings();
+
+        FeatureRenderer fr = ap.getSeqPanel().seqCanvas
+                .getFeatureRenderer();
+        String[] renderOrder = fr.getRenderOrder().toArray(new String[0]);
+
+        Vector<String> settingsAdded = new Vector<>();
+        if (renderOrder != null)
+        {
+          for (String featureType : renderOrder)
+          {
+            FeatureSettings.Setting setting = new FeatureSettings.Setting();
+            setting.setType(featureType);
+
+            /*
+             * save any filter for the feature type
+             */
+            FeatureMatcherSetI filter = fr.getFeatureFilter(featureType);
+            if (filter != null)  {
+              Iterator<FeatureMatcherI> filters = filter.getMatchers().iterator();
+              FeatureMatcherI firstFilter = filters.next();
+              setting.setMatcherSet(Jalview2XML.marshalFilter(
+                      firstFilter, filters, filter.isAnded()));
+            }
+
+            /*
+             * save colour scheme for the feature type
+             */
+            FeatureColourI fcol = fr.getFeatureStyle(featureType);
+            if (!fcol.isSimpleColour())
+            {
+              setting.setColour(fcol.getMaxColour().getRGB());
+              setting.setMincolour(fcol.getMinColour().getRGB());
+              setting.setMin(fcol.getMin());
+              setting.setMax(fcol.getMax());
+              setting.setColourByLabel(fcol.isColourByLabel());
+              if (fcol.isColourByAttribute())
+              {
+                String[] attName = fcol.getAttributeName();
+                setting.getAttributeName().add(attName[0]);
+                if (attName.length > 1)
+                {
+                  setting.getAttributeName().add(attName[1]);
+                }
+              }
+              setting.setAutoScale(fcol.isAutoScaled());
+              setting.setThreshold(fcol.getThreshold());
+              Color noColour = fcol.getNoColour();
+              if (noColour == null)
+              {
+                setting.setNoValueColour(NoValueColour.NONE);
+              }
+              else if (noColour.equals(fcol.getMaxColour()))
+              {
+                setting.setNoValueColour(NoValueColour.MAX);
+              }
+              else
+              {
+                setting.setNoValueColour(NoValueColour.MIN);
+              }
+              // -1 = No threshold, 0 = Below, 1 = Above
+              setting.setThreshstate(fcol.isAboveThreshold() ? 1
+                      : (fcol.isBelowThreshold() ? 0 : -1));
+            }
+            else
+            {
+              setting.setColour(fcol.getColour().getRGB());
+            }
+
+            setting.setDisplay(
+                    av.getFeaturesDisplayed().isVisible(featureType));
+            float rorder = fr
+                    .getOrder(featureType);
+            if (rorder > -1)
+            {
+              setting.setOrder(rorder);
+            }
+            /// fs.addSetting(setting);
+            fs.getSetting().add(setting);
+            settingsAdded.addElement(featureType);
+          }
+        }
+
+        // is groups actually supposed to be a map here ?
+        Iterator<String> en = fr.getFeatureGroups().iterator();
+        Vector<String> groupsAdded = new Vector<>();
+        while (en.hasNext())
+        {
+          String grp = en.next();
+          if (groupsAdded.contains(grp))
+          {
+            continue;
+          }
+          Group g = new Group();
+          g.setName(grp);
+          g.setDisplay(((Boolean) fr.checkGroupVisibility(grp, false))
+                          .booleanValue());
+          // fs.addGroup(g);
+          fs.getGroup().add(g);
+          groupsAdded.addElement(grp);
+        }
+        // jms.setFeatureSettings(fs);
+        object.setFeatureSettings(fs);
+      }
+
+      if (av.hasHiddenColumns())
+      {
+        jalview.datamodel.HiddenColumns hidden = av.getAlignment()
+                .getHiddenColumns();
+        if (hidden == null)
+        {
+          warn("REPORT BUG: avoided null columnselection bug (DMAM reported). Please contact Jim about this.");
+        }
+        else
+        {
+          Iterator<int[]> hiddenRegions = hidden.iterator();
+          while (hiddenRegions.hasNext())
+          {
+            int[] region = hiddenRegions.next();
+            HiddenColumns hc = new HiddenColumns();
+            hc.setStart(region[0]);
+            hc.setEnd(region[1]);
+            // view.addHiddenColumns(hc);
+            view.getHiddenColumns().add(hc);
+          }
+        }
+      }
+      if (calcIdSet.size() > 0)
+      {
+        for (String calcId : calcIdSet)
+        {
+          if (calcId.trim().length() > 0)
+          {
+            CalcIdParam cidp = createCalcIdParam(calcId, av);
+            // Some calcIds have no parameters.
+            if (cidp != null)
+            {
+              // view.addCalcIdParam(cidp);
+              view.getCalcIdParam().add(cidp);
+            }
+          }
+        }
+      }
+
+      // jms.addViewport(view);
+      object.getViewport().add(view);
+    }
+    // object.setJalviewModelSequence(jms);
+    // object.getVamsasModel().addSequenceSet(vamsasSet);
+    object.getVamsasModel().getSequenceSet().add(vamsasSet);
+
+    if (jout != null && fileName != null)
+    {
+      // We may not want to write the object to disk,
+      // eg we can copy the alignViewport to a new view object
+      // using save and then load
+      try
+      {
+        System.out.println("Writing jar entry " + fileName);
+        JarEntry entry = new JarEntry(fileName);
+        jout.putNextEntry(entry);
+        PrintWriter pout = new PrintWriter(
+                new OutputStreamWriter(jout, UTF_8));
+        JAXBContext jaxbContext = JAXBContext
+                .newInstance(JalviewModel.class);
+        Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
+
+        // output pretty printed
+        // jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        jaxbMarshaller.marshal(
+                new ObjectFactory().createJalviewModel(object), pout);
+
+        // jaxbMarshaller.marshal(object, pout);
+        // marshaller.marshal(object);
+        pout.flush();
+        jout.closeEntry();
+      } catch (Exception ex)
+      {
+        // TODO: raise error in GUI if marshalling failed.
+        System.err.println("Error writing Jalview project");
+        ex.printStackTrace();
+      }
+    }
+    return object;
+  }
+
+  /**
+   * Save any Varna viewers linked to this sequence. Writes an rnaViewer element
+   * for each viewer, with
+   * <ul>
+   * <li>viewer geometry (position, size, split pane divider location)</li>
+   * <li>index of the selected structure in the viewer (currently shows gapped
+   * or ungapped)</li>
+   * <li>the id of the annotation holding RNA secondary structure</li>
+   * <li>(currently only one SS is shown per viewer, may be more in future)</li>
+   * </ul>
+   * Varna viewer state is also written out (in native Varna XML) to separate
+   * project jar entries. A separate entry is written for each RNA structure
+   * displayed, with the naming convention
+   * <ul>
+   * <li>rna_viewId_sequenceId_annotationId_[gapped|trimmed]</li>
+   * </ul>
+   * 
+   * @param jout
+   * @param jseq
+   * @param jds
+   * @param viewIds
+   * @param ap
+   * @param storeDataset
+   */
+  protected void saveRnaViewers(JarOutputStream jout, JSeq jseq,
+          final SequenceI jds, List<String> viewIds, AlignmentPanel ap,
+          boolean storeDataset)
+  {
+    if (Desktop.desktop == null)
+    {
+      return;
+    }
+    JInternalFrame[] frames = Desktop.desktop.getAllFrames();
+    for (int f = frames.length - 1; f > -1; f--)
+    {
+      if (frames[f] instanceof AppVarna)
+      {
+        AppVarna varna = (AppVarna) frames[f];
+        /*
+         * link the sequence to every viewer that is showing it and is linked to
+         * its alignment panel
+         */
+        if (varna.isListeningFor(jds) && ap == varna.getAlignmentPanel())
+        {
+          String viewId = varna.getViewId();
+          RnaViewer rna = new RnaViewer();
+          rna.setViewId(viewId);
+          rna.setTitle(varna.getTitle());
+          rna.setXpos(varna.getX());
+          rna.setYpos(varna.getY());
+          rna.setWidth(varna.getWidth());
+          rna.setHeight(varna.getHeight());
+          rna.setDividerLocation(varna.getDividerLocation());
+          rna.setSelectedRna(varna.getSelectedIndex());
+          // jseq.addRnaViewer(rna);
+          jseq.getRnaViewer().add(rna);
+
+          /*
+           * Store each Varna panel's state once in the project per sequence.
+           * First time through only (storeDataset==false)
+           */
+          // boolean storeSessions = false;
+          // String sequenceViewId = viewId + seqsToIds.get(jds);
+          // if (!storeDataset && !viewIds.contains(sequenceViewId))
+          // {
+          // viewIds.add(sequenceViewId);
+          // storeSessions = true;
+          // }
+          for (RnaModel model : varna.getModels())
+          {
+            if (model.seq == jds)
+            {
+              /*
+               * VARNA saves each view (sequence or alignment secondary
+               * structure, gapped or trimmed) as a separate XML file
+               */
+              String jarEntryName = rnaSessions.get(model);
+              if (jarEntryName == null)
+              {
+
+                String varnaStateFile = varna.getStateInfo(model.rna);
+                jarEntryName = RNA_PREFIX + viewId + "_" + nextCounter();
+                copyFileToJar(jout, varnaStateFile, jarEntryName);
+                rnaSessions.put(model, jarEntryName);
+              }
+              SecondaryStructure ss = new SecondaryStructure();
+              String annotationId = varna.getAnnotation(jds).annotationId;
+              ss.setAnnotationId(annotationId);
+              ss.setViewerState(jarEntryName);
+              ss.setGapped(model.gapped);
+              ss.setTitle(model.title);
+              // rna.addSecondaryStructure(ss);
+              rna.getSecondaryStructure().add(ss);
+            }
+          }
+        }
+      }
+    }
+  }
+
+  /**
+   * Copy the contents of a file to a new entry added to the output jar
+   * 
+   * @param jout
+   * @param infilePath
+   * @param jarEntryName
+   */
+  protected void copyFileToJar(JarOutputStream jout, String infilePath,
+          String jarEntryName)
+  {
+    DataInputStream dis = null;
+    try
+    {
+      File file = new File(infilePath);
+      if (file.exists() && jout != null)
+      {
+        dis = new DataInputStream(new FileInputStream(file));
+        byte[] data = new byte[(int) file.length()];
+        dis.readFully(data);
+        writeJarEntry(jout, jarEntryName, data);
+      }
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    } finally
+    {
+      if (dis != null)
+      {
+        try
+        {
+          dis.close();
+        } catch (IOException e)
+        {
+          // ignore
+        }
+      }
+    }
+  }
+
+  /**
+   * Write the data to a new entry of given name in the output jar file
+   * 
+   * @param jout
+   * @param jarEntryName
+   * @param data
+   * @throws IOException
+   */
+  protected void writeJarEntry(JarOutputStream jout, String jarEntryName,
+          byte[] data) throws IOException
+  {
+    if (jout != null)
+    {
+      System.out.println("Writing jar entry " + jarEntryName);
+      jout.putNextEntry(new JarEntry(jarEntryName));
+      DataOutputStream dout = new DataOutputStream(jout);
+      dout.write(data, 0, data.length);
+      dout.flush();
+      jout.closeEntry();
+    }
+  }
+
+  /**
+   * Save the state of a structure viewer
+   * 
+   * @param ap
+   * @param jds
+   * @param pdb
+   *          the archive XML element under which to save the state
+   * @param entry
+   * @param viewIds
+   * @param matchedFile
+   * @param viewFrame
+   * @return
+   */
+  protected String saveStructureState(AlignmentPanel ap, SequenceI jds,
+          Pdbids pdb, PDBEntry entry, List<String> viewIds,
+          String matchedFile, StructureViewerBase viewFrame)
+  {
+    final AAStructureBindingModel bindingModel = viewFrame.getBinding();
+
+    /*
+     * Look for any bindings for this viewer to the PDB file of interest
+     * (including part matches excluding chain id)
+     */
+    for (int peid = 0; peid < bindingModel.getPdbCount(); peid++)
+    {
+      final PDBEntry pdbentry = bindingModel.getPdbEntry(peid);
+      final String pdbId = pdbentry.getId();
+      if (!pdbId.equals(entry.getId())
+              && !(entry.getId().length() > 4 && entry.getId().toLowerCase()
+                      .startsWith(pdbId.toLowerCase())))
+      {
+        /*
+         * not interested in a binding to a different PDB entry here
+         */
+        continue;
+      }
+      if (matchedFile == null)
+      {
+        matchedFile = pdbentry.getFile();
+      }
+      else if (!matchedFile.equals(pdbentry.getFile()))
+      {
+        Cache.log.warn(
+                "Probably lost some PDB-Sequence mappings for this structure file (which apparently has same PDB Entry code): "
+                        + pdbentry.getFile());
+      }
+      // record the
+      // file so we
+      // can get at it if the ID
+      // match is ambiguous (e.g.
+      // 1QIP==1qipA)
+
+      for (int smap = 0; smap < viewFrame.getBinding()
+              .getSequence()[peid].length; smap++)
+      {
+        // if (jal.findIndex(jmol.jmb.sequence[peid][smap]) > -1)
+        if (jds == viewFrame.getBinding().getSequence()[peid][smap])
+        {
+          StructureState state = new StructureState();
+          state.setVisible(true);
+          state.setXpos(viewFrame.getX());
+          state.setYpos(viewFrame.getY());
+          state.setWidth(viewFrame.getWidth());
+          state.setHeight(viewFrame.getHeight());
+          final String viewId = viewFrame.getViewId();
+          state.setViewId(viewId);
+          state.setAlignwithAlignPanel(viewFrame.isUsedforaligment(ap));
+          state.setColourwithAlignPanel(viewFrame.isUsedforcolourby(ap));
+          state.setColourByJmol(viewFrame.isColouredByViewer());
+          state.setType(viewFrame.getViewerType().toString());
+          // pdb.addStructureState(state);
+          pdb.getStructureState().add(state);
+        }
+      }
+    }
+    return matchedFile;
+  }
+
+  /**
+   * Populates the AnnotationColourScheme xml for save. This captures the
+   * settings of the options in the 'Colour by Annotation' dialog.
+   * 
+   * @param acg
+   * @param userColours
+   * @param jm
+   * @return
+   */
+  private AnnotationColourScheme constructAnnotationColours(
+          AnnotationColourGradient acg, List<UserColourScheme> userColours,
+          JalviewModel jm)
+  {
+    AnnotationColourScheme ac = new AnnotationColourScheme();
+    ac.setAboveThreshold(acg.getAboveThreshold());
+    ac.setThreshold(acg.getAnnotationThreshold());
+    // 2.10.2 save annotationId (unique) not annotation label
+    ac.setAnnotation(acg.getAnnotation().annotationId);
+    if (acg.getBaseColour() instanceof UserColourScheme)
+    {
+      ac.setColourScheme(
+              setUserColourScheme(acg.getBaseColour(), userColours, jm));
+    }
+    else
+    {
+      ac.setColourScheme(
+              ColourSchemeProperty.getColourName(acg.getBaseColour()));
+    }
+
+    ac.setMaxColour(acg.getMaxColour().getRGB());
+    ac.setMinColour(acg.getMinColour().getRGB());
+    ac.setPerSequence(acg.isSeqAssociated());
+    ac.setPredefinedColours(acg.isPredefinedColours());
+    return ac;
+  }
+
+  private void storeAlignmentAnnotation(AlignmentAnnotation[] aa,
+          IdentityHashMap<SequenceGroup, String> groupRefs,
+          AlignmentViewport av, Set<String> calcIdSet, boolean storeDS,
+          SequenceSet vamsasSet)
+  {
+
+    for (int i = 0; i < aa.length; i++)
+    {
+      Annotation an = new Annotation();
+
+      AlignmentAnnotation annotation = aa[i];
+      if (annotation.annotationId != null)
+      {
+        annotationIds.put(annotation.annotationId, annotation);
+      }
+
+      an.setId(annotation.annotationId);
+
+      an.setVisible(annotation.visible);
+
+      an.setDescription(annotation.description);
+
+      if (annotation.sequenceRef != null)
+      {
+        // 2.9 JAL-1781 xref on sequence id rather than name
+        an.setSequenceRef(seqsToIds.get(annotation.sequenceRef));
+      }
+      if (annotation.groupRef != null)
+      {
+        String groupIdr = groupRefs.get(annotation.groupRef);
+        if (groupIdr == null)
+        {
+          // make a locally unique String
+          groupRefs.put(annotation.groupRef,
+                  groupIdr = ("" + System.currentTimeMillis()
+                          + annotation.groupRef.getName()
+                          + groupRefs.size()));
+        }
+        an.setGroupRef(groupIdr.toString());
+      }
+
+      // store all visualization attributes for annotation
+      an.setGraphHeight(annotation.graphHeight);
+      an.setCentreColLabels(annotation.centreColLabels);
+      an.setScaleColLabels(annotation.scaleColLabel);
+      an.setShowAllColLabels(annotation.showAllColLabels);
+      an.setBelowAlignment(annotation.belowAlignment);
+
+      if (annotation.graph > 0)
+      {
+        an.setGraph(true);
+        an.setGraphType(annotation.graph);
+        an.setGraphGroup(annotation.graphGroup);
+        if (annotation.getThreshold() != null)
+        {
+          ThresholdLine line = new ThresholdLine();
+          line.setLabel(annotation.getThreshold().label);
+          line.setValue(annotation.getThreshold().value);
+          line.setColour(annotation.getThreshold().colour.getRGB());
+          an.setThresholdLine(line);
+        }
+      }
+      else
+      {
+        an.setGraph(false);
+      }
+
+      an.setLabel(annotation.label);
+
+      if (annotation == av.getAlignmentQualityAnnot()
+              || annotation == av.getAlignmentConservationAnnotation()
+              || annotation == av.getAlignmentConsensusAnnotation()
+              || annotation.autoCalculated)
+      {
+        // new way of indicating autocalculated annotation -
+        an.setAutoCalculated(annotation.autoCalculated);
+      }
+      if (annotation.hasScore())
+      {
+        an.setScore(annotation.getScore());
+      }
+
+      if (annotation.getCalcId() != null)
+      {
+        calcIdSet.add(annotation.getCalcId());
+        an.setCalcId(annotation.getCalcId());
+      }
+      if (annotation.hasProperties())
+      {
+        for (String pr : annotation.getProperties())
+        {
+          jalview.xml.binding.jalview.Annotation.Property prop = new jalview.xml.binding.jalview.Annotation.Property();
+          prop.setName(pr);
+          prop.setValue(annotation.getProperty(pr));
+          // an.addProperty(prop);
+          an.getProperty().add(prop);
+        }
+      }
+
+      AnnotationElement ae;
+      if (annotation.annotations != null)
+      {
+        an.setScoreOnly(false);
+        for (int a = 0; a < annotation.annotations.length; a++)
+        {
+          if ((annotation == null) || (annotation.annotations[a] == null))
+          {
+            continue;
+          }
+
+          ae = new AnnotationElement();
+          if (annotation.annotations[a].description != null)
+          {
+            ae.setDescription(annotation.annotations[a].description);
+          }
+          if (annotation.annotations[a].displayCharacter != null)
+          {
+            ae.setDisplayCharacter(
+                    annotation.annotations[a].displayCharacter);
+          }
+
+          if (!Float.isNaN(annotation.annotations[a].value))
+          {
+            ae.setValue(annotation.annotations[a].value);
+          }
+
+          ae.setPosition(a);
+          if (annotation.annotations[a].secondaryStructure > ' ')
+          {
+            ae.setSecondaryStructure(
+                    annotation.annotations[a].secondaryStructure + "");
+          }
+
+          if (annotation.annotations[a].colour != null
+                  && annotation.annotations[a].colour != java.awt.Color.black)
+          {
+            ae.setColour(annotation.annotations[a].colour.getRGB());
+          }
+
+          // an.addAnnotationElement(ae);
+          an.getAnnotationElement().add(ae);
+          if (annotation.autoCalculated)
+          {
+            // only write one non-null entry into the annotation row -
+            // sufficient to get the visualization attributes necessary to
+            // display data
+            continue;
+          }
+        }
+      }
+      else
+      {
+        an.setScoreOnly(true);
+      }
+      if (!storeDS || (storeDS && !annotation.autoCalculated))
+      {
+        // skip autocalculated annotation - these are only provided for
+        // alignments
+        // vamsasSet.addAnnotation(an);
+        vamsasSet.getAnnotation().add(an);
+      }
+    }
+
+  }
+
+  private CalcIdParam createCalcIdParam(String calcId, AlignViewport av)
+  {
+    AutoCalcSetting settings = av.getCalcIdSettingsFor(calcId);
+    if (settings != null)
+    {
+      CalcIdParam vCalcIdParam = new CalcIdParam();
+      vCalcIdParam.setCalcId(calcId);
+      // vCalcIdParam.addServiceURL(settings.getServiceURI());
+      vCalcIdParam.getServiceURL().add(settings.getServiceURI());
+      // generic URI allowing a third party to resolve another instance of the
+      // service used for this calculation
+      for (String url : settings.getServiceURLs())
+      {
+        // vCalcIdParam.addServiceURL(urls);
+        vCalcIdParam.getServiceURL().add(url);
+      }
+      vCalcIdParam.setVersion("1.0");
+      if (settings.getPreset() != null)
+      {
+        WsParamSetI setting = settings.getPreset();
+        vCalcIdParam.setName(setting.getName());
+        vCalcIdParam.setDescription(setting.getDescription());
+      }
+      else
+      {
+        vCalcIdParam.setName("");
+        vCalcIdParam.setDescription("Last used parameters");
+      }
+      // need to be able to recover 1) settings 2) user-defined presets or
+      // recreate settings from preset 3) predefined settings provided by
+      // service - or settings that can be transferred (or discarded)
+      vCalcIdParam.setParameters(
+              settings.getWsParamFile().replace("\n", "|\\n|"));
+      vCalcIdParam.setAutoUpdate(settings.isAutoUpdate());
+      // todo - decide if updateImmediately is needed for any projects.
+
+      return vCalcIdParam;
+    }
+    return null;
+  }
+
+  private boolean recoverCalcIdParam(CalcIdParam calcIdParam,
+          AlignViewport av)
+  {
+    if (calcIdParam.getVersion().equals("1.0"))
+    {
+      final String[] calcIds = calcIdParam.getServiceURL().toArray(new String[0]);
+      Jws2Instance service = Jws2Discoverer.getDiscoverer()
+              .getPreferredServiceFor(calcIds);
+      if (service != null)
+      {
+        WsParamSetI parmSet = null;
+        try
+        {
+          parmSet = service.getParamStore().parseServiceParameterFile(
+                  calcIdParam.getName(), calcIdParam.getDescription(),
+                  calcIds,
+                  calcIdParam.getParameters().replace("|\\n|", "\n"));
+        } catch (IOException x)
+        {
+          warn("Couldn't parse parameter data for "
+                  + calcIdParam.getCalcId(), x);
+          return false;
+        }
+        List<ArgumentI> argList = null;
+        if (calcIdParam.getName().length() > 0)
+        {
+          parmSet = service.getParamStore()
+                  .getPreset(calcIdParam.getName());
+          if (parmSet != null)
+          {
+            // TODO : check we have a good match with settings in AACon -
+            // otherwise we'll need to create a new preset
+          }
+        }
+        else
+        {
+          argList = parmSet.getArguments();
+          parmSet = null;
+        }
+        AAConSettings settings = new AAConSettings(
+                calcIdParam.isAutoUpdate(), service, parmSet, argList);
+        av.setCalcIdSettingsFor(calcIdParam.getCalcId(), settings,
+                calcIdParam.isNeedsUpdate());
+        return true;
+      }
+      else
+      {
+        warn("Cannot resolve a service for the parameters used in this project. Try configuring a JABAWS server.");
+        return false;
+      }
+    }
+    throw new Error(MessageManager.formatMessage(
+            "error.unsupported_version_calcIdparam", new Object[]
+            { calcIdParam.toString() }));
+  }
+
+  /**
+   * External mapping between jalview objects and objects yielding a valid and
+   * unique object ID string. This is null for normal Jalview project IO, but
+   * non-null when a jalview project is being read or written as part of a
+   * vamsas session.
+   */
+  IdentityHashMap jv2vobj = null;
+
+  /**
+   * Construct a unique ID for jvobj using either existing bindings or if none
+   * exist, the result of the hashcode call for the object.
+   * 
+   * @param jvobj
+   *          jalview data object
+   * @return unique ID for referring to jvobj
+   */
+  private String makeHashCode(Object jvobj, String altCode)
+  {
+    if (jv2vobj != null)
+    {
+      Object id = jv2vobj.get(jvobj);
+      if (id != null)
+      {
+        return id.toString();
+      }
+      // check string ID mappings
+      if (jvids2vobj != null && jvobj instanceof String)
+      {
+        id = jvids2vobj.get(jvobj);
+      }
+      if (id != null)
+      {
+        return id.toString();
+      }
+      // give up and warn that something has gone wrong
+      warn("Cannot find ID for object in external mapping : " + jvobj);
+    }
+    return altCode;
+  }
+
+  /**
+   * return local jalview object mapped to ID, if it exists
+   * 
+   * @param idcode
+   *          (may be null)
+   * @return null or object bound to idcode
+   */
+  private Object retrieveExistingObj(String idcode)
+  {
+    if (idcode != null && vobj2jv != null)
+    {
+      return vobj2jv.get(idcode);
+    }
+    return null;
+  }
+
+  /**
+   * binding from ID strings from external mapping table to jalview data model
+   * objects.
+   */
+  private Hashtable vobj2jv;
+
+  private Sequence createVamsasSequence(String id, SequenceI jds)
+  {
+    return createVamsasSequence(true, id, jds, null);
+  }
+
+  private Sequence createVamsasSequence(boolean recurse, String id,
+          SequenceI jds, SequenceI parentseq)
+  {
+    Sequence vamsasSeq = new Sequence();
+    vamsasSeq.setId(id);
+    vamsasSeq.setName(jds.getName());
+    vamsasSeq.setSequence(jds.getSequenceAsString());
+    vamsasSeq.setDescription(jds.getDescription());
+    jalview.datamodel.DBRefEntry[] dbrefs = null;
+    if (jds.getDatasetSequence() != null)
+    {
+      vamsasSeq.setDsseqid(seqHash(jds.getDatasetSequence()));
+    }
+    else
+    {
+      // seqId==dsseqid so we can tell which sequences really are
+      // dataset sequences only
+      vamsasSeq.setDsseqid(id);
+      dbrefs = jds.getDBRefs();
+      if (parentseq == null)
+      {
+        parentseq = jds;
+      }
+    }
+    if (dbrefs != null)
+    {
+      for (int d = 0; d < dbrefs.length; d++)
+      {
+        DBRef dbref = new DBRef();
+        dbref.setSource(dbrefs[d].getSource());
+        dbref.setVersion(dbrefs[d].getVersion());
+        dbref.setAccessionId(dbrefs[d].getAccessionId());
+        if (dbrefs[d].hasMap())
+        {
+          Mapping mp = createVamsasMapping(dbrefs[d].getMap(), parentseq,
+                  jds, recurse);
+          dbref.setMapping(mp);
+        }
+        // vamsasSeq.addDBRef(dbref);
+        vamsasSeq.getDBRef().add(dbref);
+      }
+    }
+    return vamsasSeq;
+  }
+
+  private Mapping createVamsasMapping(jalview.datamodel.Mapping jmp,
+          SequenceI parentseq, SequenceI jds, boolean recurse)
+  {
+    Mapping mp = null;
+    if (jmp.getMap() != null)
+    {
+      mp = new Mapping();
+
+      jalview.util.MapList mlst = jmp.getMap();
+      List<int[]> r = mlst.getFromRanges();
+      for (int[] range : r)
+      {
+        MapListFrom mfrom = new MapListFrom();
+        mfrom.setStart(range[0]);
+        mfrom.setEnd(range[1]);
+        // mp.addMapListFrom(mfrom);
+        mp.getMapListFrom().add(mfrom);
+      }
+      r = mlst.getToRanges();
+      for (int[] range : r)
+      {
+        MapListTo mto = new MapListTo();
+        mto.setStart(range[0]);
+        mto.setEnd(range[1]);
+        // mp.addMapListTo(mto);
+        mp.getMapListTo().add(mto);
+      }
+      mp.setMapFromUnit(BigInteger.valueOf(mlst.getFromRatio()));
+      mp.setMapToUnit(BigInteger.valueOf(mlst.getToRatio()));
+      if (jmp.getTo() != null)
+      {
+        // MappingChoice mpc = new MappingChoice();
+
+        // check/create ID for the sequence referenced by getTo()
+
+        String jmpid = "";
+        SequenceI ps = null;
+        if (parentseq != jmp.getTo()
+                && parentseq.getDatasetSequence() != jmp.getTo())
+        {
+          // chaining dbref rather than a handshaking one
+          jmpid = seqHash(ps = jmp.getTo());
+        }
+        else
+        {
+          jmpid = seqHash(ps = parentseq);
+        }
+        // mpc.setDseqFor(jmpid);
+        mp.setDseqFor(jmpid);
+        if (!seqRefIds.containsKey(jmpid))
+        {
+          jalview.bin.Cache.log.debug("creatign new DseqFor ID");
+          seqRefIds.put(jmpid, ps);
+        }
+        else
+        {
+          jalview.bin.Cache.log.debug("reusing DseqFor ID");
+        }
+
+        // mp.setMappingChoice(mpc);
+      }
+    }
+    return mp;
+  }
+
+  String setUserColourScheme(jalview.schemes.ColourSchemeI cs,
+          List<UserColourScheme> userColours, JalviewModel jm)
+  {
+    String id = null;
+    jalview.schemes.UserColourScheme ucs = (jalview.schemes.UserColourScheme) cs;
+    boolean newucs = false;
+    if (!userColours.contains(ucs))
+    {
+      userColours.add(ucs);
+      newucs = true;
+    }
+    id = "ucs" + userColours.indexOf(ucs);
+    if (newucs)
+    {
+      // actually create the scheme's entry in the XML model
+      java.awt.Color[] colours = ucs.getColours();
+      UserColours uc = new UserColours();
+      // UserColourScheme jbucs = new UserColourScheme();
+      JalviewUserColours jbucs = new JalviewUserColours();
+
+      for (int i = 0; i < colours.length; i++)
+      {
+        Colour col = new Colour();
+        col.setName(ResidueProperties.aa[i]);
+        col.setRGB(jalview.util.Format.getHexString(colours[i]));
+        // jbucs.addColour(col);
+        jbucs.getColour().add(col);
+      }
+      if (ucs.getLowerCaseColours() != null)
+      {
+        colours = ucs.getLowerCaseColours();
+        for (int i = 0; i < colours.length; i++)
+        {
+          Colour col = new Colour();
+          col.setName(ResidueProperties.aa[i].toLowerCase());
+          col.setRGB(jalview.util.Format.getHexString(colours[i]));
+          // jbucs.addColour(col);
+          jbucs.getColour().add(col);
+        }
+      }
+
+      uc.setId(id);
+      uc.setUserColourScheme(jbucs);
+      // jm.addUserColours(uc);
+      jm.getUserColours().add(uc);
+    }
+
+    return id;
+  }
+
+  jalview.schemes.UserColourScheme getUserColourScheme(
+          JalviewModel jm, String id)
+  {
+    List<UserColours> uc = jm.getUserColours();
+    UserColours colours = null;
+/*
+    for (int i = 0; i < uc.length; i++)
+    {
+      if (uc[i].getId().equals(id))
+      {
+        colours = uc[i];
+        break;
+      }
+    }
+*/
+    for (UserColours c : uc)
+    {
+      if (c.getId().equals(id))
+      {
+        colours = c;
+        break;
+      }
+    }
+
+    java.awt.Color[] newColours = new java.awt.Color[24];
+
+    for (int i = 0; i < 24; i++)
+    {
+      newColours[i] = new java.awt.Color(Integer.parseInt(
+              // colours.getUserColourScheme().getColour(i).getRGB(), 16));
+              colours.getUserColourScheme().getColour().get(i).getRGB(),
+              16));
+    }
+
+    jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(
+            newColours);
+
+    if (colours.getUserColourScheme().getColour().size()/*Count()*/ > 24)
+    {
+      newColours = new java.awt.Color[23];
+      for (int i = 0; i < 23; i++)
+      {
+        newColours[i] = new java.awt.Color(Integer.parseInt(
+                colours.getUserColourScheme().getColour().get(i + 24)
+                        .getRGB(),
+                16));
+      }
+      ucs.setLowerCaseColours(newColours);
+    }
+
+    return ucs;
+  }
+
+  /**
+   * contains last error message (if any) encountered by XML loader.
+   */
+  String errorMessage = null;
+
+  /**
+   * flag to control whether the Jalview2XML_V1 parser should be deferred to if
+   * exceptions are raised during project XML parsing
+   */
+  public boolean attemptversion1parse = false;
+
+  /**
+   * Load a jalview project archive from a jar file
+   * 
+   * @param file
+   *          - HTTP URL or filename
+   */
+  public AlignFrame loadJalviewAlign(final String file)
+  {
+
+    jalview.gui.AlignFrame af = null;
+
+    try
+    {
+      // create list to store references for any new Jmol viewers created
+      newStructureViewers = new Vector<>();
+      // UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING
+      // Workaround is to make sure caller implements the JarInputStreamProvider
+      // interface
+      // so we can re-open the jar input stream for each entry.
+
+      jarInputStreamProvider jprovider = createjarInputStreamProvider(file);
+      af = loadJalviewAlign(jprovider);
+      if (af != null)
+      {
+        af.setMenusForViewport();
+      }
+    } catch (MalformedURLException e)
+    {
+      errorMessage = "Invalid URL format for '" + file + "'";
+      reportErrors();
+    } finally
+    {
+      try
+      {
+        SwingUtilities.invokeAndWait(new Runnable()
+        {
+          @Override
+          public void run()
+          {
+            setLoadingFinishedForNewStructureViewers();
+          };
+        });
+      } catch (Exception x)
+      {
+        System.err.println("Error loading alignment: " + x.getMessage());
+      }
+    }
+    return af;
+  }
+
+  private jarInputStreamProvider createjarInputStreamProvider(
+          final String file) throws MalformedURLException
+  {
+    URL url = null;
+    errorMessage = null;
+    uniqueSetSuffix = null;
+    seqRefIds = null;
+    viewportsAdded.clear();
+    frefedSequence = null;
+
+    if (file.startsWith("http://"))
+    {
+      url = new URL(file);
+    }
+    final URL _url = url;
+    return new jarInputStreamProvider()
+    {
+
+      @Override
+      public JarInputStream getJarInputStream() throws IOException
+      {
+        if (_url != null)
+        {
+          return new JarInputStream(_url.openStream());
+        }
+        else
+        {
+          return new JarInputStream(new FileInputStream(file));
+        }
+      }
+
+      @Override
+      public String getFilename()
+      {
+        return file;
+      }
+    };
+  }
+
+  /**
+   * Recover jalview session from a jalview project archive. Caller may
+   * initialise uniqueSetSuffix, seqRefIds, viewportsAdded and frefedSequence
+   * themselves. Any null fields will be initialised with default values,
+   * non-null fields are left alone.
+   * 
+   * @param jprovider
+   * @return
+   */
+  public AlignFrame loadJalviewAlign(final jarInputStreamProvider jprovider)
+  {
+    errorMessage = null;
+    if (uniqueSetSuffix == null)
+    {
+      uniqueSetSuffix = System.currentTimeMillis() % 100000 + "";
+    }
+    if (seqRefIds == null)
+    {
+      initSeqRefs();
+    }
+    AlignFrame af = null, _af = null;
+    IdentityHashMap<AlignmentI, AlignmentI> importedDatasets = new IdentityHashMap<>();
+    Map<String, AlignFrame> gatherToThisFrame = new HashMap<>();
+    final String file = jprovider.getFilename();
+    try
+    {
+      JarInputStream jin = null;
+      JarEntry jarentry = null;
+      int entryCount = 1;
+
+      do
+      {
+        jin = jprovider.getJarInputStream();
+        for (int i = 0; i < entryCount; i++)
+        {
+          jarentry = jin.getNextJarEntry();
+        }
+
+        if (jarentry != null && jarentry.getName().endsWith(".xml"))
+        {
+          InputStreamReader in = new InputStreamReader(jin, UTF_8);
+          // JalviewModel object = new JalviewModel();
+
+          JAXBContext jc = JAXBContext
+                  .newInstance("jalview.xml.binding.jalview");
+          XMLStreamReader streamReader = XMLInputFactory.newInstance()
+                  .createXMLStreamReader(jin);
+          javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+          JAXBElement<JalviewModel> jbe = um
+                  .unmarshal(streamReader, JalviewModel.class);
+          JalviewModel object = jbe.getValue();
+
+          /*
+          Unmarshaller unmar = new Unmarshaller(object);
+          unmar.setValidation(false);
+          object = (JalviewModel) unmar.unmarshal(in);
+          */
+          if (true) // !skipViewport(object))
+          {
+            _af = loadFromObject(object, file, true, jprovider);
+            if (_af != null && object.getViewport().size() > 0)
+            // getJalviewModelSequence().getViewportCount() > 0)
+            {
+              if (af == null)
+              {
+                // store a reference to the first view
+                af = _af;
+              }
+              if (_af.getViewport().isGatherViewsHere())
+              {
+                // if this is a gathered view, keep its reference since
+                // after gathering views, only this frame will remain
+                af = _af;
+                gatherToThisFrame.put(_af.getViewport().getSequenceSetId(),
+                        _af);
+              }
+              // Save dataset to register mappings once all resolved
+              importedDatasets.put(
+                      af.getViewport().getAlignment().getDataset(),
+                      af.getViewport().getAlignment().getDataset());
+            }
+          }
+          entryCount++;
+        }
+        else if (jarentry != null)
+        {
+          // Some other file here.
+          entryCount++;
+        }
+      } while (jarentry != null);
+      resolveFrefedSequences();
+    } catch (IOException ex)
+    {
+      ex.printStackTrace();
+      errorMessage = "Couldn't locate Jalview XML file : " + file;
+      System.err.println(
+              "Exception whilst loading jalview XML file : " + ex + "\n");
+    } catch (Exception ex)
+    {
+      System.err.println("Parsing as Jalview Version 2 file failed.");
+      ex.printStackTrace(System.err);
+      if (attemptversion1parse)
+      {
+        // Is Version 1 Jar file?
+        try
+        {
+          af = new Jalview2XML_V1(raiseGUI).LoadJalviewAlign(jprovider);
+        } catch (Exception ex2)
+        {
+          System.err.println("Exception whilst loading as jalviewXMLV1:");
+          ex2.printStackTrace();
+          af = null;
+        }
+      }
+      if (Desktop.instance != null)
+      {
+        Desktop.instance.stopLoading();
+      }
+      if (af != null)
+      {
+        System.out.println("Successfully loaded archive file");
+        return af;
+      }
+      ex.printStackTrace();
+
+      System.err.println(
+              "Exception whilst loading jalview XML file : " + ex + "\n");
+    } catch (OutOfMemoryError e)
+    {
+      // Don't use the OOM Window here
+      errorMessage = "Out of memory loading jalview XML file";
+      System.err.println("Out of memory whilst loading jalview XML file");
+      e.printStackTrace();
+    }
+
+    /*
+     * Regather multiple views (with the same sequence set id) to the frame (if
+     * any) that is flagged as the one to gather to, i.e. convert them to tabbed
+     * views instead of separate frames. Note this doesn't restore a state where
+     * some expanded views in turn have tabbed views - the last "first tab" read
+     * in will play the role of gatherer for all.
+     */
+    for (AlignFrame fr : gatherToThisFrame.values())
+    {
+      Desktop.instance.gatherViews(fr);
+    }
+
+    restoreSplitFrames();
+    for (AlignmentI ds : importedDatasets.keySet())
+    {
+      if (ds.getCodonFrames() != null)
+      {
+        StructureSelectionManager
+                .getStructureSelectionManager(Desktop.instance)
+                .registerMappings(ds.getCodonFrames());
+      }
+    }
+    if (errorMessage != null)
+    {
+      reportErrors();
+    }
+
+    if (Desktop.instance != null)
+    {
+      Desktop.instance.stopLoading();
+    }
+
+    return af;
+  }
+
+  /**
+   * Try to reconstruct and display SplitFrame windows, where each contains
+   * complementary dna and protein alignments. Done by pairing up AlignFrame
+   * objects (created earlier) which have complementary viewport ids associated.
+   */
+  protected void restoreSplitFrames()
+  {
+    List<SplitFrame> gatherTo = new ArrayList<>();
+    List<AlignFrame> addedToSplitFrames = new ArrayList<>();
+    Map<String, AlignFrame> dna = new HashMap<>();
+
+    /*
+     * Identify the DNA alignments
+     */
+    for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
+            .entrySet())
+    {
+      AlignFrame af = candidate.getValue();
+      if (af.getViewport().getAlignment().isNucleotide())
+      {
+        dna.put(candidate.getKey().getId(), af);
+      }
+    }
+
+    /*
+     * Try to match up the protein complements
+     */
+    for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
+            .entrySet())
+    {
+      AlignFrame af = candidate.getValue();
+      if (!af.getViewport().getAlignment().isNucleotide())
+      {
+        String complementId = candidate.getKey().getComplementId();
+        // only non-null complements should be in the Map
+        if (complementId != null && dna.containsKey(complementId))
+        {
+          final AlignFrame dnaFrame = dna.get(complementId);
+          SplitFrame sf = createSplitFrame(dnaFrame, af);
+          addedToSplitFrames.add(dnaFrame);
+          addedToSplitFrames.add(af);
+          dnaFrame.setMenusForViewport();
+          af.setMenusForViewport();
+          if (af.getViewport().isGatherViewsHere())
+          {
+            gatherTo.add(sf);
+          }
+        }
+      }
+    }
+
+    /*
+     * Open any that we failed to pair up (which shouldn't happen!) as
+     * standalone AlignFrame's.
+     */
+    for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
+            .entrySet())
+    {
+      AlignFrame af = candidate.getValue();
+      if (!addedToSplitFrames.contains(af))
+      {
+        Viewport view = candidate.getKey();
+        Desktop.addInternalFrame(af, view.getTitle(),
+                safeInt(view.getWidth()), safeInt(view.getHeight()));
+        af.setMenusForViewport();
+        System.err.println("Failed to restore view " + view.getTitle()
+                + " to split frame");
+      }
+    }
+
+    /*
+     * Gather back into tabbed views as flagged.
+     */
+    for (SplitFrame sf : gatherTo)
+    {
+      Desktop.instance.gatherViews(sf);
+    }
+
+    splitFrameCandidates.clear();
+  }
+
+  /**
+   * Construct and display one SplitFrame holding DNA and protein alignments.
+   * 
+   * @param dnaFrame
+   * @param proteinFrame
+   * @return
+   */
+  protected SplitFrame createSplitFrame(AlignFrame dnaFrame,
+          AlignFrame proteinFrame)
+  {
+    SplitFrame splitFrame = new SplitFrame(dnaFrame, proteinFrame);
+    String title = MessageManager.getString("label.linked_view_title");
+    int width = (int) dnaFrame.getBounds().getWidth();
+    int height = (int) (dnaFrame.getBounds().getHeight()
+            + proteinFrame.getBounds().getHeight() + 50);
+
+    /*
+     * SplitFrame location is saved to both enclosed frames
+     */
+    splitFrame.setLocation(dnaFrame.getX(), dnaFrame.getY());
+    Desktop.addInternalFrame(splitFrame, title, width, height);
+
+    /*
+     * And compute cDNA consensus (couldn't do earlier with consensus as
+     * mappings were not yet present)
+     */
+    proteinFrame.getViewport().alignmentChanged(proteinFrame.alignPanel);
+
+    return splitFrame;
+  }
+
+  /**
+   * check errorMessage for a valid error message and raise an error box in the
+   * GUI or write the current errorMessage to stderr and then clear the error
+   * state.
+   */
+  protected void reportErrors()
+  {
+    reportErrors(false);
+  }
+
+  protected void reportErrors(final boolean saving)
+  {
+    if (errorMessage != null)
+    {
+      final String finalErrorMessage = errorMessage;
+      if (raiseGUI)
+      {
+        javax.swing.SwingUtilities.invokeLater(new Runnable()
+        {
+          @Override
+          public void run()
+          {
+            JvOptionPane.showInternalMessageDialog(Desktop.desktop,
+                    finalErrorMessage,
+                    "Error " + (saving ? "saving" : "loading")
+                            + " Jalview file",
+                    JvOptionPane.WARNING_MESSAGE);
+          }
+        });
+      }
+      else
+      {
+        System.err.println("Problem loading Jalview file: " + errorMessage);
+      }
+    }
+    errorMessage = null;
+  }
+
+  Map<String, String> alreadyLoadedPDB = new HashMap<>();
+
+  /**
+   * when set, local views will be updated from view stored in JalviewXML
+   * Currently (28th Sep 2008) things will go horribly wrong in vamsas document
+   * sync if this is set to true.
+   */
+  private final boolean updateLocalViews = false;
+
+  /**
+   * Returns the path to a temporary file holding the PDB file for the given PDB
+   * id. The first time of asking, searches for a file of that name in the
+   * Jalview project jar, and copies it to a new temporary file. Any repeat
+   * requests just return the path to the file previously created.
+   * 
+   * @param jprovider
+   * @param pdbId
+   * @return
+   */
+  String loadPDBFile(jarInputStreamProvider jprovider, String pdbId,
+          String origFile)
+  {
+    if (alreadyLoadedPDB.containsKey(pdbId))
+    {
+      return alreadyLoadedPDB.get(pdbId).toString();
+    }
+
+    String tempFile = copyJarEntry(jprovider, pdbId, "jalview_pdb",
+            origFile);
+    if (tempFile != null)
+    {
+      alreadyLoadedPDB.put(pdbId, tempFile);
+    }
+    return tempFile;
+  }
+
+  /**
+   * Copies the jar entry of given name to a new temporary file and returns the
+   * path to the file, or null if the entry is not found.
+   * 
+   * @param jprovider
+   * @param jarEntryName
+   * @param prefix
+   *          a prefix for the temporary file name, must be at least three
+   *          characters long
+   * @param origFile
+   *          null or original file - so new file can be given the same suffix
+   *          as the old one
+   * @return
+   */
+  protected String copyJarEntry(jarInputStreamProvider jprovider,
+          String jarEntryName, String prefix, String origFile)
+  {
+    BufferedReader in = null;
+    PrintWriter out = null;
+    String suffix = ".tmp";
+    if (origFile == null)
+    {
+      origFile = jarEntryName;
+    }
+    int sfpos = origFile.lastIndexOf(".");
+    if (sfpos > -1 && sfpos < (origFile.length() - 3))
+    {
+      suffix = "." + origFile.substring(sfpos + 1);
+    }
+    try
+    {
+      JarInputStream jin = jprovider.getJarInputStream();
+      /*
+       * if (jprovider.startsWith("http://")) { jin = new JarInputStream(new
+       * URL(jprovider).openStream()); } else { jin = new JarInputStream(new
+       * FileInputStream(jprovider)); }
+       */
+
+      JarEntry entry = null;
+      do
+      {
+        entry = jin.getNextJarEntry();
+      } while (entry != null && !entry.getName().equals(jarEntryName));
+      if (entry != null)
+      {
+        in = new BufferedReader(new InputStreamReader(jin, UTF_8));
+        File outFile = File.createTempFile(prefix, suffix);
+        outFile.deleteOnExit();
+        out = new PrintWriter(new FileOutputStream(outFile));
+        String data;
+
+        while ((data = in.readLine()) != null)
+        {
+          out.println(data);
+        }
+        out.flush();
+        String t = outFile.getAbsolutePath();
+        return t;
+      }
+      else
+      {
+        warn("Couldn't find entry in Jalview Jar for " + jarEntryName);
+      }
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    } finally
+    {
+      if (in != null)
+      {
+        try
+        {
+          in.close();
+        } catch (IOException e)
+        {
+          // ignore
+        }
+      }
+      if (out != null)
+      {
+        out.close();
+      }
+    }
+
+    return null;
+  }
+
+  private class JvAnnotRow
+  {
+    public JvAnnotRow(int i, AlignmentAnnotation jaa)
+    {
+      order = i;
+      template = jaa;
+    }
+
+    /**
+     * persisted version of annotation row from which to take vis properties
+     */
+    public jalview.datamodel.AlignmentAnnotation template;
+
+    /**
+     * original position of the annotation row in the alignment
+     */
+    public int order;
+  }
+
+  /**
+   * Load alignment frame from jalview XML DOM object
+   * 
+   * @param jalviewModel
+   *          DOM
+   * @param file
+   *          filename source string
+   * @param loadTreesAndStructures
+   *          when false only create Viewport
+   * @param jprovider
+   *          data source provider
+   * @return alignment frame created from view stored in DOM
+   */
+  AlignFrame loadFromObject(JalviewModel jalviewModel, String file,
+          boolean loadTreesAndStructures, jarInputStreamProvider jprovider)
+  {
+    SequenceSet vamsasSet = jalviewModel.getVamsasModel().getSequenceSet().get(0);
+    List<Sequence> vamsasSeqs = vamsasSet.getSequence();
+
+    // JalviewModelSequence jms = object.getJalviewModelSequence();
+
+    // Viewport view = (jms.getViewportCount() > 0) ? jms.getViewport(0)
+    // : null;
+    Viewport view = (jalviewModel.getViewport().size() > 0)
+            ? jalviewModel.getViewport().get(0)
+            : null;
+
+    // ////////////////////////////////
+    // INITIALISE ALIGNMENT SEQUENCESETID AND VIEWID
+    //
+    //
+    // If we just load in the same jar file again, the sequenceSetId
+    // will be the same, and we end up with multiple references
+    // to the same sequenceSet. We must modify this id on load
+    // so that each load of the file gives a unique id
+
+    /**
+     * used to resolve correct alignment dataset for alignments with multiple
+     * views
+     */
+    String uniqueSeqSetId = null;
+    String viewId = null;
+    if (view != null)
+    {
+      uniqueSeqSetId = view.getSequenceSetId() + uniqueSetSuffix;
+      viewId = (view.getId() == null ? null
+              : view.getId() + uniqueSetSuffix);
+    }
+
+    // ////////////////////////////////
+    // LOAD SEQUENCES
+
+    List<SequenceI> hiddenSeqs = null;
+
+    List<SequenceI> tmpseqs = new ArrayList<>();
+
+    boolean multipleView = false;
+    SequenceI referenceseqForView = null;
+    // JSeq[] jseqs = object.getJalviewModelSequence().getJSeq();
+    List<JSeq> jseqs = jalviewModel.getJSeq();
+    int vi = 0; // counter in vamsasSeq array
+    for (int i = 0; i < jseqs.size(); i++)
+    {
+      JSeq jseq = jseqs.get(i);
+      String seqId = jseq.getId();
+
+      SequenceI tmpSeq = seqRefIds.get(seqId);
+      if (tmpSeq != null)
+      {
+        if (!incompleteSeqs.containsKey(seqId))
+        {
+          // may not need this check, but keep it for at least 2.9,1 release
+          if (tmpSeq.getStart() != jseq.getStart()
+                  || tmpSeq.getEnd() != jseq.getEnd())
+          {
+            System.err.println(
+                    "Warning JAL-2154 regression: updating start/end for sequence "
+                            + tmpSeq.toString() + " to " + jseq);
+          }
+        }
+        else
+        {
+          incompleteSeqs.remove(seqId);
+        }
+        if (vamsasSeqs.size() > vi
+                && vamsasSeqs.get(vi).getId().equals(seqId))
+        {
+          // most likely we are reading a dataset XML document so
+          // update from vamsasSeq section of XML for this sequence
+          tmpSeq.setName(vamsasSeqs.get(vi).getName());
+          tmpSeq.setDescription(vamsasSeqs.get(vi).getDescription());
+          tmpSeq.setSequence(vamsasSeqs.get(vi).getSequence());
+          vi++;
+        }
+        else
+        {
+          // reading multiple views, so vamsasSeq set is a subset of JSeq
+          multipleView = true;
+        }
+        tmpSeq.setStart(jseq.getStart());
+        tmpSeq.setEnd(jseq.getEnd());
+        tmpseqs.add(tmpSeq);
+      }
+      else
+      {
+        Sequence vamsasSeq = vamsasSeqs.get(vi);
+        tmpSeq = new jalview.datamodel.Sequence(vamsasSeq.getName(),
+                vamsasSeq.getSequence());
+        tmpSeq.setDescription(vamsasSeq.getDescription());
+        tmpSeq.setStart(jseq.getStart());
+        tmpSeq.setEnd(jseq.getEnd());
+        tmpSeq.setVamsasId(uniqueSetSuffix + seqId);
+        seqRefIds.put(vamsasSeq.getId(), tmpSeq);
+        tmpseqs.add(tmpSeq);
+        vi++;
+      }
+
+      if (safeBoolean(jseq.isViewreference()))
+      {
+        referenceseqForView = tmpseqs.get(tmpseqs.size() - 1);
+      }
+
+      if (jseq.isHidden() != null && jseq.isHidden().booleanValue())
+      {
+        if (hiddenSeqs == null)
+        {
+          hiddenSeqs = new ArrayList<>();
+        }
+
+        hiddenSeqs.add(tmpSeq);
+      }
+    }
+
+    // /
+    // Create the alignment object from the sequence set
+    // ///////////////////////////////
+    SequenceI[] orderedSeqs = tmpseqs
+            .toArray(new SequenceI[tmpseqs.size()]);
+
+    AlignmentI al = null;
+    // so we must create or recover the dataset alignment before going further
+    // ///////////////////////////////
+    if (vamsasSet.getDatasetId() == null || vamsasSet.getDatasetId() == "")
+    {
+      // older jalview projects do not have a dataset - so creat alignment and
+      // dataset
+      al = new Alignment(orderedSeqs);
+      al.setDataset(null);
+    }
+    else
+    {
+      boolean isdsal = jalviewModel.getViewport().isEmpty();
+      if (isdsal)
+      {
+        // we are importing a dataset record, so
+        // recover reference to an alignment already materialsed as dataset
+        al = getDatasetFor(vamsasSet.getDatasetId());
+      }
+      if (al == null)
+      {
+        // materialse the alignment
+        al = new Alignment(orderedSeqs);
+      }
+      if (isdsal)
+      {
+        addDatasetRef(vamsasSet.getDatasetId(), al);
+      }
+
+      // finally, verify all data in vamsasSet is actually present in al
+      // passing on flag indicating if it is actually a stored dataset
+      recoverDatasetFor(vamsasSet, al, isdsal, uniqueSeqSetId);
+    }
+
+    if (referenceseqForView != null)
+    {
+      al.setSeqrep(referenceseqForView);
+    }
+    // / Add the alignment properties
+    for (int i = 0; i < vamsasSet.getSequenceSetProperties().size(); i++)
+    {
+      SequenceSetProperties ssp = vamsasSet.getSequenceSetProperties()
+              .get(i);
+      al.setProperty(ssp.getKey(), ssp.getValue());
+    }
+
+    // ///////////////////////////////
+
+    Hashtable pdbloaded = new Hashtable(); // TODO nothing writes to this??
+    if (!multipleView)
+    {
+      // load sequence features, database references and any associated PDB
+      // structures for the alignment
+      //
+      // prior to 2.10, this part would only be executed the first time a
+      // sequence was encountered, but not afterwards.
+      // now, for 2.10 projects, this is also done if the xml doc includes
+      // dataset sequences not actually present in any particular view.
+      //
+      for (int i = 0; i < vamsasSeqs.size(); i++)
+      {
+        JSeq jseq = jseqs.get(i);
+        if (jseq.getFeatures().size() > 0)
+        {
+          List<Feature> features = jseq.getFeatures();
+          for (int f = 0; f < features.size(); f++)
+          {
+            Feature feat = features.get(f);
+            SequenceFeature sf = new SequenceFeature(feat.getType(),
+                    feat.getDescription(), feat.getBegin(), feat.getEnd(),
+                    safeFloat(feat.getScore()), feat.getFeatureGroup());
+            sf.setStatus(feat.getStatus());
+
+            /*
+             * load any feature attributes - include map-valued attributes
+             */
+            Map<String, Map<String, String>> mapAttributes = new HashMap<>();
+            for (int od = 0; od < feat.getOtherData().size(); od++)
+            {
+              OtherData keyValue = feat.getOtherData().get(od);
+              String attributeName = keyValue.getKey();
+              String attributeValue = keyValue.getValue();
+              if (attributeName.startsWith("LINK"))
+              {
+                sf.addLink(attributeValue);
+              }
+              else
+              {
+                String subAttribute = keyValue.getKey2();
+                if (subAttribute == null)
+                {
+                  // simple string-valued attribute
+                  sf.setValue(attributeName, attributeValue);
+                }
+                else
+                {
+                  // attribute 'key' has sub-attribute 'key2'
+                  if (!mapAttributes.containsKey(attributeName))
+                  {
+                    mapAttributes.put(attributeName, new HashMap<>());
+                  }
+                  mapAttributes.get(attributeName).put(subAttribute,
+                          attributeValue);
+                }
+              }
+            }
+            for (Entry<String, Map<String, String>> mapAttribute : mapAttributes
+                    .entrySet())
+            {
+              sf.setValue(mapAttribute.getKey(), mapAttribute.getValue());
+            }
+
+            // adds feature to datasequence's feature set (since Jalview 2.10)
+            al.getSequenceAt(i).addSequenceFeature(sf);
+          }
+        }
+        if (vamsasSeqs.get(i).getDBRef().size() > 0)
+        {
+          // adds dbrefs to datasequence's set (since Jalview 2.10)
+          addDBRefs(
+                  al.getSequenceAt(i).getDatasetSequence() == null
+                          ? al.getSequenceAt(i)
+                          : al.getSequenceAt(i).getDatasetSequence(),
+                  vamsasSeqs.get(i));
+        }
+        if (jseq.getPdbids().size() > 0)
+        {
+          List<Pdbids> ids = jseq.getPdbids();
+          for (int p = 0; p < ids.size(); p++)
+          {
+            Pdbids pdbid = ids.get(p);
+            jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();
+            entry.setId(pdbid.getId());
+            if (pdbid.getType() != null)
+            {
+              if (PDBEntry.Type.getType(pdbid.getType()) != null)
+              {
+                entry.setType(PDBEntry.Type.getType(pdbid.getType()));
+              }
+              else
+              {
+                entry.setType(PDBEntry.Type.FILE);
+              }
+            }
+            // jprovider is null when executing 'New View'
+            if (pdbid.getFile() != null && jprovider != null)
+            {
+              if (!pdbloaded.containsKey(pdbid.getFile()))
+              {
+                entry.setFile(loadPDBFile(jprovider, pdbid.getId(),
+                        pdbid.getFile()));
+              }
+              else
+              {
+                entry.setFile(pdbloaded.get(pdbid.getId()).toString());
+              }
+            }
+            /*
+            if (pdbid.getPdbentryItem() != null)
+            {
+              for (PdbentryItem item : pdbid.getPdbentryItem())
+              {
+                for (Property pr : item.getProperty())
+                {
+                  entry.setProperty(pr.getName(), pr.getValue());
+                }
+              }
+            }
+            */
+            for (Property prop : pdbid.getProperty())
+            {
+              entry.setProperty(prop.getName(), prop.getValue());
+            }
+            StructureSelectionManager
+                    .getStructureSelectionManager(Desktop.instance)
+                    .registerPDBEntry(entry);
+            // adds PDBEntry to datasequence's set (since Jalview 2.10)
+            if (al.getSequenceAt(i).getDatasetSequence() != null)
+            {
+              al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);
+            }
+            else
+            {
+              al.getSequenceAt(i).addPDBId(entry);
+            }
+          }
+        }
+      }
+    } // end !multipleview
+
+    // ///////////////////////////////
+    // LOAD SEQUENCE MAPPINGS
+
+    if (vamsasSet.getAlcodonFrame().size() > 0)
+    {
+      // TODO Potentially this should only be done once for all views of an
+      // alignment
+      List<AlcodonFrame> alc = vamsasSet.getAlcodonFrame();
+      for (int i = 0; i < alc.size(); i++)
+      {
+        AlignedCodonFrame cf = new AlignedCodonFrame();
+        if (alc.get(i).getAlcodMap().size() > 0)
+        {
+          List<AlcodMap> maps = alc.get(i).getAlcodMap();
+          for (int m = 0; m < maps.size(); m++)
+          {
+            AlcodMap map = maps.get(m);
+            SequenceI dnaseq = seqRefIds.get(map.getDnasq());
+            // Load Mapping
+            jalview.datamodel.Mapping mapping = null;
+            // attach to dna sequence reference.
+            if (map.getMapping() != null)
+            {
+              mapping = addMapping(map.getMapping());
+              if (dnaseq != null && mapping.getTo() != null)
+              {
+                cf.addMap(dnaseq, mapping.getTo(), mapping.getMap());
+              }
+              else
+              {
+                // defer to later
+                frefedSequence.add(
+                        newAlcodMapRef(map.getDnasq(), cf, mapping));
+              }
+            }
+          }
+          al.addCodonFrame(cf);
+        }
+      }
+    }
+
+    // ////////////////////////////////
+    // LOAD ANNOTATIONS
+    List<JvAnnotRow> autoAlan = new ArrayList<>();
+
+    /*
+     * store any annotations which forward reference a group's ID
+     */
+    Map<String, List<AlignmentAnnotation>> groupAnnotRefs = new Hashtable<>();
+
+    if (vamsasSet.getAnnotation().size()/*Count()*/ > 0)
+    {
+      List<Annotation> an = vamsasSet.getAnnotation();
+
+      for (int i = 0; i < an.size(); i++)
+      {
+        Annotation annotation = an.get(i);
+
+        /**
+         * test if annotation is automatically calculated for this view only
+         */
+        boolean autoForView = false;
+        if (annotation.getLabel().equals("Quality")
+                || annotation.getLabel().equals("Conservation")
+                || annotation.getLabel().equals("Consensus"))
+        {
+          // Kludge for pre 2.5 projects which lacked the autocalculated flag
+          autoForView = true;
+          // JAXB has no has() test; schema defaults value to false
+          // if (!annotation.hasAutoCalculated())
+          // {
+          // annotation.setAutoCalculated(true);
+          // }
+        }
+        if (autoForView || annotation.isAutoCalculated())
+        {
+          // remove ID - we don't recover annotation from other views for
+          // view-specific annotation
+          annotation.setId(null);
+        }
+
+        // set visibility for other annotation in this view
+        String annotationId = annotation.getId();
+        if (annotationId != null && annotationIds.containsKey(annotationId))
+        {
+          AlignmentAnnotation jda = annotationIds.get(annotationId);
+          // in principle Visible should always be true for annotation displayed
+          // in multiple views
+          if (annotation.isVisible() != null)
+          {
+            jda.visible = annotation.isVisible();
+          }
+
+          al.addAnnotation(jda);
+
+          continue;
+        }
+        // Construct new annotation from model.
+        List<AnnotationElement> ae = annotation.getAnnotationElement();
+        jalview.datamodel.Annotation[] anot = null;
+        java.awt.Color firstColour = null;
+        int anpos;
+        if (!annotation.isScoreOnly())
+        {
+          anot = new jalview.datamodel.Annotation[al.getWidth()];
+          for (int aa = 0; aa < ae.size() && aa < anot.length; aa++)
+          {
+            AnnotationElement annElement = ae.get(aa);
+            anpos = annElement.getPosition();
+
+            if (anpos >= anot.length)
+            {
+              continue;
+            }
+
+            float value = safeFloat(annElement.getValue());
+            anot[anpos] = new jalview.datamodel.Annotation(
+                    annElement.getDisplayCharacter(),
+                    annElement.getDescription(),
+                    (annElement.getSecondaryStructure() == null
+                            || annElement.getSecondaryStructure()
+                                    .length() == 0)
+                                            ? ' '
+                                            : annElement
+                                                    .getSecondaryStructure()
+                                                    .charAt(0),
+                    value);
+            anot[anpos].colour = new Color(safeInt(annElement.getColour()));
+            if (firstColour == null)
+            {
+              firstColour = anot[anpos].colour;
+            }
+          }
+        }
+        jalview.datamodel.AlignmentAnnotation jaa = null;
+
+        if (annotation.isGraph())
+        {
+          float llim = 0, hlim = 0;
+          // if (autoForView || an[i].isAutoCalculated()) {
+          // hlim=11f;
+          // }
+          jaa = new jalview.datamodel.AlignmentAnnotation(
+                  annotation.getLabel(), annotation.getDescription(), anot,
+                  llim, hlim, safeInt(annotation.getGraphType()));
+
+          jaa.graphGroup = safeInt(annotation.getGraphGroup());
+          jaa._linecolour = firstColour;
+          if (annotation.getThresholdLine() != null)
+          {
+            jaa.setThreshold(new jalview.datamodel.GraphLine(
+                    safeFloat(annotation.getThresholdLine().getValue()),
+                    annotation.getThresholdLine().getLabel(),
+                    new java.awt.Color(safeInt(
+                            annotation.getThresholdLine().getColour()))));
+          }
+          if (autoForView || annotation.isAutoCalculated())
+          {
+            // Hardwire the symbol display line to ensure that labels for
+            // histograms are displayed
+            jaa.hasText = true;
+          }
+        }
+        else
+        {
+          jaa = new jalview.datamodel.AlignmentAnnotation(
+                  annotation.getLabel(), annotation.getDescription(), anot);
+          jaa._linecolour = firstColour;
+        }
+        // register new annotation
+        if (annotation.getId() != null)
+        {
+          annotationIds.put(annotation.getId(), jaa);
+          jaa.annotationId = annotation.getId();
+        }
+        // recover sequence association
+        String sequenceRef = annotation.getSequenceRef();
+        if (sequenceRef != null)
+        {
+          // from 2.9 sequenceRef is to sequence id (JAL-1781)
+          SequenceI sequence = seqRefIds.get(sequenceRef);
+          if (sequence == null)
+          {
+            // in pre-2.9 projects sequence ref is to sequence name
+            sequence = al.findName(sequenceRef);
+          }
+          if (sequence != null)
+          {
+            jaa.createSequenceMapping(sequence, 1, true);
+            sequence.addAlignmentAnnotation(jaa);
+          }
+        }
+        // and make a note of any group association
+        if (annotation.getGroupRef() != null
+                && annotation.getGroupRef().length() > 0)
+        {
+          List<jalview.datamodel.AlignmentAnnotation> aal = groupAnnotRefs
+                  .get(annotation.getGroupRef());
+          if (aal == null)
+          {
+            aal = new ArrayList<>();
+            groupAnnotRefs.put(annotation.getGroupRef(), aal);
+          }
+          aal.add(jaa);
+        }
+
+        if (annotation.getScore() != null)
+        {
+          jaa.setScore(annotation.getScore().doubleValue());
+        }
+        if (annotation.isVisible() != null)
+        {
+          jaa.visible = annotation.isVisible().booleanValue();
+        }
+
+        if (annotation.isCentreColLabels() != null)
+        {
+          jaa.centreColLabels = annotation.isCentreColLabels()
+                  .booleanValue();
+        }
+
+        if (annotation.isScaleColLabels() != null)
+        {
+          jaa.scaleColLabel = annotation.isScaleColLabels().booleanValue();
+        }
+        if (annotation.isAutoCalculated())
+        {
+          // newer files have an 'autoCalculated' flag and store calculation
+          // state in viewport properties
+          jaa.autoCalculated = true; // means annotation will be marked for
+          // update at end of load.
+        }
+        if (annotation.getGraphHeight() != null)
+        {
+          jaa.graphHeight = annotation.getGraphHeight().intValue();
+        }
+        jaa.belowAlignment = annotation.isBelowAlignment();
+        jaa.setCalcId(annotation.getCalcId());
+        if (annotation.getProperty().size() > 0)
+        {
+          for (Annotation.Property prop : annotation
+                  .getProperty())
+          {
+            jaa.setProperty(prop.getName(), prop.getValue());
+          }
+        }
+        if (jaa.autoCalculated)
+        {
+          autoAlan.add(new JvAnnotRow(i, jaa));
+        }
+        else
+        // if (!autoForView)
+        {
+          // add autocalculated group annotation and any user created annotation
+          // for the view
+          al.addAnnotation(jaa);
+        }
+      }
+    }
+    // ///////////////////////
+    // LOAD GROUPS
+    // Create alignment markup and styles for this view
+    if (jalviewModel.getJGroup().size() > 0)
+    {
+      List<JGroup> groups = jalviewModel.getJGroup();
+      boolean addAnnotSchemeGroup = false;
+      for (int i = 0; i < groups.size(); i++)
+      {
+        JGroup jGroup = groups.get(i);
+        ColourSchemeI cs = null;
+        if (jGroup.getColour() != null)
+        {
+          if (jGroup.getColour().startsWith("ucs"))
+          {
+            cs = getUserColourScheme(jalviewModel, jGroup.getColour());
+          }
+          else if (jGroup.getColour().equals("AnnotationColourGradient")
+                  && jGroup.getAnnotationColours() != null)
+          {
+            addAnnotSchemeGroup = true;
+          }
+          else
+          {
+            cs = ColourSchemeProperty.getColourScheme(al,
+                    jGroup.getColour());
+          }
+        }
+        int pidThreshold = safeInt(jGroup.getPidThreshold());
+
+        Vector<SequenceI> seqs = new Vector<>();
+
+        for (int s = 0; s < jGroup.getSeq().size(); s++)
+        {
+          String seqId = jGroup.getSeq().get(s);
+          SequenceI ts = seqRefIds.get(seqId);
+
+          if (ts != null)
+          {
+            seqs.addElement(ts);
+          }
+        }
+
+        if (seqs.size() < 1)
+        {
+          continue;
+        }
+
+        SequenceGroup sg = new SequenceGroup(seqs, jGroup.getName(), cs,
+                safeBoolean(jGroup.isDisplayBoxes()),
+                safeBoolean(jGroup.isDisplayText()),
+                safeBoolean(jGroup.isColourText()),
+                safeInt(jGroup.getStart()), safeInt(jGroup.getEnd()));
+        sg.getGroupColourScheme().setThreshold(pidThreshold, true);
+        sg.getGroupColourScheme()
+                .setConservationInc(safeInt(jGroup.getConsThreshold()));
+        sg.setOutlineColour(new Color(safeInt(jGroup.getOutlineColour())));
+
+        sg.textColour = new Color(safeInt(jGroup.getTextCol1()));
+        sg.textColour2 = new Color(safeInt(jGroup.getTextCol2()));
+        sg.setShowNonconserved(safeBoolean(jGroup.isShowUnconserved()));
+        sg.thresholdTextColour = safeInt(jGroup.getTextColThreshold());
+        // attributes with a default in the schema are never null
+          sg.setShowConsensusHistogram(jGroup.isShowConsensusHistogram());
+          sg.setshowSequenceLogo(jGroup.isShowSequenceLogo());
+          sg.setNormaliseSequenceLogo(jGroup.isNormaliseSequenceLogo());
+        sg.setIgnoreGapsConsensus(jGroup.isIgnoreGapsinConsensus());
+        if (jGroup.getConsThreshold() != null
+                && jGroup.getConsThreshold().intValue() != 0)
+        {
+          Conservation c = new Conservation("All", sg.getSequences(null), 0,
+                  sg.getWidth() - 1);
+          c.calculate();
+          c.verdict(false, 25);
+          sg.cs.setConservation(c);
+        }
+
+        if (jGroup.getId() != null && groupAnnotRefs.size() > 0)
+        {
+          // re-instate unique group/annotation row reference
+          List<AlignmentAnnotation> jaal = groupAnnotRefs
+                  .get(jGroup.getId());
+          if (jaal != null)
+          {
+            for (AlignmentAnnotation jaa : jaal)
+            {
+              jaa.groupRef = sg;
+              if (jaa.autoCalculated)
+              {
+                // match up and try to set group autocalc alignment row for this
+                // annotation
+                if (jaa.label.startsWith("Consensus for "))
+                {
+                  sg.setConsensus(jaa);
+                }
+                // match up and try to set group autocalc alignment row for this
+                // annotation
+                if (jaa.label.startsWith("Conservation for "))
+                {
+                  sg.setConservationRow(jaa);
+                }
+              }
+            }
+          }
+        }
+        al.addGroup(sg);
+        if (addAnnotSchemeGroup)
+        {
+          // reconstruct the annotation colourscheme
+          sg.setColourScheme(constructAnnotationColour(
+                  jGroup.getAnnotationColours(), null, al, jalviewModel, false));
+        }
+      }
+    }
+    if (view == null)
+    {
+      // only dataset in this model, so just return.
+      return null;
+    }
+    // ///////////////////////////////
+    // LOAD VIEWPORT
+
+    AlignFrame af = null;
+    AlignViewport av = null;
+    // now check to see if we really need to create a new viewport.
+    if (multipleView && viewportsAdded.size() == 0)
+    {
+      // We recovered an alignment for which a viewport already exists.
+      // TODO: fix up any settings necessary for overlaying stored state onto
+      // state recovered from another document. (may not be necessary).
+      // we may need a binding from a viewport in memory to one recovered from
+      // XML.
+      // and then recover its containing af to allow the settings to be applied.
+      // TODO: fix for vamsas demo
+      System.err.println(
+              "About to recover a viewport for existing alignment: Sequence set ID is "
+                      + uniqueSeqSetId);
+      Object seqsetobj = retrieveExistingObj(uniqueSeqSetId);
+      if (seqsetobj != null)
+      {
+        if (seqsetobj instanceof String)
+        {
+          uniqueSeqSetId = (String) seqsetobj;
+          System.err.println(
+                  "Recovered extant sequence set ID mapping for ID : New Sequence set ID is "
+                          + uniqueSeqSetId);
+        }
+        else
+        {
+          System.err.println(
+                  "Warning : Collision between sequence set ID string and existing jalview object mapping.");
+        }
+
+      }
+    }
+    /**
+     * indicate that annotation colours are applied across all groups (pre
+     * Jalview 2.8.1 behaviour)
+     */
+    boolean doGroupAnnColour = Jalview2XML.isVersionStringLaterThan("2.8.1",
+            jalviewModel.getVersion());
+
+    AlignmentPanel ap = null;
+    boolean isnewview = true;
+    if (viewId != null)
+    {
+      // Check to see if this alignment already has a view id == viewId
+      jalview.gui.AlignmentPanel views[] = Desktop
+              .getAlignmentPanels(uniqueSeqSetId);
+      if (views != null && views.length > 0)
+      {
+        for (int v = 0; v < views.length; v++)
+        {
+          if (views[v].av.getViewId().equalsIgnoreCase(viewId))
+          {
+            // recover the existing alignpanel, alignframe, viewport
+            af = views[v].alignFrame;
+            av = views[v].av;
+            ap = views[v];
+            // TODO: could even skip resetting view settings if we don't want to
+            // change the local settings from other jalview processes
+            isnewview = false;
+          }
+        }
+      }
+    }
+
+    if (isnewview)
+    {
+      af = loadViewport(file, jseqs, hiddenSeqs, al, jalviewModel, view,
+              uniqueSeqSetId, viewId, autoAlan);
+      av = af.getViewport();
+      ap = af.alignPanel;
+    }
+
+    /*
+     * Load any trees, PDB structures and viewers
+     * 
+     * Not done if flag is false (when this method is used for New View)
+     */
+    if (loadTreesAndStructures)
+    {
+      loadTrees(jalviewModel, view, af, av, ap);
+      loadPDBStructures(jprovider, jseqs, af, ap);
+      loadRnaViewers(jprovider, jseqs, ap);
+    }
+    // and finally return.
+    return af;
+  }
+
+  /**
+   * Instantiate and link any saved RNA (Varna) viewers. The state of the Varna
+   * panel is restored from separate jar entries, two (gapped and trimmed) per
+   * sequence and secondary structure.
+   * 
+   * Currently each viewer shows just one sequence and structure (gapped and
+   * trimmed), however this method is designed to support multiple sequences or
+   * structures in viewers if wanted in future.
+   * 
+   * @param jprovider
+   * @param jseqs
+   * @param ap
+   */
+  private void loadRnaViewers(jarInputStreamProvider jprovider,
+          List<JSeq> jseqs, AlignmentPanel ap)
+  {
+    /*
+     * scan the sequences for references to viewers; create each one the first
+     * time it is referenced, add Rna models to existing viewers
+     */
+    for (JSeq jseq : jseqs)
+    {
+      for (int i = 0; i < jseq.getRnaViewer().size(); i++)
+      {
+        RnaViewer viewer = jseq.getRnaViewer().get(i);
+        AppVarna appVarna = findOrCreateVarnaViewer(viewer, uniqueSetSuffix,
+                ap);
+
+        for (int j = 0; j < viewer.getSecondaryStructure().size(); j++)
+        {
+          SecondaryStructure ss = viewer.getSecondaryStructure().get(j);
+          SequenceI seq = seqRefIds.get(jseq.getId());
+          AlignmentAnnotation ann = this.annotationIds
+                  .get(ss.getAnnotationId());
+
+          /*
+           * add the structure to the Varna display (with session state copied
+           * from the jar to a temporary file)
+           */
+          boolean gapped = safeBoolean(ss.isGapped());
+          String rnaTitle = ss.getTitle();
+          String sessionState = ss.getViewerState();
+          String tempStateFile = copyJarEntry(jprovider, sessionState,
+                  "varna", null);
+          RnaModel rna = new RnaModel(rnaTitle, ann, seq, null, gapped);
+          appVarna.addModelSession(rna, rnaTitle, tempStateFile);
+        }
+        appVarna.setInitialSelection(safeInt(viewer.getSelectedRna()));
+      }
+    }
+  }
+
+  /**
+   * Locate and return an already instantiated matching AppVarna, or create one
+   * if not found
+   * 
+   * @param viewer
+   * @param viewIdSuffix
+   * @param ap
+   * @return
+   */
+  protected AppVarna findOrCreateVarnaViewer(RnaViewer viewer,
+          String viewIdSuffix, AlignmentPanel ap)
+  {
+    /*
+     * on each load a suffix is appended to the saved viewId, to avoid conflicts
+     * if load is repeated
+     */
+    String postLoadId = viewer.getViewId() + viewIdSuffix;
+    for (JInternalFrame frame : getAllFrames())
+    {
+      if (frame instanceof AppVarna)
+      {
+        AppVarna varna = (AppVarna) frame;
+        if (postLoadId.equals(varna.getViewId()))
+        {
+          // this viewer is already instantiated
+          // could in future here add ap as another 'parent' of the
+          // AppVarna window; currently just 1-to-many
+          return varna;
+        }
+      }
+    }
+
+    /*
+     * viewer not found - make it
+     */
+    RnaViewerModel model = new RnaViewerModel(postLoadId, viewer.getTitle(),
+            safeInt(viewer.getXpos()), safeInt(viewer.getYpos()),
+            safeInt(viewer.getWidth()), safeInt(viewer.getHeight()),
+            safeInt(viewer.getDividerLocation()));
+    AppVarna varna = new AppVarna(model, ap);
+
+    return varna;
+  }
+
+  /**
+   * Load any saved trees
+   * 
+   * @param jm
+   * @param view
+   * @param af
+   * @param av
+   * @param ap
+   */
+  protected void loadTrees(JalviewModel jm, Viewport view,
+          AlignFrame af, AlignViewport av, AlignmentPanel ap)
+  {
+    // TODO result of automated refactoring - are all these parameters needed?
+    try
+    {
+      for (int t = 0; t < jm.getTree().size(); t++)
+      {
+
+        Tree tree = jm.getTree().get(t);
+
+        TreePanel tp = (TreePanel) retrieveExistingObj(tree.getId());
+        if (tp == null)
+        {
+          tp = af.showNewickTree(new NewickFile(tree.getNewick()),
+                  tree.getTitle(), safeInt(tree.getWidth()),
+                  safeInt(tree.getHeight()), safeInt(tree.getXpos()),
+                  safeInt(tree.getYpos()));
+          if (tree.getId() != null)
+          {
+            // perhaps bind the tree id to something ?
+          }
+        }
+        else
+        {
+          // update local tree attributes ?
+          // TODO: should check if tp has been manipulated by user - if so its
+          // settings shouldn't be modified
+          tp.setTitle(tree.getTitle());
+          tp.setBounds(new Rectangle(safeInt(tree.getXpos()),
+                  safeInt(tree.getYpos()), safeInt(tree.getWidth()),
+                  safeInt(tree.getHeight())));
+          tp.setViewport(av); // af.viewport;
+          // TODO: verify 'associate with all views' works still
+          tp.getTreeCanvas().setViewport(av); // af.viewport;
+          tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
+
+        }
+        if (tp == null)
+        {
+          warn("There was a problem recovering stored Newick tree: \n"
+                  + tree.getNewick());
+          continue;
+        }
+
+        tp.fitToWindow.setState(safeBoolean(tree.isFitToWindow()));
+        tp.fitToWindow_actionPerformed(null);
+
+        if (tree.getFontName() != null)
+        {
+          tp.setTreeFont(
+                  new Font(tree.getFontName(), safeInt(tree.getFontStyle()),
+                          safeInt(tree.getFontSize())));
+        }
+        else
+        {
+          tp.setTreeFont(
+                  new Font(view.getFontName(), safeInt(view.getFontStyle()),
+                          safeInt(view.getFontSize())));
+        }
+
+        tp.showPlaceholders(safeBoolean(tree.isMarkUnlinked()));
+        tp.showBootstrap(safeBoolean(tree.isShowBootstrap()));
+        tp.showDistances(safeBoolean(tree.isShowDistances()));
+
+        tp.getTreeCanvas().setThreshold(safeFloat(tree.getThreshold()));
+
+        if (safeBoolean(tree.isCurrentTree()))
+        {
+          af.getViewport().setCurrentTree(tp.getTree());
+        }
+      }
+
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    }
+  }
+
+  /**
+   * Load and link any saved structure viewers.
+   * 
+   * @param jprovider
+   * @param jseqs
+   * @param af
+   * @param ap
+   */
+  protected void loadPDBStructures(jarInputStreamProvider jprovider,
+          List<JSeq> jseqs, AlignFrame af, AlignmentPanel ap)
+  {
+    /*
+     * Run through all PDB ids on the alignment, and collect mappings between
+     * distinct view ids and all sequences referring to that view.
+     */
+    Map<String, StructureViewerModel> structureViewers = new LinkedHashMap<>();
+
+    for (int i = 0; i < jseqs.size(); i++)
+    {
+      JSeq jseq = jseqs.get(i);
+      if (jseq.getPdbids().size() > 0)
+      {
+        List<Pdbids> ids = jseq.getPdbids();
+        for (int p = 0; p < ids.size(); p++)
+        {
+          Pdbids pdbid = ids.get(p);
+          final int structureStateCount = pdbid.getStructureState().size();
+          for (int s = 0; s < structureStateCount; s++)
+          {
+            // check to see if we haven't already created this structure view
+            final StructureState structureState = pdbid
+                    .getStructureState().get(s);
+            String sviewid = (structureState.getViewId() == null) ? null
+                    : structureState.getViewId() + uniqueSetSuffix;
+            jalview.datamodel.PDBEntry jpdb = new jalview.datamodel.PDBEntry();
+            // Originally : pdbid.getFile()
+            // : TODO: verify external PDB file recovery still works in normal
+            // jalview project load
+            jpdb.setFile(
+                    loadPDBFile(jprovider, pdbid.getId(), pdbid.getFile()));
+            jpdb.setId(pdbid.getId());
+
+            int x = safeInt(structureState.getXpos());
+            int y = safeInt(structureState.getYpos());
+            int width = safeInt(structureState.getWidth());
+            int height = safeInt(structureState.getHeight());
+
+            // Probably don't need to do this anymore...
+            // Desktop.desktop.getComponentAt(x, y);
+            // TODO: NOW: check that this recovers the PDB file correctly.
+            String pdbFile = loadPDBFile(jprovider, pdbid.getId(),
+                    pdbid.getFile());
+            jalview.datamodel.SequenceI seq = seqRefIds
+                    .get(jseq.getId() + "");
+            if (sviewid == null)
+            {
+              sviewid = "_jalview_pre2_4_" + x + "," + y + "," + width + ","
+                      + height;
+            }
+            if (!structureViewers.containsKey(sviewid))
+            {
+              structureViewers.put(sviewid,
+                      new StructureViewerModel(x, y, width, height, false,
+                              false, true, structureState.getViewId(),
+                              structureState.getType()));
+              // Legacy pre-2.7 conversion JAL-823 :
+              // do not assume any view has to be linked for colour by
+              // sequence
+            }
+
+            // assemble String[] { pdb files }, String[] { id for each
+            // file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, {
+            // seqs_file 2}, boolean[] {
+            // linkAlignPanel,superposeWithAlignpanel}} from hash
+            StructureViewerModel jmoldat = structureViewers.get(sviewid);
+            jmoldat.setAlignWithPanel(jmoldat.isAlignWithPanel()
+                    || structureState.isAlignwithAlignPanel());
+
+            /*
+             * Default colour by linked panel to false if not specified (e.g.
+             * for pre-2.7 projects)
+             */
+            boolean colourWithAlignPanel = jmoldat.isColourWithAlignPanel();
+            colourWithAlignPanel |= structureState.isColourwithAlignPanel();
+            jmoldat.setColourWithAlignPanel(colourWithAlignPanel);
+
+            /*
+             * Default colour by viewer to true if not specified (e.g. for
+             * pre-2.7 projects)
+             */
+            boolean colourByViewer = jmoldat.isColourByViewer();
+            colourByViewer &= structureState.isColourByJmol();
+            jmoldat.setColourByViewer(colourByViewer);
+
+            if (jmoldat.getStateData().length() < structureState
+                    .getValue()/*Content()*/.length())
+            {
+              jmoldat.setStateData(structureState.getValue());// Content());
+            }
+            if (pdbid.getFile() != null)
+            {
+              File mapkey = new File(pdbid.getFile());
+              StructureData seqstrmaps = jmoldat.getFileData().get(mapkey);
+              if (seqstrmaps == null)
+              {
+                jmoldat.getFileData().put(mapkey,
+                        seqstrmaps = jmoldat.new StructureData(pdbFile,
+                                pdbid.getId()));
+              }
+              if (!seqstrmaps.getSeqList().contains(seq))
+              {
+                seqstrmaps.getSeqList().add(seq);
+                // TODO and chains?
+              }
+            }
+            else
+            {
+              errorMessage = ("The Jmol views in this project were imported\nfrom an older version of Jalview.\nPlease review the sequence colour associations\nin the Colour by section of the Jmol View menu.\n\nIn the case of problems, see note at\nhttp://issues.jalview.org/browse/JAL-747");
+              warn(errorMessage);
+            }
+          }
+        }
+      }
+    }
+    // Instantiate the associated structure views
+    for (Entry<String, StructureViewerModel> entry : structureViewers
+            .entrySet())
+    {
+      try
+      {
+        createOrLinkStructureViewer(entry, af, ap, jprovider);
+      } catch (Exception e)
+      {
+        System.err.println(
+                "Error loading structure viewer: " + e.getMessage());
+        // failed - try the next one
+      }
+    }
+  }
+
+  /**
+   * 
+   * @param viewerData
+   * @param af
+   * @param ap
+   * @param jprovider
+   */
+  protected void createOrLinkStructureViewer(
+          Entry<String, StructureViewerModel> viewerData, AlignFrame af,
+          AlignmentPanel ap, jarInputStreamProvider jprovider)
+  {
+    final StructureViewerModel stateData = viewerData.getValue();
+
+    /*
+     * Search for any viewer windows already open from other alignment views
+     * that exactly match the stored structure state
+     */
+    StructureViewerBase comp = findMatchingViewer(viewerData);
+
+    if (comp != null)
+    {
+      linkStructureViewer(ap, comp, stateData);
+      return;
+    }
+
+    /*
+     * From 2.9: stateData.type contains JMOL or CHIMERA, data is in jar entry
+     * "viewer_"+stateData.viewId
+     */
+    if (ViewerType.CHIMERA.toString().equals(stateData.getType()))
+    {
+      createChimeraViewer(viewerData, af, jprovider);
+    }
+    else
+    {
+      /*
+       * else Jmol (if pre-2.9, stateData contains JMOL state string)
+       */
+      createJmolViewer(viewerData, af, jprovider);
+    }
+  }
+
+  /**
+   * Create a new Chimera viewer.
+   * 
+   * @param data
+   * @param af
+   * @param jprovider
+   */
+  protected void createChimeraViewer(
+          Entry<String, StructureViewerModel> viewerData, AlignFrame af,
+          jarInputStreamProvider jprovider)
+  {
+    StructureViewerModel data = viewerData.getValue();
+    String chimeraSessionFile = data.getStateData();
+
+    /*
+     * Copy Chimera session from jar entry "viewer_"+viewId to a temporary file
+     * 
+     * NB this is the 'saved' viewId as in the project file XML, _not_ the
+     * 'uniquified' sviewid used to reconstruct the viewer here
+     */
+    String viewerJarEntryName = getViewerJarEntryName(data.getViewId());
+    chimeraSessionFile = copyJarEntry(jprovider, viewerJarEntryName,
+            "chimera", null);
+
+    Set<Entry<File, StructureData>> fileData = data.getFileData()
+            .entrySet();
+    List<PDBEntry> pdbs = new ArrayList<>();
+    List<SequenceI[]> allseqs = new ArrayList<>();
+    for (Entry<File, StructureData> pdb : fileData)
+    {
+      String filePath = pdb.getValue().getFilePath();
+      String pdbId = pdb.getValue().getPdbId();
+      // pdbs.add(new PDBEntry(filePath, pdbId));
+      pdbs.add(new PDBEntry(pdbId, null, PDBEntry.Type.PDB, filePath));
+      final List<SequenceI> seqList = pdb.getValue().getSeqList();
+      SequenceI[] seqs = seqList.toArray(new SequenceI[seqList.size()]);
+      allseqs.add(seqs);
+    }
+
+    boolean colourByChimera = data.isColourByViewer();
+    boolean colourBySequence = data.isColourWithAlignPanel();
+
+    // TODO use StructureViewer as a factory here, see JAL-1761
+    final PDBEntry[] pdbArray = pdbs.toArray(new PDBEntry[pdbs.size()]);
+    final SequenceI[][] seqsArray = allseqs
+            .toArray(new SequenceI[allseqs.size()][]);
+    String newViewId = viewerData.getKey();
+
+    ChimeraViewFrame cvf = new ChimeraViewFrame(chimeraSessionFile,
+            af.alignPanel, pdbArray, seqsArray, colourByChimera,
+            colourBySequence, newViewId);
+    cvf.setSize(data.getWidth(), data.getHeight());
+    cvf.setLocation(data.getX(), data.getY());
+  }
+
+  /**
+   * Create a new Jmol window. First parse the Jmol state to translate filenames
+   * loaded into the view, and record the order in which files are shown in the
+   * Jmol view, so we can add the sequence mappings in same order.
+   * 
+   * @param viewerData
+   * @param af
+   * @param jprovider
+   */
+  protected void createJmolViewer(
+          final Entry<String, StructureViewerModel> viewerData,
+          AlignFrame af, jarInputStreamProvider jprovider)
+  {
+    final StructureViewerModel svattrib = viewerData.getValue();
+    String state = svattrib.getStateData();
+
+    /*
+     * Pre-2.9: state element value is the Jmol state string
+     * 
+     * 2.9+: @type is "JMOL", state data is in a Jar file member named "viewer_"
+     * + viewId
+     */
+    if (ViewerType.JMOL.toString().equals(svattrib.getType()))
+    {
+      state = readJarEntry(jprovider,
+              getViewerJarEntryName(svattrib.getViewId()));
+    }
+
+    List<String> pdbfilenames = new ArrayList<>();
+    List<SequenceI[]> seqmaps = new ArrayList<>();
+    List<String> pdbids = new ArrayList<>();
+    StringBuilder newFileLoc = new StringBuilder(64);
+    int cp = 0, ncp, ecp;
+    Map<File, StructureData> oldFiles = svattrib.getFileData();
+    while ((ncp = state.indexOf("load ", cp)) > -1)
+    {
+      do
+      {
+        // look for next filename in load statement
+        newFileLoc.append(state.substring(cp,
+                ncp = (state.indexOf("\"", ncp + 1) + 1)));
+        String oldfilenam = state.substring(ncp,
+                ecp = state.indexOf("\"", ncp));
+        // recover the new mapping data for this old filename
+        // have to normalize filename - since Jmol and jalview do
+        // filename
+        // translation differently.
+        StructureData filedat = oldFiles.get(new File(oldfilenam));
+        if (filedat == null)
+        {
+          String reformatedOldFilename = oldfilenam.replaceAll("/", "\\\\");
+          filedat = oldFiles.get(new File(reformatedOldFilename));
+        }
+        newFileLoc.append(Platform.escapeString(filedat.getFilePath()));
+        pdbfilenames.add(filedat.getFilePath());
+        pdbids.add(filedat.getPdbId());
+        seqmaps.add(filedat.getSeqList().toArray(new SequenceI[0]));
+        newFileLoc.append("\"");
+        cp = ecp + 1; // advance beyond last \" and set cursor so we can
+                      // look for next file statement.
+      } while ((ncp = state.indexOf("/*file*/", cp)) > -1);
+    }
+    if (cp > 0)
+    {
+      // just append rest of state
+      newFileLoc.append(state.substring(cp));
+    }
+    else
+    {
+      System.err.print("Ignoring incomplete Jmol state for PDB ids: ");
+      newFileLoc = new StringBuilder(state);
+      newFileLoc.append("; load append ");
+      for (File id : oldFiles.keySet())
+      {
+        // add this and any other pdb files that should be present in
+        // the viewer
+        StructureData filedat = oldFiles.get(id);
+        newFileLoc.append(filedat.getFilePath());
+        pdbfilenames.add(filedat.getFilePath());
+        pdbids.add(filedat.getPdbId());
+        seqmaps.add(filedat.getSeqList().toArray(new SequenceI[0]));
+        newFileLoc.append(" \"");
+        newFileLoc.append(filedat.getFilePath());
+        newFileLoc.append("\"");
+
+      }
+      newFileLoc.append(";");
+    }
+
+    if (newFileLoc.length() == 0)
+    {
+      return;
+    }
+    int histbug = newFileLoc.indexOf("history = ");
+    if (histbug > -1)
+    {
+      /*
+       * change "history = [true|false];" to "history = [1|0];"
+       */
+      histbug += 10;
+      int diff = histbug == -1 ? -1 : newFileLoc.indexOf(";", histbug);
+      String val = (diff == -1) ? null
+              : newFileLoc.substring(histbug, diff);
+      if (val != null && val.length() >= 4)
+      {
+        if (val.contains("e")) // eh? what can it be?
+        {
+          if (val.trim().equals("true"))
+          {
+            val = "1";
+          }
+          else
+          {
+            val = "0";
+          }
+          newFileLoc.replace(histbug, diff, val);
+        }
+      }
+    }
+
+    final String[] pdbf = pdbfilenames
+            .toArray(new String[pdbfilenames.size()]);
+    final String[] id = pdbids.toArray(new String[pdbids.size()]);
+    final SequenceI[][] sq = seqmaps
+            .toArray(new SequenceI[seqmaps.size()][]);
+    final String fileloc = newFileLoc.toString();
+    final String sviewid = viewerData.getKey();
+    final AlignFrame alf = af;
+    final Rectangle rect = new Rectangle(svattrib.getX(), svattrib.getY(),
+            svattrib.getWidth(), svattrib.getHeight());
+    try
+    {
+      javax.swing.SwingUtilities.invokeAndWait(new Runnable()
+      {
+        @Override
+        public void run()
+        {
+          JalviewStructureDisplayI sview = null;
+          try
+          {
+            sview = new StructureViewer(
+                    alf.alignPanel.getStructureSelectionManager())
+                            .createView(StructureViewer.ViewerType.JMOL,
+                                    pdbf, id, sq, alf.alignPanel, svattrib,
+                                    fileloc, rect, sviewid);
+            addNewStructureViewer(sview);
+          } catch (OutOfMemoryError ex)
+          {
+            new OOMWarning("restoring structure view for PDB id " + id,
+                    (OutOfMemoryError) ex.getCause());
+            if (sview != null && sview.isVisible())
+            {
+              sview.closeViewer(false);
+              sview.setVisible(false);
+              sview.dispose();
+            }
+          }
+        }
+      });
+    } catch (InvocationTargetException ex)
+    {
+      warn("Unexpected error when opening Jmol view.", ex);
+
+    } catch (InterruptedException e)
+    {
+      // e.printStackTrace();
+    }
+
+  }
+
+  /**
+   * Generates a name for the entry in the project jar file to hold state
+   * information for a structure viewer
+   * 
+   * @param viewId
+   * @return
+   */
+  protected String getViewerJarEntryName(String viewId)
+  {
+    return VIEWER_PREFIX + viewId;
+  }
+
+  /**
+   * Returns any open frame that matches given structure viewer data. The match
+   * is based on the unique viewId, or (for older project versions) the frame's
+   * geometry.
+   * 
+   * @param viewerData
+   * @return
+   */
+  protected StructureViewerBase findMatchingViewer(
+          Entry<String, StructureViewerModel> viewerData)
+  {
+    final String sviewid = viewerData.getKey();
+    final StructureViewerModel svattrib = viewerData.getValue();
+    StructureViewerBase comp = null;
+    JInternalFrame[] frames = getAllFrames();
+    for (JInternalFrame frame : frames)
+    {
+      if (frame instanceof StructureViewerBase)
+      {
+        /*
+         * Post jalview 2.4 schema includes structure view id
+         */
+        if (sviewid != null && ((StructureViewerBase) frame).getViewId()
+                .equals(sviewid))
+        {
+          comp = (StructureViewerBase) frame;
+          break; // break added in 2.9
+        }
+        /*
+         * Otherwise test for matching position and size of viewer frame
+         */
+        else if (frame.getX() == svattrib.getX()
+                && frame.getY() == svattrib.getY()
+                && frame.getHeight() == svattrib.getHeight()
+                && frame.getWidth() == svattrib.getWidth())
+        {
+          comp = (StructureViewerBase) frame;
+          // no break in faint hope of an exact match on viewId
+        }
+      }
+    }
+    return comp;
+  }
+
+  /**
+   * Link an AlignmentPanel to an existing structure viewer.
+   * 
+   * @param ap
+   * @param viewer
+   * @param oldFiles
+   * @param useinViewerSuperpos
+   * @param usetoColourbyseq
+   * @param viewerColouring
+   */
+  protected void linkStructureViewer(AlignmentPanel ap,
+          StructureViewerBase viewer, StructureViewerModel stateData)
+  {
+    // NOTE: if the jalview project is part of a shared session then
+    // view synchronization should/could be done here.
+
+    final boolean useinViewerSuperpos = stateData.isAlignWithPanel();
+    final boolean usetoColourbyseq = stateData.isColourWithAlignPanel();
+    final boolean viewerColouring = stateData.isColourByViewer();
+    Map<File, StructureData> oldFiles = stateData.getFileData();
+
+    /*
+     * Add mapping for sequences in this view to an already open viewer
+     */
+    final AAStructureBindingModel binding = viewer.getBinding();
+    for (File id : oldFiles.keySet())
+    {
+      // add this and any other pdb files that should be present in the
+      // viewer
+      StructureData filedat = oldFiles.get(id);
+      String pdbFile = filedat.getFilePath();
+      SequenceI[] seq = filedat.getSeqList().toArray(new SequenceI[0]);
+      binding.getSsm().setMapping(seq, null, pdbFile, DataSourceType.FILE,
+              null);
+      binding.addSequenceForStructFile(pdbFile, seq);
+    }
+    // and add the AlignmentPanel's reference to the view panel
+    viewer.addAlignmentPanel(ap);
+    if (useinViewerSuperpos)
+    {
+      viewer.useAlignmentPanelForSuperposition(ap);
+    }
+    else
+    {
+      viewer.excludeAlignmentPanelForSuperposition(ap);
+    }
+    if (usetoColourbyseq)
+    {
+      viewer.useAlignmentPanelForColourbyseq(ap, !viewerColouring);
+    }
+    else
+    {
+      viewer.excludeAlignmentPanelForColourbyseq(ap);
+    }
+  }
+
+  /**
+   * Get all frames within the Desktop.
+   * 
+   * @return
+   */
+  protected JInternalFrame[] getAllFrames()
+  {
+    JInternalFrame[] frames = null;
+    // TODO is this necessary - is it safe - risk of hanging?
+    do
+    {
+      try
+      {
+        frames = Desktop.desktop.getAllFrames();
+      } catch (ArrayIndexOutOfBoundsException e)
+      {
+        // occasional No such child exceptions are thrown here...
+        try
+        {
+          Thread.sleep(10);
+        } catch (InterruptedException f)
+        {
+        }
+      }
+    } while (frames == null);
+    return frames;
+  }
+
+  /**
+   * Answers true if 'version' is equal to or later than 'supported', where each
+   * is formatted as major/minor versions like "2.8.3" or "2.3.4b1" for bugfix
+   * changes. Development and test values for 'version' are leniently treated
+   * i.e. answer true.
+   * 
+   * @param supported
+   *          - minimum version we are comparing against
+   * @param version
+   *          - version of data being processsed
+   * @return
+   */
+  public static boolean isVersionStringLaterThan(String supported,
+          String version)
+  {
+    if (supported == null || version == null
+            || version.equalsIgnoreCase("DEVELOPMENT BUILD")
+            || version.equalsIgnoreCase("Test")
+            || version.equalsIgnoreCase("AUTOMATED BUILD"))
+    {
+      System.err.println("Assuming project file with "
+              + (version == null ? "null" : version)
+              + " is compatible with Jalview version " + supported);
+      return true;
+    }
+    else
+    {
+      return StringUtils.compareVersions(version, supported, "b") >= 0;
+    }
+  }
+
+  Vector<JalviewStructureDisplayI> newStructureViewers = null;
+
+  protected void addNewStructureViewer(JalviewStructureDisplayI sview)
+  {
+    if (newStructureViewers != null)
+    {
+      sview.getBinding().setFinishedLoadingFromArchive(false);
+      newStructureViewers.add(sview);
+    }
+  }
+
+  protected void setLoadingFinishedForNewStructureViewers()
+  {
+    if (newStructureViewers != null)
+    {
+      for (JalviewStructureDisplayI sview : newStructureViewers)
+      {
+        sview.getBinding().setFinishedLoadingFromArchive(true);
+      }
+      newStructureViewers.clear();
+      newStructureViewers = null;
+    }
+  }
+
+  AlignFrame loadViewport(String file, List<JSeq> JSEQ,
+          List<SequenceI> hiddenSeqs, AlignmentI al,
+          JalviewModel jm, Viewport view, String uniqueSeqSetId,
+          String viewId, List<JvAnnotRow> autoAlan)
+  {
+    AlignFrame af = null;
+    af = new AlignFrame(al, safeInt(view.getWidth()),
+            safeInt(view.getHeight()), uniqueSeqSetId, viewId);
+
+    af.setFileName(file, FileFormat.Jalview);
+
+    final AlignViewport viewport = af.getViewport();
+    for (int i = 0; i < JSEQ.size(); i++)
+    {
+      int colour = safeInt(JSEQ.get(i).getColour());
+      viewport.setSequenceColour(viewport.getAlignment().getSequenceAt(i),
+              new Color(colour));
+    }
+
+    if (al.hasSeqrep())
+    {
+      viewport.setColourByReferenceSeq(true);
+      viewport.setDisplayReferenceSeq(true);
+    }
+
+    viewport.setGatherViewsHere(safeBoolean(view.isGatheredViews()));
+
+    if (view.getSequenceSetId() != null)
+    {
+      AlignmentViewport av = viewportsAdded.get(uniqueSeqSetId);
+
+      viewport.setSequenceSetId(uniqueSeqSetId);
+      if (av != null)
+      {
+        // propagate shared settings to this new view
+        viewport.setHistoryList(av.getHistoryList());
+        viewport.setRedoList(av.getRedoList());
+      }
+      else
+      {
+        viewportsAdded.put(uniqueSeqSetId, viewport);
+      }
+      // TODO: check if this method can be called repeatedly without
+      // side-effects if alignpanel already registered.
+      PaintRefresher.Register(af.alignPanel, uniqueSeqSetId);
+    }
+    // apply Hidden regions to view.
+    if (hiddenSeqs != null)
+    {
+      for (int s = 0; s < JSEQ.size(); s++)
+      {
+        SequenceGroup hidden = new SequenceGroup();
+        boolean isRepresentative = false;
+        for (int r = 0; r < JSEQ.get(s).getHiddenSequences().size(); r++)
+        {
+          isRepresentative = true;
+          SequenceI sequenceToHide = al
+                  .getSequenceAt(JSEQ.get(s).getHiddenSequences().get(r));
+          hidden.addSequence(sequenceToHide, false);
+          // remove from hiddenSeqs list so we don't try to hide it twice
+          hiddenSeqs.remove(sequenceToHide);
+        }
+        if (isRepresentative)
+        {
+          SequenceI representativeSequence = al.getSequenceAt(s);
+          hidden.addSequence(representativeSequence, false);
+          viewport.hideRepSequences(representativeSequence, hidden);
+        }
+      }
+
+      SequenceI[] hseqs = hiddenSeqs
+              .toArray(new SequenceI[hiddenSeqs.size()]);
+      viewport.hideSequence(hseqs);
+
+    }
+    // recover view properties and display parameters
+
+    viewport.setShowAnnotation(safeBoolean(view.isShowAnnotation()));
+    viewport.setAbovePIDThreshold(safeBoolean(view.isPidSelected()));
+    final int pidThreshold = safeInt(view.getPidThreshold());
+    viewport.setThreshold(pidThreshold);
+
+    viewport.setColourText(safeBoolean(view.isShowColourText()));
+
+    viewport
+            .setConservationSelected(
+                    safeBoolean(view.isConservationSelected()));
+    viewport.setIncrement(safeInt(view.getConsThreshold()));
+    viewport.setShowJVSuffix(safeBoolean(view.isShowFullId()));
+    viewport.setRightAlignIds(safeBoolean(view.isRightAlignIds()));
+    viewport.setFont(new Font(view.getFontName(),
+            safeInt(view.getFontStyle()), safeInt(view.getFontSize())),
+            true);
+    ViewStyleI vs = viewport.getViewStyle();
+    vs.setScaleProteinAsCdna(view.isScaleProteinAsCdna());
+    viewport.setViewStyle(vs);
+    // TODO: allow custom charWidth/Heights to be restored by updating them
+    // after setting font - which means set above to false
+    viewport.setRenderGaps(safeBoolean(view.isRenderGaps()));
+    viewport.setWrapAlignment(safeBoolean(view.isWrapAlignment()));
+    viewport.setShowAnnotation(safeBoolean(view.isShowAnnotation()));
+
+    viewport.setShowBoxes(safeBoolean(view.isShowBoxes()));
+
+    viewport.setShowText(safeBoolean(view.isShowText()));
+
+    viewport.setTextColour(new Color(safeInt(view.getTextCol1())));
+    viewport.setTextColour2(new Color(safeInt(view.getTextCol2())));
+    viewport.setThresholdTextColour(safeInt(view.getTextColThreshold()));
+    viewport.setShowUnconserved(view.isShowUnconserved());
+    viewport.getRanges().setStartRes(safeInt(view.getStartRes()));
+
+    if (view.getViewName() != null)
+    {
+      viewport.setViewName(view.getViewName());
+      af.setInitialTabVisible();
+    }
+    af.setBounds(safeInt(view.getXpos()), safeInt(view.getYpos()),
+            safeInt(view.getWidth()), safeInt(view.getHeight()));
+    // startSeq set in af.alignPanel.updateLayout below
+    af.alignPanel.updateLayout();
+    ColourSchemeI cs = null;
+    // apply colourschemes
+    if (view.getBgColour() != null)
+    {
+      if (view.getBgColour().startsWith("ucs"))
+      {
+        cs = getUserColourScheme(jm, view.getBgColour());
+      }
+      else if (view.getBgColour().startsWith("Annotation"))
+      {
+        AnnotationColourScheme viewAnnColour = view.getAnnotationColours();
+        cs = constructAnnotationColour(viewAnnColour, af, al, jm, true);
+
+        // annpos
+
+      }
+      else
+      {
+        cs = ColourSchemeProperty.getColourScheme(al, view.getBgColour());
+      }
+    }
+
+    viewport.setGlobalColourScheme(cs);
+    viewport.getResidueShading().setThreshold(pidThreshold,
+            view.isIgnoreGapsinConsensus());
+    viewport.getResidueShading()
+            .setConsensus(viewport.getSequenceConsensusHash());
+    viewport.setColourAppliesToAllGroups(false);
+
+    if (safeBoolean(view.isConservationSelected()) && cs != null)
+    {
+      viewport.getResidueShading()
+              .setConservationInc(safeInt(view.getConsThreshold()));
+    }
+
+    af.changeColour(cs);
+
+    viewport.setColourAppliesToAllGroups(true);
+
+    viewport
+            .setShowSequenceFeatures(
+                    safeBoolean(view.isShowSequenceFeatures()));
+
+    viewport.setCentreColumnLabels(view.isCentreColumnLabels());
+    viewport.setIgnoreGapsConsensus(view.isIgnoreGapsinConsensus(), null);
+    viewport.setFollowHighlight(view.isFollowHighlight());
+    viewport.followSelection = view.isFollowSelection();
+    viewport.setShowConsensusHistogram(view.isShowConsensusHistogram());
+    viewport.setShowSequenceLogo(view.isShowSequenceLogo());
+    viewport.setNormaliseSequenceLogo(view.isNormaliseSequenceLogo());
+    viewport.setShowDBRefs(safeBoolean(view.isShowDbRefTooltip()));
+    viewport.setShowNPFeats(safeBoolean(view.isShowNPfeatureTooltip()));
+    viewport.setShowGroupConsensus(view.isShowGroupConsensus());
+    viewport.setShowGroupConservation(view.isShowGroupConservation());
+
+    // recover feature settings
+    if (jm.getFeatureSettings() != null)
+    {
+      FeatureRenderer fr = af.alignPanel.getSeqPanel().seqCanvas
+              .getFeatureRenderer();
+      FeaturesDisplayed fdi;
+      viewport.setFeaturesDisplayed(fdi = new FeaturesDisplayed());
+      String[] renderOrder = new String[jm.getFeatureSettings()
+              .getSetting().size()];
+      Map<String, FeatureColourI> featureColours = new Hashtable<>();
+      Map<String, Float> featureOrder = new Hashtable<>();
+
+      for (int fs = 0; fs < jm.getFeatureSettings()
+              .getSetting().size(); fs++)
+      {
+        Setting setting = jm.getFeatureSettings().getSetting().get(fs);
+        String featureType = setting.getType();
+
+        /*
+         * restore feature filters (if any)
+         */
+        jalview.xml.binding.jalview.FeatureMatcherSet filters = setting
+                .getMatcherSet();
+        if (filters != null)
+        {
+          FeatureMatcherSetI filter = Jalview2XML
+                  .parseFilter(featureType, filters);
+          if (!filter.isEmpty())
+          {
+            fr.setFeatureFilter(featureType, filter);
+          }
+        }
+
+        /*
+         * restore feature colour scheme
+         */
+        Color maxColour = new Color(setting.getColour());
+        if (setting.getMincolour() != null)
+        {
+          /*
+           * minColour is always set unless a simple colour
+           * (including for colour by label though it doesn't use it)
+           */
+          Color minColour = new Color(setting.getMincolour().intValue());
+          Color noValueColour = minColour;
+          NoValueColour noColour = setting.getNoValueColour();
+          if (noColour == NoValueColour.NONE)
+          {
+            noValueColour = null;
+          }
+          else if (noColour == NoValueColour.MAX)
+          {
+            noValueColour = maxColour;
+          }
+          float min = safeFloat(safeFloat(setting.getMin()));
+          float max = setting.getMax() == null ? 1f
+                  : setting.getMax().floatValue();
+          FeatureColourI gc = new FeatureColour(minColour, maxColour,
+                  noValueColour, min, max);
+          if (setting.getAttributeName().size() > 0)
+          {
+            gc.setAttributeName(setting.getAttributeName().toArray(
+                    new String[setting.getAttributeName().size()]));
+          }
+          if (setting.getThreshold() != null)
+          {
+            gc.setThreshold(setting.getThreshold().floatValue());
+            int threshstate = safeInt(setting.getThreshstate());
+            // -1 = None, 0 = Below, 1 = Above threshold
+            if (threshstate == 0)
+            {
+              gc.setBelowThreshold(true);
+            }
+            else if (threshstate == 1)
+            {
+              gc.setAboveThreshold(true);
+            }
+          }
+          gc.setAutoScaled(true); // default
+          if (setting.isAutoScale() != null)
+          {
+            gc.setAutoScaled(setting.isAutoScale());
+          }
+          if (setting.isColourByLabel() != null)
+          {
+            gc.setColourByLabel(setting.isColourByLabel());
+          }
+          // and put in the feature colour table.
+          featureColours.put(featureType, gc);
+        }
+        else
+        {
+          featureColours.put(featureType,
+                  new FeatureColour(maxColour));
+        }
+        renderOrder[fs] = featureType;
+        if (setting.getOrder() != null)
+        {
+          featureOrder.put(featureType, setting.getOrder().floatValue());
+        }
+        else
+        {
+          featureOrder.put(featureType, new Float(
+                  fs / jm.getFeatureSettings().getSetting().size()));
+        }
+        if (safeBoolean(setting.isDisplay()))
+        {
+          fdi.setVisible(featureType);
+        }
+      }
+      Map<String, Boolean> fgtable = new Hashtable<>();
+      for (int gs = 0; gs < jm.getFeatureSettings().getGroup().size(); gs++)
+      {
+        Group grp = jm.getFeatureSettings().getGroup().get(gs);
+        fgtable.put(grp.getName(), new Boolean(grp.isDisplay()));
+      }
+      // FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder,
+      // fgtable, featureColours, jms.getFeatureSettings().hasTransparency() ?
+      // jms.getFeatureSettings().getTransparency() : 0.0, featureOrder);
+      FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder,
+              fgtable, featureColours, 1.0f, featureOrder);
+      fr.transferSettings(frs);
+    }
+
+    if (view.getHiddenColumns().size() > 0)
+    {
+      for (int c = 0; c < view.getHiddenColumns().size(); c++)
+      {
+        final HiddenColumns hc = view.getHiddenColumns().get(c);
+        viewport.hideColumns(safeInt(hc.getStart()),
+                safeInt(hc.getEnd()) /* +1 */);
+      }
+    }
+    if (view.getCalcIdParam() != null)
+    {
+      for (CalcIdParam calcIdParam : view.getCalcIdParam())
+      {
+        if (calcIdParam != null)
+        {
+          if (recoverCalcIdParam(calcIdParam, viewport))
+          {
+          }
+          else
+          {
+            warn("Couldn't recover parameters for "
+                    + calcIdParam.getCalcId());
+          }
+        }
+      }
+    }
+    af.setMenusFromViewport(viewport);
+    af.setTitle(view.getTitle());
+    // TODO: we don't need to do this if the viewport is aready visible.
+    /*
+     * Add the AlignFrame to the desktop (it may be 'gathered' later), unless it
+     * has a 'cdna/protein complement' view, in which case save it in order to
+     * populate a SplitFrame once all views have been read in.
+     */
+    String complementaryViewId = view.getComplementId();
+    if (complementaryViewId == null)
+    {
+      Desktop.addInternalFrame(af, view.getTitle(),
+              safeInt(view.getWidth()), safeInt(view.getHeight()));
+      // recompute any autoannotation
+      af.alignPanel.updateAnnotation(false, true);
+      reorderAutoannotation(af, al, autoAlan);
+      af.alignPanel.alignmentChanged();
+    }
+    else
+    {
+      splitFrameCandidates.put(view, af);
+    }
+    return af;
+  }
+
+  /**
+   * Reads saved data to restore Colour by Annotation settings
+   * 
+   * @param viewAnnColour
+   * @param af
+   * @param al
+   * @param model
+   * @param checkGroupAnnColour
+   * @return
+   */
+  private ColourSchemeI constructAnnotationColour(
+          AnnotationColourScheme viewAnnColour, AlignFrame af,
+          AlignmentI al, JalviewModel model, boolean checkGroupAnnColour)
+  {
+    boolean propagateAnnColour = false;
+    AlignmentI annAlignment = af != null ? af.getViewport().getAlignment()
+            : al;
+    if (checkGroupAnnColour && al.getGroups() != null
+            && al.getGroups().size() > 0)
+    {
+      // pre 2.8.1 behaviour
+      // check to see if we should transfer annotation colours
+      propagateAnnColour = true;
+      for (SequenceGroup sg : al.getGroups())
+      {
+        if (sg.getColourScheme() instanceof AnnotationColourGradient)
+        {
+          propagateAnnColour = false;
+        }
+      }
+    }
+
+    /*
+     * 2.10.2- : saved annotationId is AlignmentAnnotation.annotationId
+     */
+    String annotationId = viewAnnColour.getAnnotation();
+    AlignmentAnnotation matchedAnnotation = annotationIds.get(annotationId);
+
+    /*
+     * pre 2.10.2: saved annotationId is AlignmentAnnotation.label
+     */
+    if (matchedAnnotation == null
+            && annAlignment.getAlignmentAnnotation() != null)
+    {
+      for (int i = 0; i < annAlignment.getAlignmentAnnotation().length; i++)
+      {
+        if (annotationId
+                .equals(annAlignment.getAlignmentAnnotation()[i].label))
+        {
+          matchedAnnotation = annAlignment.getAlignmentAnnotation()[i];
+          break;
+        }
+      }
+    }
+    if (matchedAnnotation == null)
+    {
+      System.err.println("Failed to match annotation colour scheme for "
+              + annotationId);
+      return null;
+    }
+    if (matchedAnnotation.getThreshold() == null)
+    {
+      matchedAnnotation.setThreshold(
+              new GraphLine(safeFloat(viewAnnColour.getThreshold()),
+                      "Threshold", Color.black));
+    }
+
+    AnnotationColourGradient cs = null;
+    if (viewAnnColour.getColourScheme().equals("None"))
+    {
+      cs = new AnnotationColourGradient(matchedAnnotation,
+              new Color(safeInt(viewAnnColour.getMinColour())),
+              new Color(safeInt(viewAnnColour.getMaxColour())),
+              safeInt(viewAnnColour.getAboveThreshold()));
+    }
+    else if (viewAnnColour.getColourScheme().startsWith("ucs"))
+    {
+      cs = new AnnotationColourGradient(matchedAnnotation,
+              getUserColourScheme(model, viewAnnColour.getColourScheme()),
+              safeInt(viewAnnColour.getAboveThreshold()));
+    }
+    else
+    {
+      cs = new AnnotationColourGradient(matchedAnnotation,
+              ColourSchemeProperty.getColourScheme(al,
+                      viewAnnColour.getColourScheme()),
+              safeInt(viewAnnColour.getAboveThreshold()));
+    }
+
+    boolean perSequenceOnly = safeBoolean(viewAnnColour.isPerSequence());
+    boolean useOriginalColours = safeBoolean(
+            viewAnnColour.isPredefinedColours());
+    cs.setSeqAssociated(perSequenceOnly);
+    cs.setPredefinedColours(useOriginalColours);
+
+    if (propagateAnnColour && al.getGroups() != null)
+    {
+      // Also use these settings for all the groups
+      for (int g = 0; g < al.getGroups().size(); g++)
+      {
+        SequenceGroup sg = al.getGroups().get(g);
+        if (sg.getGroupColourScheme() == null)
+        {
+          continue;
+        }
+
+        AnnotationColourGradient groupScheme = new AnnotationColourGradient(
+                matchedAnnotation, sg.getColourScheme(),
+                safeInt(viewAnnColour.getAboveThreshold()));
+        sg.setColourScheme(groupScheme);
+        groupScheme.setSeqAssociated(perSequenceOnly);
+        groupScheme.setPredefinedColours(useOriginalColours);
+      }
+    }
+    return cs;
+  }
+
+  private void reorderAutoannotation(AlignFrame af, AlignmentI al,
+          List<JvAnnotRow> autoAlan)
+  {
+    // copy over visualization settings for autocalculated annotation in the
+    // view
+    if (al.getAlignmentAnnotation() != null)
+    {
+      /**
+       * Kludge for magic autoannotation names (see JAL-811)
+       */
+      String[] magicNames = new String[] { "Consensus", "Quality",
+          "Conservation" };
+      JvAnnotRow nullAnnot = new JvAnnotRow(-1, null);
+      Hashtable<String, JvAnnotRow> visan = new Hashtable<>();
+      for (String nm : magicNames)
+      {
+        visan.put(nm, nullAnnot);
+      }
+      for (JvAnnotRow auan : autoAlan)
+      {
+        visan.put(auan.template.label
+                + (auan.template.getCalcId() == null ? ""
+                        : "\t" + auan.template.getCalcId()),
+                auan);
+      }
+      int hSize = al.getAlignmentAnnotation().length;
+      List<JvAnnotRow> reorder = new ArrayList<>();
+      // work through any autoCalculated annotation already on the view
+      // removing it if it should be placed in a different location on the
+      // annotation panel.
+      List<String> remains = new ArrayList<>(visan.keySet());
+      for (int h = 0; h < hSize; h++)
+      {
+        jalview.datamodel.AlignmentAnnotation jalan = al
+                .getAlignmentAnnotation()[h];
+        if (jalan.autoCalculated)
+        {
+          String k;
+          JvAnnotRow valan = visan.get(k = jalan.label);
+          if (jalan.getCalcId() != null)
+          {
+            valan = visan.get(k = jalan.label + "\t" + jalan.getCalcId());
+          }
+
+          if (valan != null)
+          {
+            // delete the auto calculated row from the alignment
+            al.deleteAnnotation(jalan, false);
+            remains.remove(k);
+            hSize--;
+            h--;
+            if (valan != nullAnnot)
+            {
+              if (jalan != valan.template)
+              {
+                // newly created autoannotation row instance
+                // so keep a reference to the visible annotation row
+                // and copy over all relevant attributes
+                if (valan.template.graphHeight >= 0)
+
+                {
+                  jalan.graphHeight = valan.template.graphHeight;
+                }
+                jalan.visible = valan.template.visible;
+              }
+              reorder.add(new JvAnnotRow(valan.order, jalan));
+            }
+          }
+        }
+      }
+      // Add any (possibly stale) autocalculated rows that were not appended to
+      // the view during construction
+      for (String other : remains)
+      {
+        JvAnnotRow othera = visan.get(other);
+        if (othera != nullAnnot && othera.template.getCalcId() != null
+                && othera.template.getCalcId().length() > 0)
+        {
+          reorder.add(othera);
+        }
+      }
+      // now put the automatic annotation in its correct place
+      int s = 0, srt[] = new int[reorder.size()];
+      JvAnnotRow[] rws = new JvAnnotRow[reorder.size()];
+      for (JvAnnotRow jvar : reorder)
+      {
+        rws[s] = jvar;
+        srt[s++] = jvar.order;
+      }
+      reorder.clear();
+      jalview.util.QuickSort.sort(srt, rws);
+      // and re-insert the annotation at its correct position
+      for (JvAnnotRow jvar : rws)
+      {
+        al.addAnnotation(jvar.template, jvar.order);
+      }
+      af.alignPanel.adjustAnnotationHeight();
+    }
+  }
+
+  Hashtable skipList = null;
+
+  /**
+   * TODO remove this method
+   * 
+   * @param view
+   * @return AlignFrame bound to sequenceSetId from view, if one exists. private
+   *         AlignFrame getSkippedFrame(Viewport view) { if (skipList==null) {
+   *         throw new Error("Implementation Error. No skipList defined for this
+   *         Jalview2XML instance."); } return (AlignFrame)
+   *         skipList.get(view.getSequenceSetId()); }
+   */
+
+  /**
+   * Check if the Jalview view contained in object should be skipped or not.
+   * 
+   * @param object
+   * @return true if view's sequenceSetId is a key in skipList
+   */
+  private boolean skipViewport(JalviewModel object)
+  {
+    if (skipList == null)
+    {
+      return false;
+    }
+    String id = object.getViewport().get(0).getSequenceSetId();
+    if (skipList.containsKey(id))
+    {
+      if (Cache.log != null && Cache.log.isDebugEnabled())
+      {
+        Cache.log.debug("Skipping seuqence set id " + id);
+      }
+      return true;
+    }
+    return false;
+  }
+
+  public void addToSkipList(AlignFrame af)
+  {
+    if (skipList == null)
+    {
+      skipList = new Hashtable();
+    }
+    skipList.put(af.getViewport().getSequenceSetId(), af);
+  }
+
+  public void clearSkipList()
+  {
+    if (skipList != null)
+    {
+      skipList.clear();
+      skipList = null;
+    }
+  }
+
+  private void recoverDatasetFor(SequenceSet vamsasSet, AlignmentI al,
+          boolean ignoreUnrefed, String uniqueSeqSetId)
+  {
+    jalview.datamodel.AlignmentI ds = getDatasetFor(
+            vamsasSet.getDatasetId());
+    AlignmentI xtant_ds = ds;
+    if (xtant_ds == null)
+    {
+      // good chance we are about to create a new dataset, but check if we've
+      // seen some of the dataset sequence IDs before.
+      // TODO: skip this check if we are working with project generated by
+      // version 2.11 or later
+      xtant_ds = checkIfHasDataset(vamsasSet.getSequence());
+      if (xtant_ds != null)
+      {
+        ds = xtant_ds;
+        addDatasetRef(vamsasSet.getDatasetId(), ds);
+      }
+    }
+    Vector dseqs = null;
+    if (!ignoreUnrefed)
+    {
+      // recovering an alignment View
+      AlignmentI seqSetDS = getDatasetFor(UNIQSEQSETID + uniqueSeqSetId);
+      if (seqSetDS != null)
+      {
+        if (ds != null && ds != seqSetDS)
+        {
+          warn("JAL-3171 regression: Overwriting a dataset reference for an alignment"
+                  + " - CDS/Protein crossreference data may be lost");
+          if (xtant_ds != null)
+          {
+            // This can only happen if the unique sequence set ID was bound to a
+            // dataset that did not contain any of the sequences in the view
+            // currently being restored.
+            warn("JAL-3171 SERIOUS!  TOTAL CONFUSION - please consider contacting the Jalview Development team so they can investigate why your project caused this message to be displayed.");
+          }
+        }
+        ds = seqSetDS;
+        addDatasetRef(vamsasSet.getDatasetId(), ds);
+      }
+    }
+    if (ds == null)
+    {
+      // try even harder to restore dataset
+      AlignmentI xtantDS = checkIfHasDataset(vamsasSet.getSequence());
+      // create a list of new dataset sequences
+      dseqs = new Vector();
+    }
+    for (int i = 0, iSize = vamsasSet.getSequence().size(); i < iSize; i++)
+    {
+      Sequence vamsasSeq = vamsasSet.getSequence().get(i);
+      ensureJalviewDatasetSequence(vamsasSeq, ds, dseqs, ignoreUnrefed, i);
+    }
+    // create a new dataset
+    if (ds == null)
+    {
+      SequenceI[] dsseqs = new SequenceI[dseqs.size()];
+      dseqs.copyInto(dsseqs);
+      ds = new jalview.datamodel.Alignment(dsseqs);
+      debug("Created new dataset " + vamsasSet.getDatasetId()
+              + " for alignment " + System.identityHashCode(al));
+      addDatasetRef(vamsasSet.getDatasetId(), ds);
+    }
+    // set the dataset for the newly imported alignment.
+    if (al.getDataset() == null && !ignoreUnrefed)
+    {
+      al.setDataset(ds);
+      // register dataset for the alignment's uniqueSeqSetId for legacy projects
+      addDatasetRef(UNIQSEQSETID + uniqueSeqSetId, ds);
+    }
+    updateSeqDatasetBinding(vamsasSet.getSequence(), ds);
+  }
+
+  /**
+   * XML dataset sequence ID to materialised dataset reference
+   */
+  HashMap<String, AlignmentI> seqToDataset = new HashMap<>();
+
+  /**
+   * @return the first materialised dataset reference containing a dataset
+   *         sequence referenced in the given view
+   * @param list
+   *          - sequences from the view
+   */
+  AlignmentI checkIfHasDataset(List<Sequence> list)
+  {
+    for (Sequence restoredSeq : list)
+    {
+      AlignmentI datasetFor = seqToDataset.get(restoredSeq.getDsseqid());
+      if (datasetFor != null)
+      {
+        return datasetFor;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Register ds as the containing dataset for the dataset sequences referenced
+   * by sequences in list
+   * 
+   * @param list
+   *          - sequences in a view
+   * @param ds
+   */
+  void updateSeqDatasetBinding(List<Sequence> list, AlignmentI ds)
+  {
+    for (Sequence restoredSeq : list)
+    {
+      AlignmentI prevDS = seqToDataset.put(restoredSeq.getDsseqid(), ds);
+      if (prevDS != null && prevDS != ds)
+      {
+        warn("Dataset sequence appears in many datasets: "
+                + restoredSeq.getDsseqid());
+        // TODO: try to merge!
+      }
+    }
+  }
+  /**
+   * 
+   * @param vamsasSeq
+   *          sequence definition to create/merge dataset sequence for
+   * @param ds
+   *          dataset alignment
+   * @param dseqs
+   *          vector to add new dataset sequence to
+   * @param ignoreUnrefed
+   *          - when true, don't create new sequences from vamsasSeq if it's id
+   *          doesn't already have an asssociated Jalview sequence.
+   * @param vseqpos
+   *          - used to reorder the sequence in the alignment according to the
+   *          vamsasSeq array ordering, to preserve ordering of dataset
+   */
+  private void ensureJalviewDatasetSequence(Sequence vamsasSeq,
+          AlignmentI ds, Vector dseqs, boolean ignoreUnrefed, int vseqpos)
+  {
+    // JBP TODO: Check this is called for AlCodonFrames to support recovery of
+    // xRef Codon Maps
+    SequenceI sq = seqRefIds.get(vamsasSeq.getId());
+    boolean reorder = false;
+    SequenceI dsq = null;
+    if (sq != null && sq.getDatasetSequence() != null)
+    {
+      dsq = sq.getDatasetSequence();
+    }
+    else
+    {
+      reorder = true;
+    }
+    if (sq == null && ignoreUnrefed)
+    {
+      return;
+    }
+    String sqid = vamsasSeq.getDsseqid();
+    if (dsq == null)
+    {
+      // need to create or add a new dataset sequence reference to this sequence
+      if (sqid != null)
+      {
+        dsq = seqRefIds.get(sqid);
+      }
+      // check again
+      if (dsq == null)
+      {
+        // make a new dataset sequence
+        dsq = sq.createDatasetSequence();
+        if (sqid == null)
+        {
+          // make up a new dataset reference for this sequence
+          sqid = seqHash(dsq);
+        }
+        dsq.setVamsasId(uniqueSetSuffix + sqid);
+        seqRefIds.put(sqid, dsq);
+        if (ds == null)
+        {
+          if (dseqs != null)
+          {
+            dseqs.addElement(dsq);
+          }
+        }
+        else
+        {
+          ds.addSequence(dsq);
+        }
+      }
+      else
+      {
+        if (sq != dsq)
+        { // make this dataset sequence sq's dataset sequence
+          sq.setDatasetSequence(dsq);
+          // and update the current dataset alignment
+          if (ds == null)
+          {
+            if (dseqs != null)
+            {
+              if (!dseqs.contains(dsq))
+              {
+                dseqs.add(dsq);
+              }
+            }
+            else
+            {
+              if (ds.findIndex(dsq) < 0)
+              {
+                ds.addSequence(dsq);
+              }
+            }
+          }
+        }
+      }
+    }
+    // TODO: refactor this as a merge dataset sequence function
+    // now check that sq (the dataset sequence) sequence really is the union of
+    // all references to it
+    // boolean pre = sq.getStart() < dsq.getStart();
+    // boolean post = sq.getEnd() > dsq.getEnd();
+    // if (pre || post)
+    if (sq != dsq)
+    {
+      // StringBuffer sb = new StringBuffer();
+      String newres = jalview.analysis.AlignSeq.extractGaps(
+              jalview.util.Comparison.GapChars, sq.getSequenceAsString());
+      if (!newres.equalsIgnoreCase(dsq.getSequenceAsString())
+              && newres.length() > dsq.getLength())
+      {
+        // Update with the longer sequence.
+        synchronized (dsq)
+        {
+          /*
+           * if (pre) { sb.insert(0, newres .substring(0, dsq.getStart() -
+           * sq.getStart())); dsq.setStart(sq.getStart()); } if (post) {
+           * sb.append(newres.substring(newres.length() - sq.getEnd() -
+           * dsq.getEnd())); dsq.setEnd(sq.getEnd()); }
+           */
+          dsq.setSequence(newres);
+        }
+        // TODO: merges will never happen if we 'know' we have the real dataset
+        // sequence - this should be detected when id==dssid
+        System.err.println(
+                "DEBUG Notice:  Merged dataset sequence (if you see this often, post at http://issues.jalview.org/browse/JAL-1474)"); // ("
+        // + (pre ? "prepended" : "") + " "
+        // + (post ? "appended" : ""));
+      }
+    }
+    else
+    {
+      // sequence refs are identical. We may need to update the existing dataset
+      // alignment with this one, though.
+      if (ds != null && dseqs == null)
+      {
+        int opos = ds.findIndex(dsq);
+        SequenceI tseq = null;
+        if (opos != -1 && vseqpos != opos)
+        {
+          // remove from old position
+          ds.deleteSequence(dsq);
+        }
+        if (vseqpos < ds.getHeight())
+        {
+          if (vseqpos != opos)
+          {
+            // save sequence at destination position
+            tseq = ds.getSequenceAt(vseqpos);
+            ds.replaceSequenceAt(vseqpos, dsq);
+            ds.addSequence(tseq);
+          }
+        }
+        else
+        {
+          ds.addSequence(dsq);
+        }
+      }
+    }
+  }
+
+  /*
+   * TODO use AlignmentI here and in related methods - needs
+   * AlignmentI.getDataset() changed to return AlignmentI instead of Alignment
+   */
+  Hashtable<String, AlignmentI> datasetIds = null;
+
+  IdentityHashMap<AlignmentI, String> dataset2Ids = null;
+
+  private AlignmentI getDatasetFor(String datasetId)
+  {
+    if (datasetIds == null)
+    {
+      datasetIds = new Hashtable<>();
+      return null;
+    }
+    if (datasetIds.containsKey(datasetId))
+    {
+      return datasetIds.get(datasetId);
+    }
+    return null;
+  }
+
+  private void addDatasetRef(String datasetId, AlignmentI dataset)
+  {
+    if (datasetIds == null)
+    {
+      datasetIds = new Hashtable<>();
+    }
+    datasetIds.put(datasetId, dataset);
+  }
+
+  /**
+   * make a new dataset ID for this jalview dataset alignment
+   * 
+   * @param dataset
+   * @return
+   */
+  private String getDatasetIdRef(AlignmentI dataset)
+  {
+    if (dataset.getDataset() != null)
+    {
+      warn("Serious issue!  Dataset Object passed to getDatasetIdRef is not a Jalview DATASET alignment...");
+    }
+    String datasetId = makeHashCode(dataset, null);
+    if (datasetId == null)
+    {
+      // make a new datasetId and record it
+      if (dataset2Ids == null)
+      {
+        dataset2Ids = new IdentityHashMap<>();
+      }
+      else
+      {
+        datasetId = dataset2Ids.get(dataset);
+      }
+      if (datasetId == null)
+      {
+        datasetId = "ds" + dataset2Ids.size() + 1;
+        dataset2Ids.put(dataset, datasetId);
+      }
+    }
+    return datasetId;
+  }
+
+  private void addDBRefs(SequenceI datasetSequence, Sequence sequence)
+  {
+    for (int d = 0; d < sequence.getDBRef().size(); d++)
+    {
+      DBRef dr = sequence.getDBRef().get(d);
+      jalview.datamodel.DBRefEntry entry = new jalview.datamodel.DBRefEntry(
+              dr.getSource(), dr.getVersion(), dr.getAccessionId());
+      if (dr.getMapping() != null)
+      {
+        entry.setMap(addMapping(dr.getMapping()));
+      }
+      datasetSequence.addDBRef(entry);
+    }
+  }
+
+  private jalview.datamodel.Mapping addMapping(Mapping m)
+  {
+    SequenceI dsto = null;
+    // Mapping m = dr.getMapping();
+    int fr[] = new int[m.getMapListFrom().size() * 2];
+    Iterator<MapListFrom> from = m.getMapListFrom().iterator();// enumerateMapListFrom();
+    for (int _i = 0; from.hasNext(); _i += 2)
+    {
+      MapListFrom mf = from.next();
+      fr[_i] = mf.getStart();
+      fr[_i + 1] = mf.getEnd();
+    }
+    int fto[] = new int[m.getMapListTo().size() * 2];
+    Iterator<MapListTo> to = m.getMapListTo().iterator();// enumerateMapListTo();
+    for (int _i = 0; to.hasNext(); _i += 2)
+    {
+      MapListTo mf = to.next();
+      fto[_i] = mf.getStart();
+      fto[_i + 1] = mf.getEnd();
+    }
+    jalview.datamodel.Mapping jmap = new jalview.datamodel.Mapping(dsto, fr,
+            fto, m.getMapFromUnit().intValue(),
+            m.getMapToUnit().intValue());
+    // if (m.getMappingChoice() != null)
+    // {
+    // MappingChoice mc = m.getMappingChoice();
+    if (m.getDseqFor() != null)
+    {
+      String dsfor = m.getDseqFor();
+      if (seqRefIds.containsKey(dsfor))
+      {
+        /**
+         * recover from hash
+         */
+        jmap.setTo(seqRefIds.get(dsfor));
+      }
+      else
+      {
+        frefedSequence.add(newMappingRef(dsfor, jmap));
+      }
+    }
+    else
+    {
+      /**
+       * local sequence definition
+       */
+      Sequence ms = m.getSequence();
+      SequenceI djs = null;
+      String sqid = ms.getDsseqid();
+      if (sqid != null && sqid.length() > 0)
+      {
+        /*
+         * recover dataset sequence
+         */
+        djs = seqRefIds.get(sqid);
+      }
+      else
+      {
+        System.err.println(
+                "Warning - making up dataset sequence id for DbRef sequence map reference");
+        sqid = ((Object) ms).toString(); // make up a new hascode for
+        // undefined dataset sequence hash
+        // (unlikely to happen)
+      }
+
+      if (djs == null)
+      {
+        /**
+         * make a new dataset sequence and add it to refIds hash
+         */
+        djs = new jalview.datamodel.Sequence(ms.getName(),
+                ms.getSequence());
+        djs.setStart(jmap.getMap().getToLowest());
+        djs.setEnd(jmap.getMap().getToHighest());
+        djs.setVamsasId(uniqueSetSuffix + sqid);
+        jmap.setTo(djs);
+        incompleteSeqs.put(sqid, djs);
+        seqRefIds.put(sqid, djs);
+
+      }
+      jalview.bin.Cache.log.debug("about to recurse on addDBRefs.");
+      addDBRefs(djs, ms);
+
+    }
+
+    return jmap;
+  }
+
+  /**
+   * Provides a 'copy' of an alignment view (on action New View) by 'saving' the
+   * view as XML (but not to file), and then reloading it
+   * 
+   * @param ap
+   * @return
+   */
+  public AlignmentPanel copyAlignPanel(AlignmentPanel ap)
+  {
+    initSeqRefs();
+    JalviewModel jm = saveState(ap, null, null, null);
+
+    addDatasetRef(
+            jm.getVamsasModel().getSequenceSet().get(0).getDatasetId(),
+            ap.getAlignment().getDataset());
+
+    uniqueSetSuffix = "";
+    // jm.getJalviewModelSequence().getViewport(0).setId(null);
+    jm.getViewport().get(0).setId(null);
+    // we don't overwrite the view we just copied
+
+    if (this.frefedSequence == null)
+    {
+      frefedSequence = new Vector<>();
+    }
+
+    viewportsAdded.clear();
+
+    AlignFrame af = loadFromObject(jm, null, false, null);
+    af.getAlignPanels().clear();
+    af.closeMenuItem_actionPerformed(true);
+
+    /*
+     * if(ap.av.getAlignment().getAlignmentAnnotation()!=null) { for(int i=0;
+     * i<ap.av.getAlignment().getAlignmentAnnotation().length; i++) {
+     * if(!ap.av.getAlignment().getAlignmentAnnotation()[i].autoCalculated) {
+     * af.alignPanel.av.getAlignment().getAlignmentAnnotation()[i] =
+     * ap.av.getAlignment().getAlignmentAnnotation()[i]; } } }
+     */
+
+    return af.alignPanel;
+  }
+
+  private Hashtable jvids2vobj;
+
+  private void warn(String msg)
+  {
+    warn(msg, null);
+  }
+
+  private void warn(String msg, Exception e)
+  {
+    if (Cache.log != null)
+    {
+      if (e != null)
+      {
+        Cache.log.warn(msg, e);
+      }
+      else
+      {
+        Cache.log.warn(msg);
+      }
+    }
+    else
+    {
+      System.err.println("Warning: " + msg);
+      if (e != null)
+      {
+        e.printStackTrace();
+      }
+    }
+  }
+
+  private void debug(String string)
+  {
+    debug(string, null);
+  }
+
+  private void debug(String msg, Exception e)
+  {
+    if (Cache.log != null)
+    {
+      if (e != null)
+      {
+        Cache.log.debug(msg, e);
+      }
+      else
+      {
+        Cache.log.debug(msg);
+      }
+    }
+    else
+    {
+      System.err.println("Warning: " + msg);
+      if (e != null)
+      {
+        e.printStackTrace();
+      }
+    }
+  }
+
+  /**
+   * set the object to ID mapping tables used to write/recover objects and XML
+   * ID strings for the jalview project. If external tables are provided then
+   * finalize and clearSeqRefs will not clear the tables when the Jalview2XML
+   * object goes out of scope. - also populates the datasetIds hashtable with
+   * alignment objects containing dataset sequences
+   * 
+   * @param vobj2jv
+   *          Map from ID strings to jalview datamodel
+   * @param jv2vobj
+   *          Map from jalview datamodel to ID strings
+   * 
+   * 
+   */
+  public void setObjectMappingTables(Hashtable vobj2jv,
+          IdentityHashMap jv2vobj)
+  {
+    this.jv2vobj = jv2vobj;
+    this.vobj2jv = vobj2jv;
+    Iterator ds = jv2vobj.keySet().iterator();
+    String id;
+    while (ds.hasNext())
+    {
+      Object jvobj = ds.next();
+      id = jv2vobj.get(jvobj).toString();
+      if (jvobj instanceof jalview.datamodel.Alignment)
+      {
+        if (((jalview.datamodel.Alignment) jvobj).getDataset() == null)
+        {
+          addDatasetRef(id, (jalview.datamodel.Alignment) jvobj);
+        }
+      }
+      else if (jvobj instanceof jalview.datamodel.Sequence)
+      {
+        // register sequence object so the XML parser can recover it.
+        if (seqRefIds == null)
+        {
+          seqRefIds = new HashMap<>();
+        }
+        if (seqsToIds == null)
+        {
+          seqsToIds = new IdentityHashMap<>();
+        }
+        seqRefIds.put(jv2vobj.get(jvobj).toString(), (SequenceI) jvobj);
+        seqsToIds.put((SequenceI) jvobj, id);
+      }
+      else if (jvobj instanceof jalview.datamodel.AlignmentAnnotation)
+      {
+        String anid;
+        AlignmentAnnotation jvann = (AlignmentAnnotation) jvobj;
+        annotationIds.put(anid = jv2vobj.get(jvobj).toString(), jvann);
+        if (jvann.annotationId == null)
+        {
+          jvann.annotationId = anid;
+        }
+        if (!jvann.annotationId.equals(anid))
+        {
+          // TODO verify that this is the correct behaviour
+          this.warn("Overriding Annotation ID for " + anid
+                  + " from different id : " + jvann.annotationId);
+          jvann.annotationId = anid;
+        }
+      }
+      else if (jvobj instanceof String)
+      {
+        if (jvids2vobj == null)
+        {
+          jvids2vobj = new Hashtable();
+          jvids2vobj.put(jvobj, jv2vobj.get(jvobj).toString());
+        }
+      }
+      else
+      {
+        Cache.log.debug("Ignoring " + jvobj.getClass() + " (ID = " + id);
+      }
+    }
+  }
+
+  /**
+   * set the uniqueSetSuffix used to prefix/suffix object IDs for jalview
+   * objects created from the project archive. If string is null (default for
+   * construction) then suffix will be set automatically.
+   * 
+   * @param string
+   */
+  public void setUniqueSetSuffix(String string)
+  {
+    uniqueSetSuffix = string;
+
+  }
+
+  /**
+   * uses skipList2 as the skipList for skipping views on sequence sets
+   * associated with keys in the skipList
+   * 
+   * @param skipList2
+   */
+  public void setSkipList(Hashtable skipList2)
+  {
+    skipList = skipList2;
+  }
+
+  /**
+   * Reads the jar entry of given name and returns its contents, or null if the
+   * entry is not found.
+   * 
+   * @param jprovider
+   * @param jarEntryName
+   * @return
+   */
+  protected String readJarEntry(jarInputStreamProvider jprovider,
+          String jarEntryName)
+  {
+    String result = null;
+    BufferedReader in = null;
+
+    try
+    {
+      /*
+       * Reopen the jar input stream and traverse its entries to find a matching
+       * name
+       */
+      JarInputStream jin = jprovider.getJarInputStream();
+      JarEntry entry = null;
+      do
+      {
+        entry = jin.getNextJarEntry();
+      } while (entry != null && !entry.getName().equals(jarEntryName));
+
+      if (entry != null)
+      {
+        StringBuilder out = new StringBuilder(256);
+        in = new BufferedReader(new InputStreamReader(jin, UTF_8));
+        String data;
+
+        while ((data = in.readLine()) != null)
+        {
+          out.append(data);
+        }
+        result = out.toString();
+      }
+      else
+      {
+        warn("Couldn't find entry in Jalview Jar for " + jarEntryName);
+      }
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    } finally
+    {
+      if (in != null)
+      {
+        try
+        {
+          in.close();
+        } catch (IOException e)
+        {
+          // ignore
+        }
+      }
+    }
+
+    return result;
+  }
+
+  /**
+   * Returns an incrementing counter (0, 1, 2...)
+   * 
+   * @return
+   */
+  private synchronized int nextCounter()
+  {
+    return counter++;
+  }
+
+  /**
+   * Populates an XML model of the feature colour scheme for one feature type
+   * 
+   * @param featureType
+   * @param fcol
+   * @return
+   */
+  public static Colour marshalColour(
+          String featureType, FeatureColourI fcol)
+  {
+    Colour col = new Colour();
+    if (fcol.isSimpleColour())
+    {
+      col.setRGB(Format.getHexString(fcol.getColour()));
+    }
+    else
+    {
+      col.setRGB(Format.getHexString(fcol.getMaxColour()));
+      col.setMin(fcol.getMin());
+      col.setMax(fcol.getMax());
+      col.setMinRGB(jalview.util.Format.getHexString(fcol.getMinColour()));
+      col.setAutoScale(fcol.isAutoScaled());
+      col.setThreshold(fcol.getThreshold());
+      col.setColourByLabel(fcol.isColourByLabel());
+      col.setThreshType(fcol.isAboveThreshold() ? ThresholdType.ABOVE
+              : (fcol.isBelowThreshold() ? ThresholdType.BELOW
+                      : ThresholdType.NONE));
+      if (fcol.isColourByAttribute())
+      {
+        final String[] attName = fcol.getAttributeName();
+        col.getAttributeName().add(attName[0]);
+        if (attName.length > 1)
+        {
+          col.getAttributeName().add(attName[1]);
+        }
+      }
+      Color noColour = fcol.getNoColour();
+      if (noColour == null)
+      {
+        col.setNoValueColour(NoValueColour.NONE);
+      }
+      else if (noColour == fcol.getMaxColour())
+      {
+        col.setNoValueColour(NoValueColour.MAX);
+      }
+      else
+      {
+        col.setNoValueColour(NoValueColour.MIN);
+      }
+    }
+    col.setName(featureType);
+    return col;
+  }
+
+  /**
+   * Populates an XML model of the feature filter(s) for one feature type
+   * 
+   * @param firstMatcher
+   *          the first (or only) match condition)
+   * @param filter
+   *          remaining match conditions (if any)
+   * @param and
+   *          if true, conditions are and-ed, else or-ed
+   */
+  public static jalview.xml.binding.jalview.FeatureMatcherSet marshalFilter(
+          FeatureMatcherI firstMatcher, Iterator<FeatureMatcherI> filters,
+          boolean and)
+  {
+    jalview.xml.binding.jalview.FeatureMatcherSet result = new jalview.xml.binding.jalview.FeatureMatcherSet();
+  
+    if (filters.hasNext())
+    {
+      /*
+       * compound matcher
+       */
+      CompoundMatcher compound = new CompoundMatcher();
+      compound.setAnd(and);
+      jalview.xml.binding.jalview.FeatureMatcherSet matcher1 = marshalFilter(
+              firstMatcher, Collections.emptyIterator(), and);
+      // compound.addMatcherSet(matcher1);
+      compound.getMatcherSet().add(matcher1);
+      FeatureMatcherI nextMatcher = filters.next();
+      jalview.xml.binding.jalview.FeatureMatcherSet matcher2 = marshalFilter(
+              nextMatcher, filters, and);
+      // compound.addMatcherSet(matcher2);
+      compound.getMatcherSet().add(matcher2);
+      result.setCompoundMatcher(compound);
+    }
+    else
+    {
+      /*
+       * single condition matcher
+       */
+      // MatchCondition matcherModel = new MatchCondition();
+      jalview.xml.binding.jalview.FeatureMatcher matcherModel = new jalview.xml.binding.jalview.FeatureMatcher();
+      matcherModel.setCondition(
+              firstMatcher.getMatcher().getCondition().getStableName());
+      matcherModel.setValue(firstMatcher.getMatcher().getPattern());
+      if (firstMatcher.isByAttribute())
+      {
+        matcherModel.setBy(FilterBy.BY_ATTRIBUTE);
+        // matcherModel.setAttributeName(firstMatcher.getAttribute());
+        String[] attName = firstMatcher.getAttribute();
+        matcherModel.getAttributeName().add(attName[0]); // attribute
+        if (attName.length > 1)
+        {
+          matcherModel.getAttributeName().add(attName[1]); // sub-attribute
+        }
+      }
+      else if (firstMatcher.isByLabel())
+      {
+        matcherModel.setBy(FilterBy.BY_LABEL);
+      }
+      else if (firstMatcher.isByScore())
+      {
+        matcherModel.setBy(FilterBy.BY_SCORE);
+      }
+      result.setMatchCondition(matcherModel);
+    }
+  
+    return result;
+  }
+
+  /**
+   * Loads one XML model of a feature filter to a Jalview object
+   * 
+   * @param featureType
+   * @param matcherSetModel
+   * @return
+   */
+  public static FeatureMatcherSetI parseFilter(
+          String featureType,
+          jalview.xml.binding.jalview.FeatureMatcherSet matcherSetModel)
+  {
+    FeatureMatcherSetI result = new FeatureMatcherSet();
+    try
+    {
+      parseFilterConditions(result, matcherSetModel, true);
+    } catch (IllegalStateException e)
+    {
+      // mixing AND and OR conditions perhaps
+      System.err.println(
+              String.format("Error reading filter conditions for '%s': %s",
+                      featureType, e.getMessage()));
+      // return as much as was parsed up to the error
+    }
+  
+    return result;
+  }
+
+  /**
+   * Adds feature match conditions to matcherSet as unmarshalled from XML
+   * (possibly recursively for compound conditions)
+   * 
+   * @param matcherSet
+   * @param matcherSetModel
+   * @param and
+   *          if true, multiple conditions are AND-ed, else they are OR-ed
+   * @throws IllegalStateException
+   *           if AND and OR conditions are mixed
+   */
+  protected static void parseFilterConditions(
+          FeatureMatcherSetI matcherSet,
+          jalview.xml.binding.jalview.FeatureMatcherSet matcherSetModel,
+          boolean and)
+  {
+    jalview.xml.binding.jalview.FeatureMatcher mc = matcherSetModel
+            .getMatchCondition();
+    if (mc != null)
+    {
+      /*
+       * single condition
+       */
+      FilterBy filterBy = mc.getBy();
+      Condition cond = Condition.fromString(mc.getCondition());
+      String pattern = mc.getValue();
+      FeatureMatcherI matchCondition = null;
+      if (filterBy == FilterBy.BY_LABEL)
+      {
+        matchCondition = FeatureMatcher.byLabel(cond, pattern);
+      }
+      else if (filterBy == FilterBy.BY_SCORE)
+      {
+        matchCondition = FeatureMatcher.byScore(cond, pattern);
+  
+      }
+      else if (filterBy == FilterBy.BY_ATTRIBUTE)
+      {
+        final List<String> attributeName = mc.getAttributeName();
+        String[] attNames = attributeName
+                .toArray(new String[attributeName.size()]);
+        matchCondition = FeatureMatcher.byAttribute(cond, pattern,
+                attNames);
+      }
+  
+      /*
+       * note this throws IllegalStateException if AND-ing to a 
+       * previously OR-ed compound condition, or vice versa
+       */
+      if (and)
+      {
+        matcherSet.and(matchCondition);
+      }
+      else
+      {
+        matcherSet.or(matchCondition);
+      }
+    }
+    else
+    {
+      /*
+       * compound condition
+       */
+      List<jalview.xml.binding.jalview.FeatureMatcherSet> matchers = matcherSetModel
+              .getCompoundMatcher().getMatcherSet();
+      boolean anded = matcherSetModel.getCompoundMatcher().isAnd();
+      if (matchers.size() == 2)
+      {
+        parseFilterConditions(matcherSet, matchers.get(0), anded);
+        parseFilterConditions(matcherSet, matchers.get(1), anded);
+      }
+      else
+      {
+        System.err.println("Malformed compound filter condition");
+      }
+    }
+  }
+
+  /**
+   * Loads one XML model of a feature colour to a Jalview object
+   * 
+   * @param colourModel
+   * @return
+   */
+  public static FeatureColourI parseColour(Colour colourModel)
+  {
+    FeatureColourI colour = null;
+  
+    if (colourModel.getMax() != null)
+    {
+      Color mincol = null;
+      Color maxcol = null;
+      Color noValueColour = null;
+  
+      try
+      {
+        mincol = new Color(Integer.parseInt(colourModel.getMinRGB(), 16));
+        maxcol = new Color(Integer.parseInt(colourModel.getRGB(), 16));
+      } catch (Exception e)
+      {
+        Cache.log.warn("Couldn't parse out graduated feature color.", e);
+      }
+  
+      NoValueColour noCol = colourModel.getNoValueColour();
+      if (noCol == NoValueColour.MIN)
+      {
+        noValueColour = mincol;
+      }
+      else if (noCol == NoValueColour.MAX)
+      {
+        noValueColour = maxcol;
+      }
+  
+      colour = new FeatureColour(mincol, maxcol, noValueColour,
+              safeFloat(colourModel.getMin()),
+              safeFloat(colourModel.getMax()));
+      final List<String> attributeName = colourModel.getAttributeName();
+      String[] attributes = attributeName
+              .toArray(new String[attributeName.size()]);
+      if (attributes != null && attributes.length > 0)
+      {
+        colour.setAttributeName(attributes);
+      }
+      if (colourModel.isAutoScale() != null)
+      {
+        colour.setAutoScaled(colourModel.isAutoScale().booleanValue());
+      }
+      if (colourModel.isColourByLabel() != null)
+      {
+        colour.setColourByLabel(
+                colourModel.isColourByLabel().booleanValue());
+      }
+      if (colourModel.getThreshold() != null)
+      {
+        colour.setThreshold(colourModel.getThreshold().floatValue());
+      }
+      ThresholdType ttyp = colourModel.getThreshType();
+      if (ttyp == ThresholdType.ABOVE)
+      {
+        colour.setAboveThreshold(true);
+      }
+      else if (ttyp == ThresholdType.BELOW)
+      {
+        colour.setBelowThreshold(true);
+      }
+    }
+    else
+    {
+      Color color = new Color(Integer.parseInt(colourModel.getRGB(), 16));
+      colour = new FeatureColour(color);
+    }
+  
+    return colour;
+  }
+}
index 9f08688..481f809 100644 (file)
  */
 package jalview.schemes;
 
-import jalview.binding.JalviewUserColours;
+import jalview.xml.binding.jalview.JalviewUserColours;
 
 import java.awt.Color;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStreamReader;
 
-import org.exolab.castor.xml.Unmarshaller;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
 
 public class ColourSchemeLoader
 {
@@ -51,12 +54,14 @@ public class ColourSchemeLoader
       InputStreamReader in = new InputStreamReader(
               new FileInputStream(file), "UTF-8");
 
-      jalview.schemabinding.version2.JalviewUserColours jucs = new jalview.schemabinding.version2.JalviewUserColours();
-
-      org.exolab.castor.xml.Unmarshaller unmar = new org.exolab.castor.xml.Unmarshaller(
-              jucs);
-      jucs = (jalview.schemabinding.version2.JalviewUserColours) unmar
-              .unmarshal(in);
+      JAXBContext jc = JAXBContext
+              .newInstance("jalview.xml.binding.jalview");
+      javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+      XMLStreamReader streamReader = XMLInputFactory.newInstance()
+              .createXMLStreamReader(in);
+      JAXBElement<JalviewUserColours> jbe = um.unmarshal(streamReader,
+              JalviewUserColours.class);
+      JalviewUserColours jucs = jbe.getValue();
 
       /*
        * non-case-sensitive colours are for 20 amino acid codes,
@@ -69,9 +74,9 @@ public class ColourSchemeLoader
 
       String name;
       int index;
-      for (int i = 0; i < jucs.getColourCount(); i++)
+      for (int i = 0; i < jucs.getColour().size(); i++)
       {
-        name = jucs.getColour(i).getName();
+        name = jucs.getColour().get(i).getName();
         if (ResidueProperties.aa3Hash.containsKey(name))
         {
           index = ResidueProperties.aa3Hash.get(name).intValue();
@@ -86,7 +91,7 @@ public class ColourSchemeLoader
         }
 
         Color color = new Color(
-                Integer.parseInt(jucs.getColour(i).getRGB(), 16));
+                Integer.parseInt(jucs.getColour().get(i).getRGB(), 16));
         if (name.toLowerCase().equals(name))
         {
           caseSensitive = true;
@@ -117,7 +122,7 @@ public class ColourSchemeLoader
 
         jalview.binding.JalviewUserColours jucs = new jalview.binding.JalviewUserColours();
 
-        jucs = JalviewUserColours.unmarshal(in);
+        jucs = jalview.binding.JalviewUserColours.unmarshal(in);
 
         newColours = new Color[jucs.getColourCount()];
 
index fcf322d..4174f5b 100644 (file)
@@ -30,6 +30,12 @@ import java.util.List;
 
 public class StructureMapping
 {
+  public static final int UNASSIGNED_VALUE = Integer.MIN_VALUE;
+
+  private static final int PDB_RES_NUM_INDEX = 0;
+
+  private static final int PDB_ATOM_NUM_INDEX = 1;
+
   String mappingDetails;
 
   SequenceI sequence;
@@ -40,17 +46,12 @@ public class StructureMapping
 
   String pdbchain;
 
-  public static final int UNASSIGNED_VALUE = Integer.MIN_VALUE;
-
-  private static final int PDB_RES_NUM_INDEX = 0;
-
-  private static final int PDB_ATOM_NUM_INDEX = 1;
-
   // Mapping key is residue index while value is an array containing PDB resNum,
   // and atomNo
   HashMap<Integer, int[]> mapping;
 
   jalview.datamodel.Mapping seqToPdbMapping = null;
+
   /**
    * Constructor
    * 
@@ -145,7 +146,7 @@ public class StructureMapping
    */
   public List<int[]> getPDBResNumRanges(int fromSeqPos, int toSeqPos)
   {
-    List<int[]> result = new ArrayList<int[]>();
+    List<int[]> result = new ArrayList<>();
     int startRes = -1;
     int endRes = -1;
 
@@ -263,4 +264,105 @@ public class StructureMapping
   {
     return seqToPdbMapping;
   }
+
+  /**
+   * A hash function that satisfies the contract that if two mappings are
+   * equal(), they have the same hashCode
+   */
+  @Override
+  public int hashCode()
+  {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result
+            + ((mappingDetails == null) ? 0 : mappingDetails.hashCode());
+    result = prime * result
+            + ((pdbchain == null) ? 0 : pdbchain.hashCode());
+    result = prime * result + ((pdbfile == null) ? 0 : pdbfile.hashCode());
+    result = prime * result + ((pdbid == null) ? 0 : pdbid.hashCode());
+    result = prime * result
+            + ((seqToPdbMapping == null) ? 0 : seqToPdbMapping.hashCode());
+    result = prime * result
+            + ((sequence == null) ? 0 : sequence.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj)
+  {
+    if (this == obj)
+    {
+      return true;
+    }
+    if (obj == null)
+    {
+      return false;
+    }
+    if (getClass() != obj.getClass())
+    {
+      return false;
+    }
+    StructureMapping other = (StructureMapping) obj;
+    if (mappingDetails == null)
+    {
+      if (other.mappingDetails != null)
+      {
+        return false;
+      }
+    }
+    else if (!mappingDetails.equals(other.mappingDetails))
+    {
+      return false;
+    }
+    if (pdbchain == null)
+    {
+      if (other.pdbchain != null)
+      {
+        return false;
+      }
+    }
+    else if (!pdbchain.equals(other.pdbchain))
+    {
+      return false;
+    }
+    if (pdbfile == null)
+    {
+      if (other.pdbfile != null)
+      {
+        return false;
+      }
+    }
+    else if (!pdbfile.equals(other.pdbfile))
+    {
+      return false;
+    }
+    if (pdbid == null)
+    {
+      if (other.pdbid != null)
+      {
+        return false;
+      }
+    }
+    else if (!pdbid.equals(other.pdbid))
+    {
+      return false;
+    }
+    if (seqToPdbMapping == null)
+    {
+      if (other.seqToPdbMapping != null)
+      {
+        return false;
+      }
+    }
+    else if (!seqToPdbMapping.equals(other.seqToPdbMapping))
+    {
+      return false;
+    }
+    if (sequence != other.sequence)
+    {
+      return false;
+    }
+
+    return true;
+  }
 }
index 10fe836..cd986c0 100644 (file)
@@ -285,7 +285,8 @@ public class StructureSelectionManager
   }
 
   /**
-   * Returns the file name for a mapped PDB id (or null if not mapped).
+   * Returns the filename the PDB id is already mapped to if known, or null if
+   * it is not mapped
    * 
    * @param pdbid
    * @return
@@ -294,7 +295,7 @@ public class StructureSelectionManager
   {
     for (StructureMapping sm : mappings)
     {
-      if (sm.getPdbId().equals(pdbid))
+      if (sm.getPdbId().equalsIgnoreCase(pdbid))
       {
         return sm.pdbfile;
       }
@@ -397,8 +398,11 @@ public class StructureSelectionManager
     {
       // FIXME if sourceType is not null, we've lost data here
       sourceType = AppletFormatAdapter.checkProtocol(pdbFile);
-      pdb = new JmolParser(pdbFile, sourceType);
-
+      pdb = new JmolParser(false, pdbFile, sourceType);
+      pdb.addSettings(parseSecStr && processSecondaryStructure,
+              parseSecStr && addTempFacAnnot,
+              parseSecStr && secStructServices);
+      pdb.doParse();
       if (pdb.getId() != null && pdb.getId().trim().length() > 0
               && DataSourceType.FILE == sourceType)
       {
@@ -572,6 +576,13 @@ public class StructureSelectionManager
             {
               System.err.println(e.getMessage());
             }
+            catch (Exception e)
+            {
+              System.err
+                      .println(
+                              "Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair");
+              System.err.println(e.getMessage());
+            }
           }
           if (!foundSiftsMappings.isEmpty())
           {
@@ -605,7 +616,10 @@ public class StructureSelectionManager
       }
       if (forStructureView)
       {
-        mappings.addAll(seqToStrucMapping);
+        for (StructureMapping sm : seqToStrucMapping)
+        {
+          addStructureMapping(sm); // not addAll!
+        }
       }
       if (progress != null)
       {
@@ -657,7 +671,10 @@ public class StructureSelectionManager
 
   public void addStructureMapping(StructureMapping sm)
   {
-    mappings.add(sm);
+    if (!mappings.contains(sm))
+    {
+      mappings.add(sm);
+    }
   }
 
   /**
index c944345..9f28ee1 100644 (file)
@@ -116,8 +116,17 @@ public class MapList
   {
     int hashCode = 31 * fromRatio;
     hashCode = 31 * hashCode + toRatio;
-    hashCode = 31 * hashCode + fromShifts.toArray().hashCode();
-    hashCode = 31 * hashCode + toShifts.toArray().hashCode();
+    for (int[] shift : fromShifts)
+    {
+      hashCode = 31 * hashCode + shift[0];
+      hashCode = 31 * hashCode + shift[1];
+    }
+    for (int[] shift : toShifts)
+    {
+      hashCode = 31 * hashCode + shift[0];
+      hashCode = 31 * hashCode + shift[1];
+    }
+
     return hashCode;
   }
 
@@ -318,6 +327,13 @@ public class MapList
     fromHighest = Integer.MIN_VALUE;
     for (int[] range : fromRange)
     {
+      if (range.length != 2)
+      {
+        // throw new IllegalArgumentException(range);
+        System.err.println(
+                "Invalid format for fromRange " + Arrays.toString(range)
+                + " may cause errors");
+      }
       fromLowest = Math.min(fromLowest, Math.min(range[0], range[1]));
       fromHighest = Math.max(fromHighest, Math.max(range[0], range[1]));
     }
@@ -326,6 +342,13 @@ public class MapList
     toHighest = Integer.MIN_VALUE;
     for (int[] range : toRange)
     {
+      if (range.length != 2)
+      {
+        // throw new IllegalArgumentException(range);
+        System.err.println("Invalid format for toRange "
+                + Arrays.toString(range)
+                + " may cause errors");
+      }
       toLowest = Math.min(toLowest, Math.min(range[0], range[1]));
       toHighest = Math.max(toHighest, Math.max(range[0], range[1]));
     }
@@ -1194,11 +1217,20 @@ public class MapList
     for (int[] range : getToRanges())
     {
       int[] transferred = map.locateInTo(range[0], range[1]);
-      if (transferred == null)
+      if (transferred == null || transferred.length % 2 != 0)
       {
         return null;
       }
-      toRanges.add(transferred);
+
+      /*
+       *  convert [start1, end1, start2, end2, ...] 
+       *  to [[start1, end1], [start2, end2], ...]
+       */
+      for (int i = 0; i < transferred.length;)
+      {
+        toRanges.add(new int[] { transferred[i], transferred[i + 1] });
+        i += 2;
+      }
     }
 
     return new MapList(getFromRanges(), toRanges, outFromRatio, outToRatio);
index 1677eca..061e70c 100644 (file)
@@ -28,15 +28,12 @@ import jalview.datamodel.DBRefSource;
 import jalview.datamodel.Mapping;
 import jalview.datamodel.SequenceI;
 import jalview.gui.CutAndPasteTransfer;
-import jalview.gui.DasSourceBrowser;
 import jalview.gui.Desktop;
 import jalview.gui.FeatureSettings;
 import jalview.gui.IProgressIndicator;
 import jalview.gui.OOMWarning;
 import jalview.util.DBRefUtils;
 import jalview.util.MessageManager;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-import jalview.ws.dbsources.das.datamodel.DasSequenceSource;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
 import java.util.ArrayList;
@@ -119,7 +116,7 @@ public class DBRefFetcher implements Runnable
           DbSourceProxy[] sources, FeatureSettings featureSettings,
           boolean isNucleotide)
   {
-    listeners = new ArrayList<FetchFinishedListenerI>();
+    listeners = new ArrayList<>();
     this.progressWindow = progressIndicatorFrame;
     alseqs = new SequenceI[seqs.length];
     SequenceI[] ds = new SequenceI[seqs.length];
@@ -165,23 +162,7 @@ public class DBRefFetcher implements Runnable
   {
     // af.featureSettings_actionPerformed(null);
     String[] defdb = null;
-    List<DbSourceProxy> selsources = new ArrayList<DbSourceProxy>();
-    Vector<jalviewSourceI> dasselsrc = (featureSettings != null)
-            ? featureSettings.getSelectedSources()
-            : new DasSourceBrowser().getSelectedSources();
-
-    for (jalviewSourceI src : dasselsrc)
-    {
-      List<DbSourceProxy> sp = src.getSequenceSourceProxies();
-      if (sp != null)
-      {
-        selsources.addAll(sp);
-        if (sp.size() > 1)
-        {
-          Cache.log.debug("Added many Db Sources for :" + src.getTitle());
-        }
-      }
-    }
+    List<DbSourceProxy> selsources = new ArrayList<>();
     // select appropriate databases based on alignFrame context.
     if (forNucleotide)
     {
@@ -191,7 +172,7 @@ public class DBRefFetcher implements Runnable
     {
       defdb = DBRefSource.PROTEINDBS;
     }
-    List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
+    List<DbSourceProxy> srces = new ArrayList<>();
     for (String ddb : defdb)
     {
       List<DbSourceProxy> srcesfordb = sfetcher.getSourceProxy(ddb);
@@ -235,30 +216,6 @@ public class DBRefFetcher implements Runnable
   }
 
   /**
-   * retrieve all the das sequence sources and add them to the list of db
-   * sources to retrieve from
-   */
-  public void appendAllDasSources()
-  {
-    if (dbSources == null)
-    {
-      dbSources = new DbSourceProxy[0];
-    }
-    // append additional sources
-    DbSourceProxy[] otherdb = sfetcher
-            .getDbSourceProxyInstances(DasSequenceSource.class);
-    if (otherdb != null && otherdb.length > 0)
-    {
-      DbSourceProxy[] newsrc = new DbSourceProxy[dbSources.length
-              + otherdb.length];
-      System.arraycopy(dbSources, 0, newsrc, 0, dbSources.length);
-      System.arraycopy(otherdb, 0, newsrc, dbSources.length,
-              otherdb.length);
-      dbSources = newsrc;
-    }
-  }
-
-  /**
    * start the fetcher thread
    * 
    * @param waitTillFinished
@@ -311,14 +268,14 @@ public class DBRefFetcher implements Runnable
       }
       else if (seqs == null)
       {
-        seqs = new Vector<SequenceI>();
+        seqs = new Vector<>();
         seqs.addElement(seq);
       }
 
     }
     else
     {
-      seqs = new Vector<SequenceI>();
+      seqs = new Vector<>();
       seqs.addElement(seq);
     }
 
@@ -357,9 +314,9 @@ public class DBRefFetcher implements Runnable
       e.printStackTrace();
     }
 
-    Vector<SequenceI> sdataset = new Vector<SequenceI>(
+    Vector<SequenceI> sdataset = new Vector<>(
             Arrays.asList(dataset));
-    List<String> warningMessages = new ArrayList<String>();
+    List<String> warningMessages = new ArrayList<>();
 
     int db = 0;
     while (sdataset.size() > 0 && db < dbSources.length)
@@ -371,8 +328,8 @@ public class DBRefFetcher implements Runnable
       SequenceI[] currSeqs = new SequenceI[sdataset.size()];
       sdataset.copyInto(currSeqs);// seqs that are to be validated against
       // dbSources[db]
-      Vector<String> queries = new Vector<String>(); // generated queries curSeq
-      seqRefs = new Hashtable<String, Vector<SequenceI>>();
+      Vector<String> queries = new Vector<>(); // generated queries curSeq
+      seqRefs = new Hashtable<>();
 
       int seqIndex = 0;
 
@@ -574,7 +531,7 @@ public class DBRefFetcher implements Runnable
     {
       // Work out which sequences this sequence matches,
       // taking into account all accessionIds and names in the file
-      Vector<SequenceI> sequenceMatches = new Vector<SequenceI>();
+      Vector<SequenceI> sequenceMatches = new Vector<>();
       // look for corresponding accession ids
       DBRefEntry[] entryRefs = DBRefUtils
               .selectRefs(retrievedSeq.getDBRefs(), new String[]
@@ -826,7 +783,7 @@ public class DBRefFetcher implements Runnable
    */
   private SequenceI[] recoverDbSequences(SequenceI[] sequencesArray)
   {
-    Vector<SequenceI> nseq = new Vector<SequenceI>();
+    Vector<SequenceI> nseq = new Vector<>();
     for (int i = 0; sequencesArray != null
             && i < sequencesArray.length; i++)
     {
diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java
deleted file mode 100644 (file)
index c661e2c..0000000
+++ /dev/null
@@ -1,925 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws;
-
-import jalview.bin.Cache;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceI;
-import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
-import jalview.gui.FeatureSettings;
-import jalview.gui.JvOptionPane;
-import jalview.util.DBRefUtils;
-import jalview.util.MessageManager;
-import jalview.util.UrlLink;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.biodas.jdas.client.FeaturesClient;
-import org.biodas.jdas.client.adapters.features.DasGFFAdapter;
-import org.biodas.jdas.client.adapters.features.DasGFFAdapter.GFFAdapter;
-import org.biodas.jdas.client.threads.FeaturesClientMultipleSources;
-import org.biodas.jdas.schema.features.ERRORSEGMENT;
-import org.biodas.jdas.schema.features.FEATURE;
-import org.biodas.jdas.schema.features.LINK;
-import org.biodas.jdas.schema.features.SEGMENT;
-import org.biodas.jdas.schema.features.TYPE;
-import org.biodas.jdas.schema.features.UNKNOWNFEATURE;
-import org.biodas.jdas.schema.features.UNKNOWNSEGMENT;
-import org.biodas.jdas.schema.sources.COORDINATES;
-
-/**
- * DOCUMENT ME!
- * 
- * @author $author$
- * @version $Revision$
- */
-public class DasSequenceFeatureFetcher
-{
-  SequenceI[] sequences;
-
-  AlignFrame af;
-
-  FeatureSettings fsettings;
-
-  StringBuffer sbuffer = new StringBuffer();
-
-  List<jalviewSourceI> selectedSources;
-
-  boolean cancelled = false;
-
-  private void debug(String mesg)
-  {
-    debug(mesg, null);
-  }
-
-  private void debug(String mesg, Exception e)
-  {
-    if (Cache.log != null)
-    {
-      Cache.log.debug(mesg, e);
-    }
-    else
-    {
-      System.err.println(mesg);
-      if (e != null)
-      {
-        e.printStackTrace();
-      }
-    }
-  }
-
-  long startTime;
-
-  private DasSourceRegistryI sourceRegistry;
-
-  private boolean useJDASMultiThread = true;
-
-  /**
-   * Creates a new SequenceFeatureFetcher object. Uses default
-   * 
-   * @param align
-   *          DOCUMENT ME!
-   * @param ap
-   *          DOCUMENT ME!
-   */
-  public DasSequenceFeatureFetcher(SequenceI[] sequences,
-          FeatureSettings fsettings, Vector selectedSources)
-  {
-    this(sequences, fsettings, selectedSources, true, true, true);
-  }
-
-  public DasSequenceFeatureFetcher(SequenceI[] oursequences,
-          FeatureSettings fsettings, List<jalviewSourceI> selectedSources2,
-          boolean checkDbrefs, boolean promptFetchDbrefs)
-  {
-    this(oursequences, fsettings, selectedSources2, checkDbrefs,
-            promptFetchDbrefs, true);
-  }
-
-  public DasSequenceFeatureFetcher(SequenceI[] oursequences,
-          FeatureSettings fsettings, List<jalviewSourceI> selectedSources2,
-          boolean checkDbrefs, boolean promptFetchDbrefs,
-          boolean useJDasMultiThread)
-  {
-    this.useJDASMultiThread = useJDasMultiThread;
-    this.selectedSources = new ArrayList<>();
-    // filter both sequences and sources to eliminate duplicates
-    for (jalviewSourceI src : selectedSources2)
-    {
-      if (!selectedSources.contains(src))
-      {
-        selectedSources.add(src);
-      }
-      ;
-    }
-    Vector sqs = new Vector();
-    for (int i = 0; i < oursequences.length; i++)
-    {
-      if (!sqs.contains(oursequences[i]))
-      {
-        sqs.addElement(oursequences[i]);
-      }
-    }
-    sequences = new SequenceI[sqs.size()];
-    for (int i = 0; i < sequences.length; i++)
-    {
-      sequences[i] = (SequenceI) sqs.elementAt(i);
-    }
-    if (fsettings != null)
-    {
-      this.fsettings = fsettings;
-      this.af = fsettings.af;
-      af.setShowSeqFeatures(true);
-    }
-    int uniprotCount = 0;
-    for (jalviewSourceI source : selectedSources)
-    {
-      for (COORDINATES coords : source.getVersion().getCOORDINATES())
-      {
-        // TODO: match UniProt coord system canonically (?) - does
-        // UniProt==uniprot==UNIPROT ?
-        if (coords.getAuthority().toLowerCase().equals("uniprot"))
-        {
-          uniprotCount++;
-          break;
-        }
-      }
-    }
-
-    int refCount = 0;
-    for (int i = 0; i < sequences.length; i++)
-    {
-      DBRefEntry[] dbref = sequences[i].getDBRefs();
-      if (dbref != null)
-      {
-        for (int j = 0; j < dbref.length; j++)
-        {
-          if (dbref[j].getSource().equals(DBRefSource.UNIPROT))
-          {
-            refCount++;
-            break;
-          }
-        }
-      }
-    }
-
-    if (checkDbrefs && refCount < sequences.length && uniprotCount > 0)
-    {
-
-      int reply = JvOptionPane.YES_OPTION;
-      if (promptFetchDbrefs)
-      {
-        reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
-                MessageManager.getString(
-                        "info.you_want_jalview_to_find_uniprot_accessions"),
-                MessageManager
-                        .getString("label.find_uniprot_accession_ids"),
-                JvOptionPane.YES_NO_OPTION, JvOptionPane.QUESTION_MESSAGE);
-      }
-
-      if (reply == JvOptionPane.YES_OPTION)
-      {
-        Thread thread = new Thread(new FetchDBRefs());
-        thread.start();
-      }
-      else
-      {
-        _startFetching();
-      }
-    }
-    else
-    {
-      _startFetching();
-    }
-
-  }
-
-  private void _startFetching()
-  {
-    running = true;
-    new Thread(new FetchSeqFeatures()).start();
-  }
-
-  class FetchSeqFeatures implements Runnable
-  {
-    @Override
-    public void run()
-    {
-      startFetching();
-      setGuiFetchComplete();
-    }
-  }
-
-  class FetchDBRefs implements Runnable
-  {
-    @Override
-    public void run()
-    {
-      running = true;
-      boolean isNucleotide = af.getViewport().getAlignment().isNucleotide();
-      new DBRefFetcher(sequences, af, null, af.featureSettings,
-              isNucleotide).fetchDBRefs(true);
-
-      startFetching();
-      setGuiFetchComplete();
-    }
-  }
-
-  /**
-   * Spawns Fetcher threads to add features to sequences in the dataset
-   */
-  void startFetching()
-  {
-    running = true;
-    cancelled = false;
-    startTime = System.currentTimeMillis();
-    if (af != null)
-    {
-      af.setProgressBar(MessageManager.getString(
-              "status.fetching_das_sequence_features"), startTime);
-    }
-    if (sourceRegistry == null)
-    {
-      sourceRegistry = Cache.getDasSourceRegistry();
-    }
-    if (selectedSources == null || selectedSources.size() == 0)
-    {
-      try
-      {
-        jalviewSourceI[] sources = sourceRegistry.getSources()
-                .toArray(new jalviewSourceI[0]);
-        String active = Cache.getDefault("DAS_ACTIVE_SOURCE", "uniprot");
-        StringTokenizer st = new StringTokenizer(active, "\t");
-        selectedSources = new Vector();
-        String token;
-        while (st.hasMoreTokens())
-        {
-          token = st.nextToken();
-          for (int i = 0; i < sources.length; i++)
-          {
-            if (sources[i].getTitle().equals(token))
-            {
-              selectedSources.add(sources[i]);
-              break;
-            }
-          }
-        }
-      } catch (Exception ex)
-      {
-        debug("Exception whilst setting default feature sources from registry and local preferences.",
-                ex);
-      }
-    }
-
-    if (selectedSources == null || selectedSources.size() == 0)
-    {
-      System.out.println("No DAS Sources active");
-      cancelled = true;
-      setGuiNoDassourceActive();
-      return;
-    }
-
-    sourcesRemaining = selectedSources.size();
-    FeaturesClientMultipleSources fc = new FeaturesClientMultipleSources();
-    fc.setConnProps(sourceRegistry.getSessionHandler());
-    // Now sending requests one at a time to each server
-    ArrayList<jalviewSourceI> srcobj = new ArrayList<>();
-    ArrayList<String> src = new ArrayList<>();
-    List<List<String>> ids = new ArrayList<>();
-    List<List<DBRefEntry>> idobj = new ArrayList<>();
-    List<Map<String, SequenceI>> sqset = new ArrayList<>();
-    for (jalviewSourceI _sr : selectedSources)
-    {
-
-      Map<String, SequenceI> slist = new HashMap<>();
-      List<DBRefEntry> idob = new ArrayList<>();
-      List<String> qset = new ArrayList<>();
-
-      for (SequenceI seq : sequences)
-      {
-        Object[] idset = nextSequence(_sr, seq);
-        if (idset != null)
-        {
-          List<DBRefEntry> _idob = (List<DBRefEntry>) idset[0];
-          List<String> _qset = (List<String>) idset[1];
-          if (_idob.size() > 0)
-          {
-            // add sequence's ref for each id derived from it
-            // (space inefficient, but most unambiguous)
-            // could replace with hash with _qset values as keys.
-            Iterator<DBRefEntry> dbobj = _idob.iterator();
-            for (String q : _qset)
-            {
-              SequenceI osq = slist.get(q);
-              DBRefEntry dr = dbobj.next();
-              if (osq != null && osq != seq)
-              {
-                // skip - non-canonical query
-              }
-              else
-              {
-                idob.add(dr);
-                qset.add(q);
-                slist.put(q, seq);
-              }
-            }
-          }
-        }
-      }
-      if (idob.size() > 0)
-      {
-        srcobj.add(_sr);
-        src.add(_sr.getSourceURL());
-        ids.add(qset);
-        idobj.add(idob);
-        sqset.add(slist);
-      }
-    }
-    Map<String, Map<List<String>, Exception>> errors = new HashMap<>();
-    Map<String, Map<List<String>, DasGFFAdapter>> results = new HashMap<>();
-    if (!useJDASMultiThread)
-    {
-      Iterator<String> sources = src.iterator();
-      // iterate over each query for each source and do each one individually
-      for (List<String> idl : ids)
-      {
-        String source = sources.next();
-        FeaturesClient featuresc = new FeaturesClient(
-                sourceRegistry.getSessionHandler()
-                        .getConnectionPropertyProviderFor(source));
-        for (String id : idl)
-        {
-          List<String> qid = Arrays.asList(new String[] { id });
-          try
-          {
-            DasGFFAdapter dga = featuresc.fetchData(source, qid);
-            Map<List<String>, DasGFFAdapter> ers = results.get(source);
-            if (ers == null)
-            {
-              results.put(source,
-                      ers = new HashMap<>());
-            }
-            ers.put(qid, dga);
-          } catch (Exception ex)
-          {
-            Map<List<String>, Exception> ers = errors.get(source);
-            if (ers == null)
-            {
-              errors.put(source,
-                      ers = new HashMap<>());
-            }
-            ers.put(qid, ex);
-          }
-        }
-      }
-    }
-    else
-    {
-      // pass them all at once
-      fc.fetchData(src, ids, false, results, errors);
-      fc.shutDown();
-      while (!fc.isTerminated())
-      {
-        try
-        {
-          Thread.sleep(200);
-        } catch (InterruptedException x)
-        {
-
-        }
-      }
-    }
-    Iterator<List<String>> idset = ids.iterator();
-    Iterator<List<DBRefEntry>> idobjset = idobj.iterator();
-    Iterator<Map<String, SequenceI>> seqset = sqset.iterator();
-    for (jalviewSourceI source : srcobj)
-    {
-      processResponse(seqset.next(), source, idset.next(), idobjset.next(),
-              results.get(source.getSourceURL()),
-              errors.get(source.getSourceURL()));
-    }
-  }
-
-  private void processResponse(Map<String, SequenceI> sequencemap,
-          jalviewSourceI jvsource, List<String> ids, List<DBRefEntry> idobj,
-          Map<List<String>, DasGFFAdapter> results,
-          Map<List<String>, Exception> errors)
-  {
-    Set<SequenceI> sequences = new HashSet<>();
-    String source = jvsource.getSourceURL();
-    // process features
-    DasGFFAdapter result = (results == null) ? null : results.get(ids);
-    Exception error = (errors == null) ? null : errors.get(ids);
-    if (result == null)
-    {
-      debug("das source " + source + " could not be contacted. "
-              + (error == null ? "" : error.toString()));
-    }
-    else
-    {
-
-      GFFAdapter gff = result.getGFF();
-      List<SEGMENT> segments = gff.getSegments();
-      List<ERRORSEGMENT> errorsegs = gff.getErrorSegments();
-      List<UNKNOWNFEATURE> unkfeats = gff.getUnknownFeatures();
-      List<UNKNOWNSEGMENT> unksegs = gff.getUnknownSegments();
-      debug("das source " + source + " returned " + gff.getTotal()
-              + " responses. " + (errorsegs != null ? errorsegs.size() : 0)
-              + " were incorrect segment queries, "
-              + (unkfeats != null ? unkfeats.size() : 0)
-              + " were unknown features "
-              + (unksegs != null ? unksegs.size() : 0)
-              + " were unknown segments and "
-              + (segments != null ? segments.size() : 0)
-              + " were segment responses.");
-      Iterator<DBRefEntry> dbr = idobj.iterator();
-      if (segments != null)
-      {
-        for (SEGMENT seg : segments)
-        {
-          String id = seg.getId();
-          if (ids.indexOf(id) == -1)
-          {
-            id = id.toUpperCase();
-          }
-          DBRefEntry dbref = idobj.get(ids.indexOf(id));
-          SequenceI sequence = sequencemap.get(id);
-          boolean added = false;
-          sequences.add(sequence);
-
-          for (FEATURE feat : seg.getFEATURE())
-          {
-            // standard DAS feature-> jalview sequence feature transformation
-            SequenceFeature f = newSequenceFeature(feat,
-                    jvsource.getTitle());
-            if (!parseSeqFeature(sequence, f, feat, jvsource))
-            {
-              if (dbref.getMap() != null && f.getBegin() > 0
-                      && f.getEnd() > 0)
-              {
-                debug("mapping from " + f.getBegin() + " - " + f.getEnd());
-                SequenceFeature vf[] = null;
-
-                try
-                {
-                  vf = dbref.getMap().locateFeature(f);
-                } catch (Exception ex)
-                {
-                  Cache.log.warn(
-                          "Error in 'experimental' mapping of features. Please try to reproduce and then report info to jalview-discuss@jalview.org.");
-                  Cache.log.warn("Mapping feature from " + f.getBegin()
-                          + " to " + f.getEnd() + " in dbref "
-                          + dbref.getAccessionId() + " in "
-                          + dbref.getSource());
-                  Cache.log.warn("using das Source " + source);
-                  Cache.log.warn("Exception", ex);
-                }
-
-                if (vf != null)
-                {
-                  for (int v = 0; v < vf.length; v++)
-                  {
-                    debug("mapping to " + v + ": " + vf[v].getBegin()
-                            + " - " + vf[v].getEnd());
-                    sequence.addSequenceFeature(vf[v]);
-                  }
-                }
-              }
-              else
-              {
-                sequence.addSequenceFeature(f);
-              }
-            }
-          }
-        }
-        featuresAdded(sequences);
-      }
-      else
-      {
-        // System.out.println("No features found for " + seq.getName()
-        // + " from: " + e.getDasSource().getNickname());
-      }
-    }
-  }
-
-  private void setGuiNoDassourceActive()
-  {
-
-    if (af != null)
-    {
-      af.setProgressBar(
-              MessageManager.getString("status.no_das_sources_active"),
-              startTime);
-    }
-    if (getFeatSettings() != null)
-    {
-      fsettings.noDasSourceActive();
-    }
-  }
-
-  /**
-   * Update our fsettings dialog reference if we didn't have one when we were
-   * first initialised.
-   * 
-   * @return fsettings
-   */
-  private FeatureSettings getFeatSettings()
-  {
-    if (fsettings == null)
-    {
-      if (af != null)
-      {
-        fsettings = af.featureSettings;
-      }
-    }
-    return fsettings;
-  }
-
-  public void cancel()
-  {
-    if (af != null)
-    {
-      af.setProgressBar(MessageManager.getString(
-              "status.das_feature_fetching_cancelled"), startTime);
-    }
-    cancelled = true;
-  }
-
-  int sourcesRemaining = 0;
-
-  private boolean running = false;
-
-  private void setGuiFetchComplete()
-  {
-    running = false;
-    if (!cancelled && af != null)
-    {
-      // only update the progress bar if we've completed the fetch normally
-      af.setProgressBar(MessageManager.getString(
-              "status.das_feature_fetching_complete"), startTime);
-    }
-
-    if (af != null && af.featureSettings != null)
-    {
-      af.featureSettings.discoverAllFeatureData();
-    }
-
-    if (getFeatSettings() != null)
-    {
-      fsettings.complete();
-    }
-  }
-
-  void featuresAdded(Set<SequenceI> seqs)
-  {
-    if (af == null)
-    {
-      // no gui to update with features.
-      return;
-    }
-    af.getFeatureRenderer().featuresAdded();
-
-    int start = af.getViewport().getRanges().getStartSeq();
-    int end = af.getViewport().getRanges().getEndSeq();
-    int index;
-    for (index = start; index < end; index++)
-    {
-      for (SequenceI seq : seqs)
-      {
-        if (seq == af.getViewport().getAlignment().getSequenceAt(index)
-                .getDatasetSequence())
-        {
-          af.alignPanel.paintAlignment(true, true);
-          index = end;
-          break;
-        }
-      }
-    }
-  }
-
-  Object[] nextSequence(jalviewSourceI dasSource, SequenceI seq)
-  {
-    if (cancelled)
-    {
-      return null;
-    }
-    DBRefEntry[] uprefs = DBRefUtils.selectRefs(seq.getDBRefs(),
-            new String[]
-            {
-                // jalview.datamodel.DBRefSource.PDB,
-                DBRefSource.UNIPROT,
-            // jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord
-            // sys sources
-            });
-    // TODO: minimal list of DAS queries to make by querying with untyped ID if
-    // distinct from any typed IDs
-
-    List<DBRefEntry> ids = new ArrayList<>();
-    List<String> qstring = new ArrayList<>();
-    boolean dasCoordSysFound = false;
-
-    if (uprefs != null)
-    {
-      // do any of these ids match the source's coordinate system ?
-      for (int j = 0; !dasCoordSysFound && j < uprefs.length; j++)
-      {
-
-        for (COORDINATES csys : dasSource.getVersion().getCOORDINATES())
-        {
-          if (DBRefUtils.isDasCoordinateSystem(csys.getAuthority(),
-                  uprefs[j]))
-          {
-            debug("Launched fetcher for coordinate system "
-                    + csys.getAuthority());
-            // Will have to pass any mapping information to the fetcher
-            // - the start/end for the DBRefEntry may not be the same as the
-            // sequence's start/end
-
-            System.out.println(
-                    seq.getName() + " " + (seq.getDatasetSequence() == null)
-                            + " " + csys.getUri());
-
-            dasCoordSysFound = true; // break's out of the loop
-            ids.add(uprefs[j]);
-            qstring.add(uprefs[j].getAccessionId());
-          }
-          else
-          {
-            System.out.println("IGNORE " + csys.getAuthority());
-          }
-        }
-      }
-    }
-
-    if (!dasCoordSysFound)
-    {
-      String id = null;
-      // try and use the name as the sequence id
-      if (seq.getName().indexOf("|") > -1)
-      {
-        id = seq.getName().substring(seq.getName().lastIndexOf("|") + 1);
-        if (id.trim().length() < 4)
-        {
-          // hack - we regard a significant ID as being at least 4
-          // non-whitespace characters
-          id = seq.getName().substring(0, seq.getName().lastIndexOf("|"));
-          if (id.indexOf("|") > -1)
-          {
-            id = id.substring(id.lastIndexOf("|") + 1);
-          }
-        }
-      }
-      else
-      {
-        id = seq.getName();
-      }
-      if (id != null)
-      {
-        DBRefEntry dbre = new DBRefEntry();
-        dbre.setAccessionId(id);
-        // Should try to call a general feature fetcher that
-        // queries many sources with name to discover applicable ID references
-        ids.add(dbre);
-        qstring.add(dbre.getAccessionId());
-      }
-    }
-
-    return new Object[] { ids, qstring };
-  }
-
-  /**
-   * examine the given sequence feature to determine if it should actually be
-   * turned into sequence annotation or database cross references rather than a
-   * simple sequence feature.
-   * 
-   * @param seq
-   *          the sequence to annotate
-   * @param f
-   *          the jalview sequence feature generated from the DAS feature
-   * @param map
-   *          the sequence feature attributes
-   * @param source
-   *          the source that emitted the feature
-   * @return true if feature was consumed as another kind of annotation.
-   */
-  protected boolean parseSeqFeature(SequenceI seq, SequenceFeature f,
-          FEATURE feature, jalviewSourceI source)
-  {
-    SequenceI mseq = seq;
-    while (seq.getDatasetSequence() != null)
-    {
-      seq = seq.getDatasetSequence();
-    }
-    if (f.getType() != null)
-    {
-      String type = f.getType();
-      if (type.equalsIgnoreCase("protein_name"))
-      {
-        // parse name onto the alignment sequence or the dataset sequence.
-        if (seq.getDescription() == null
-                || seq.getDescription().trim().length() == 0)
-        {
-          // could look at the note series to pick out the first long name, for
-          // the moment just use the whole description string
-          seq.setDescription(f.getDescription());
-        }
-        if (mseq.getDescription() == null
-                || mseq.getDescription().trim().length() == 0)
-        {
-          // could look at the note series to pick out the first long name, for
-          // the moment just use the whole description string
-          mseq.setDescription(f.getDescription());
-        }
-        return true;
-      }
-      // check if source has biosapiens or other sequence ontology label
-      if (type.equalsIgnoreCase("DBXREF") || type.equalsIgnoreCase("DBREF"))
-      {
-        // try to parse the accession out
-
-        DBRefEntry dbr = new DBRefEntry();
-        dbr.setVersion(source.getTitle());
-        StringTokenizer st = new StringTokenizer(f.getDescription(), ":");
-        if (st.hasMoreTokens())
-        {
-          dbr.setSource(st.nextToken());
-        }
-        if (st.hasMoreTokens())
-        {
-          dbr.setAccessionId(st.nextToken());
-        }
-        seq.addDBRef(dbr);
-
-        if (f.links != null && f.links.size() > 0)
-        {
-          // feature is also appended to enable links to be seen.
-          // TODO: consider extending dbrefs to have their own links ?
-          // TODO: new feature: extract dbref links from DAS servers and add the
-          // URL pattern to the list of DB name associated links in the user's
-          // preferences ?
-          // for the moment - just fix up the existing feature so it displays
-          // correctly.
-          // f.setType(dbr.getSource());
-          // f.setDescription();
-          f.setValue("linkonly", Boolean.TRUE);
-          // f.setDescription("");
-          Vector newlinks = new Vector();
-          Enumeration it = f.links.elements();
-          while (it.hasMoreElements())
-          {
-            String elm;
-            UrlLink urllink = new UrlLink(elm = (String) it.nextElement());
-            if (urllink.isValid())
-            {
-              urllink.setLabel(f.getDescription());
-              newlinks.addElement(urllink.toString());
-            }
-            else
-            {
-              // couldn't parse the link properly. Keep it anyway - just in
-              // case.
-              debug("couldn't parse link string - " + elm);
-              newlinks.addElement(elm);
-            }
-          }
-          f.links = newlinks;
-          seq.addSequenceFeature(f);
-        }
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * creates a jalview sequence feature from a das feature document
-   * 
-   * @param feat
-   * @return sequence feature object created using dasfeature information
-   */
-  SequenceFeature newSequenceFeature(FEATURE feat, String nickname)
-  {
-    if (feat == null)
-    {
-      return null;
-    }
-    try
-    {
-      /**
-       * Different qNames for a DAS Feature - are string keys to the HashMaps in
-       * features "METHOD") || qName.equals("TYPE") || qName.equals("START") ||
-       * qName.equals("END") || qName.equals("NOTE") || qName.equals("LINK") ||
-       * qName.equals("SCORE")
-       */
-      String desc = new String();
-      if (feat.getNOTE() != null)
-      {
-        for (String note : feat.getNOTE())
-        {
-          desc += note;
-        }
-      }
-
-      int start = 0, end = 0;
-      float score = 0f;
-
-      try
-      {
-        start = Integer.parseInt(feat.getSTART().toString());
-      } catch (Exception ex)
-      {
-      }
-      try
-      {
-        end = Integer.parseInt(feat.getEND().toString());
-      } catch (Exception ex)
-      {
-      }
-      try
-      {
-        Object scr = feat.getSCORE();
-        if (scr != null)
-        {
-          score = (float) Double.parseDouble(scr.toString());
-
-        }
-      } catch (Exception ex)
-      {
-      }
-
-      SequenceFeature f = new SequenceFeature(getTypeString(feat.getTYPE()),
-              desc, start, end, score, nickname);
-
-      if (feat.getLINK() != null)
-      {
-        for (LINK link : feat.getLINK())
-        {
-          // Do not put feature extent in link text for non-positional features
-          if (f.begin == 0 && f.end == 0)
-          {
-            f.addLink(f.getType() + " " + link.getContent() + "|"
-                    + link.getHref());
-          }
-          else
-          {
-            f.addLink(f.getType() + " " + f.begin + "_" + f.end + " "
-                    + link.getContent() + "|" + link.getHref());
-          }
-        }
-      }
-
-      return f;
-    } catch (Exception e)
-    {
-      System.out.println("ERRR " + e);
-      e.printStackTrace();
-      System.out.println("############");
-      debug("Failed to parse " + feat.toString(), e);
-      return null;
-    }
-  }
-
-  private String getTypeString(TYPE type)
-  {
-    return type.getContent();
-  }
-
-  public boolean isRunning()
-  {
-    return running;
-  }
-
-}
index a0b77de..29d4ec7 100644 (file)
@@ -29,12 +29,10 @@ import jalview.ws.dbsources.PfamFull;
 import jalview.ws.dbsources.PfamSeed;
 import jalview.ws.dbsources.RfamSeed;
 import jalview.ws.dbsources.Uniprot;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
 import jalview.ws.seqfetcher.ASequenceFetcher;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
 import java.util.ArrayList;
-import java.util.List;
 
 /**
  * This implements the run-time discovery of sequence database clients.
@@ -50,11 +48,6 @@ public class SequenceFetcher extends ASequenceFetcher
    */
   public SequenceFetcher()
   {
-    this(true);
-  }
-
-  public SequenceFetcher(boolean addDas)
-  {
     addDBRefSourceImpl(EnsemblGene.class);
     addDBRefSourceImpl(EnsemblGenomes.class);
     addDBRefSourceImpl(EmblSource.class);
@@ -64,26 +57,19 @@ public class SequenceFetcher extends ASequenceFetcher
     addDBRefSourceImpl(PfamFull.class);
     addDBRefSourceImpl(PfamSeed.class);
     addDBRefSourceImpl(RfamSeed.class);
-
-    if (addDas)
-    {
-      registerDasSequenceSources();
-    }
   }
 
   /**
-   * return an ordered list of database sources where non-das database classes
-   * appear before das database classes
+   * return an ordered list of database sources excluding alignment only databases
    */
   public String[] getOrderedSupportedSources()
   {
     String[] srcs = this.getSupportedDb();
-    ArrayList<String> dassrc = new ArrayList<String>(),
-            nondas = new ArrayList<String>();
+    ArrayList<String> src = new ArrayList<>();
+
     for (int i = 0; i < srcs.length; i++)
     {
-      boolean das = false, skip = false;
-      String nm;
+      boolean skip = false;
       for (DbSourceProxy dbs : getSourceProxy(srcs[i]))
       {
         // Skip the alignment databases for the moment - they're not useful for
@@ -92,86 +78,28 @@ public class SequenceFetcher extends ASequenceFetcher
         {
           skip = true;
         }
-        else
-        {
-          nm = dbs.getDbName();
-          if (getSourceProxy(
-                  srcs[i]) instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
-          {
-            if (nm.startsWith("das:"))
-            {
-              nm = nm.substring(4);
-              das = true;
-            }
-            break;
-          }
-        }
       }
       if (skip)
       {
         continue;
       }
-      if (das)
       {
-        dassrc.add(srcs[i]);
-      }
-      else
-      {
-        nondas.add(srcs[i]);
+        src.add(srcs[i]);
       }
     }
-    String[] tosort = nondas.toArray(new String[0]),
-            sorted = nondas.toArray(new String[0]);
+    String[] tosort = src.toArray(new String[0]),
+            sorted = src.toArray(new String[0]);
     for (int j = 0, jSize = sorted.length; j < jSize; j++)
     {
       tosort[j] = tosort[j].toLowerCase();
     }
     jalview.util.QuickSort.sort(tosort, sorted);
     // construct array with all sources listed
-
-    srcs = new String[sorted.length + dassrc.size()];
     int i = 0;
     for (int j = sorted.length - 1; j >= 0; j--, i++)
     {
       srcs[i] = sorted[j];
-      sorted[j] = null;
-    }
-
-    sorted = dassrc.toArray(new String[0]);
-    tosort = dassrc.toArray(new String[0]);
-    for (int j = 0, jSize = sorted.length; j < jSize; j++)
-    {
-      tosort[j] = tosort[j].toLowerCase();
-    }
-    jalview.util.QuickSort.sort(tosort, sorted);
-    for (int j = sorted.length - 1; j >= 0; j--, i++)
-    {
-      srcs[i] = sorted[j];
     }
     return srcs;
   }
-
-  /**
-   * query the currently defined DAS source registry for sequence sources and
-   * add a DasSequenceSource instance for each source to the SequenceFetcher
-   * source list.
-   */
-  public void registerDasSequenceSources()
-  {
-    // TODO: define a context as a registry provider (either desktop,
-    // jalview.bin.cache, or something else).
-    for (jalviewSourceI source : jalview.bin.Cache.getDasSourceRegistry()
-            .getSources())
-    {
-      if (source.isSequenceSource())
-      {
-        List<DbSourceProxy> dassources = source.getSequenceSourceProxies();
-        for (DbSourceProxy seqsrc : dassources)
-        {
-          addDbRefSourceImpl(seqsrc);
-        }
-      }
-    }
-  }
-
 }
index ca90d60..e114ea9 100644 (file)
  */
 package jalview.ws.dbsources;
 
+import jalview.analysis.SequenceIdMatcher;
+import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.FeatureProperties;
+import jalview.datamodel.Mapping;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
-import jalview.datamodel.xdb.embl.EmblEntry;
-import jalview.datamodel.xdb.embl.EmblFile;
+import jalview.util.DBRefUtils;
+import jalview.util.DnaUtils;
+import jalview.util.MapList;
+import jalview.util.MappingUtils;
 import jalview.util.MessageManager;
 import jalview.ws.ebi.EBIFetchClient;
+import jalview.xml.binding.embl.EntryType;
+import jalview.xml.binding.embl.EntryType.Feature;
+import jalview.xml.binding.embl.EntryType.Feature.Qualifier;
+import jalview.xml.binding.embl.XrefType;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 public abstract class EmblXmlSource extends EbiFileRetrievedProxy
 {
@@ -39,22 +68,24 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
    */
   private static final String EMBL_NOT_FOUND_REPLY = "ERROR 12 No entries found.";
 
+  private static final Pattern SPACE_PATTERN = Pattern.compile(" ");
+
   public EmblXmlSource()
   {
     super();
   }
 
   /**
-   * retrieve and parse an emblxml file
+   * Retrieves and parses an emblxml file, and returns an alignment containing
+   * the parsed sequences, or null if none were found
    * 
    * @param emprefx
-   *          either EMBL or EMBLCDS strings are allowed - anything else will
-   *          not retrieve emblxml
+   *          "EMBL" or "EMBLCDS" - anything else will not retrieve emblxml
    * @param query
    * @return
    * @throws Exception
    */
-  public AlignmentI getEmblSequenceRecords(String emprefx, String query)
+  protected AlignmentI getEmblSequenceRecords(String emprefx, String query)
           throws Exception
   {
     startQuery();
@@ -87,18 +118,17 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
    * @return
    * @throws Exception
    */
-  public AlignmentI getEmblSequenceRecords(String emprefx, String query,
+  protected AlignmentI getEmblSequenceRecords(String emprefx, String query,
           File reply) throws Exception
   {
-    EmblFile efile = null;
-    List<SequenceI> seqs = new ArrayList<>();
-
+    List<EntryType> entries = null;
     if (reply != null && reply.exists())
     {
       file = reply.getAbsolutePath();
       if (reply.length() > EMBL_NOT_FOUND_REPLY.length())
       {
-        efile = EmblFile.getEmblFile(reply);
+        InputStream is = new FileInputStream(reply);
+        entries = getEmblEntries(is);
       }
     }
 
@@ -107,33 +137,664 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
      * EmbFile reads something like (e.g.) this ungrammatical phrase
      * Entry: <acc> display type is either not supported or entry is not found.
      */
+    AlignmentI al = null;
+    List<SequenceI> seqs = new ArrayList<>();
     List<SequenceI> peptides = new ArrayList<>();
-    if (efile != null && efile.getEntries() != null)
+    if (entries != null)
     {
-      for (EmblEntry entry : efile.getEntries())
+      for (EntryType entry : entries)
       {
-        SequenceI seq = entry.getSequence(emprefx, peptides);
+        SequenceI seq = getSequence(emprefx, entry, peptides);
         if (seq != null)
         {
           seqs.add(seq.deriveSequence());
           // place DBReferences on dataset and refer
         }
       }
+      if (!seqs.isEmpty())
+      {
+        al = new Alignment(seqs.toArray(new SequenceI[seqs.size()]));
+      }
+      else
+      {
+        System.out.println(
+                "No record found for '" + emprefx + ":" + query + "'");
+      }
     }
 
-    AlignmentI al = null;
-    if (!seqs.isEmpty())
-    {
-      al = new Alignment(seqs.toArray(new SequenceI[seqs.size()]));
-    }
     stopQuery();
     return al;
   }
 
+  /**
+   * Reads the XML reply from file and unmarshals it to Java objects. Answers a
+   * (possibly empty) list of <code>EntryType</code> objects.
+   * 
+   * is
+   * 
+   * @return
+   */
+  List<EntryType> getEmblEntries(InputStream is)
+  {
+    List<EntryType> entries = new ArrayList<>();
+    try
+    {
+      JAXBContext jc = JAXBContext.newInstance("jalview.xml.binding.embl");
+      XMLStreamReader streamReader = XMLInputFactory.newInstance()
+              .createXMLStreamReader(is);
+      javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+      jalview.xml.binding.embl.ROOT root = (jalview.xml.binding.embl.ROOT) um
+              .unmarshal(streamReader);
+
+      /*
+       * document root contains either "entry" or "entrySet"
+       */
+      if (root == null)
+      {
+        return entries;
+      }
+      if (root.getEntrySet() != null)
+      {
+        entries = root.getEntrySet().getEntry();
+      }
+      else if (root.getEntry() != null)
+      {
+        entries.add(root.getEntry());
+      }
+    } catch (JAXBException | XMLStreamException
+            | FactoryConfigurationError e)
+    {
+      e.printStackTrace();
+    }
+    return entries;
+  }
+
+  /**
+   * A helper method to parse XML data and construct a sequence, with any
+   * available database references and features
+   * 
+   * @param emprefx
+   * @param entry
+   * @param peptides
+   * @return
+   */
+  SequenceI getSequence(String sourceDb, EntryType entry,
+          List<SequenceI> peptides)
+  {
+    String seqString = entry.getSequence();
+    if (seqString == null)
+    {
+      return null;
+    }
+    seqString = seqString.replace(" ", "").replace("\n", "").replace("\t",
+            "");
+    String accession = entry.getAccession();
+    SequenceI dna = new Sequence(sourceDb + "|" + accession, seqString);
+
+    dna.setDescription(entry.getDescription());
+    String sequenceVersion = String.valueOf(entry.getVersion().intValue());
+    DBRefEntry selfRref = new DBRefEntry(sourceDb, sequenceVersion,
+            accession);
+    dna.addDBRef(selfRref);
+    selfRref.setMap(
+            new Mapping(null, new int[]
+            { 1, dna.getLength() }, new int[] { 1, dna.getLength() }, 1,
+                    1));
+
+    /*
+     * add db references
+     */
+    List<XrefType> xrefs = entry.getXref();
+    if (xrefs != null)
+    {
+      for (XrefType xref : xrefs)
+      {
+        String acc = xref.getId();
+        String source = DBRefUtils.getCanonicalName(xref.getDb());
+        String version = xref.getSecondaryId();
+        if (version == null || "".equals(version))
+        {
+          version = "0";
+        }
+        dna.addDBRef(new DBRefEntry(source, version, acc));
+      }
+    }
+
+    SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
+    try
+    {
+      List<Feature> features = entry.getFeature();
+      if (features != null)
+      {
+        for (Feature feature : features)
+        {
+          if (FeatureProperties.isCodingFeature(sourceDb,
+                  feature.getName()))
+          {
+            parseCodingFeature(entry, feature, sourceDb, dna, peptides,
+                    matcher);
+          }
+        }
+      }
+    } catch (Exception e)
+    {
+      System.err.println("EMBL Record Features parsing error!");
+      System.err
+              .println("Please report the following to help@jalview.org :");
+      System.err.println("EMBL Record " + accession);
+      System.err.println("Resulted in exception: " + e.getMessage());
+      e.printStackTrace(System.err);
+    }
+
+    return dna;
+  }
+
+  /**
+   * Extracts coding region and product from a CDS feature and decorates it with
+   * annotations
+   * 
+   * @param entry
+   * @param feature
+   * @param sourceDb
+   * @param dna
+   * @param peptides
+   * @param matcher
+   */
+  void parseCodingFeature(EntryType entry, Feature feature, String sourceDb,
+          SequenceI dna, List<SequenceI> peptides,
+          SequenceIdMatcher matcher)
+  {
+    final boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
+    final String accession = entry.getAccession();
+    final String sequenceVersion = entry.getVersion().toString();
+
+    int[] exons = getCdsRanges(entry.getAccession(), feature);
+
+    String translation = null;
+    String proteinName = "";
+    String proteinId = null;
+    Map<String, String> vals = new Hashtable<>();
+
+    /*
+     * codon_start 1/2/3 in EMBL corresponds to phase 0/1/2 in CDS
+     * (phase is required for CDS features in GFF3 format)
+     */
+    int codonStart = 1;
+
+    /*
+     * parse qualifiers, saving protein translation, protein id,
+     * codon start position, product (name), and 'other values'
+     */
+    if (feature.getQualifier() != null)
+    {
+      for (Qualifier q : feature.getQualifier())
+      {
+        String qname = q.getName();
+        String value = q.getValue();
+        value = value == null ? ""
+                : value.trim().replace(" ", "").replace("\n", "")
+                        .replace("\t", "");
+        if (qname.equals("translation"))
+        {
+          translation = value;
+        }
+        else if (qname.equals("protein_id"))
+        {
+          proteinId = value;
+        }
+        else if (qname.equals("codon_start"))
+        {
+          try
+          {
+            codonStart = Integer.parseInt(value.trim());
+          } catch (NumberFormatException e)
+          {
+            System.err.println("Invalid codon_start in XML for "
+                    + entry.getAccession() + ": " + e.getMessage());
+          }
+        }
+        else if (qname.equals("product"))
+        {
+          // sometimes name is returned e.g. for V00488
+          proteinName = value;
+        }
+        else
+        {
+          // throw anything else into the additional properties hash
+          if (!"".equals(value))
+          {
+            vals.put(qname, value);
+          }
+        }
+      }
+    }
+
+    DBRefEntry proteinToEmblProteinRef = null;
+    exons = MappingUtils.removeStartPositions(codonStart - 1, exons);
+
+    SequenceI product = null;
+    Mapping dnaToProteinMapping = null;
+    if (translation != null && proteinName != null && proteinId != null)
+    {
+      int translationLength = translation.length();
+
+      /*
+       * look for product in peptides list, if not found, add it
+       */
+      product = matcher.findIdMatch(proteinId);
+      if (product == null)
+      {
+        product = new Sequence(proteinId, translation, 1,
+                translationLength);
+        product.setDescription(((proteinName.length() == 0)
+                ? "Protein Product from " + sourceDb
+                : proteinName));
+        peptides.add(product);
+        matcher.add(product);
+      }
+
+      // we have everything - create the mapping and perhaps the protein
+      // sequence
+      if (exons == null || exons.length == 0)
+      {
+        /*
+         * workaround until we handle dna location for CDS sequence
+         * e.g. location="X53828.1:60..1058" correctly
+         */
+        System.err.println(
+                "Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect ("
+                        + sourceDb + ":" + entry.getAccession() + ")");
+        int dnaLength = dna.getLength();
+        if (translationLength * 3 == (1 - codonStart + dnaLength))
+        {
+          System.err.println(
+                  "Not allowing for additional stop codon at end of cDNA fragment... !");
+          // this might occur for CDS sequences where no features are marked
+          exons = new int[] { dna.getStart() + (codonStart - 1),
+              dna.getEnd() };
+          dnaToProteinMapping = new Mapping(product, exons,
+                  new int[]
+                  { 1, translationLength }, 3, 1);
+        }
+        if ((translationLength + 1) * 3 == (1 - codonStart + dnaLength))
+        {
+          System.err.println(
+                  "Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!");
+          exons = new int[] { dna.getStart() + (codonStart - 1),
+              dna.getEnd() - 3 };
+          dnaToProteinMapping = new Mapping(product, exons,
+                  new int[]
+                  { 1, translationLength }, 3, 1);
+        }
+      }
+      else
+      {
+        // Trim the exon mapping if necessary - the given product may only be a
+        // fragment of a larger protein. (EMBL:AY043181 is an example)
+
+        if (isEmblCdna)
+        {
+          // TODO: Add a DbRef back to the parent EMBL sequence with the exon
+          // map
+          // if given a dataset reference, search dataset for parent EMBL
+          // sequence if it exists and set its map
+          // make a new feature annotating the coding contig
+        }
+        else
+        {
+          // final product length truncation check
+          int[] cdsRanges = adjustForProteinLength(translationLength,
+                  exons);
+          dnaToProteinMapping = new Mapping(product, cdsRanges,
+                  new int[]
+                  { 1, translationLength }, 3, 1);
+          if (product != null)
+          {
+            /*
+             * make xref with mapping from protein to EMBL dna
+             */
+            DBRefEntry proteinToEmblRef = new DBRefEntry(DBRefSource.EMBL,
+                    sequenceVersion, proteinId,
+                    new Mapping(dnaToProteinMapping.getMap().getInverse()));
+            product.addDBRef(proteinToEmblRef);
+
+            /*
+             * make xref from protein to EMBLCDS; we assume here that the 
+             * CDS sequence version is same as dna sequence (?!)
+             */
+            MapList proteinToCdsMapList = new MapList(
+                    new int[]
+                    { 1, translationLength },
+                    new int[]
+                    { 1 + (codonStart - 1),
+                        (codonStart - 1) + 3 * translationLength },
+                    1, 3);
+            DBRefEntry proteinToEmblCdsRef = new DBRefEntry(
+                    DBRefSource.EMBLCDS, sequenceVersion, proteinId,
+                    new Mapping(proteinToCdsMapList));
+            product.addDBRef(proteinToEmblCdsRef);
+
+            /*
+             * make 'direct' xref from protein to EMBLCDSPROTEIN
+             */
+            proteinToEmblProteinRef = new DBRefEntry(proteinToEmblCdsRef);
+            proteinToEmblProteinRef.setSource(DBRefSource.EMBLCDSProduct);
+            proteinToEmblProteinRef.setMap(null);
+            product.addDBRef(proteinToEmblProteinRef);
+          }
+        }
+      }
+
+      /*
+       * add cds features to dna sequence
+       */
+      String cds = feature.getName(); // "CDS"
+      for (int xint = 0; exons != null
+              && xint < exons.length - 1; xint += 2)
+      {
+        int exonStart = exons[xint];
+        int exonEnd = exons[xint + 1];
+        int begin = Math.min(exonStart, exonEnd);
+        int end = Math.max(exonStart, exonEnd);
+        int exonNumber = xint / 2 + 1;
+        String desc = String.format("Exon %d for protein '%s' EMBLCDS:%s",
+                exonNumber, proteinName, proteinId);
+
+        SequenceFeature sf = makeCdsFeature(cds, desc, begin, end, sourceDb,
+                vals);
+
+        sf.setEnaLocation(feature.getLocation());
+        boolean forwardStrand = exonStart <= exonEnd;
+        sf.setStrand(forwardStrand ? "+" : "-");
+        sf.setPhase(String.valueOf(codonStart - 1));
+        sf.setValue(FeatureProperties.EXONPOS, exonNumber);
+        sf.setValue(FeatureProperties.EXONPRODUCT, proteinName);
+
+        dna.addSequenceFeature(sf);
+      }
+    }
+
+    /*
+     * add feature dbRefs to sequence, and mappings for Uniprot xrefs
+     */
+    boolean hasUniprotDbref = false;
+    List<XrefType> xrefs = feature.getXref();
+    if (xrefs != null)
+    {
+      boolean mappingUsed = false;
+      for (XrefType xref : xrefs)
+      {
+        /*
+         * ensure UniProtKB/Swiss-Prot converted to UNIPROT
+         */
+        String source = DBRefUtils.getCanonicalName(xref.getDb());
+        String version = xref.getSecondaryId();
+        if (version == null || "".equals(version))
+        {
+          version = "0";
+        }
+        DBRefEntry dbref = new DBRefEntry(source, version, xref.getId());
+        DBRefEntry proteinDbRef = new DBRefEntry(source, version,
+                dbref.getAccessionId());
+        if (source.equals(DBRefSource.UNIPROT))
+        {
+          String proteinSeqName = DBRefSource.UNIPROT + "|"
+                  + dbref.getAccessionId();
+          if (dnaToProteinMapping != null
+                  && dnaToProteinMapping.getTo() != null)
+          {
+            if (mappingUsed)
+            {
+              /*
+               * two or more Uniprot xrefs for the same CDS - 
+               * each needs a distinct Mapping (as to a different sequence)
+               */
+              dnaToProteinMapping = new Mapping(dnaToProteinMapping);
+            }
+            mappingUsed = true;
+
+            /*
+             * try to locate the protein mapped to (possibly by a 
+             * previous CDS feature); if not found, construct it from
+             * the EMBL translation
+             */
+            SequenceI proteinSeq = matcher.findIdMatch(proteinSeqName);
+            if (proteinSeq == null)
+            {
+              proteinSeq = new Sequence(proteinSeqName,
+                      product.getSequenceAsString());
+              matcher.add(proteinSeq);
+              peptides.add(proteinSeq);
+            }
+            dnaToProteinMapping.setTo(proteinSeq);
+            dnaToProteinMapping.setMappedFromId(proteinId);
+            proteinSeq.addDBRef(proteinDbRef);
+            dbref.setMap(dnaToProteinMapping);
+          }
+          hasUniprotDbref = true;
+        }
+        if (product != null)
+        {
+          /*
+           * copy feature dbref to our protein product
+           */
+          DBRefEntry pref = proteinDbRef;
+          pref.setMap(null); // reference is direct
+          product.addDBRef(pref);
+          // Add converse mapping reference
+          if (dnaToProteinMapping != null)
+          {
+            Mapping pmap = new Mapping(dna,
+                    dnaToProteinMapping.getMap().getInverse());
+            pref = new DBRefEntry(sourceDb, sequenceVersion, accession);
+            pref.setMap(pmap);
+            if (dnaToProteinMapping.getTo() != null)
+            {
+              dnaToProteinMapping.getTo().addDBRef(pref);
+            }
+          }
+        }
+        dna.addDBRef(dbref);
+      }
+    }
+
+    /*
+     * if we have a product (translation) but no explicit Uniprot dbref
+     * (example: EMBL AAFI02000057 protein_id EAL65544.1)
+     * then construct mappings to an assumed EMBLCDSPROTEIN accession
+     */
+    if (!hasUniprotDbref && product != null)
+    {
+      if (proteinToEmblProteinRef == null)
+      {
+        // assuming CDSPROTEIN sequence version = dna version (?!)
+        proteinToEmblProteinRef = new DBRefEntry(DBRefSource.EMBLCDSProduct,
+                sequenceVersion, proteinId);
+      }
+      product.addDBRef(proteinToEmblProteinRef);
+
+      if (dnaToProteinMapping != null
+              && dnaToProteinMapping.getTo() != null)
+      {
+        DBRefEntry dnaToEmblProteinRef = new DBRefEntry(
+                DBRefSource.EMBLCDSProduct, sequenceVersion,
+                proteinId);
+        dnaToEmblProteinRef.setMap(dnaToProteinMapping);
+        dnaToProteinMapping.setMappedFromId(proteinId);
+        dna.addDBRef(dnaToEmblProteinRef);
+      }
+    }
+  }
+
   @Override
   public boolean isDnaCoding()
   {
     return true;
   }
 
+  /**
+   * Returns the CDS positions as a single array of [start, end, start, end...]
+   * positions. If on the reverse strand, these will be in descending order.
+   * 
+   * @param accession
+   * @param feature
+   * @return
+   */
+  protected int[] getCdsRanges(String accession, Feature feature)
+  {
+    String location = feature.getLocation();
+    if (location == null)
+    {
+      return new int[] {};
+    }
+  
+    try
+    {
+      List<int[]> ranges = DnaUtils.parseLocation(location);
+      return listToArray(ranges);
+    } catch (ParseException e)
+    {
+      Cache.log.warn(
+              String.format("Not parsing inexact CDS location %s in ENA %s",
+                      location, accession));
+      return new int[] {};
+    }
+  }
+
+  /**
+   * Converts a list of [start, end] ranges to a single array of [start, end,
+   * start, end ...]
+   * 
+   * @param ranges
+   * @return
+   */
+  int[] listToArray(List<int[]> ranges)
+  {
+    int[] result = new int[ranges.size() * 2];
+    int i = 0;
+    for (int[] range : ranges)
+    {
+      result[i++] = range[0];
+      result[i++] = range[1];
+    }
+    return result;
+  }
+
+  /**
+   * Helper method to construct a SequenceFeature for one cds range
+   * 
+   * @param type
+   *          feature type ("CDS")
+   * @param desc
+   *          description
+   * @param begin
+   *          start position
+   * @param end
+   *          end position
+   * @param group
+   *          feature group
+   * @param vals
+   *          map of 'miscellaneous values' for feature
+   * @return
+   */
+  protected SequenceFeature makeCdsFeature(String type, String desc,
+          int begin, int end, String group, Map<String, String> vals)
+  {
+    SequenceFeature sf = new SequenceFeature(type, desc, begin, end, group);
+    if (!vals.isEmpty())
+    {
+      StringBuilder sb = new StringBuilder();
+      boolean first = true;
+      for (Entry<String, String> val : vals.entrySet())
+      {
+        if (!first)
+        {
+          sb.append(";");
+        }
+        sb.append(val.getKey()).append("=").append(val.getValue());
+        first = false;
+        sf.setValue(val.getKey(), val.getValue());
+      }
+      sf.setAttributes(sb.toString());
+    }
+    return sf;
+  }
+
+  /**
+   * Truncates (if necessary) the exon intervals to match 3 times the length of
+   * the protein; also accepts 3 bases longer (for stop codon not included in
+   * protein)
+   * 
+   * @param proteinLength
+   * @param exon
+   *          an array of [start, end, start, end...] intervals
+   * @return the same array (if unchanged) or a truncated copy
+   */
+  static int[] adjustForProteinLength(int proteinLength, int[] exon)
+  {
+    if (proteinLength <= 0 || exon == null)
+    {
+      return exon;
+    }
+    int expectedCdsLength = proteinLength * 3;
+    int exonLength = MappingUtils.getLength(Arrays.asList(exon));
+  
+    /*
+     * if exon length matches protein, or is shorter, or longer by the 
+     * length of a stop codon (3 bases), then leave it unchanged
+     */
+    if (expectedCdsLength >= exonLength
+            || expectedCdsLength == exonLength - 3)
+    {
+      return exon;
+    }
+  
+    int origxon[];
+    int sxpos = -1;
+    int endxon = 0;
+    origxon = new int[exon.length];
+    System.arraycopy(exon, 0, origxon, 0, exon.length);
+    int cdspos = 0;
+    for (int x = 0; x < exon.length; x += 2)
+    {
+      cdspos += Math.abs(exon[x + 1] - exon[x]) + 1;
+      if (expectedCdsLength <= cdspos)
+      {
+        // advanced beyond last codon.
+        sxpos = x;
+        if (expectedCdsLength != cdspos)
+        {
+          // System.err
+          // .println("Truncating final exon interval on region by "
+          // + (cdspos - cdslength));
+        }
+  
+        /*
+         * shrink the final exon - reduce end position if forward
+         * strand, increase it if reverse
+         */
+        if (exon[x + 1] >= exon[x])
+        {
+          endxon = exon[x + 1] - cdspos + expectedCdsLength;
+        }
+        else
+        {
+          endxon = exon[x + 1] + cdspos - expectedCdsLength;
+        }
+        break;
+      }
+    }
+  
+    if (sxpos != -1)
+    {
+      // and trim the exon interval set if necessary
+      int[] nxon = new int[sxpos + 2];
+      System.arraycopy(exon, 0, nxon, 0, sxpos + 2);
+      nxon[sxpos + 1] = endxon; // update the end boundary for the new exon
+                                // set
+      exon = nxon;
+    }
+    return exon;
+  }
+
 }
index 6b09eb6..86282c7 100644 (file)
@@ -29,25 +29,37 @@ import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
-import jalview.datamodel.xdb.uniprot.UniprotEntry;
-import jalview.datamodel.xdb.uniprot.UniprotFeature;
-import jalview.datamodel.xdb.uniprot.UniprotFile;
+import jalview.schemes.ResidueProperties;
+import jalview.util.StringUtils;
 import jalview.ws.seqfetcher.DbSourceProxyImpl;
+import jalview.xml.binding.uniprot.DbReferenceType;
+import jalview.xml.binding.uniprot.Entry;
+import jalview.xml.binding.uniprot.FeatureType;
+import jalview.xml.binding.uniprot.LocationType;
+import jalview.xml.binding.uniprot.PositionType;
+import jalview.xml.binding.uniprot.PropertyType;
 
 import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 
-import org.exolab.castor.mapping.Mapping;
-import org.exolab.castor.xml.Unmarshaller;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 import com.stevesoft.pat.Regex;
 
 /**
+ * This class queries the Uniprot database for sequence data, unmarshals the
+ * returned XML, and converts it to Jalview Sequence records (including attached
+ * database references and sequence features)
+ * 
  * @author JimP
  * 
  */
@@ -57,11 +69,6 @@ public class Uniprot extends DbSourceProxyImpl
 
   private static final String BAR_DELIMITER = "|";
 
-  /*
-   * Castor mapping loaded from uniprot_mapping.xml
-   */
-  private static Mapping map;
-
   /**
    * Constructor
    */
@@ -119,43 +126,6 @@ public class Uniprot extends DbSourceProxyImpl
     return "0"; // we really don't know what version we're on.
   }
 
-  /**
-   * Reads a file containing the reply to the EBI Fetch Uniprot data query,
-   * unmarshals it to a UniprotFile object, and returns the list of UniprotEntry
-   * data models (mapped from &lt;entry&gt; elements)
-   * 
-   * @param fileReader
-   * @return
-   */
-  public Vector<UniprotEntry> getUniprotEntries(Reader fileReader)
-  {
-    UniprotFile uni = new UniprotFile();
-    try
-    {
-      if (map == null)
-      {
-        // 1. Load the mapping information from the file
-        map = new Mapping(uni.getClass().getClassLoader());
-        URL url = getClass().getResource("/uniprot_mapping.xml");
-        map.loadMapping(url);
-      }
-
-      // 2. Unmarshal the data
-      Unmarshaller unmar = new Unmarshaller(uni);
-      unmar.setIgnoreExtraElements(true);
-      unmar.setMapping(map);
-      if (fileReader != null)
-      {
-        uni = (UniprotFile) unmar.unmarshal(fileReader);
-      }
-    } catch (Exception e)
-    {
-      System.out.println("Error getUniprotEntries() " + e);
-    }
-
-    return uni.getUniprotEntries();
-  }
-
   /*
    * (non-Javadoc)
    * 
@@ -173,25 +143,21 @@ public class Uniprot extends DbSourceProxyImpl
 
       String downloadstring = getDomain() + "/uniprot/" + queries
               + ".xml";
-      URL url = null;
-      URLConnection urlconn = null;
 
-      url = new URL(downloadstring);
-      urlconn = url.openConnection();
+      URL url = new URL(downloadstring);
+      URLConnection urlconn = url.openConnection();
       InputStream istr = urlconn.getInputStream();
-      Vector<UniprotEntry> entries = getUniprotEntries(
-              new InputStreamReader(istr, "UTF-8"));
-
+      List<Entry> entries = getUniprotEntries(istr);
       if (entries != null)
       {
-        ArrayList<SequenceI> seqs = new ArrayList<>();
-        for (UniprotEntry entry : entries)
+        List<SequenceI> seqs = new ArrayList<>();
+        for (Entry entry : entries)
         {
-          seqs.add(uniprotEntryToSequenceI(entry));
+          seqs.add(uniprotEntryToSequence(entry));
         }
-        al = new Alignment(seqs.toArray(new SequenceI[0]));
-
+        al = new Alignment(seqs.toArray(new SequenceI[seqs.size()]));
       }
+
       stopQuery();
       return al;
     } catch (Exception e)
@@ -204,83 +170,124 @@ public class Uniprot extends DbSourceProxyImpl
   }
 
   /**
+   * Converts an Entry object (bound from Uniprot XML) to a Jalview Sequence
    * 
    * @param entry
-   *          UniprotEntry
-   * @return SequenceI instance created from the UniprotEntry instance
+   * @return
    */
-  public SequenceI uniprotEntryToSequenceI(UniprotEntry entry)
+  SequenceI uniprotEntryToSequence(Entry entry)
   {
     String id = getUniprotEntryId(entry);
+    String seqString = entry.getSequence().getValue();
+
+    /*
+     * for backwards compatibility with Castor processing,
+     * remove any internal spaces
+     */
+    if (seqString.indexOf(' ') > -1)
+    {
+      seqString = seqString.replace(" ", "");
+    }
     SequenceI sequence = new Sequence(id,
-            entry.getUniprotSequence().getContent());
+            seqString);
     sequence.setDescription(getUniprotEntryDescription(entry));
 
+    /*
+     * add a 'self' DBRefEntry for each accession
+     */
     final String dbVersion = getDbVersion();
-    ArrayList<DBRefEntry> dbRefs = new ArrayList<>();
+    List<DBRefEntry> dbRefs = new ArrayList<>();
     for (String accessionId : entry.getAccession())
     {
       DBRefEntry dbRef = new DBRefEntry(DBRefSource.UNIPROT, dbVersion,
               accessionId);
-
-      // mark dbRef as a primary reference for this sequence
       dbRefs.add(dbRef);
     }
 
-    Vector<PDBEntry> onlyPdbEntries = new Vector<>();
-    for (PDBEntry pdb : entry.getDbReference())
+    /*
+     * add a DBRefEntry for each dbReference element in the XML;
+     * also add a PDBEntry if type="PDB";
+     * also add an EMBLCDS dbref if protein sequence id is given
+     * also add an Ensembl dbref " " " " " "
+     */
+    Vector<PDBEntry> pdbRefs = new Vector<>();
+    for (DbReferenceType dbref : entry.getDbReference())
     {
-      DBRefEntry dbr = new DBRefEntry();
-      dbr.setSource(pdb.getType());
-      dbr.setAccessionId(pdb.getId());
-      dbr.setVersion(DBRefSource.UNIPROT + ":" + dbVersion);
+      String type = dbref.getType();
+      DBRefEntry dbr = new DBRefEntry(type,
+              DBRefSource.UNIPROT + ":" + dbVersion, dbref.getId());
       dbRefs.add(dbr);
-      if ("PDB".equals(pdb.getType()))
+      if ("PDB".equals(type))
       {
-        onlyPdbEntries.addElement(pdb);
+        pdbRefs.add(new PDBEntry(dbr));
       }
-      if ("EMBL".equals(pdb.getType()))
+      if ("EMBL".equals(type))
       {
-        // look for a CDS reference and add it, too.
-        String cdsId = (String) pdb.getProperty("protein sequence ID");
+        /*
+         * e.g. Uniprot accession Q9BXM7 has
+         * <dbReference type="EMBL" id="M19359">
+         *   <property type="protein sequence ID" value="AAA40981.1"/>
+         *   <property type="molecule type" value="Genomic_DNA"/>
+         * </dbReference> 
+         */
+        String cdsId = getProperty(dbref.getProperty(),
+                "protein sequence ID");
         if (cdsId != null && cdsId.trim().length() > 0)
         {
           // remove version
           String[] vrs = cdsId.split("\\.");
-          dbr = new DBRefEntry(DBRefSource.EMBLCDS, vrs.length > 1 ? vrs[1]
-                  : DBRefSource.UNIPROT + ":" + dbVersion, vrs[0]);
+          String version = vrs.length > 1 ? vrs[1]
+                  : DBRefSource.UNIPROT + ":" + dbVersion;
+          dbr = new DBRefEntry(DBRefSource.EMBLCDS, version, vrs[0]);
           dbRefs.add(dbr);
         }
       }
-      if ("Ensembl".equals(pdb.getType()))
+      if ("Ensembl".equals(type))
       {
-        /*UniprotXML
+        /*
+         * e.g. Uniprot accession Q9BXM7 has
          * <dbReference type="Ensembl" id="ENST00000321556">
-        * <molecule id="Q9BXM7-1"/>
-        * <property type="protein sequence ID" value="ENSP00000364204"/>
-        * <property type="gene ID" value="ENSG00000158828"/>
-        * </dbReference> 
+         *   <molecule id="Q9BXM7-1"/>
+         *   <property type="protein sequence ID" value="ENSP00000364204"/>
+         *   <property type="gene ID" value="ENSG00000158828"/>
+         * </dbReference> 
          */
-        String cdsId = (String) pdb.getProperty("protein sequence ID");
+        String cdsId = getProperty(dbref.getProperty(),
+                "protein sequence ID");
         if (cdsId != null && cdsId.trim().length() > 0)
         {
           dbr = new DBRefEntry(DBRefSource.ENSEMBL,
                   DBRefSource.UNIPROT + ":" + dbVersion, cdsId.trim());
           dbRefs.add(dbr);
-
         }
       }
     }
 
-    sequence.setPDBId(onlyPdbEntries);
+    /*
+     * create features; they have either begin and end, or position, in XML
+     */
+    sequence.setPDBId(pdbRefs);
     if (entry.getFeature() != null)
     {
-      for (UniprotFeature uf : entry.getFeature())
+      for (FeatureType uf : entry.getFeature())
       {
-        SequenceFeature copy = new SequenceFeature(uf.getType(),
-                uf.getDescription(), uf.getBegin(), uf.getEnd(), "Uniprot");
-        copy.setStatus(uf.getStatus());
-        sequence.addSequenceFeature(copy);
+        LocationType location = uf.getLocation();
+        int start = 0;
+        int end = 0;
+        if (location.getPosition() != null)
+        {
+          start = location.getPosition().getPosition().intValue();
+          end = start;
+        }
+        else
+        {
+          start = location.getBegin().getPosition().intValue();
+          end = location.getEnd().getPosition().intValue();
+        }
+        SequenceFeature sf = new SequenceFeature(uf.getType(),
+                getDescription(uf), start, end, "Uniprot");
+        sf.setStatus(uf.getStatus());
+        sequence.addSequenceFeature(sf);
       }
     }
     for (DBRefEntry dbr : dbRefs)
@@ -291,37 +298,148 @@ public class Uniprot extends DbSourceProxyImpl
   }
 
   /**
+   * A helper method that builds a sequence feature description
    * 
-   * @param entry
-   *          UniportEntry
-   * @return protein name(s) delimited by a white space character
+   * @param feature
+   * @return
    */
-  public static String getUniprotEntryDescription(UniprotEntry entry)
+  static String getDescription(FeatureType feature)
   {
-    StringBuilder desc = new StringBuilder(32);
-    if (entry.getProtein() != null && entry.getProtein().getName() != null)
+    String orig = feature.getOriginal();
+    List<String> variants = feature.getVariation();
+    StringBuilder sb = new StringBuilder();
+
+    /*
+     * append variant in standard format if present
+     * e.g. p.Arg59Lys
+     * multiple variants are split over lines using <br>
+     */
+    boolean asHtml = false;
+    if (orig != null && !orig.isEmpty() && variants != null
+            && !variants.isEmpty())
     {
-      boolean first = true;
-      for (String nm : entry.getProtein().getName())
+      int p = 0;
+      for (String var : variants)
       {
-        if (!first)
+        // TODO proper HGVS nomenclature for delins structural variations
+        // http://varnomen.hgvs.org/recommendations/protein/variant/delins/
+        // for now we are pragmatic - any orig/variant sequence longer than
+        // three characters is shown with single-character notation rather than
+        // three-letter notation
+        sb.append("p.");
+        if (orig.length() < 4)
+        {
+          for (int c = 0, clen = orig.length(); c < clen; c++)
+          {
+            char origchar = orig.charAt(c);
+            String orig3 = ResidueProperties.aa2Triplet.get("" + origchar);
+            sb.append(orig3 == null ? origchar
+                    : StringUtils.toSentenceCase(orig3));
+          }
+        }
+        else
         {
-          desc.append(" ");
+          sb.append(orig);
+        }
+
+        LocationType location = feature.getLocation();
+        PositionType start = location.getPosition() == null
+                ? location.getBegin()
+                : location.getPosition();
+        sb.append(Integer.toString(start.getPosition().intValue()));
+
+        if (var.length() < 4)
+        {
+          for (int c = 0, clen = var.length(); c < clen; c++)
+          {
+            char varchar = var.charAt(c);
+            String var3 = ResidueProperties.aa2Triplet.get("" + varchar);
+
+            sb.append(var3 != null ? StringUtils.toSentenceCase(var3)
+                    : "" + varchar);
+          }
+        }
+        else
+        {
+          sb.append(var);
+        }
+        if (++p != variants.size())
+        {
+          sb.append("<br/>&nbsp;&nbsp;");
+          asHtml = true;
+        }
+        else
+        {
+          sb.append(" ");
         }
-        first = false;
-        desc.append(nm);
       }
     }
-    return desc.toString();
+    String description = feature.getDescription();
+    if (description != null)
+    {
+      sb.append(description);
+    }
+    if (asHtml)
+    {
+      sb.insert(0, "<html>");
+      sb.append("</html>");
+    }
+
+    return sb.toString();
+  }
+
+  /**
+   * A helper method that searches the list of properties for one with the given
+   * key, and if found returns the property value, else returns null
+   * 
+   * @param properties
+   * @param key
+   * @return
+   */
+  static String getProperty(List<PropertyType> properties, String key)
+  {
+    String value = null;
+    if (properties != null)
+    {
+      for (PropertyType prop : properties)
+      {
+        if (key.equals(prop.getType()))
+        {
+          value = prop.getValue();
+          break;
+        }
+      }
+    }
+    return value;
+  }
+
+  /**
+   * Extracts xml element entry/protein/recommendedName/fullName
+   * 
+   * @param entry
+   * @return
+   */
+  static String getUniprotEntryDescription(Entry entry)
+  {
+    String desc = "";
+    if (entry.getProtein() != null
+            && entry.getProtein().getRecommendedName() != null)
+    {
+      // fullName is mandatory if recommendedName is present
+      desc = entry.getProtein().getRecommendedName().getFullName()
+              .getValue();
+    }
+    return desc;
   }
 
   /**
-   *
+   * Constructs a sequence id by concatenating all entry/name elements with '|'
+   * separator
+   * 
    * @param entry
-   *          UniprotEntry
-   * @return The accession id(s) and name(s) delimited by '|'.
+   * @return
    */
-  public static String getUniprotEntryId(UniprotEntry entry)
+  static String getUniprotEntryId(Entry entry)
   {
     StringBuilder name = new StringBuilder(32);
     for (String n : entry.getName())
@@ -368,4 +486,35 @@ public class Uniprot extends DbSourceProxyImpl
   {
     return 0;
   }
+
+  /**
+   * Reads the reply to the EBI Fetch Uniprot data query, unmarshals it to an
+   * Uniprot object, and returns the enclosed Entry objects, or null on any
+   * failure
+   * 
+   * @param is
+   * @return
+   */
+  public List<Entry> getUniprotEntries(InputStream is)
+  {
+    List<Entry> entries = null;
+    try
+    {
+      JAXBContext jc = JAXBContext
+              .newInstance("jalview.xml.binding.uniprot");
+      XMLStreamReader streamReader = XMLInputFactory.newInstance()
+              .createXMLStreamReader(is);
+      javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+      jalview.xml.binding.uniprot.Uniprot uniprot = (jalview.xml.binding.uniprot.Uniprot) um.unmarshal(streamReader);
+      if (uniprot != null && !uniprot.getEntry().isEmpty())
+      {
+        entries = uniprot.getEntry();
+      }
+    } catch (JAXBException | XMLStreamException
+            | FactoryConfigurationError e)
+    {
+      e.printStackTrace();
+    }
+    return entries;
+  }
 }
diff --git a/src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java b/src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java
deleted file mode 100644 (file)
index 55c50b2..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws.dbsources.das.api;
-
-import java.util.List;
-
-import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI;
-
-/**
- * API for a registry that provides datasources that jalview can access
- * 
- * @author jprocter
- * 
- */
-public interface DasSourceRegistryI
-{
-
-  List<jalviewSourceI> getSources();
-
-  String getDasRegistryURL();
-
-  jalviewSourceI getSource(String nickname);
-
-  // TODO: re JAL-424 - introduce form where local source is queried for
-  // metadata, rather than have it all provided by caller.
-  jalviewSourceI createLocalSource(String uri, String name,
-          boolean sequence, boolean features);
-
-  boolean removeLocalSource(jalviewSourceI source);
-
-  void refreshSources();
-
-  String getLocalSourceString();
-
-  List<jalviewSourceI> resolveSourceNicknames(List<String> sources);
-
-  // TODO: refactor to jDAS specific interface
-  MultipleConnectionPropertyProviderI getSessionHandler();
-}
diff --git a/src/jalview/ws/dbsources/das/api/jalviewSourceI.java b/src/jalview/ws/dbsources/das/api/jalviewSourceI.java
deleted file mode 100644 (file)
index bc3c8ea..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws.dbsources.das.api;
-
-import jalview.ws.seqfetcher.DbSourceProxy;
-
-import java.util.List;
-
-import org.biodas.jdas.schema.sources.MAINTAINER;
-import org.biodas.jdas.schema.sources.VERSION;
-
-public interface jalviewSourceI
-{
-
-  String getTitle();
-
-  VERSION getVersion();
-
-  String getDocHref();
-
-  String getDescription();
-
-  String getUri();
-
-  MAINTAINER getMAINTAINER();
-
-  String getEmail();
-
-  boolean isLocal();
-
-  boolean isSequenceSource();
-
-  String[] getCapabilityList(VERSION v);
-
-  String[] getLabelsFor(VERSION v);
-
-  /**
-   * 
-   * @return null if not a sequence source, otherwise a series of database
-   *         sources that can be used to retrieve sequence data for particular
-   *         database coordinate systems
-   */
-  List<DbSourceProxy> getSequenceSourceProxies();
-
-  boolean isFeatureSource();
-
-  /**
-   * returns the base URL for the latest version of a source's DAS endpoint set
-   * 
-   * @return
-   */
-  String getSourceURL();
-
-  /**
-   * test to see if this source's latest version is older than the given source
-   * 
-   * @param jalviewSourceI
-   * @return true if newer than given source
-   */
-  boolean isNewerThan(jalviewSourceI jalviewSourceI);
-
-  /**
-   * test if the source is a reference source for the authority
-   * 
-   * @return
-   */
-  boolean isReferenceSource();
-
-}
diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java b/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java
deleted file mode 100644 (file)
index 84f6d4d..0000000
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws.dbsources.das.datamodel;
-
-import jalview.bin.Cache;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceI;
-import jalview.util.MessageManager;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-import jalview.ws.seqfetcher.DbSourceProxy;
-import jalview.ws.seqfetcher.DbSourceProxyImpl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.biodas.jdas.client.SequenceClient;
-import org.biodas.jdas.client.adapters.sequence.DasSequenceAdapter;
-import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI;
-import org.biodas.jdas.client.threads.SequenceClientMultipleSources;
-import org.biodas.jdas.schema.sequence.SEQUENCE;
-import org.biodas.jdas.schema.sources.COORDINATES;
-import org.biodas.jdas.schema.sources.SOURCE;
-import org.biodas.jdas.schema.sources.VERSION;
-
-import com.stevesoft.pat.Regex;
-
-/**
- * an instance of this class is created for each unique DAS Sequence source (ie
- * one capable of handling the 'sequence' for a particular MapMaster)
- * 
- * @author JimP
- * 
- */
-public class DasSequenceSource extends DbSourceProxyImpl
-        implements DbSourceProxy
-{
-  private jalviewSourceI jsrc;
-
-  protected SOURCE source = null;
-
-  protected VERSION version = null;
-
-  protected COORDINATES coordsys = null;
-
-  protected String dbname = "DASCS";
-
-  protected String dbrefname = "das:source";
-
-  protected MultipleConnectionPropertyProviderI connprops = null;
-
-  /**
-   * DAS sources are tier 1 - if we have a direct DB connection then we should
-   * prefer it
-   */
-  private int tier = 1;
-
-  /**
-   * create a new DbSource proxy for a DAS 1 source
-   * 
-   * @param dbnbame
-   *          Human Readable Name to use when fetching from this source
-   * @param dbrefname
-   *          DbRefName for DbRefs attached to sequences retrieved from this
-   *          source
-   * @param source
-   *          Das1Source
-   * @param coordsys
-   *          specific coordinate system to use for this source
-   * @throws Exception
-   *           if source is not capable of the 'sequence' command
-   */
-  public DasSequenceSource(String dbname, String dbrefname, SOURCE source,
-          VERSION version, COORDINATES coordsys,
-          MultipleConnectionPropertyProviderI connprops) throws Exception
-  {
-    if (!(jsrc = new JalviewSource(source, connprops, false))
-            .isSequenceSource())
-    {
-      throw new Exception(MessageManager.formatMessage(
-              "exception.das_source_doesnt_support_sequence_command",
-              new String[]
-              { source.getTitle() }));
-    }
-    this.tier = 1 + ((jsrc.isLocal() || jsrc.isReferenceSource()) ? 0 : 1);
-    this.source = source;
-    this.dbname = dbname;
-    this.dbrefname = dbrefname.toUpperCase();
-    if (coordsys != null)
-    {
-      this.coordsys = coordsys;
-    }
-    this.connprops = connprops;
-  }
-
-  public String getAccessionSeparator()
-  {
-    return "\t";
-  }
-
-  public Regex getAccessionValidator()
-  {
-    /** ? * */
-    return Regex.perlCode("m/([^:]+)(:\\d+,\\d+)?/");
-  }
-
-  public String getDbName()
-  {
-    // TODO: map to
-    return dbname + " (DAS)";
-  }
-
-  public String getDbSource()
-  {
-    return dbrefname;
-  }
-
-  public String getDbVersion()
-  {
-    return coordsys != null ? coordsys.getVersion() : "";
-  }
-
-  public AlignmentI getSequenceRecords(String queries) throws Exception
-  {
-    StringTokenizer st = new StringTokenizer(queries, "\t");
-    List<String> toks = new ArrayList<String>(),
-            src = new ArrayList<String>(), acIds = new ArrayList<String>();
-    while (st.hasMoreTokens())
-    {
-      String t;
-      toks.add(t = st.nextToken());
-      acIds.add(t.replaceAll(":[0-9,]+", ""));
-    }
-    src.add(jsrc.getSourceURL());
-    Map<String, Map<List<String>, DasSequenceAdapter>> resultset = new HashMap<String, Map<List<String>, DasSequenceAdapter>>();
-    Map<String, Map<List<String>, Exception>> errors = new HashMap<String, Map<List<String>, Exception>>();
-
-    // First try multiple sources
-    boolean multiple = true, retry = false;
-    do
-    {
-      if (!multiple)
-      {
-        retry = false;
-        // slow, fetch one at a time.
-        for (String sr : src)
-        {
-          System.err.println(
-                  "Retrieving IDs individually from das source: " + sr);
-          org.biodas.jdas.client.SequenceClient sq = new SequenceClient(
-                  connprops.getConnectionPropertyProviderFor(sr));
-          for (String q : toks)
-          {
-            List<String> qset = Arrays.asList(new String[] { q });
-            try
-            {
-              DasSequenceAdapter s = sq.fetchData(sr, qset);
-              Map<List<String>, DasSequenceAdapter> dss = resultset.get(sr);
-              if (dss == null)
-              {
-                resultset.put(sr,
-                        dss = new HashMap<List<String>, DasSequenceAdapter>());
-              }
-              dss.put(qset, s);
-            } catch (Exception x)
-            {
-              Map<List<String>, Exception> ers = errors.get(sr);
-              if (ers == null)
-              {
-                errors.put(sr,
-                        ers = new HashMap<List<String>, Exception>());
-              }
-              ers.put(qset, x);
-            }
-          }
-        }
-      }
-      else
-      {
-        SequenceClientMultipleSources sclient;
-        sclient = new SequenceClientMultipleSources();
-        sclient.fetchData(src, toks, resultset, errors);
-        sclient.shutDown();
-        while (!sclient.isTerminated())
-        {
-          try
-          {
-            Thread.sleep(200);
-
-          } catch (InterruptedException x)
-          {
-          }
-        }
-        if (resultset.isEmpty() && !errors.isEmpty())
-        {
-          retry = true;
-          multiple = false;
-        }
-      }
-    } while (retry);
-
-    if (resultset.isEmpty())
-    {
-      System.err.println("Sequence Query to " + jsrc.getTitle() + " with '"
-              + queries + "' returned no sequences.");
-      return null;
-    }
-    else
-    {
-      Vector<SequenceI> seqs = null;
-      for (Map.Entry<String, Map<List<String>, DasSequenceAdapter>> resset : resultset
-              .entrySet())
-      {
-        for (Map.Entry<List<String>, DasSequenceAdapter> result : resset
-                .getValue().entrySet())
-        {
-          DasSequenceAdapter dasseqresp = result.getValue();
-          List<String> accessions = result.getKey();
-          for (SEQUENCE e : dasseqresp.getSequence())
-          {
-            String lbl = e.getId();
-
-            if (acIds.indexOf(lbl) == -1)
-            {
-              System.err.println(
-                      "Warning - received sequence event for strange accession code ("
-                              + lbl + ")");
-            }
-            else
-            {
-              if (seqs == null)
-              {
-                if (e.getContent().length() == 0)
-                {
-                  System.err.println(
-                          "Empty sequence returned for accession code ("
-                                  + lbl + ") from " + resset.getKey()
-                                  + " (source is " + getDbName());
-                  continue;
-                }
-              }
-              seqs = new java.util.Vector<SequenceI>();
-              // JDAS returns a sequence complete with any newlines and spaces
-              // in the XML
-              Sequence sq = new Sequence(lbl,
-                      e.getContent().replaceAll("\\s+", ""));
-              sq.setStart(e.getStart().intValue());
-              sq.addDBRef(new DBRefEntry(getDbSource(),
-                      getDbVersion() + ":" + e.getVersion(), lbl));
-              seqs.addElement(sq);
-            }
-          }
-        }
-      }
-
-      if (seqs == null || seqs.size() == 0)
-        return null;
-      SequenceI[] sqs = new SequenceI[seqs.size()];
-      for (int i = 0, iSize = seqs.size(); i < iSize; i++)
-      {
-        sqs[i] = (SequenceI) seqs.elementAt(i);
-      }
-      Alignment al = new Alignment(sqs);
-      if (jsrc.isFeatureSource())
-      {
-        java.util.Vector<jalviewSourceI> srcs = new java.util.Vector<jalviewSourceI>();
-        srcs.addElement(jsrc);
-        try
-        {
-          jalview.ws.DasSequenceFeatureFetcher dssf = new jalview.ws.DasSequenceFeatureFetcher(
-                  sqs, null, srcs, false, false, multiple);
-          while (dssf.isRunning())
-          {
-            try
-            {
-              Thread.sleep(200);
-            } catch (InterruptedException x)
-            {
-
-            }
-          }
-
-        } catch (Exception x)
-        {
-          Cache.log.error(
-                  "Couldn't retrieve features for sequence from its source.",
-                  x);
-        }
-      }
-
-      return al;
-    }
-  }
-
-  public String getTestQuery()
-  {
-    return coordsys == null ? "" : coordsys.getTestRange();
-  }
-
-  public boolean isValidReference(String accession)
-  {
-    // TODO try to validate an accession against source
-    // We don't really know how to do this without querying source
-
-    return true;
-  }
-
-  /**
-   * @return the source
-   */
-  public SOURCE getSource()
-  {
-    return source;
-  }
-
-  /**
-   * @return the coordsys
-   */
-  public COORDINATES getCoordsys()
-  {
-    return coordsys;
-  }
-
-  @Override
-  public int getTier()
-  {
-    return tier;
-  }
-}
diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java
deleted file mode 100644 (file)
index de7f380..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws.dbsources.das.datamodel;
-
-import jalview.bin.Cache;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.biodas.jdas.client.ConnectionPropertyProviderI;
-import org.biodas.jdas.client.SourcesClient;
-import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI;
-import org.biodas.jdas.dassources.Capabilities;
-import org.biodas.jdas.schema.sources.CAPABILITY;
-import org.biodas.jdas.schema.sources.SOURCE;
-import org.biodas.jdas.schema.sources.SOURCES;
-import org.biodas.jdas.schema.sources.VERSION;
-
-/**
- *
- */
-public class DasSourceRegistry
-        implements DasSourceRegistryI, MultipleConnectionPropertyProviderI
-{
-  // private org.biodas.jdas.schema.sources.SOURCE[] dasSources = null;
-  private List<jalviewSourceI> dasSources = null;
-
-  private Hashtable<String, jalviewSourceI> sourceNames = null;
-
-  private Hashtable<String, jalviewSourceI> localSources = null;
-
-  // public static String DEFAULT_REGISTRY = "http://www.dasregistry.org/das/";
-  public static String DEFAULT_REGISTRY = "http://www.ebi.ac.uk/das-srv/registry/das/";
-
-  /**
-   * true if thread is running and we are talking to DAS registry service
-   */
-  private boolean loadingDasSources = false;
-
-  public boolean isLoadingDasSources()
-  {
-    return loadingDasSources;
-  }
-
-  @Override
-  public String getDasRegistryURL()
-  {
-    String registry = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
-            DEFAULT_REGISTRY);
-
-    if (registry.indexOf("/registry/das1/sources/") > -1)
-    {
-      jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
-              DEFAULT_REGISTRY);
-      registry = DEFAULT_REGISTRY;
-    }
-    if (registry.lastIndexOf("sources.xml") == registry.length() - 11)
-    {
-      // no trailing sources.xml document for registry in JDAS
-      jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
-              registry = registry.substring(0,
-                      registry.lastIndexOf("sources.xml")));
-    }
-    return registry;
-  }
-
-  /**
-   * query the default DAS Source Registry for sources. Uses value of jalview
-   * property DAS_REGISTRY_URL and the DasSourceBrowser.DEFAULT_REGISTRY if that
-   * doesn't exist.
-   * 
-   * @return list of sources
-   */
-  private List<jalviewSourceI> getDASSources()
-  {
-
-    return getDASSources(getDasRegistryURL(), this);
-  }
-
-  /**
-   * query the given URL for DasSources.
-   * 
-   * @param registryURL
-   *          return sources from registryURL
-   */
-  private static List<jalviewSourceI> getDASSources(String registryURL,
-          MultipleConnectionPropertyProviderI registry)
-  {
-    try
-    {
-      URL url = new URL(registryURL);
-      org.biodas.jdas.client.SourcesClientInterface client = new SourcesClient();
-
-      SOURCES sources = client.fetchDataRegistry(registryURL, null, null,
-              null, null, null, null);
-
-      List<SOURCE> dassources = sources.getSOURCE();
-      ArrayList<jalviewSourceI> dsrc = new ArrayList<jalviewSourceI>();
-      HashMap<String, Integer> latests = new HashMap<String, Integer>();
-      Integer latest;
-      for (SOURCE src : dassources)
-      {
-        JalviewSource jsrc = new JalviewSource(src, registry, false);
-        latest = latests.get(jsrc.getSourceURL());
-        if (latest != null)
-        {
-          if (jsrc.isNewerThan(dsrc.get(latest.intValue())))
-          {
-            dsrc.set(latest.intValue(), jsrc);
-          }
-          else
-          {
-            System.out.println(
-                    "Debug: Ignored older source " + jsrc.getTitle());
-          }
-        }
-        else
-        {
-          latests.put(jsrc.getSourceURL(), Integer.valueOf(dsrc.size()));
-          dsrc.add(jsrc);
-        }
-      }
-      return dsrc;
-    } catch (Exception ex)
-    {
-      System.out.println(
-              "DAS1 registry at " + registryURL + " no longer exists");
-      return new ArrayList<jalviewSourceI>();
-    }
-  }
-
-  public void run()
-  {
-    getSources();
-  }
-
-  @Override
-  public List<jalviewSourceI> getSources()
-  {
-    if (dasSources == null)
-    {
-      dasSources = getDASSources();
-    }
-    return appendLocalSources();
-  }
-
-  /**
-   * generate Sources from the local das source list
-   * 
-   */
-  private void addLocalDasSources()
-  {
-    if (localSources == null)
-    {
-      // get local sources from properties and initialise the local source list
-      String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE");
-
-      if (local != null)
-      {
-        int n = 1;
-        StringTokenizer st = new StringTokenizer(local, "\t");
-        while (st.hasMoreTokens())
-        {
-          String token = st.nextToken();
-          int bar = token.indexOf("|");
-          if (bar == -1)
-          {
-            System.err.println(
-                    "Warning: DAS user local source appears to have no nickname (expected a '|' followed by nickname)\nOffending definition: '"
-                            + token + "'");
-          }
-          String url = token.substring(bar + 1);
-          boolean features = true, sequence = false;
-          if (url.startsWith("sequence:"))
-          {
-            url = url.substring(9);
-            // this source also serves sequences as well as features
-            sequence = true;
-          }
-          try
-          {
-            if (bar > -1)
-            {
-              createLocalSource(url, token.substring(0, bar), sequence,
-                      features);
-            }
-            else
-            {
-              createLocalSource(url, "User Source" + n, sequence, features);
-            }
-          } catch (Exception q)
-          {
-            System.err.println(
-                    "Unexpected exception when creating local source from '"
-                            + token + "'");
-            q.printStackTrace();
-          }
-          n++;
-        }
-      }
-    }
-  }
-
-  private List<jalviewSourceI> appendLocalSources()
-  {
-    List<jalviewSourceI> srclist = new ArrayList<jalviewSourceI>();
-    addLocalDasSources();
-    sourceNames = new Hashtable<String, jalviewSourceI>();
-    if (dasSources != null)
-    {
-      for (jalviewSourceI src : dasSources)
-      {
-        sourceNames.put(src.getTitle(), src);
-        srclist.add(src);
-      }
-    }
-
-    if (localSources == null)
-    {
-      return srclist;
-    }
-    Enumeration en = localSources.keys();
-    while (en.hasMoreElements())
-    {
-      String key = en.nextElement().toString();
-      jalviewSourceI jvsrc = localSources.get(key);
-      sourceNames.put(key, jvsrc);
-      srclist.add(jvsrc);
-    }
-    return srclist;
-  }
-
-  /*
-  * 
-  */
-
-  @Override
-  public jalviewSourceI createLocalSource(String url, String name,
-          boolean sequence, boolean features)
-  {
-    SOURCE local = _createLocalSource(url, name, sequence, features);
-
-    if (localSources == null)
-    {
-      localSources = new Hashtable<String, jalviewSourceI>();
-    }
-    jalviewSourceI src = new JalviewSource(local, this, true);
-    localSources.put(local.getTitle(), src);
-    return src;
-  }
-
-  private SOURCE _createLocalSource(String url, String name,
-          boolean sequence, boolean features)
-  {
-    SOURCE local = new SOURCE();
-
-    local.setUri(url);
-    local.setTitle(name);
-    local.setVERSION(new ArrayList<VERSION>());
-    VERSION v = new VERSION();
-    List<CAPABILITY> cp = new ArrayList<CAPABILITY>();
-    if (sequence)
-    {
-      /*
-       * Could try and synthesize a coordinate system for the source if needbe
-       * COORDINATES coord = new COORDINATES(); coord.setAuthority("NCBI");
-       * coord.setSource("Chromosome"); coord.setTaxid("9606");
-       * coord.setVersion("35"); version.getCOORDINATES().add(coord);
-       */
-      CAPABILITY cap = new CAPABILITY();
-      cap.setType("das1:" + Capabilities.SEQUENCE.getName());
-      cap.setQueryUri(url + "/sequence");
-      cp.add(cap);
-    }
-    if (features)
-    {
-      CAPABILITY cap = new CAPABILITY();
-      cap.setType("das1:" + Capabilities.FEATURES.getName());
-      cap.setQueryUri(url + "/features");
-      cp.add(cap);
-    }
-
-    v.getCAPABILITY().addAll(cp);
-    local.getVERSION().add(v);
-
-    return local;
-  }
-
-  @Override
-  public jalviewSourceI getSource(String nickname)
-  {
-    return sourceNames.get(nickname);
-  }
-
-  @Override
-  public boolean removeLocalSource(jalviewSourceI source)
-  {
-    if (localSources.containsValue(source))
-    {
-      localSources.remove(source.getTitle());
-      sourceNames.remove(source.getTitle());
-      dasSources.remove(source);
-      jalview.bin.Cache.setProperty("DAS_LOCAL_SOURCE",
-              getLocalSourceString());
-
-      return true;
-    }
-    return false;
-  }
-
-  @Override
-  public void refreshSources()
-  {
-    dasSources = null;
-    sourceNames = null;
-    run();
-  }
-
-  @Override
-  public List<jalviewSourceI> resolveSourceNicknames(List<String> sources)
-  {
-    ArrayList<jalviewSourceI> resolved = new ArrayList<jalviewSourceI>();
-    if (sourceNames != null)
-    {
-      for (String src : sources)
-      {
-        jalviewSourceI dsrc = sourceNames.get(src);
-        if (dsrc != null)
-        {
-          resolved.add(dsrc);
-        }
-      }
-    }
-    return resolved;
-  }
-
-  @Override
-  public String getLocalSourceString()
-  {
-    if (localSources != null)
-    {
-      StringBuffer sb = new StringBuffer();
-      Enumeration en = localSources.keys();
-      while (en.hasMoreElements())
-      {
-        String token = en.nextElement().toString();
-        jalviewSourceI srco = localSources.get(token);
-        sb.append(token + "|" + (srco.isSequenceSource() ? "sequence:" : "")
-                + srco.getUri() + "\t");
-      }
-      return sb.toString();
-    }
-    return "";
-  }
-
-  private static final Hashtable<URL, String> authStash;
-  static
-  {
-    authStash = new Hashtable<URL, String>();
-
-    try
-    {
-      // TODO: allow same credentials for https and http
-      authStash.put(
-              new URL("http://www.compbio.dundee.ac.uk/geneweb/das/myseq/"),
-              "Basic SmltOm1pSg==");
-    } catch (MalformedURLException e)
-    {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-  }
-
-  @Override
-  public MultipleConnectionPropertyProviderI getSessionHandler()
-  {
-    return this;
-  }
-
-  @Override
-  public ConnectionPropertyProviderI getConnectionPropertyProviderFor(
-          String arg0)
-  {
-
-    final ConnectionPropertyProviderI conprov = new ConnectionPropertyProviderI()
-    {
-      boolean authed = false;
-
-      @Override
-      public void setConnectionProperties(HttpURLConnection connection)
-      {
-        String auth = authStash.get(connection.getURL());
-        if (auth != null && auth.length() > 0)
-        {
-          connection.setRequestProperty("Authorisation", auth);
-          authed = true;
-        }
-        else
-        {
-          authed = false;
-        }
-      }
-
-      @Override
-      public boolean getResponseProperties(HttpURLConnection connection)
-      {
-        String auth = authStash.get(connection.getURL());
-        if (auth != null && auth.length() == 0)
-        {
-          // don't attempt to check if we authed or not - user entered empty
-          // password
-          return false;
-        }
-        if (!authed)
-        {
-          if (auth != null)
-          {
-            // try and pass credentials.
-            return true;
-          }
-          // see if we should try and create a new auth record.
-          String ameth = connection.getHeaderField("X-DAS-AuthMethods");
-          Cache.log.debug("Could authenticate to " + connection.getURL()
-                  + " with : " + ameth);
-          // TODO: search auth string and raise login box - return if auth was
-          // provided
-          return false;
-        }
-        else
-        {
-          // check to see if auth was successful
-          String asuc = connection
-                  .getHeaderField("X-DAS_AuthenticatedUser");
-          if (asuc != null && asuc.trim().length() > 0)
-          {
-            // authentication was successful
-            Cache.log.debug("Authenticated successfully to "
-                    + connection.getURL().toString());
-            return false;
-          }
-          // it wasn't - so we should tell the user it failed and ask if they
-          // want to attempt authentication again.
-          authStash.remove(connection.getURL());
-          // open a new login/password dialog with cancel button
-          // set new authStash content with password and return true
-          return true; //
-          // User cancelled auth - so put empty string in stash to indicate we
-          // don't want to auth with this server.
-          // authStash.put(connection.getURL(), "");
-          // return false;
-        }
-      }
-    };
-    return conprov;
-  }
-
-}
diff --git a/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java b/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java
deleted file mode 100644 (file)
index 07ba027..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws.dbsources.das.datamodel;
-
-import jalview.util.MessageManager;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-import jalview.ws.seqfetcher.DbSourceProxy;
-
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI;
-import org.biodas.jdas.dassources.Capabilities;
-import org.biodas.jdas.dassources.utils.DasTimeFormat;
-import org.biodas.jdas.schema.sources.CAPABILITY;
-import org.biodas.jdas.schema.sources.COORDINATES;
-import org.biodas.jdas.schema.sources.MAINTAINER;
-import org.biodas.jdas.schema.sources.PROP;
-import org.biodas.jdas.schema.sources.SOURCE;
-import org.biodas.jdas.schema.sources.VERSION;
-
-public class JalviewSource implements jalviewSourceI
-{
-  SOURCE source;
-
-  MultipleConnectionPropertyProviderI connprov;
-
-  public JalviewSource(SOURCE local2,
-          MultipleConnectionPropertyProviderI connprov, boolean local)
-  {
-    this.connprov = connprov;
-    this.local = local;
-    source = local2;
-  }
-
-  @Override
-  public String getTitle()
-  {
-    return source.getTitle();
-  }
-
-  @Override
-  public VERSION getVersion()
-  {
-
-    return getVersionFor(source);
-  }
-
-  @Override
-  public String getDocHref()
-  {
-    return source.getDocHref();
-  }
-
-  @Override
-  public String getDescription()
-  {
-    return source.getDescription();
-  }
-
-  @Override
-  public String getUri()
-  {
-    return source.getUri();
-  }
-
-  @Override
-  public MAINTAINER getMAINTAINER()
-  {
-    return source.getMAINTAINER();
-  }
-
-  @Override
-  public String getEmail()
-  {
-    return (local) ? null : source.getMAINTAINER().getEmail();
-  }
-
-  boolean local = false;
-
-  @Override
-  public boolean isLocal()
-  {
-    return local;
-  }
-
-  @Override
-  public boolean isSequenceSource()
-  {
-    String seqcap = "das1:" + Capabilities.SEQUENCE.getName();
-    for (String cp : getCapabilityList(getVersionFor(source)))
-    {
-      if (cp.equals(seqcap))
-      {
-        return true;
-
-      }
-    }
-    return false;
-  }
-
-  @Override
-  public boolean isFeatureSource()
-  {
-    String seqcap = "das1:" + Capabilities.FEATURES.getName();
-    for (String cp : getCapabilityList(getVersionFor(source)))
-    {
-      if (cp.equals(seqcap))
-      {
-        return true;
-
-      }
-    }
-    return false;
-  }
-
-  private VERSION getVersionFor(SOURCE ds)
-  {
-    VERSION latest = null;
-    for (VERSION v : ds.getVERSION())
-    {
-      if (latest == null
-              || isLaterThan(latest.getCreated(), v.getCreated()))
-      {
-        // TODO: das 1.6 - should just get the first version - ignore other
-        // versions since not specified how to construct URL from version's URI
-        // + source URI
-        latest = v;
-      }
-    }
-    return latest;
-  }
-
-  /**
-   * compare date strings. null or unparseable dates are assumed to be oldest
-   * 
-   * @param ref
-   * @param newer
-   * @return true iff ref comes before newer
-   */
-  private boolean isLaterThan(String ref, String newer)
-  {
-    Date refdate = null, newdate = null;
-    if (ref != null && ref.trim().length() > 0)
-    {
-      try
-      {
-        refdate = DasTimeFormat.fromDASString(ref.trim());
-
-      } catch (ParseException x)
-      {
-      }
-    }
-    if (newer != null && newer.trim().length() > 0)
-    {
-      try
-      {
-        newdate = DasTimeFormat.fromDASString(newer);
-      } catch (ParseException e)
-      {
-      }
-    }
-    if (refdate != null)
-    {
-      if (newdate != null)
-      {
-        return refdate.before(newdate);
-      }
-      return false;
-    }
-    if (newdate != null)
-    {
-      return true;
-    }
-    // assume first instance of source is newest in list. - TODO: check if
-    // natural ordering of source versions is newest first or oldest first
-    return false;
-  }
-
-  public String[] getLabelsFor(VERSION v)
-  {
-    ArrayList<String> labels = new ArrayList<String>();
-    for (PROP p : v.getPROP())
-    {
-      if (p.getName().equalsIgnoreCase("LABEL"))
-      {
-        labels.add(p.getValue());
-      }
-    }
-    return labels.toArray(new String[0]);
-  }
-
-  private CAPABILITY getCapability(Capabilities capability)
-  {
-    for (CAPABILITY p : getVersion().getCAPABILITY())
-    {
-      if (p.getType().equalsIgnoreCase(capability.getName()) || p.getType()
-              .equalsIgnoreCase("das1:" + capability.getName()))
-      {
-        return p;
-      }
-    }
-    return null;
-  }
-
-  public String[] getCapabilityList(VERSION v)
-  {
-
-    ArrayList<String> labels = new ArrayList<String>();
-    for (CAPABILITY p : v.getCAPABILITY())
-    {
-      // TODO: work out what to do with namespace prefix
-      // does SEQUENCE == das1:SEQUENCE and das2:SEQUENCE ?
-      // for moment, just show all capabilities...
-      if (p.getType().startsWith("das1:"))
-      {
-        labels.add(p.getType());
-      }
-    }
-    return labels.toArray(new String[0]);
-  }
-
-  @Override
-  public List<DbSourceProxy> getSequenceSourceProxies()
-  {
-    if (!isSequenceSource())
-    {
-      return null;
-    }
-    ArrayList<DbSourceProxy> seqsources = new ArrayList<DbSourceProxy>();
-    if (!local)
-    {
-      VERSION v = getVersion();
-      Map<String, COORDINATES> latestc = new Hashtable<String, COORDINATES>();
-      for (COORDINATES cs : v.getCOORDINATES())
-      {
-        COORDINATES ltst = latestc.get(cs.getUri());
-        if (ltst == null || ltst.getVersion() == null
-                || (ltst.getVersion() != null && cs.getVersion() != null
-                        && isLaterThan(ltst.getVersion(), cs.getVersion())))
-        {
-          latestc.put(cs.getUri(), cs);
-        }
-      }
-      for (COORDINATES cs : latestc.values())
-      {
-        DasSequenceSource ds;
-        /*
-         * if (css == null || css.length == 0) { // TODO: query das source
-         * directly to identify coordinate system... or // have to make up a
-         * coordinate system css = new DasCoordinateSystem[] { new
-         * DasCoordinateSystem() }; css[0].setName(d1s.getNickname());
-         * css[0].setUniqueId(d1s.getNickname()); } for (int c = 0; c <
-         * css.length; c++) {
-         */
-        try
-        {
-          seqsources.add(ds = new DasSequenceSource(
-                  getTitle() + " (" + cs.getAuthority() + " "
-                          + cs.getSource()
-                          + (cs.getVersion() != null ? " " + cs.getVersion()
-                                  : "")
-                          + ")",
-                  cs.getAuthority(), source, v, cs, connprov));
-          if (seqsources.size() > 1)
-          {
-            System.err.println("Added another sequence DB source for "
-                    + getTitle() + " (" + ds.getDbName() + ")");
-          }
-        } catch (Exception e)
-        {
-          System.err.println("Ignoring sequence coord system " + cs + " ("
-                  + cs.getContent() + ") for source " + getTitle()
-                  + "- threw exception when constructing fetcher.\n");
-          e.printStackTrace();
-        }
-      }
-    }
-    else
-    {
-      try
-      {
-        seqsources.add(new DasSequenceSource(getTitle(), getTitle(), source,
-                getVersion(), null, connprov));
-      } catch (Exception e)
-      {
-        // TODO Auto-generated catch block
-        e.printStackTrace();
-      }
-
-    }
-    if (seqsources.size() > 1)
-    {
-      // sort by name
-      DbSourceProxy[] tsort = seqsources.toArray(new DasSequenceSource[0]);
-      String[] nm = new String[tsort.length];
-      for (int i = 0; i < nm.length; i++)
-      {
-        nm[i] = tsort[i].getDbName().toLowerCase();
-      }
-      jalview.util.QuickSort.sort(nm, tsort);
-      seqsources.clear();
-      for (DbSourceProxy ssrc : tsort)
-      {
-        seqsources.add(ssrc);
-      }
-    }
-    return seqsources;
-  }
-
-  @Override
-  public String getSourceURL()
-  {
-    try
-    {
-      // kind of dumb, since
-      // org.biodas.jdas.dassources.utils.VersionAdapter.getSourceUriFromQueryUri()
-      // does this,
-      // but this way, we can access non DAS 1.6 compliant sources (which have
-      // to have a URL like <sourcename>/das/ and cause a validation exception)
-
-      for (CAPABILITY cap : getVersion().getCAPABILITY())
-      {
-        String capname = cap.getType()
-                .substring(cap.getType().indexOf(":") + 1);
-        int p = cap.getQueryUri().lastIndexOf(capname);
-        if (p < -1)
-        {
-          throw new Exception(MessageManager.formatMessage(
-                  "exception.invalid_das_source", new String[]
-                  { source.getUri() }));
-        }
-        if (cap.getQueryUri().charAt(p) == '/')
-        {
-          p--;
-        }
-        return cap.getQueryUri().substring(0, p);
-      }
-    } catch (Exception x)
-    {
-      System.err.println("Serious: Couldn't get the URL for source "
-              + source.getTitle());
-      x.printStackTrace();
-    }
-    return null;
-  }
-
-  @Override
-  public boolean isNewerThan(jalviewSourceI other)
-  {
-    return isLaterThan(getVersion().getCreated(),
-            other.getVersion().getCreated());
-  }
-
-  @Override
-  public boolean isReferenceSource()
-  {
-    // TODO check source object for indication that we are the primary for a DAS
-    // coordinate system
-    return false;
-  }
-}
diff --git a/src/jalview/xml/binding/embl/EntrySetType.java b/src/jalview/xml/binding/embl/EntrySetType.java
new file mode 100644 (file)
index 0000000..09947ec
--- /dev/null
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EntrySetType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="EntrySetType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence maxOccurs="unbounded">
+ *         &lt;element name="entry" type="{}EntryType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EntrySetType", propOrder = {
+    "entry"
+})
+public class EntrySetType {
+
+    @XmlElement(required = true)
+    protected List<EntryType> entry;
+
+    /**
+     * Gets the value of the entry property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the entry property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEntry().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EntryType }
+     * 
+     * 
+     */
+    public List<EntryType> getEntry() {
+        if (entry == null) {
+            entry = new ArrayList<EntryType>();
+        }
+        return this.entry;
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/EntryType.java b/src/jalview/xml/binding/embl/EntryType.java
new file mode 100644 (file)
index 0000000..8964a3f
--- /dev/null
@@ -0,0 +1,2680 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for EntryType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="EntryType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="secondaryAccession" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="projectAccession" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="comment" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="keyword" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="reference" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="author" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                   &lt;element name="applicant" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                   &lt;element name="consortium" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="submissionDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
+ *                   &lt;element name="journal" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="year" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="volume" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="issue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="firstPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="lastPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="comment" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="referenceLocation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="type" use="required">
+ *                   &lt;simpleType>
+ *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *                       &lt;enumeration value="submission"/>
+ *                       &lt;enumeration value="book"/>
+ *                       &lt;enumeration value="article"/>
+ *                       &lt;enumeration value="patent"/>
+ *                       &lt;enumeration value="thesis"/>
+ *                       &lt;enumeration value="unpublished"/>
+ *                     &lt;/restriction>
+ *                   &lt;/simpleType>
+ *                 &lt;/attribute>
+ *                 &lt;attribute name="number" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                 &lt;attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="feature" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="taxon" minOccurs="0">
+ *                     &lt;complexType>
+ *                       &lt;complexContent>
+ *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           &lt;sequence>
+ *                             &lt;element name="lineage" minOccurs="0">
+ *                               &lt;complexType>
+ *                                 &lt;complexContent>
+ *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     &lt;sequence>
+ *                                       &lt;element name="taxon" maxOccurs="unbounded">
+ *                                         &lt;complexType>
+ *                                           &lt;complexContent>
+ *                                             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                             &lt;/restriction>
+ *                                           &lt;/complexContent>
+ *                                         &lt;/complexType>
+ *                                       &lt;/element>
+ *                                     &lt;/sequence>
+ *                                   &lt;/restriction>
+ *                                 &lt;/complexContent>
+ *                               &lt;/complexType>
+ *                             &lt;/element>
+ *                           &lt;/sequence>
+ *                           &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           &lt;attribute name="commonName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           &lt;attribute name="taxId" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                         &lt;/restriction>
+ *                       &lt;/complexContent>
+ *                     &lt;/complexType>
+ *                   &lt;/element>
+ *                   &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+ *                   &lt;element name="qualifier" maxOccurs="unbounded" minOccurs="0">
+ *                     &lt;complexType>
+ *                       &lt;complexContent>
+ *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           &lt;sequence>
+ *                             &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           &lt;/sequence>
+ *                           &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         &lt;/restriction>
+ *                       &lt;/complexContent>
+ *                     &lt;/complexType>
+ *                   &lt;/element>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="location" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="assembly" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="range" maxOccurs="unbounded">
+ *                     &lt;complexType>
+ *                       &lt;complexContent>
+ *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                           &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                         &lt;/restriction>
+ *                       &lt;/complexContent>
+ *                     &lt;/complexType>
+ *                   &lt;/element>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="contig" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;choice maxOccurs="unbounded" minOccurs="0">
+ *                     &lt;element name="range">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="gap">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                             &lt;attribute name="unknownLength" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/choice>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="entryVersion" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="dataClass" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="taxonomicDivision" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="moleculeType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="sequenceLength" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="topology" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="circular"/>
+ *             &lt;enumeration value="linear"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="firstPublic" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="firstPublicRelease" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       &lt;attribute name="lastUpdated" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="lastUpdatedRelease" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EntryType", propOrder = {
+    "secondaryAccession",
+    "projectAccession",
+    "description",
+    "comment",
+    "keyword",
+    "reference",
+    "xref",
+    "feature",
+    "assembly",
+    "contig",
+    "sequence"
+})
+public class EntryType {
+
+    protected List<String> secondaryAccession;
+    protected List<String> projectAccession;
+    @XmlElement(required = true)
+    protected String description;
+    protected String comment;
+    protected List<String> keyword;
+    protected List<EntryType.Reference> reference;
+    protected List<XrefType> xref;
+    protected List<EntryType.Feature> feature;
+    protected EntryType.Assembly assembly;
+    protected EntryType.Contig contig;
+    protected String sequence;
+    @XmlAttribute(name = "accession", required = true)
+    protected String accession;
+    @XmlAttribute(name = "version", required = true)
+    protected BigInteger version;
+    @XmlAttribute(name = "entryVersion")
+    protected BigInteger entryVersion;
+    @XmlAttribute(name = "dataClass", required = true)
+    protected String dataClass;
+    @XmlAttribute(name = "taxonomicDivision", required = true)
+    protected String taxonomicDivision;
+    @XmlAttribute(name = "moleculeType", required = true)
+    protected String moleculeType;
+    @XmlAttribute(name = "sequenceLength", required = true)
+    protected BigInteger sequenceLength;
+    @XmlAttribute(name = "topology", required = true)
+    protected String topology;
+    @XmlAttribute(name = "firstPublic")
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar firstPublic;
+    @XmlAttribute(name = "firstPublicRelease")
+    protected BigInteger firstPublicRelease;
+    @XmlAttribute(name = "lastUpdated")
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar lastUpdated;
+    @XmlAttribute(name = "lastUpdatedRelease")
+    protected BigInteger lastUpdatedRelease;
+
+    /**
+     * Gets the value of the secondaryAccession property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the secondaryAccession property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSecondaryAccession().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getSecondaryAccession() {
+        if (secondaryAccession == null) {
+            secondaryAccession = new ArrayList<String>();
+        }
+        return this.secondaryAccession;
+    }
+
+    /**
+     * Gets the value of the projectAccession property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the projectAccession property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProjectAccession().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getProjectAccession() {
+        if (projectAccession == null) {
+            projectAccession = new ArrayList<String>();
+        }
+        return this.projectAccession;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the comment property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getComment() {
+        return comment;
+    }
+
+    /**
+     * Sets the value of the comment property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setComment(String value) {
+        this.comment = value;
+    }
+
+    /**
+     * Gets the value of the keyword property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the keyword property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getKeyword().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getKeyword() {
+        if (keyword == null) {
+            keyword = new ArrayList<String>();
+        }
+        return this.keyword;
+    }
+
+    /**
+     * Gets the value of the reference property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the reference property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getReference().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EntryType.Reference }
+     * 
+     * 
+     */
+    public List<EntryType.Reference> getReference() {
+        if (reference == null) {
+            reference = new ArrayList<EntryType.Reference>();
+        }
+        return this.reference;
+    }
+
+    /**
+     * Gets the value of the xref property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the xref property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getXref().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link XrefType }
+     * 
+     * 
+     */
+    public List<XrefType> getXref() {
+        if (xref == null) {
+            xref = new ArrayList<XrefType>();
+        }
+        return this.xref;
+    }
+
+    /**
+     * Gets the value of the feature property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the feature property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getFeature().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EntryType.Feature }
+     * 
+     * 
+     */
+    public List<EntryType.Feature> getFeature() {
+        if (feature == null) {
+            feature = new ArrayList<EntryType.Feature>();
+        }
+        return this.feature;
+    }
+
+    /**
+     * Gets the value of the assembly property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntryType.Assembly }
+     *     
+     */
+    public EntryType.Assembly getAssembly() {
+        return assembly;
+    }
+
+    /**
+     * Sets the value of the assembly property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntryType.Assembly }
+     *     
+     */
+    public void setAssembly(EntryType.Assembly value) {
+        this.assembly = value;
+    }
+
+    /**
+     * Gets the value of the contig property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntryType.Contig }
+     *     
+     */
+    public EntryType.Contig getContig() {
+        return contig;
+    }
+
+    /**
+     * Sets the value of the contig property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntryType.Contig }
+     *     
+     */
+    public void setContig(EntryType.Contig value) {
+        this.contig = value;
+    }
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequence(String value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the accession property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAccession() {
+        return accession;
+    }
+
+    /**
+     * Sets the value of the accession property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAccession(String value) {
+        this.accession = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setVersion(BigInteger value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the entryVersion property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getEntryVersion() {
+        return entryVersion;
+    }
+
+    /**
+     * Sets the value of the entryVersion property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setEntryVersion(BigInteger value) {
+        this.entryVersion = value;
+    }
+
+    /**
+     * Gets the value of the dataClass property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDataClass() {
+        return dataClass;
+    }
+
+    /**
+     * Sets the value of the dataClass property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDataClass(String value) {
+        this.dataClass = value;
+    }
+
+    /**
+     * Gets the value of the taxonomicDivision property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTaxonomicDivision() {
+        return taxonomicDivision;
+    }
+
+    /**
+     * Sets the value of the taxonomicDivision property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTaxonomicDivision(String value) {
+        this.taxonomicDivision = value;
+    }
+
+    /**
+     * Gets the value of the moleculeType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getMoleculeType() {
+        return moleculeType;
+    }
+
+    /**
+     * Sets the value of the moleculeType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setMoleculeType(String value) {
+        this.moleculeType = value;
+    }
+
+    /**
+     * Gets the value of the sequenceLength property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getSequenceLength() {
+        return sequenceLength;
+    }
+
+    /**
+     * Sets the value of the sequenceLength property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setSequenceLength(BigInteger value) {
+        this.sequenceLength = value;
+    }
+
+    /**
+     * Gets the value of the topology property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTopology() {
+        return topology;
+    }
+
+    /**
+     * Sets the value of the topology property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTopology(String value) {
+        this.topology = value;
+    }
+
+    /**
+     * Gets the value of the firstPublic property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getFirstPublic() {
+        return firstPublic;
+    }
+
+    /**
+     * Sets the value of the firstPublic property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setFirstPublic(XMLGregorianCalendar value) {
+        this.firstPublic = value;
+    }
+
+    /**
+     * Gets the value of the firstPublicRelease property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getFirstPublicRelease() {
+        return firstPublicRelease;
+    }
+
+    /**
+     * Sets the value of the firstPublicRelease property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setFirstPublicRelease(BigInteger value) {
+        this.firstPublicRelease = value;
+    }
+
+    /**
+     * Gets the value of the lastUpdated property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getLastUpdated() {
+        return lastUpdated;
+    }
+
+    /**
+     * Sets the value of the lastUpdated property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setLastUpdated(XMLGregorianCalendar value) {
+        this.lastUpdated = value;
+    }
+
+    /**
+     * Gets the value of the lastUpdatedRelease property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getLastUpdatedRelease() {
+        return lastUpdatedRelease;
+    }
+
+    /**
+     * Sets the value of the lastUpdatedRelease property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setLastUpdatedRelease(BigInteger value) {
+        this.lastUpdatedRelease = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="range" maxOccurs="unbounded">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                 &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "range"
+    })
+    public static class Assembly {
+
+        @XmlElement(required = true)
+        protected List<EntryType.Assembly.Range> range;
+
+        /**
+         * Gets the value of the range property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the range property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getRange().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EntryType.Assembly.Range }
+         * 
+         * 
+         */
+        public List<EntryType.Assembly.Range> getRange() {
+            if (range == null) {
+                range = new ArrayList<EntryType.Assembly.Range>();
+            }
+            return this.range;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Range {
+
+            @XmlAttribute(name = "begin", required = true)
+            protected BigInteger begin;
+            @XmlAttribute(name = "end", required = true)
+            protected BigInteger end;
+            @XmlAttribute(name = "primaryBegin")
+            protected BigInteger primaryBegin;
+            @XmlAttribute(name = "primaryEnd")
+            protected BigInteger primaryEnd;
+            @XmlAttribute(name = "accession", required = true)
+            protected String accession;
+            @XmlAttribute(name = "version", required = true)
+            protected BigInteger version;
+            @XmlAttribute(name = "complement")
+            protected Boolean complement;
+
+            /**
+             * Gets the value of the begin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getBegin() {
+                return begin;
+            }
+
+            /**
+             * Sets the value of the begin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setBegin(BigInteger value) {
+                this.begin = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setEnd(BigInteger value) {
+                this.end = value;
+            }
+
+            /**
+             * Gets the value of the primaryBegin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryBegin() {
+                return primaryBegin;
+            }
+
+            /**
+             * Sets the value of the primaryBegin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryBegin(BigInteger value) {
+                this.primaryBegin = value;
+            }
+
+            /**
+             * Gets the value of the primaryEnd property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryEnd() {
+                return primaryEnd;
+            }
+
+            /**
+             * Sets the value of the primaryEnd property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryEnd(BigInteger value) {
+                this.primaryEnd = value;
+            }
+
+            /**
+             * Gets the value of the accession property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getAccession() {
+                return accession;
+            }
+
+            /**
+             * Sets the value of the accession property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setAccession(String value) {
+                this.accession = value;
+            }
+
+            /**
+             * Gets the value of the version property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getVersion() {
+                return version;
+            }
+
+            /**
+             * Sets the value of the version property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setVersion(BigInteger value) {
+                this.version = value;
+            }
+
+            /**
+             * Gets the value of the complement property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isComplement() {
+                if (complement == null) {
+                    return false;
+                } else {
+                    return complement;
+                }
+            }
+
+            /**
+             * Sets the value of the complement property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setComplement(Boolean value) {
+                this.complement = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;choice maxOccurs="unbounded" minOccurs="0">
+     *           &lt;element name="range">
+     *             &lt;complexType>
+     *               &lt;complexContent>
+     *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                   &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                   &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                 &lt;/restriction>
+     *               &lt;/complexContent>
+     *             &lt;/complexType>
+     *           &lt;/element>
+     *           &lt;element name="gap">
+     *             &lt;complexType>
+     *               &lt;complexContent>
+     *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                   &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *                   &lt;attribute name="unknownLength" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                 &lt;/restriction>
+     *               &lt;/complexContent>
+     *             &lt;/complexType>
+     *           &lt;/element>
+     *         &lt;/choice>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "rangeOrGap"
+    })
+    public static class Contig {
+
+        @XmlElements({
+            @XmlElement(name = "range", type = EntryType.Contig.Range.class),
+            @XmlElement(name = "gap", type = EntryType.Contig.Gap.class)
+        })
+        protected List<Object> rangeOrGap;
+
+        /**
+         * Gets the value of the rangeOrGap property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the rangeOrGap property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getRangeOrGap().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EntryType.Contig.Range }
+         * {@link EntryType.Contig.Gap }
+         * 
+         * 
+         */
+        public List<Object> getRangeOrGap() {
+            if (rangeOrGap == null) {
+                rangeOrGap = new ArrayList<Object>();
+            }
+            return this.rangeOrGap;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="unknownLength" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Gap {
+
+            @XmlAttribute(name = "begin", required = true)
+            protected BigInteger begin;
+            @XmlAttribute(name = "end", required = true)
+            protected BigInteger end;
+            @XmlAttribute(name = "length", required = true)
+            protected BigInteger length;
+            @XmlAttribute(name = "unknownLength")
+            protected Boolean unknownLength;
+
+            /**
+             * Gets the value of the begin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getBegin() {
+                return begin;
+            }
+
+            /**
+             * Sets the value of the begin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setBegin(BigInteger value) {
+                this.begin = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setEnd(BigInteger value) {
+                this.end = value;
+            }
+
+            /**
+             * Gets the value of the length property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getLength() {
+                return length;
+            }
+
+            /**
+             * Sets the value of the length property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setLength(BigInteger value) {
+                this.length = value;
+            }
+
+            /**
+             * Gets the value of the unknownLength property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isUnknownLength() {
+                if (unknownLength == null) {
+                    return false;
+                } else {
+                    return unknownLength;
+                }
+            }
+
+            /**
+             * Sets the value of the unknownLength property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setUnknownLength(Boolean value) {
+                this.unknownLength = value;
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryBegin" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="primaryEnd" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="accession" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *       &lt;attribute name="complement" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Range {
+
+            @XmlAttribute(name = "begin", required = true)
+            protected BigInteger begin;
+            @XmlAttribute(name = "end", required = true)
+            protected BigInteger end;
+            @XmlAttribute(name = "primaryBegin")
+            protected BigInteger primaryBegin;
+            @XmlAttribute(name = "primaryEnd")
+            protected BigInteger primaryEnd;
+            @XmlAttribute(name = "accession", required = true)
+            protected String accession;
+            @XmlAttribute(name = "version", required = true)
+            protected BigInteger version;
+            @XmlAttribute(name = "complement")
+            protected Boolean complement;
+
+            /**
+             * Gets the value of the begin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getBegin() {
+                return begin;
+            }
+
+            /**
+             * Sets the value of the begin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setBegin(BigInteger value) {
+                this.begin = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setEnd(BigInteger value) {
+                this.end = value;
+            }
+
+            /**
+             * Gets the value of the primaryBegin property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryBegin() {
+                return primaryBegin;
+            }
+
+            /**
+             * Sets the value of the primaryBegin property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryBegin(BigInteger value) {
+                this.primaryBegin = value;
+            }
+
+            /**
+             * Gets the value of the primaryEnd property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getPrimaryEnd() {
+                return primaryEnd;
+            }
+
+            /**
+             * Sets the value of the primaryEnd property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setPrimaryEnd(BigInteger value) {
+                this.primaryEnd = value;
+            }
+
+            /**
+             * Gets the value of the accession property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getAccession() {
+                return accession;
+            }
+
+            /**
+             * Sets the value of the accession property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setAccession(String value) {
+                this.accession = value;
+            }
+
+            /**
+             * Gets the value of the version property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getVersion() {
+                return version;
+            }
+
+            /**
+             * Sets the value of the version property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setVersion(BigInteger value) {
+                this.version = value;
+            }
+
+            /**
+             * Gets the value of the complement property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isComplement() {
+                if (complement == null) {
+                    return false;
+                } else {
+                    return complement;
+                }
+            }
+
+            /**
+             * Sets the value of the complement property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setComplement(Boolean value) {
+                this.complement = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="taxon" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="lineage" minOccurs="0">
+     *                     &lt;complexType>
+     *                       &lt;complexContent>
+     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           &lt;sequence>
+     *                             &lt;element name="taxon" maxOccurs="unbounded">
+     *                               &lt;complexType>
+     *                                 &lt;complexContent>
+     *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                                   &lt;/restriction>
+     *                                 &lt;/complexContent>
+     *                               &lt;/complexType>
+     *                             &lt;/element>
+     *                           &lt;/sequence>
+     *                         &lt;/restriction>
+     *                       &lt;/complexContent>
+     *                     &lt;/complexType>
+     *                   &lt;/element>
+     *                 &lt;/sequence>
+     *                 &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="commonName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="taxId" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="qualifier" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 &lt;/sequence>
+     *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="location" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "taxon",
+        "xref",
+        "qualifier"
+    })
+    public static class Feature {
+
+        protected EntryType.Feature.FeatureTaxon taxon;
+        protected List<XrefType> xref;
+        protected List<EntryType.Feature.Qualifier> qualifier;
+        @XmlAttribute(name = "name", required = true)
+        protected String name;
+        @XmlAttribute(name = "location", required = true)
+        protected String location;
+
+        /**
+         * Gets the value of the taxon property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EntryType.Feature.FeatureTaxon }
+         *     
+         */
+        public EntryType.Feature.FeatureTaxon getTaxon() {
+            return taxon;
+        }
+
+        /**
+         * Sets the value of the taxon property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EntryType.Feature.FeatureTaxon }
+         *     
+         */
+        public void setTaxon(EntryType.Feature.FeatureTaxon value) {
+            this.taxon = value;
+        }
+
+        /**
+         * Gets the value of the xref property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the xref property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getXref().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link XrefType }
+         * 
+         * 
+         */
+        public List<XrefType> getXref() {
+            if (xref == null) {
+                xref = new ArrayList<XrefType>();
+            }
+            return this.xref;
+        }
+
+        /**
+         * Gets the value of the qualifier property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the qualifier property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getQualifier().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EntryType.Feature.Qualifier }
+         * 
+         * 
+         */
+        public List<EntryType.Feature.Qualifier> getQualifier() {
+            if (qualifier == null) {
+                qualifier = new ArrayList<EntryType.Feature.Qualifier>();
+            }
+            return this.qualifier;
+        }
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the location property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLocation() {
+            return location;
+        }
+
+        /**
+         * Sets the value of the location property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLocation(String value) {
+            this.location = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="lineage" minOccurs="0">
+         *           &lt;complexType>
+         *             &lt;complexContent>
+         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 &lt;sequence>
+         *                   &lt;element name="taxon" maxOccurs="unbounded">
+         *                     &lt;complexType>
+         *                       &lt;complexContent>
+         *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                         &lt;/restriction>
+         *                       &lt;/complexContent>
+         *                     &lt;/complexType>
+         *                   &lt;/element>
+         *                 &lt;/sequence>
+         *               &lt;/restriction>
+         *             &lt;/complexContent>
+         *           &lt;/complexType>
+         *         &lt;/element>
+         *       &lt;/sequence>
+         *       &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="commonName" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="taxId" type="{http://www.w3.org/2001/XMLSchema}integer" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "lineage"
+        })
+        public static class FeatureTaxon {
+
+            protected EntryType.Feature.FeatureTaxon.Lineage lineage;
+            @XmlAttribute(name = "scientificName", required = true)
+            protected String scientificName;
+            @XmlAttribute(name = "commonName")
+            protected String commonName;
+            @XmlAttribute(name = "taxId")
+            protected BigInteger taxId;
+
+            /**
+             * Gets the value of the lineage property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link EntryType.Feature.FeatureTaxon.Lineage }
+             *     
+             */
+            public EntryType.Feature.FeatureTaxon.Lineage getLineage() {
+                return lineage;
+            }
+
+            /**
+             * Sets the value of the lineage property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link EntryType.Feature.FeatureTaxon.Lineage }
+             *     
+             */
+            public void setLineage(EntryType.Feature.FeatureTaxon.Lineage value) {
+                this.lineage = value;
+            }
+
+            /**
+             * Gets the value of the scientificName property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getScientificName() {
+                return scientificName;
+            }
+
+            /**
+             * Sets the value of the scientificName property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setScientificName(String value) {
+                this.scientificName = value;
+            }
+
+            /**
+             * Gets the value of the commonName property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getCommonName() {
+                return commonName;
+            }
+
+            /**
+             * Sets the value of the commonName property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setCommonName(String value) {
+                this.commonName = value;
+            }
+
+            /**
+             * Gets the value of the taxId property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link BigInteger }
+             *     
+             */
+            public BigInteger getTaxId() {
+                return taxId;
+            }
+
+            /**
+             * Sets the value of the taxId property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link BigInteger }
+             *     
+             */
+            public void setTaxId(BigInteger value) {
+                this.taxId = value;
+            }
+
+
+            /**
+             * <p>Java class for anonymous complex type.
+             * 
+             * <p>The following schema fragment specifies the expected content contained within this class.
+             * 
+             * <pre>
+             * &lt;complexType>
+             *   &lt;complexContent>
+             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       &lt;sequence>
+             *         &lt;element name="taxon" maxOccurs="unbounded">
+             *           &lt;complexType>
+             *             &lt;complexContent>
+             *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *               &lt;/restriction>
+             *             &lt;/complexContent>
+             *           &lt;/complexType>
+             *         &lt;/element>
+             *       &lt;/sequence>
+             *     &lt;/restriction>
+             *   &lt;/complexContent>
+             * &lt;/complexType>
+             * </pre>
+             * 
+             * 
+             */
+            @XmlAccessorType(XmlAccessType.FIELD)
+            @XmlType(name = "", propOrder = {
+                "taxon"
+            })
+            public static class Lineage {
+
+                @XmlElement(required = true)
+                protected List<EntryType.Feature.FeatureTaxon.Lineage.Taxon> taxon;
+
+                /**
+                 * Gets the value of the taxon property.
+                 * 
+                 * <p>
+                 * This accessor method returns a reference to the live list,
+                 * not a snapshot. Therefore any modification you make to the
+                 * returned list will be present inside the JAXB object.
+                 * This is why there is not a <CODE>set</CODE> method for the taxon property.
+                 * 
+                 * <p>
+                 * For example, to add a new item, do as follows:
+                 * <pre>
+                 *    getTaxon().add(newItem);
+                 * </pre>
+                 * 
+                 * 
+                 * <p>
+                 * Objects of the following type(s) are allowed in the list
+                 * {@link EntryType.Feature.FeatureTaxon.Lineage.Taxon }
+                 * 
+                 * 
+                 */
+                public List<EntryType.Feature.FeatureTaxon.Lineage.Taxon> getTaxon() {
+                    if (taxon == null) {
+                        taxon = new ArrayList<EntryType.Feature.FeatureTaxon.Lineage.Taxon>();
+                    }
+                    return this.taxon;
+                }
+
+
+                /**
+                 * <p>Java class for anonymous complex type.
+                 * 
+                 * <p>The following schema fragment specifies the expected content contained within this class.
+                 * 
+                 * <pre>
+                 * &lt;complexType>
+                 *   &lt;complexContent>
+                 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       &lt;attribute name="scientificName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+                 *     &lt;/restriction>
+                 *   &lt;/complexContent>
+                 * &lt;/complexType>
+                 * </pre>
+                 * 
+                 * 
+                 */
+                @XmlAccessorType(XmlAccessType.FIELD)
+                @XmlType(name = "")
+                public static class Taxon {
+
+                    @XmlAttribute(name = "scientificName", required = true)
+                    protected String scientificName;
+
+                    /**
+                     * Gets the value of the scientificName property.
+                     * 
+                     * @return
+                     *     possible object is
+                     *     {@link String }
+                     *     
+                     */
+                    public String getScientificName() {
+                        return scientificName;
+                    }
+
+                    /**
+                     * Sets the value of the scientificName property.
+                     * 
+                     * @param value
+                     *     allowed object is
+                     *     {@link String }
+                     *     
+                     */
+                    public void setScientificName(String value) {
+                        this.scientificName = value;
+                    }
+
+                }
+
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       &lt;/sequence>
+         *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "value"
+        })
+        public static class Qualifier {
+
+            protected String value;
+            @XmlAttribute(name = "name", required = true)
+            protected String name;
+
+            /**
+             * Gets the value of the value property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getValue() {
+                return value;
+            }
+
+            /**
+             * Sets the value of the value property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setValue(String value) {
+                this.value = value;
+            }
+
+            /**
+             * Gets the value of the name property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getName() {
+                return name;
+            }
+
+            /**
+             * Sets the value of the name property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setName(String value) {
+                this.name = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="author" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="applicant" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="consortium" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="submissionDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
+     *         &lt;element name="journal" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="year" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="volume" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="issue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="firstPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="lastPage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="comment" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="referenceLocation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *         &lt;element name="xref" type="{}XrefType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="type" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+     *             &lt;enumeration value="submission"/>
+     *             &lt;enumeration value="book"/>
+     *             &lt;enumeration value="article"/>
+     *             &lt;enumeration value="patent"/>
+     *             &lt;enumeration value="thesis"/>
+     *             &lt;enumeration value="unpublished"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *       &lt;attribute name="number" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *       &lt;attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "title",
+        "author",
+        "applicant",
+        "consortium",
+        "submissionDate",
+        "journal",
+        "year",
+        "volume",
+        "issue",
+        "firstPage",
+        "lastPage",
+        "comment",
+        "referenceLocation",
+        "xref"
+    })
+    public static class Reference {
+
+        protected String title;
+        protected List<String> author;
+        protected List<String> applicant;
+        protected String consortium;
+        @XmlSchemaType(name = "date")
+        protected XMLGregorianCalendar submissionDate;
+        protected String journal;
+        protected String year;
+        protected String volume;
+        protected String issue;
+        protected String firstPage;
+        protected String lastPage;
+        protected String comment;
+        protected String referenceLocation;
+        protected List<XrefType> xref;
+        @XmlAttribute(name = "type", required = true)
+        protected String type;
+        @XmlAttribute(name = "number", required = true)
+        protected BigInteger number;
+        @XmlAttribute(name = "location")
+        protected String location;
+
+        /**
+         * Gets the value of the title property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getTitle() {
+            return title;
+        }
+
+        /**
+         * Sets the value of the title property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setTitle(String value) {
+            this.title = value;
+        }
+
+        /**
+         * Gets the value of the author property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the author property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getAuthor().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getAuthor() {
+            if (author == null) {
+                author = new ArrayList<String>();
+            }
+            return this.author;
+        }
+
+        /**
+         * Gets the value of the applicant property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the applicant property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getApplicant().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getApplicant() {
+            if (applicant == null) {
+                applicant = new ArrayList<String>();
+            }
+            return this.applicant;
+        }
+
+        /**
+         * Gets the value of the consortium property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getConsortium() {
+            return consortium;
+        }
+
+        /**
+         * Sets the value of the consortium property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setConsortium(String value) {
+            this.consortium = value;
+        }
+
+        /**
+         * Gets the value of the submissionDate property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link XMLGregorianCalendar }
+         *     
+         */
+        public XMLGregorianCalendar getSubmissionDate() {
+            return submissionDate;
+        }
+
+        /**
+         * Sets the value of the submissionDate property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link XMLGregorianCalendar }
+         *     
+         */
+        public void setSubmissionDate(XMLGregorianCalendar value) {
+            this.submissionDate = value;
+        }
+
+        /**
+         * Gets the value of the journal property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getJournal() {
+            return journal;
+        }
+
+        /**
+         * Sets the value of the journal property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setJournal(String value) {
+            this.journal = value;
+        }
+
+        /**
+         * Gets the value of the year property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getYear() {
+            return year;
+        }
+
+        /**
+         * Sets the value of the year property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setYear(String value) {
+            this.year = value;
+        }
+
+        /**
+         * Gets the value of the volume property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getVolume() {
+            return volume;
+        }
+
+        /**
+         * Sets the value of the volume property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setVolume(String value) {
+            this.volume = value;
+        }
+
+        /**
+         * Gets the value of the issue property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getIssue() {
+            return issue;
+        }
+
+        /**
+         * Sets the value of the issue property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setIssue(String value) {
+            this.issue = value;
+        }
+
+        /**
+         * Gets the value of the firstPage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFirstPage() {
+            return firstPage;
+        }
+
+        /**
+         * Sets the value of the firstPage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFirstPage(String value) {
+            this.firstPage = value;
+        }
+
+        /**
+         * Gets the value of the lastPage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLastPage() {
+            return lastPage;
+        }
+
+        /**
+         * Sets the value of the lastPage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLastPage(String value) {
+            this.lastPage = value;
+        }
+
+        /**
+         * Gets the value of the comment property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getComment() {
+            return comment;
+        }
+
+        /**
+         * Sets the value of the comment property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setComment(String value) {
+            this.comment = value;
+        }
+
+        /**
+         * Gets the value of the referenceLocation property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getReferenceLocation() {
+            return referenceLocation;
+        }
+
+        /**
+         * Sets the value of the referenceLocation property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setReferenceLocation(String value) {
+            this.referenceLocation = value;
+        }
+
+        /**
+         * Gets the value of the xref property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the xref property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getXref().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link XrefType }
+         * 
+         * 
+         */
+        public List<XrefType> getXref() {
+            if (xref == null) {
+                xref = new ArrayList<XrefType>();
+            }
+            return this.xref;
+        }
+
+        /**
+         * Gets the value of the type property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getType() {
+            return type;
+        }
+
+        /**
+         * Sets the value of the type property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setType(String value) {
+            this.type = value;
+        }
+
+        /**
+         * Gets the value of the number property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link BigInteger }
+         *     
+         */
+        public BigInteger getNumber() {
+            return number;
+        }
+
+        /**
+         * Sets the value of the number property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link BigInteger }
+         *     
+         */
+        public void setNumber(BigInteger value) {
+            this.number = value;
+        }
+
+        /**
+         * Gets the value of the location property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLocation() {
+            return location;
+        }
+
+        /**
+         * Sets the value of the location property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLocation(String value) {
+            this.location = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/ObjectFactory.java b/src/jalview/xml/binding/embl/ObjectFactory.java
new file mode 100644 (file)
index 0000000..d5629ca
--- /dev/null
@@ -0,0 +1,159 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the jalview.xml.binding.embl package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: jalview.xml.binding.embl
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link EntryType }
+     * 
+     */
+    public EntryType createEntryType() {
+        return new EntryType();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Contig }
+     * 
+     */
+    public EntryType.Contig createEntryTypeContig() {
+        return new EntryType.Contig();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Assembly }
+     * 
+     */
+    public EntryType.Assembly createEntryTypeAssembly() {
+        return new EntryType.Assembly();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature }
+     * 
+     */
+    public EntryType.Feature createEntryTypeFeature() {
+        return new EntryType.Feature();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.FeatureTaxon }
+     * 
+     */
+    public EntryType.Feature.FeatureTaxon createEntryTypeFeatureFeatureTaxon() {
+        return new EntryType.Feature.FeatureTaxon();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.FeatureTaxon.Lineage }
+     * 
+     */
+    public EntryType.Feature.FeatureTaxon.Lineage createEntryTypeFeatureFeatureTaxonLineage() {
+        return new EntryType.Feature.FeatureTaxon.Lineage();
+    }
+
+    /**
+     * Create an instance of {@link ROOT }
+     * 
+     */
+    public ROOT createROOT() {
+        return new ROOT();
+    }
+
+    /**
+     * Create an instance of {@link EntrySetType }
+     * 
+     */
+    public EntrySetType createEntrySetType() {
+        return new EntrySetType();
+    }
+
+    /**
+     * Create an instance of {@link XrefType }
+     * 
+     */
+    public XrefType createXrefType() {
+        return new XrefType();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Reference }
+     * 
+     */
+    public EntryType.Reference createEntryTypeReference() {
+        return new EntryType.Reference();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Contig.Range }
+     * 
+     */
+    public EntryType.Contig.Range createEntryTypeContigRange() {
+        return new EntryType.Contig.Range();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Contig.Gap }
+     * 
+     */
+    public EntryType.Contig.Gap createEntryTypeContigGap() {
+        return new EntryType.Contig.Gap();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Assembly.Range }
+     * 
+     */
+    public EntryType.Assembly.Range createEntryTypeAssemblyRange() {
+        return new EntryType.Assembly.Range();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.Qualifier }
+     * 
+     */
+    public EntryType.Feature.Qualifier createEntryTypeFeatureQualifier() {
+        return new EntryType.Feature.Qualifier();
+    }
+
+    /**
+     * Create an instance of {@link EntryType.Feature.FeatureTaxon.Lineage.Taxon }
+     * 
+     */
+    public EntryType.Feature.FeatureTaxon.Lineage.Taxon createEntryTypeFeatureFeatureTaxonLineageTaxon() {
+        return new EntryType.Feature.FeatureTaxon.Lineage.Taxon();
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/ROOT.java b/src/jalview/xml/binding/embl/ROOT.java
new file mode 100644 (file)
index 0000000..f7f522d
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;choice>
+ *         &lt;element name="entrySet" type="{}EntrySetType"/>
+ *         &lt;element name="entry" type="{}EntryType"/>
+ *       &lt;/choice>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "entrySet",
+    "entry"
+})
+@XmlRootElement(name = "ROOT")
+public class ROOT {
+
+    protected EntrySetType entrySet;
+    protected EntryType entry;
+
+    /**
+     * Gets the value of the entrySet property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntrySetType }
+     *     
+     */
+    public EntrySetType getEntrySet() {
+        return entrySet;
+    }
+
+    /**
+     * Sets the value of the entrySet property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntrySetType }
+     *     
+     */
+    public void setEntrySet(EntrySetType value) {
+        this.entrySet = value;
+    }
+
+    /**
+     * Gets the value of the entry property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EntryType }
+     *     
+     */
+    public EntryType getEntry() {
+        return entry;
+    }
+
+    /**
+     * Sets the value of the entry property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EntryType }
+     *     
+     */
+    public void setEntry(EntryType value) {
+        this.entry = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/embl/XrefType.java b/src/jalview/xml/binding/embl/XrefType.java
new file mode 100644 (file)
index 0000000..9608b79
--- /dev/null
@@ -0,0 +1,121 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.14 at 02:46:00 PM BST 
+//
+
+
+package jalview.xml.binding.embl;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Database cross-reference.
+ * 
+ * <p>Java class for XrefType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="XrefType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="db" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="secondaryId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "XrefType")
+public class XrefType {
+
+    @XmlAttribute(name = "db", required = true)
+    protected String db;
+    @XmlAttribute(name = "id", required = true)
+    protected String id;
+    @XmlAttribute(name = "secondaryId")
+    protected String secondaryId;
+
+    /**
+     * Gets the value of the db property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDb() {
+        return db;
+    }
+
+    /**
+     * Sets the value of the db property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDb(String value) {
+        this.db = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the secondaryId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSecondaryId() {
+        return secondaryId;
+    }
+
+    /**
+     * Sets the value of the secondaryId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSecondaryId(String value) {
+        this.secondaryId = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/AlcodonFrame.java b/src/jalview/xml/binding/jalview/AlcodonFrame.java
new file mode 100644 (file)
index 0000000..370ecc5
--- /dev/null
@@ -0,0 +1,326 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="alcodon" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="pos1" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                 &lt;attribute name="pos2" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *                 &lt;attribute name="pos3" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="alcodMap" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Mapping"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="dnasq" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "alcodon",
+    "alcodMap"
+})
+@XmlRootElement(name = "AlcodonFrame")
+public class AlcodonFrame {
+
+    protected List<AlcodonFrame.Alcodon> alcodon;
+    protected List<AlcodonFrame.AlcodMap> alcodMap;
+
+    /**
+     * Gets the value of the alcodon property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the alcodon property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAlcodon().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link AlcodonFrame.Alcodon }
+     * 
+     * 
+     */
+    public List<AlcodonFrame.Alcodon> getAlcodon() {
+        if (alcodon == null) {
+            alcodon = new ArrayList<AlcodonFrame.Alcodon>();
+        }
+        return this.alcodon;
+    }
+
+    /**
+     * Gets the value of the alcodMap property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the alcodMap property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAlcodMap().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link AlcodonFrame.AlcodMap }
+     * 
+     * 
+     */
+    public List<AlcodonFrame.AlcodMap> getAlcodMap() {
+        if (alcodMap == null) {
+            alcodMap = new ArrayList<AlcodonFrame.AlcodMap>();
+        }
+        return this.alcodMap;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Mapping"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="dnasq" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "mapping"
+    })
+    public static class AlcodMap {
+
+        @XmlElement(name = "Mapping", required = true)
+        protected Mapping mapping;
+        @XmlAttribute(name = "dnasq", required = true)
+        protected String dnasq;
+
+        /**
+         * 
+         *                                                                             a Mapping entry and an associated protein sequence
+         *                                                                     
+         * 
+         * @return
+         *     possible object is
+         *     {@link Mapping }
+         *     
+         */
+        public Mapping getMapping() {
+            return mapping;
+        }
+
+        /**
+         * Sets the value of the mapping property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Mapping }
+         *     
+         */
+        public void setMapping(Mapping value) {
+            this.mapping = value;
+        }
+
+        /**
+         * Gets the value of the dnasq property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getDnasq() {
+            return dnasq;
+        }
+
+        /**
+         * Sets the value of the dnasq property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setDnasq(String value) {
+            this.dnasq = value;
+        }
+
+    }
+
+
+    /**
+     * 
+     *                                                                 specifies a series of aligned codons from an associated DNA sequence alignment that when translated correspond to columns of a peptide alignment.
+     *                                                                 Element may have either all pos1,2,3 attributes specified, or none at all (indicating a gapped column with no translated peptide).
+     *                                                         
+     * 
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="pos1" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *       &lt;attribute name="pos2" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *       &lt;attribute name="pos3" type="{http://www.w3.org/2001/XMLSchema}integer" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class Alcodon {
+
+        @XmlAttribute(name = "pos1")
+        protected BigInteger pos1;
+        @XmlAttribute(name = "pos2")
+        protected BigInteger pos2;
+        @XmlAttribute(name = "pos3")
+        protected BigInteger pos3;
+
+        /**
+         * Gets the value of the pos1 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link BigInteger }
+         *     
+         */
+        public BigInteger getPos1() {
+            return pos1;
+        }
+
+        /**
+         * Sets the value of the pos1 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link BigInteger }
+         *     
+         */
+        public void setPos1(BigInteger value) {
+            this.pos1 = value;
+        }
+
+        /**
+         * Gets the value of the pos2 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link BigInteger }
+         *     
+         */
+        public BigInteger getPos2() {
+            return pos2;
+        }
+
+        /**
+         * Sets the value of the pos2 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link BigInteger }
+         *     
+         */
+        public void setPos2(BigInteger value) {
+            this.pos2 = value;
+        }
+
+        /**
+         * Gets the value of the pos3 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link BigInteger }
+         *     
+         */
+        public BigInteger getPos3() {
+            return pos3;
+        }
+
+        /**
+         * Sets the value of the pos3 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link BigInteger }
+         *     
+         */
+        public void setPos3(BigInteger value) {
+            this.pos3 = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/Annotation.java b/src/jalview/xml/binding/jalview/Annotation.java
new file mode 100644 (file)
index 0000000..148406e
--- /dev/null
@@ -0,0 +1,857 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}annotationElement" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="label" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="thresholdLine" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="label" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                 &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="property" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="graph" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="graphType" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="groupRef" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="graphColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="graphGroup" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="graphHeight" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="scoreOnly" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       &lt;attribute name="score" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="centreColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="scaleColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="showAllColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="autoCalculated" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       &lt;attribute name="belowAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *       &lt;attribute name="calcId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "annotationElement",
+    "label",
+    "description",
+    "thresholdLine",
+    "property"
+})
+@XmlRootElement(name = "Annotation")
+public class Annotation {
+
+    protected List<AnnotationElement> annotationElement;
+    @XmlElement(required = true)
+    protected String label;
+    protected String description;
+    protected Annotation.ThresholdLine thresholdLine;
+    protected List<Annotation.Property> property;
+    @XmlAttribute(name = "graph", required = true)
+    protected boolean graph;
+    @XmlAttribute(name = "graphType")
+    protected Integer graphType;
+    @XmlAttribute(name = "sequenceRef")
+    protected String sequenceRef;
+    @XmlAttribute(name = "groupRef")
+    protected String groupRef;
+    @XmlAttribute(name = "graphColour")
+    protected Integer graphColour;
+    @XmlAttribute(name = "graphGroup")
+    protected Integer graphGroup;
+    @XmlAttribute(name = "graphHeight")
+    protected Integer graphHeight;
+    @XmlAttribute(name = "id")
+    protected String id;
+    @XmlAttribute(name = "scoreOnly")
+    protected Boolean scoreOnly;
+    @XmlAttribute(name = "score")
+    protected Double score;
+    @XmlAttribute(name = "visible")
+    protected Boolean visible;
+    @XmlAttribute(name = "centreColLabels")
+    protected Boolean centreColLabels;
+    @XmlAttribute(name = "scaleColLabels")
+    protected Boolean scaleColLabels;
+    @XmlAttribute(name = "showAllColLabels")
+    protected Boolean showAllColLabels;
+    @XmlAttribute(name = "autoCalculated")
+    protected Boolean autoCalculated;
+    @XmlAttribute(name = "belowAlignment")
+    protected Boolean belowAlignment;
+    @XmlAttribute(name = "calcId")
+    protected String calcId;
+
+    /**
+     * Gets the value of the annotationElement property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the annotationElement property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAnnotationElement().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link AnnotationElement }
+     * 
+     * 
+     */
+    public List<AnnotationElement> getAnnotationElement() {
+        if (annotationElement == null) {
+            annotationElement = new ArrayList<AnnotationElement>();
+        }
+        return this.annotationElement;
+    }
+
+    /**
+     * Gets the value of the label property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLabel() {
+        return label;
+    }
+
+    /**
+     * Sets the value of the label property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLabel(String value) {
+        this.label = value;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the thresholdLine property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Annotation.ThresholdLine }
+     *     
+     */
+    public Annotation.ThresholdLine getThresholdLine() {
+        return thresholdLine;
+    }
+
+    /**
+     * Sets the value of the thresholdLine property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Annotation.ThresholdLine }
+     *     
+     */
+    public void setThresholdLine(Annotation.ThresholdLine value) {
+        this.thresholdLine = value;
+    }
+
+    /**
+     * Gets the value of the property property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the property property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProperty().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Annotation.Property }
+     * 
+     * 
+     */
+    public List<Annotation.Property> getProperty() {
+        if (property == null) {
+            property = new ArrayList<Annotation.Property>();
+        }
+        return this.property;
+    }
+
+    /**
+     * Gets the value of the graph property.
+     * 
+     */
+    public boolean isGraph() {
+        return graph;
+    }
+
+    /**
+     * Sets the value of the graph property.
+     * 
+     */
+    public void setGraph(boolean value) {
+        this.graph = value;
+    }
+
+    /**
+     * Gets the value of the graphType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getGraphType() {
+        return graphType;
+    }
+
+    /**
+     * Sets the value of the graphType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setGraphType(Integer value) {
+        this.graphType = value;
+    }
+
+    /**
+     * Gets the value of the sequenceRef property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequenceRef() {
+        return sequenceRef;
+    }
+
+    /**
+     * Sets the value of the sequenceRef property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequenceRef(String value) {
+        this.sequenceRef = value;
+    }
+
+    /**
+     * Gets the value of the groupRef property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getGroupRef() {
+        return groupRef;
+    }
+
+    /**
+     * Sets the value of the groupRef property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setGroupRef(String value) {
+        this.groupRef = value;
+    }
+
+    /**
+     * Gets the value of the graphColour property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getGraphColour() {
+        return graphColour;
+    }
+
+    /**
+     * Sets the value of the graphColour property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setGraphColour(Integer value) {
+        this.graphColour = value;
+    }
+
+    /**
+     * Gets the value of the graphGroup property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getGraphGroup() {
+        return graphGroup;
+    }
+
+    /**
+     * Sets the value of the graphGroup property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setGraphGroup(Integer value) {
+        this.graphGroup = value;
+    }
+
+    /**
+     * Gets the value of the graphHeight property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getGraphHeight() {
+        return graphHeight;
+    }
+
+    /**
+     * Sets the value of the graphHeight property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setGraphHeight(Integer value) {
+        this.graphHeight = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the scoreOnly property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public boolean isScoreOnly() {
+        if (scoreOnly == null) {
+            return false;
+        } else {
+            return scoreOnly;
+        }
+    }
+
+    /**
+     * Sets the value of the scoreOnly property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setScoreOnly(Boolean value) {
+        this.scoreOnly = value;
+    }
+
+    /**
+     * Gets the value of the score property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Double }
+     *     
+     */
+    public Double getScore() {
+        return score;
+    }
+
+    /**
+     * Sets the value of the score property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Double }
+     *     
+     */
+    public void setScore(Double value) {
+        this.score = value;
+    }
+
+    /**
+     * Gets the value of the visible property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isVisible() {
+        return visible;
+    }
+
+    /**
+     * Sets the value of the visible property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setVisible(Boolean value) {
+        this.visible = value;
+    }
+
+    /**
+     * Gets the value of the centreColLabels property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isCentreColLabels() {
+        return centreColLabels;
+    }
+
+    /**
+     * Sets the value of the centreColLabels property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setCentreColLabels(Boolean value) {
+        this.centreColLabels = value;
+    }
+
+    /**
+     * Gets the value of the scaleColLabels property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isScaleColLabels() {
+        return scaleColLabels;
+    }
+
+    /**
+     * Sets the value of the scaleColLabels property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setScaleColLabels(Boolean value) {
+        this.scaleColLabels = value;
+    }
+
+    /**
+     * Gets the value of the showAllColLabels property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isShowAllColLabels() {
+        return showAllColLabels;
+    }
+
+    /**
+     * Sets the value of the showAllColLabels property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setShowAllColLabels(Boolean value) {
+        this.showAllColLabels = value;
+    }
+
+    /**
+     * Gets the value of the autoCalculated property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public boolean isAutoCalculated() {
+        if (autoCalculated == null) {
+            return false;
+        } else {
+            return autoCalculated;
+        }
+    }
+
+    /**
+     * Sets the value of the autoCalculated property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setAutoCalculated(Boolean value) {
+        this.autoCalculated = value;
+    }
+
+    /**
+     * Gets the value of the belowAlignment property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public boolean isBelowAlignment() {
+        if (belowAlignment == null) {
+            return true;
+        } else {
+            return belowAlignment;
+        }
+    }
+
+    /**
+     * Sets the value of the belowAlignment property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setBelowAlignment(Boolean value) {
+        this.belowAlignment = value;
+    }
+
+    /**
+     * Gets the value of the calcId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCalcId() {
+        return calcId;
+    }
+
+    /**
+     * Sets the value of the calcId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCalcId(String value) {
+        this.calcId = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class Property {
+
+        @XmlAttribute(name = "name")
+        protected String name;
+        @XmlAttribute(name = "value")
+        protected String value;
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="label" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *       &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class ThresholdLine {
+
+        @XmlAttribute(name = "label")
+        protected String label;
+        @XmlAttribute(name = "value")
+        protected Float value;
+        @XmlAttribute(name = "colour")
+        protected Integer colour;
+
+        /**
+         * Gets the value of the label property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLabel() {
+            return label;
+        }
+
+        /**
+         * Sets the value of the label property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLabel(String value) {
+            this.label = value;
+        }
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Float }
+         *     
+         */
+        public Float getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Float }
+         *     
+         */
+        public void setValue(Float value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the colour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getColour() {
+            return colour;
+        }
+
+        /**
+         * Sets the value of the colour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setColour(Integer value) {
+            this.colour = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/AnnotationColourScheme.java b/src/jalview/xml/binding/jalview/AnnotationColourScheme.java
new file mode 100644 (file)
index 0000000..c9ee5f1
--- /dev/null
@@ -0,0 +1,254 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for AnnotationColourScheme complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="AnnotationColourScheme">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="aboveThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="annotation" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="minColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="maxColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="colourScheme" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *       &lt;attribute name="perSequence" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="predefinedColours" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "AnnotationColourScheme", namespace = "www.jalview.org")
+public class AnnotationColourScheme {
+
+    @XmlAttribute(name = "aboveThreshold")
+    protected Integer aboveThreshold;
+    @XmlAttribute(name = "annotation")
+    protected String annotation;
+    @XmlAttribute(name = "minColour")
+    protected Integer minColour;
+    @XmlAttribute(name = "maxColour")
+    protected Integer maxColour;
+    @XmlAttribute(name = "colourScheme")
+    protected String colourScheme;
+    @XmlAttribute(name = "threshold")
+    protected Float threshold;
+    @XmlAttribute(name = "perSequence")
+    protected Boolean perSequence;
+    @XmlAttribute(name = "predefinedColours")
+    protected Boolean predefinedColours;
+
+    /**
+     * Gets the value of the aboveThreshold property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getAboveThreshold() {
+        return aboveThreshold;
+    }
+
+    /**
+     * Sets the value of the aboveThreshold property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setAboveThreshold(Integer value) {
+        this.aboveThreshold = value;
+    }
+
+    /**
+     * Gets the value of the annotation property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAnnotation() {
+        return annotation;
+    }
+
+    /**
+     * Sets the value of the annotation property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAnnotation(String value) {
+        this.annotation = value;
+    }
+
+    /**
+     * Gets the value of the minColour property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getMinColour() {
+        return minColour;
+    }
+
+    /**
+     * Sets the value of the minColour property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setMinColour(Integer value) {
+        this.minColour = value;
+    }
+
+    /**
+     * Gets the value of the maxColour property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getMaxColour() {
+        return maxColour;
+    }
+
+    /**
+     * Sets the value of the maxColour property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setMaxColour(Integer value) {
+        this.maxColour = value;
+    }
+
+    /**
+     * Gets the value of the colourScheme property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getColourScheme() {
+        return colourScheme;
+    }
+
+    /**
+     * Sets the value of the colourScheme property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setColourScheme(String value) {
+        this.colourScheme = value;
+    }
+
+    /**
+     * Gets the value of the threshold property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Float }
+     *     
+     */
+    public Float getThreshold() {
+        return threshold;
+    }
+
+    /**
+     * Sets the value of the threshold property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Float }
+     *     
+     */
+    public void setThreshold(Float value) {
+        this.threshold = value;
+    }
+
+    /**
+     * Gets the value of the perSequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isPerSequence() {
+        return perSequence;
+    }
+
+    /**
+     * Sets the value of the perSequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setPerSequence(Boolean value) {
+        this.perSequence = value;
+    }
+
+    /**
+     * Gets the value of the predefinedColours property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isPredefinedColours() {
+        return predefinedColours;
+    }
+
+    /**
+     * Sets the value of the predefinedColours property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setPredefinedColours(Boolean value) {
+        this.predefinedColours = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/AnnotationElement.java b/src/jalview/xml/binding/jalview/AnnotationElement.java
new file mode 100644 (file)
index 0000000..8cbd4fe
--- /dev/null
@@ -0,0 +1,203 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="displayCharacter" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="secondaryStructure" minOccurs="0">
+ *           &lt;simpleType>
+ *             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *               &lt;length value="1"/>
+ *             &lt;/restriction>
+ *           &lt;/simpleType>
+ *         &lt;/element>
+ *         &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}float" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="position" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "displayCharacter",
+    "description",
+    "secondaryStructure",
+    "value"
+})
+@XmlRootElement(name = "annotationElement")
+public class AnnotationElement {
+
+    protected String displayCharacter;
+    protected String description;
+    protected String secondaryStructure;
+    protected Float value;
+    @XmlAttribute(name = "position", required = true)
+    protected int position;
+    @XmlAttribute(name = "colour")
+    protected Integer colour;
+
+    /**
+     * Gets the value of the displayCharacter property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDisplayCharacter() {
+        return displayCharacter;
+    }
+
+    /**
+     * Sets the value of the displayCharacter property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDisplayCharacter(String value) {
+        this.displayCharacter = value;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the secondaryStructure property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSecondaryStructure() {
+        return secondaryStructure;
+    }
+
+    /**
+     * Sets the value of the secondaryStructure property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSecondaryStructure(String value) {
+        this.secondaryStructure = value;
+    }
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Float }
+     *     
+     */
+    public Float getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Float }
+     *     
+     */
+    public void setValue(Float value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the position property.
+     * 
+     */
+    public int getPosition() {
+        return position;
+    }
+
+    /**
+     * Sets the value of the position property.
+     * 
+     */
+    public void setPosition(int value) {
+        this.position = value;
+    }
+
+    /**
+     * Gets the value of the colour property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getColour() {
+        return colour;
+    }
+
+    /**
+     * Sets the value of the colour property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setColour(Integer value) {
+        this.colour = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/Feature.java b/src/jalview/xml/binding/jalview/Feature.java
new file mode 100644 (file)
index 0000000..7585f83
--- /dev/null
@@ -0,0 +1,363 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for feature complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="feature">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="otherData" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="key2" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="status" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="featureGroup" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="score" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "feature", namespace = "www.jalview.org", propOrder = {
+    "otherData"
+})
+public class Feature {
+
+    protected List<Feature.OtherData> otherData;
+    @XmlAttribute(name = "begin", required = true)
+    protected int begin;
+    @XmlAttribute(name = "end", required = true)
+    protected int end;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "description")
+    protected String description;
+    @XmlAttribute(name = "status")
+    protected String status;
+    @XmlAttribute(name = "featureGroup")
+    protected String featureGroup;
+    @XmlAttribute(name = "score")
+    protected Float score;
+
+    /**
+     * Gets the value of the otherData property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the otherData property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getOtherData().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Feature.OtherData }
+     * 
+     * 
+     */
+    public List<Feature.OtherData> getOtherData() {
+        if (otherData == null) {
+            otherData = new ArrayList<Feature.OtherData>();
+        }
+        return this.otherData;
+    }
+
+    /**
+     * Gets the value of the begin property.
+     * 
+     */
+    public int getBegin() {
+        return begin;
+    }
+
+    /**
+     * Sets the value of the begin property.
+     * 
+     */
+    public void setBegin(int value) {
+        this.begin = value;
+    }
+
+    /**
+     * Gets the value of the end property.
+     * 
+     */
+    public int getEnd() {
+        return end;
+    }
+
+    /**
+     * Sets the value of the end property.
+     * 
+     */
+    public void setEnd(int value) {
+        this.end = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the status property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getStatus() {
+        return status;
+    }
+
+    /**
+     * Sets the value of the status property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setStatus(String value) {
+        this.status = value;
+    }
+
+    /**
+     * Gets the value of the featureGroup property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFeatureGroup() {
+        return featureGroup;
+    }
+
+    /**
+     * Sets the value of the featureGroup property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFeatureGroup(String value) {
+        this.featureGroup = value;
+    }
+
+    /**
+     * Gets the value of the score property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Float }
+     *     
+     */
+    public Float getScore() {
+        return score;
+    }
+
+    /**
+     * Sets the value of the score property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Float }
+     *     
+     */
+    public void setScore(Float value) {
+        this.score = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="key2" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class OtherData {
+
+        @XmlAttribute(name = "key", required = true)
+        protected String key;
+        @XmlAttribute(name = "key2")
+        protected String key2;
+        @XmlAttribute(name = "value", required = true)
+        protected String value;
+
+        /**
+         * Gets the value of the key property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getKey() {
+            return key;
+        }
+
+        /**
+         * Sets the value of the key property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setKey(String value) {
+            this.key = value;
+        }
+
+        /**
+         * Gets the value of the key2 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getKey2() {
+            return key2;
+        }
+
+        /**
+         * Sets the value of the key2 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setKey2(String value) {
+            this.key2 = value;
+        }
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/FeatureMatcher.java b/src/jalview/xml/binding/jalview/FeatureMatcher.java
new file mode 100644 (file)
index 0000000..3161408
--- /dev/null
@@ -0,0 +1,160 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for FeatureMatcher complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="FeatureMatcher">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+ *         &lt;element name="condition" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="by" type="{www.jalview.org/colours}FilterBy" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "FeatureMatcher", namespace = "www.jalview.org/colours", propOrder = {
+    "attributeName",
+    "condition",
+    "value"
+})
+public class FeatureMatcher {
+
+    @XmlElement(namespace = "")
+    protected List<String> attributeName;
+    @XmlElement(namespace = "", required = true)
+    protected String condition;
+    @XmlElement(namespace = "", required = true)
+    protected String value;
+    @XmlAttribute(name = "by")
+    protected FilterBy by;
+
+    /**
+     * Gets the value of the attributeName property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the attributeName property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAttributeName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getAttributeName() {
+        if (attributeName == null) {
+            attributeName = new ArrayList<String>();
+        }
+        return this.attributeName;
+    }
+
+    /**
+     * Gets the value of the condition property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCondition() {
+        return condition;
+    }
+
+    /**
+     * Sets the value of the condition property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCondition(String value) {
+        this.condition = value;
+    }
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the by property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link FilterBy }
+     *     
+     */
+    public FilterBy getBy() {
+        return by;
+    }
+
+    /**
+     * Sets the value of the by property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link FilterBy }
+     *     
+     */
+    public void setBy(FilterBy value) {
+        this.by = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/FeatureMatcherSet.java b/src/jalview/xml/binding/jalview/FeatureMatcherSet.java
new file mode 100644 (file)
index 0000000..5e181a1
--- /dev/null
@@ -0,0 +1,192 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * A feature match condition, which may be simple or compound
+ * 
+ * <p>Java class for FeatureMatcherSet complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="FeatureMatcherSet">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;choice>
+ *         &lt;element name="matchCondition" type="{www.jalview.org/colours}FeatureMatcher"/>
+ *         &lt;element name="compoundMatcher">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" maxOccurs="2" minOccurs="2"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="and" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/choice>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "FeatureMatcherSet", namespace = "www.jalview.org/colours", propOrder = {
+    "matchCondition",
+    "compoundMatcher"
+})
+public class FeatureMatcherSet {
+
+    @XmlElement(namespace = "")
+    protected FeatureMatcher matchCondition;
+    @XmlElement(namespace = "")
+    protected FeatureMatcherSet.CompoundMatcher compoundMatcher;
+
+    /**
+     * Gets the value of the matchCondition property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link FeatureMatcher }
+     *     
+     */
+    public FeatureMatcher getMatchCondition() {
+        return matchCondition;
+    }
+
+    /**
+     * Sets the value of the matchCondition property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link FeatureMatcher }
+     *     
+     */
+    public void setMatchCondition(FeatureMatcher value) {
+        this.matchCondition = value;
+    }
+
+    /**
+     * Gets the value of the compoundMatcher property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link FeatureMatcherSet.CompoundMatcher }
+     *     
+     */
+    public FeatureMatcherSet.CompoundMatcher getCompoundMatcher() {
+        return compoundMatcher;
+    }
+
+    /**
+     * Sets the value of the compoundMatcher property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link FeatureMatcherSet.CompoundMatcher }
+     *     
+     */
+    public void setCompoundMatcher(FeatureMatcherSet.CompoundMatcher value) {
+        this.compoundMatcher = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" maxOccurs="2" minOccurs="2"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="and" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "matcherSet"
+    })
+    public static class CompoundMatcher {
+
+        @XmlElement(namespace = "", required = true)
+        protected List<FeatureMatcherSet> matcherSet;
+        @XmlAttribute(name = "and", required = true)
+        protected boolean and;
+
+        /**
+         * Gets the value of the matcherSet property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the matcherSet property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getMatcherSet().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link FeatureMatcherSet }
+         * 
+         * 
+         */
+        public List<FeatureMatcherSet> getMatcherSet() {
+            if (matcherSet == null) {
+                matcherSet = new ArrayList<FeatureMatcherSet>();
+            }
+            return this.matcherSet;
+        }
+
+        /**
+         * Gets the value of the and property.
+         * 
+         */
+        public boolean isAnd() {
+            return and;
+        }
+
+        /**
+         * Sets the value of the and property.
+         * 
+         */
+        public void setAnd(boolean value) {
+            this.and = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/FilterBy.java b/src/jalview/xml/binding/jalview/FilterBy.java
new file mode 100644 (file)
index 0000000..a854b63
--- /dev/null
@@ -0,0 +1,61 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for FilterBy.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * &lt;simpleType name="FilterBy">
+ *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     &lt;enumeration value="byLabel"/>
+ *     &lt;enumeration value="byScore"/>
+ *     &lt;enumeration value="byAttribute"/>
+ *   &lt;/restriction>
+ * &lt;/simpleType>
+ * </pre>
+ * 
+ */
+@XmlType(name = "FilterBy", namespace = "www.jalview.org/colours")
+@XmlEnum
+public enum FilterBy {
+
+    @XmlEnumValue("byLabel")
+    BY_LABEL("byLabel"),
+    @XmlEnumValue("byScore")
+    BY_SCORE("byScore"),
+    @XmlEnumValue("byAttribute")
+    BY_ATTRIBUTE("byAttribute");
+    private final String value;
+
+    FilterBy(String v) {
+        value = v;
+    }
+
+    public String value() {
+        return value;
+    }
+
+    public static FilterBy fromValue(String v) {
+        for (FilterBy c: FilterBy.values()) {
+            if (c.value.equals(v)) {
+                return c;
+            }
+        }
+        throw new IllegalArgumentException(v);
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/JalviewModel.java b/src/jalview/xml/binding/jalview/JalviewModel.java
new file mode 100644 (file)
index 0000000..0f538f2
--- /dev/null
@@ -0,0 +1,5090 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for JalviewModel complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="JalviewModel">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="creationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *         &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="vamsasModel" type="{www.vamsas.ac.uk/jalview/version2}VAMSAS"/>
+ *         &lt;sequence>
+ *           &lt;element name="JSeq" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/>
+ *                     &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;extension base="{www.jalview.org}pdbentry">
+ *                             &lt;sequence>
+ *                               &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0">
+ *                                 &lt;complexType>
+ *                                   &lt;simpleContent>
+ *                                     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                                       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                                       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                                       &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                       &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                                       &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                                       &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                                       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     &lt;/extension>
+ *                                   &lt;/simpleContent>
+ *                                 &lt;/complexType>
+ *                               &lt;/element>
+ *                             &lt;/sequence>
+ *                           &lt;/extension>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+ *                     &lt;element name="rnaViewer" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;sequence>
+ *                               &lt;element name="secondaryStructure" maxOccurs="unbounded">
+ *                                 &lt;complexType>
+ *                                   &lt;complexContent>
+ *                                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                       &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                       &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                                       &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     &lt;/restriction>
+ *                                   &lt;/complexContent>
+ *                                 &lt;/complexType>
+ *                               &lt;/element>
+ *                             &lt;/sequence>
+ *                             &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                             &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="JGroup" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *                     &lt;element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="Viewport" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+ *                     &lt;element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="calcIdParam" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
+ *                             &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                             &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                           &lt;/extension>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                   &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                   &lt;attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *                   &lt;attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="UserColours" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="tree" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence minOccurs="0">
+ *                     &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                     &lt;element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   &lt;/sequence>
+ *                   &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                   &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                   &lt;attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="FeatureSettings" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="setting" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;sequence>
+ *                               &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+ *                               &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
+ *                             &lt;/sequence>
+ *                             &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                             &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+ *                             &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                             &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="group" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *         &lt;/sequence>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "JalviewModel", namespace = "www.jalview.org", propOrder = {
+    "creationDate",
+    "version",
+    "vamsasModel",
+    "jSeq",
+    "jGroup",
+    "viewport",
+    "userColours",
+    "tree",
+    "featureSettings"
+})
+public class JalviewModel {
+
+    @XmlElement(required = true)
+    @XmlSchemaType(name = "dateTime")
+    protected XMLGregorianCalendar creationDate;
+    @XmlElement(required = true)
+    protected String version;
+    @XmlElement(required = true)
+    protected VAMSAS vamsasModel;
+    @XmlElement(name = "JSeq")
+    protected List<JalviewModel.JSeq> jSeq;
+    @XmlElement(name = "JGroup")
+    protected List<JalviewModel.JGroup> jGroup;
+    @XmlElement(name = "Viewport")
+    protected List<JalviewModel.Viewport> viewport;
+    @XmlElement(name = "UserColours")
+    protected List<JalviewModel.UserColours> userColours;
+    protected List<JalviewModel.Tree> tree;
+    @XmlElement(name = "FeatureSettings")
+    protected JalviewModel.FeatureSettings featureSettings;
+
+    /**
+     * Gets the value of the creationDate property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getCreationDate() {
+        return creationDate;
+    }
+
+    /**
+     * Sets the value of the creationDate property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setCreationDate(XMLGregorianCalendar value) {
+        this.creationDate = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVersion(String value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the vamsasModel property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link VAMSAS }
+     *     
+     */
+    public VAMSAS getVamsasModel() {
+        return vamsasModel;
+    }
+
+    /**
+     * Sets the value of the vamsasModel property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link VAMSAS }
+     *     
+     */
+    public void setVamsasModel(VAMSAS value) {
+        this.vamsasModel = value;
+    }
+
+    /**
+     * Gets the value of the jSeq property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the jSeq property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getJSeq().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModel.JSeq }
+     * 
+     * 
+     */
+    public List<JalviewModel.JSeq> getJSeq() {
+        if (jSeq == null) {
+            jSeq = new ArrayList<JalviewModel.JSeq>();
+        }
+        return this.jSeq;
+    }
+
+    /**
+     * Gets the value of the jGroup property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the jGroup property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getJGroup().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModel.JGroup }
+     * 
+     * 
+     */
+    public List<JalviewModel.JGroup> getJGroup() {
+        if (jGroup == null) {
+            jGroup = new ArrayList<JalviewModel.JGroup>();
+        }
+        return this.jGroup;
+    }
+
+    /**
+     * Gets the value of the viewport property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the viewport property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getViewport().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModel.Viewport }
+     * 
+     * 
+     */
+    public List<JalviewModel.Viewport> getViewport() {
+        if (viewport == null) {
+            viewport = new ArrayList<JalviewModel.Viewport>();
+        }
+        return this.viewport;
+    }
+
+    /**
+     * Gets the value of the userColours property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the userColours property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getUserColours().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModel.UserColours }
+     * 
+     * 
+     */
+    public List<JalviewModel.UserColours> getUserColours() {
+        if (userColours == null) {
+            userColours = new ArrayList<JalviewModel.UserColours>();
+        }
+        return this.userColours;
+    }
+
+    /**
+     * Gets the value of the tree property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the tree property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getTree().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModel.Tree }
+     * 
+     * 
+     */
+    public List<JalviewModel.Tree> getTree() {
+        if (tree == null) {
+            tree = new ArrayList<JalviewModel.Tree>();
+        }
+        return this.tree;
+    }
+
+    /**
+     * Gets the value of the featureSettings property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link JalviewModel.FeatureSettings }
+     *     
+     */
+    public JalviewModel.FeatureSettings getFeatureSettings() {
+        return featureSettings;
+    }
+
+    /**
+     * Sets the value of the featureSettings property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link JalviewModel.FeatureSettings }
+     *     
+     */
+    public void setFeatureSettings(JalviewModel.FeatureSettings value) {
+        this.featureSettings = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="setting" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+     *                   &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
+     *                 &lt;/sequence>
+     *                 &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                 &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+     *                 &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                 &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="group" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "setting",
+        "group"
+    })
+    public static class FeatureSettings {
+
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModel.FeatureSettings.Setting> setting;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModel.FeatureSettings.Group> group;
+
+        /**
+         * Gets the value of the setting property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the setting property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getSetting().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModel.FeatureSettings.Setting }
+         * 
+         * 
+         */
+        public List<JalviewModel.FeatureSettings.Setting> getSetting() {
+            if (setting == null) {
+                setting = new ArrayList<JalviewModel.FeatureSettings.Setting>();
+            }
+            return this.setting;
+        }
+
+        /**
+         * Gets the value of the group property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the group property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getGroup().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModel.FeatureSettings.Group }
+         * 
+         * 
+         */
+        public List<JalviewModel.FeatureSettings.Group> getGroup() {
+            if (group == null) {
+                group = new ArrayList<JalviewModel.FeatureSettings.Group>();
+            }
+            return this.group;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Group {
+
+            @XmlAttribute(name = "name", required = true)
+            protected String name;
+            @XmlAttribute(name = "display", required = true)
+            protected boolean display;
+
+            /**
+             * Gets the value of the name property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getName() {
+                return name;
+            }
+
+            /**
+             * Sets the value of the name property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setName(String value) {
+                this.name = value;
+            }
+
+            /**
+             * Gets the value of the display property.
+             * 
+             */
+            public boolean isDisplay() {
+                return display;
+            }
+
+            /**
+             * Sets the value of the display property.
+             * 
+             */
+            public void setDisplay(boolean value) {
+                this.display = value;
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+         *         &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
+         *       &lt;/sequence>
+         *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *       &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+         *       &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *       &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "attributeName",
+            "matcherSet"
+        })
+        public static class Setting {
+
+            @XmlElement(namespace = "www.jalview.org")
+            protected List<String> attributeName;
+            @XmlElement(namespace = "www.jalview.org")
+            protected FeatureMatcherSet matcherSet;
+            @XmlAttribute(name = "type", required = true)
+            protected String type;
+            @XmlAttribute(name = "colour", required = true)
+            protected int colour;
+            @XmlAttribute(name = "display", required = true)
+            protected boolean display;
+            @XmlAttribute(name = "order")
+            protected Float order;
+            @XmlAttribute(name = "mincolour")
+            protected Integer mincolour;
+            @XmlAttribute(name = "noValueColour")
+            protected NoValueColour noValueColour;
+            @XmlAttribute(name = "threshold")
+            protected Float threshold;
+            @XmlAttribute(name = "threshstate")
+            protected Integer threshstate;
+            @XmlAttribute(name = "max")
+            protected Float max;
+            @XmlAttribute(name = "min")
+            protected Float min;
+            @XmlAttribute(name = "colourByLabel")
+            protected Boolean colourByLabel;
+            @XmlAttribute(name = "autoScale")
+            protected Boolean autoScale;
+
+            /**
+             * Gets the value of the attributeName property.
+             * 
+             * <p>
+             * This accessor method returns a reference to the live list,
+             * not a snapshot. Therefore any modification you make to the
+             * returned list will be present inside the JAXB object.
+             * This is why there is not a <CODE>set</CODE> method for the attributeName property.
+             * 
+             * <p>
+             * For example, to add a new item, do as follows:
+             * <pre>
+             *    getAttributeName().add(newItem);
+             * </pre>
+             * 
+             * 
+             * <p>
+             * Objects of the following type(s) are allowed in the list
+             * {@link String }
+             * 
+             * 
+             */
+            public List<String> getAttributeName() {
+                if (attributeName == null) {
+                    attributeName = new ArrayList<String>();
+                }
+                return this.attributeName;
+            }
+
+            /**
+             * Gets the value of the matcherSet property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link FeatureMatcherSet }
+             *     
+             */
+            public FeatureMatcherSet getMatcherSet() {
+                return matcherSet;
+            }
+
+            /**
+             * Sets the value of the matcherSet property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link FeatureMatcherSet }
+             *     
+             */
+            public void setMatcherSet(FeatureMatcherSet value) {
+                this.matcherSet = value;
+            }
+
+            /**
+             * Gets the value of the type property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getType() {
+                return type;
+            }
+
+            /**
+             * Sets the value of the type property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setType(String value) {
+                this.type = value;
+            }
+
+            /**
+             * Gets the value of the colour property.
+             * 
+             */
+            public int getColour() {
+                return colour;
+            }
+
+            /**
+             * Sets the value of the colour property.
+             * 
+             */
+            public void setColour(int value) {
+                this.colour = value;
+            }
+
+            /**
+             * Gets the value of the display property.
+             * 
+             */
+            public boolean isDisplay() {
+                return display;
+            }
+
+            /**
+             * Sets the value of the display property.
+             * 
+             */
+            public void setDisplay(boolean value) {
+                this.display = value;
+            }
+
+            /**
+             * Gets the value of the order property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getOrder() {
+                return order;
+            }
+
+            /**
+             * Sets the value of the order property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setOrder(Float value) {
+                this.order = value;
+            }
+
+            /**
+             * Gets the value of the mincolour property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getMincolour() {
+                return mincolour;
+            }
+
+            /**
+             * Sets the value of the mincolour property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setMincolour(Integer value) {
+                this.mincolour = value;
+            }
+
+            /**
+             * Gets the value of the noValueColour property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link NoValueColour }
+             *     
+             */
+            public NoValueColour getNoValueColour() {
+                if (noValueColour == null) {
+                    return NoValueColour.MIN;
+                } else {
+                    return noValueColour;
+                }
+            }
+
+            /**
+             * Sets the value of the noValueColour property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link NoValueColour }
+             *     
+             */
+            public void setNoValueColour(NoValueColour value) {
+                this.noValueColour = value;
+            }
+
+            /**
+             * Gets the value of the threshold property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getThreshold() {
+                return threshold;
+            }
+
+            /**
+             * Sets the value of the threshold property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setThreshold(Float value) {
+                this.threshold = value;
+            }
+
+            /**
+             * Gets the value of the threshstate property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getThreshstate() {
+                return threshstate;
+            }
+
+            /**
+             * Sets the value of the threshstate property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setThreshstate(Integer value) {
+                this.threshstate = value;
+            }
+
+            /**
+             * Gets the value of the max property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getMax() {
+                return max;
+            }
+
+            /**
+             * Sets the value of the max property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setMax(Float value) {
+                this.max = value;
+            }
+
+            /**
+             * Gets the value of the min property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getMin() {
+                return min;
+            }
+
+            /**
+             * Sets the value of the min property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setMin(Float value) {
+                this.min = value;
+            }
+
+            /**
+             * Gets the value of the colourByLabel property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public Boolean isColourByLabel() {
+                return colourByLabel;
+            }
+
+            /**
+             * Sets the value of the colourByLabel property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setColourByLabel(Boolean value) {
+                this.colourByLabel = value;
+            }
+
+            /**
+             * Gets the value of the autoScale property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public Boolean isAutoScale() {
+                return autoScale;
+            }
+
+            /**
+             * Sets the value of the autoScale property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setAutoScale(Boolean value) {
+                this.autoScale = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+     *         &lt;element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "seq",
+        "annotationColours"
+    })
+    public static class JGroup {
+
+        @XmlElement(namespace = "www.jalview.org", required = true)
+        protected List<String> seq;
+        @XmlElement(namespace = "www.jalview.org")
+        protected AnnotationColourScheme annotationColours;
+        @XmlAttribute(name = "start")
+        protected Integer start;
+        @XmlAttribute(name = "end")
+        protected Integer end;
+        @XmlAttribute(name = "name")
+        protected String name;
+        @XmlAttribute(name = "colour")
+        protected String colour;
+        @XmlAttribute(name = "consThreshold")
+        protected Integer consThreshold;
+        @XmlAttribute(name = "pidThreshold")
+        protected Integer pidThreshold;
+        @XmlAttribute(name = "outlineColour")
+        protected Integer outlineColour;
+        @XmlAttribute(name = "displayBoxes")
+        protected Boolean displayBoxes;
+        @XmlAttribute(name = "displayText")
+        protected Boolean displayText;
+        @XmlAttribute(name = "colourText")
+        protected Boolean colourText;
+        @XmlAttribute(name = "textCol1")
+        protected Integer textCol1;
+        @XmlAttribute(name = "textCol2")
+        protected Integer textCol2;
+        @XmlAttribute(name = "textColThreshold")
+        protected Integer textColThreshold;
+        @XmlAttribute(name = "showUnconserved")
+        protected Boolean showUnconserved;
+        @XmlAttribute(name = "ignoreGapsinConsensus")
+        protected Boolean ignoreGapsinConsensus;
+        @XmlAttribute(name = "showConsensusHistogram")
+        protected Boolean showConsensusHistogram;
+        @XmlAttribute(name = "showSequenceLogo")
+        protected Boolean showSequenceLogo;
+        @XmlAttribute(name = "normaliseSequenceLogo")
+        protected Boolean normaliseSequenceLogo;
+        @XmlAttribute(name = "id")
+        protected String id;
+
+        /**
+         * Gets the value of the seq property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the seq property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getSeq().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getSeq() {
+            if (seq == null) {
+                seq = new ArrayList<String>();
+            }
+            return this.seq;
+        }
+
+        /**
+         * Gets the value of the annotationColours property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public AnnotationColourScheme getAnnotationColours() {
+            return annotationColours;
+        }
+
+        /**
+         * Sets the value of the annotationColours property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public void setAnnotationColours(AnnotationColourScheme value) {
+            this.annotationColours = value;
+        }
+
+        /**
+         * Gets the value of the start property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getStart() {
+            return start;
+        }
+
+        /**
+         * Sets the value of the start property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setStart(Integer value) {
+            this.start = value;
+        }
+
+        /**
+         * Gets the value of the end property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getEnd() {
+            return end;
+        }
+
+        /**
+         * Sets the value of the end property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setEnd(Integer value) {
+            this.end = value;
+        }
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the colour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getColour() {
+            return colour;
+        }
+
+        /**
+         * Sets the value of the colour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setColour(String value) {
+            this.colour = value;
+        }
+
+        /**
+         * Gets the value of the consThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getConsThreshold() {
+            return consThreshold;
+        }
+
+        /**
+         * Sets the value of the consThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setConsThreshold(Integer value) {
+            this.consThreshold = value;
+        }
+
+        /**
+         * Gets the value of the pidThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getPidThreshold() {
+            return pidThreshold;
+        }
+
+        /**
+         * Sets the value of the pidThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setPidThreshold(Integer value) {
+            this.pidThreshold = value;
+        }
+
+        /**
+         * Gets the value of the outlineColour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getOutlineColour() {
+            return outlineColour;
+        }
+
+        /**
+         * Sets the value of the outlineColour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setOutlineColour(Integer value) {
+            this.outlineColour = value;
+        }
+
+        /**
+         * Gets the value of the displayBoxes property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isDisplayBoxes() {
+            return displayBoxes;
+        }
+
+        /**
+         * Sets the value of the displayBoxes property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setDisplayBoxes(Boolean value) {
+            this.displayBoxes = value;
+        }
+
+        /**
+         * Gets the value of the displayText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isDisplayText() {
+            return displayText;
+        }
+
+        /**
+         * Sets the value of the displayText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setDisplayText(Boolean value) {
+            this.displayText = value;
+        }
+
+        /**
+         * Gets the value of the colourText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isColourText() {
+            return colourText;
+        }
+
+        /**
+         * Sets the value of the colourText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setColourText(Boolean value) {
+            this.colourText = value;
+        }
+
+        /**
+         * Gets the value of the textCol1 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol1() {
+            return textCol1;
+        }
+
+        /**
+         * Sets the value of the textCol1 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol1(Integer value) {
+            this.textCol1 = value;
+        }
+
+        /**
+         * Gets the value of the textCol2 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol2() {
+            return textCol2;
+        }
+
+        /**
+         * Sets the value of the textCol2 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol2(Integer value) {
+            this.textCol2 = value;
+        }
+
+        /**
+         * Gets the value of the textColThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextColThreshold() {
+            return textColThreshold;
+        }
+
+        /**
+         * Sets the value of the textColThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextColThreshold(Integer value) {
+            this.textColThreshold = value;
+        }
+
+        /**
+         * Gets the value of the showUnconserved property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowUnconserved() {
+            return showUnconserved;
+        }
+
+        /**
+         * Sets the value of the showUnconserved property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowUnconserved(Boolean value) {
+            this.showUnconserved = value;
+        }
+
+        /**
+         * Gets the value of the ignoreGapsinConsensus property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isIgnoreGapsinConsensus() {
+            if (ignoreGapsinConsensus == null) {
+                return true;
+            } else {
+                return ignoreGapsinConsensus;
+            }
+        }
+
+        /**
+         * Sets the value of the ignoreGapsinConsensus property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setIgnoreGapsinConsensus(Boolean value) {
+            this.ignoreGapsinConsensus = value;
+        }
+
+        /**
+         * Gets the value of the showConsensusHistogram property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowConsensusHistogram() {
+            if (showConsensusHistogram == null) {
+                return true;
+            } else {
+                return showConsensusHistogram;
+            }
+        }
+
+        /**
+         * Sets the value of the showConsensusHistogram property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowConsensusHistogram(Boolean value) {
+            this.showConsensusHistogram = value;
+        }
+
+        /**
+         * Gets the value of the showSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowSequenceLogo() {
+            if (showSequenceLogo == null) {
+                return false;
+            } else {
+                return showSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the showSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowSequenceLogo(Boolean value) {
+            this.showSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the normaliseSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isNormaliseSequenceLogo() {
+            if (normaliseSequenceLogo == null) {
+                return false;
+            } else {
+                return normaliseSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the normaliseSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setNormaliseSequenceLogo(Boolean value) {
+            this.normaliseSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;extension base="{www.jalview.org}pdbentry">
+     *                 &lt;sequence>
+     *                   &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0">
+     *                     &lt;complexType>
+     *                       &lt;simpleContent>
+     *                         &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *                           &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *                           &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                           &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *                           &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                           &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *                           &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         &lt;/extension>
+     *                       &lt;/simpleContent>
+     *                     &lt;/complexType>
+     *                   &lt;/element>
+     *                 &lt;/sequence>
+     *               &lt;/extension>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="rnaViewer" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="secondaryStructure" maxOccurs="unbounded">
+     *                     &lt;complexType>
+     *                       &lt;complexContent>
+     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                           &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         &lt;/restriction>
+     *                       &lt;/complexContent>
+     *                     &lt;/complexType>
+     *                   &lt;/element>
+     *                 &lt;/sequence>
+     *                 &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *                 &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "features",
+        "pdbids",
+        "hiddenSequences",
+        "rnaViewer"
+    })
+    public static class JSeq {
+
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<Feature> features;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModel.JSeq.Pdbids> pdbids;
+        @XmlElement(namespace = "www.jalview.org", type = Integer.class)
+        protected List<Integer> hiddenSequences;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModel.JSeq.RnaViewer> rnaViewer;
+        @XmlAttribute(name = "colour")
+        protected Integer colour;
+        @XmlAttribute(name = "start", required = true)
+        protected int start;
+        @XmlAttribute(name = "end", required = true)
+        protected int end;
+        @XmlAttribute(name = "id", required = true)
+        protected String id;
+        @XmlAttribute(name = "hidden")
+        protected Boolean hidden;
+        @XmlAttribute(name = "viewreference")
+        protected Boolean viewreference;
+
+        /**
+         * Gets the value of the features property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the features property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getFeatures().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Feature }
+         * 
+         * 
+         */
+        public List<Feature> getFeatures() {
+            if (features == null) {
+                features = new ArrayList<Feature>();
+            }
+            return this.features;
+        }
+
+        /**
+         * Gets the value of the pdbids property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the pdbids property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getPdbids().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModel.JSeq.Pdbids }
+         * 
+         * 
+         */
+        public List<JalviewModel.JSeq.Pdbids> getPdbids() {
+            if (pdbids == null) {
+                pdbids = new ArrayList<JalviewModel.JSeq.Pdbids>();
+            }
+            return this.pdbids;
+        }
+
+        /**
+         * Gets the value of the hiddenSequences property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the hiddenSequences property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getHiddenSequences().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getHiddenSequences() {
+            if (hiddenSequences == null) {
+                hiddenSequences = new ArrayList<Integer>();
+            }
+            return this.hiddenSequences;
+        }
+
+        /**
+         * Gets the value of the rnaViewer property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the rnaViewer property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getRnaViewer().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModel.JSeq.RnaViewer }
+         * 
+         * 
+         */
+        public List<JalviewModel.JSeq.RnaViewer> getRnaViewer() {
+            if (rnaViewer == null) {
+                rnaViewer = new ArrayList<JalviewModel.JSeq.RnaViewer>();
+            }
+            return this.rnaViewer;
+        }
+
+        /**
+         * Gets the value of the colour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getColour() {
+            return colour;
+        }
+
+        /**
+         * Sets the value of the colour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setColour(Integer value) {
+            this.colour = value;
+        }
+
+        /**
+         * Gets the value of the start property.
+         * 
+         */
+        public int getStart() {
+            return start;
+        }
+
+        /**
+         * Sets the value of the start property.
+         * 
+         */
+        public void setStart(int value) {
+            this.start = value;
+        }
+
+        /**
+         * Gets the value of the end property.
+         * 
+         */
+        public int getEnd() {
+            return end;
+        }
+
+        /**
+         * Sets the value of the end property.
+         * 
+         */
+        public void setEnd(int value) {
+            this.end = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+        /**
+         * Gets the value of the hidden property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isHidden() {
+            return hidden;
+        }
+
+        /**
+         * Sets the value of the hidden property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setHidden(Boolean value) {
+            this.hidden = value;
+        }
+
+        /**
+         * Gets the value of the viewreference property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isViewreference() {
+            return viewreference;
+        }
+
+        /**
+         * Sets the value of the viewreference property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setViewreference(Boolean value) {
+            this.viewreference = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;extension base="{www.jalview.org}pdbentry">
+         *       &lt;sequence>
+         *         &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0">
+         *           &lt;complexType>
+         *             &lt;simpleContent>
+         *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+         *                 &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+         *                 &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *                 &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+         *                 &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *                 &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+         *                 &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               &lt;/extension>
+         *             &lt;/simpleContent>
+         *           &lt;/complexType>
+         *         &lt;/element>
+         *       &lt;/sequence>
+         *     &lt;/extension>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "structureState"
+        })
+        public static class Pdbids
+            extends Pdbentry
+        {
+
+            @XmlElement(namespace = "www.jalview.org")
+            protected List<JalviewModel.JSeq.Pdbids.StructureState> structureState;
+
+            /**
+             * Gets the value of the structureState property.
+             * 
+             * <p>
+             * This accessor method returns a reference to the live list,
+             * not a snapshot. Therefore any modification you make to the
+             * returned list will be present inside the JAXB object.
+             * This is why there is not a <CODE>set</CODE> method for the structureState property.
+             * 
+             * <p>
+             * For example, to add a new item, do as follows:
+             * <pre>
+             *    getStructureState().add(newItem);
+             * </pre>
+             * 
+             * 
+             * <p>
+             * Objects of the following type(s) are allowed in the list
+             * {@link JalviewModel.JSeq.Pdbids.StructureState }
+             * 
+             * 
+             */
+            public List<JalviewModel.JSeq.Pdbids.StructureState> getStructureState() {
+                if (structureState == null) {
+                    structureState = new ArrayList<JalviewModel.JSeq.Pdbids.StructureState>();
+                }
+                return this.structureState;
+            }
+
+
+            /**
+             * <p>Java class for anonymous complex type.
+             * 
+             * <p>The following schema fragment specifies the expected content contained within this class.
+             * 
+             * <pre>
+             * &lt;complexType>
+             *   &lt;simpleContent>
+             *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+             *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+             *       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+             *       &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+             *       &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+             *       &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+             *       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     &lt;/extension>
+             *   &lt;/simpleContent>
+             * &lt;/complexType>
+             * </pre>
+             * 
+             * 
+             */
+            @XmlAccessorType(XmlAccessType.FIELD)
+            @XmlType(name = "", propOrder = {
+                "value"
+            })
+            public static class StructureState {
+
+                @XmlValue
+                protected String value;
+                @XmlAttribute(name = "visible")
+                protected Boolean visible;
+                @XmlAttribute(name = "viewId")
+                protected String viewId;
+                @XmlAttribute(name = "alignwithAlignPanel")
+                protected Boolean alignwithAlignPanel;
+                @XmlAttribute(name = "colourwithAlignPanel")
+                protected Boolean colourwithAlignPanel;
+                @XmlAttribute(name = "colourByJmol")
+                protected Boolean colourByJmol;
+                @XmlAttribute(name = "type")
+                protected String type;
+                @XmlAttribute(name = "width")
+                protected Integer width;
+                @XmlAttribute(name = "height")
+                protected Integer height;
+                @XmlAttribute(name = "xpos")
+                protected Integer xpos;
+                @XmlAttribute(name = "ypos")
+                protected Integer ypos;
+
+                /**
+                 * Gets the value of the value property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getValue() {
+                    return value;
+                }
+
+                /**
+                 * Sets the value of the value property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setValue(String value) {
+                    this.value = value;
+                }
+
+                /**
+                 * Gets the value of the visible property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public Boolean isVisible() {
+                    return visible;
+                }
+
+                /**
+                 * Sets the value of the visible property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setVisible(Boolean value) {
+                    this.visible = value;
+                }
+
+                /**
+                 * Gets the value of the viewId property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getViewId() {
+                    return viewId;
+                }
+
+                /**
+                 * Sets the value of the viewId property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setViewId(String value) {
+                    this.viewId = value;
+                }
+
+                /**
+                 * Gets the value of the alignwithAlignPanel property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public boolean isAlignwithAlignPanel() {
+                    if (alignwithAlignPanel == null) {
+                        return true;
+                    } else {
+                        return alignwithAlignPanel;
+                    }
+                }
+
+                /**
+                 * Sets the value of the alignwithAlignPanel property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setAlignwithAlignPanel(Boolean value) {
+                    this.alignwithAlignPanel = value;
+                }
+
+                /**
+                 * Gets the value of the colourwithAlignPanel property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public boolean isColourwithAlignPanel() {
+                    if (colourwithAlignPanel == null) {
+                        return false;
+                    } else {
+                        return colourwithAlignPanel;
+                    }
+                }
+
+                /**
+                 * Sets the value of the colourwithAlignPanel property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setColourwithAlignPanel(Boolean value) {
+                    this.colourwithAlignPanel = value;
+                }
+
+                /**
+                 * Gets the value of the colourByJmol property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public boolean isColourByJmol() {
+                    if (colourByJmol == null) {
+                        return true;
+                    } else {
+                        return colourByJmol;
+                    }
+                }
+
+                /**
+                 * Sets the value of the colourByJmol property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setColourByJmol(Boolean value) {
+                    this.colourByJmol = value;
+                }
+
+                /**
+                 * Gets the value of the type property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getType() {
+                    return type;
+                }
+
+                /**
+                 * Sets the value of the type property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setType(String value) {
+                    this.type = value;
+                }
+
+                /**
+                 * Gets the value of the width property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getWidth() {
+                    return width;
+                }
+
+                /**
+                 * Sets the value of the width property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setWidth(Integer value) {
+                    this.width = value;
+                }
+
+                /**
+                 * Gets the value of the height property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getHeight() {
+                    return height;
+                }
+
+                /**
+                 * Sets the value of the height property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setHeight(Integer value) {
+                    this.height = value;
+                }
+
+                /**
+                 * Gets the value of the xpos property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getXpos() {
+                    return xpos;
+                }
+
+                /**
+                 * Sets the value of the xpos property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setXpos(Integer value) {
+                    this.xpos = value;
+                }
+
+                /**
+                 * Gets the value of the ypos property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getYpos() {
+                    return ypos;
+                }
+
+                /**
+                 * Sets the value of the ypos property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setYpos(Integer value) {
+                    this.ypos = value;
+                }
+
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="secondaryStructure" maxOccurs="unbounded">
+         *           &lt;complexType>
+         *             &lt;complexContent>
+         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *                 &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               &lt;/restriction>
+         *             &lt;/complexContent>
+         *           &lt;/complexType>
+         *         &lt;/element>
+         *       &lt;/sequence>
+         *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+         *       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "secondaryStructure"
+        })
+        public static class RnaViewer {
+
+            @XmlElement(namespace = "www.jalview.org", required = true)
+            protected List<JalviewModel.JSeq.RnaViewer.SecondaryStructure> secondaryStructure;
+            @XmlAttribute(name = "title")
+            protected String title;
+            @XmlAttribute(name = "viewId")
+            protected String viewId;
+            @XmlAttribute(name = "dividerLocation")
+            protected Integer dividerLocation;
+            @XmlAttribute(name = "selectedRna")
+            protected Integer selectedRna;
+            @XmlAttribute(name = "width")
+            protected Integer width;
+            @XmlAttribute(name = "height")
+            protected Integer height;
+            @XmlAttribute(name = "xpos")
+            protected Integer xpos;
+            @XmlAttribute(name = "ypos")
+            protected Integer ypos;
+
+            /**
+             * Gets the value of the secondaryStructure property.
+             * 
+             * <p>
+             * This accessor method returns a reference to the live list,
+             * not a snapshot. Therefore any modification you make to the
+             * returned list will be present inside the JAXB object.
+             * This is why there is not a <CODE>set</CODE> method for the secondaryStructure property.
+             * 
+             * <p>
+             * For example, to add a new item, do as follows:
+             * <pre>
+             *    getSecondaryStructure().add(newItem);
+             * </pre>
+             * 
+             * 
+             * <p>
+             * Objects of the following type(s) are allowed in the list
+             * {@link JalviewModel.JSeq.RnaViewer.SecondaryStructure }
+             * 
+             * 
+             */
+            public List<JalviewModel.JSeq.RnaViewer.SecondaryStructure> getSecondaryStructure() {
+                if (secondaryStructure == null) {
+                    secondaryStructure = new ArrayList<JalviewModel.JSeq.RnaViewer.SecondaryStructure>();
+                }
+                return this.secondaryStructure;
+            }
+
+            /**
+             * Gets the value of the title property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getTitle() {
+                return title;
+            }
+
+            /**
+             * Sets the value of the title property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setTitle(String value) {
+                this.title = value;
+            }
+
+            /**
+             * Gets the value of the viewId property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getViewId() {
+                return viewId;
+            }
+
+            /**
+             * Sets the value of the viewId property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setViewId(String value) {
+                this.viewId = value;
+            }
+
+            /**
+             * Gets the value of the dividerLocation property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getDividerLocation() {
+                return dividerLocation;
+            }
+
+            /**
+             * Sets the value of the dividerLocation property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setDividerLocation(Integer value) {
+                this.dividerLocation = value;
+            }
+
+            /**
+             * Gets the value of the selectedRna property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getSelectedRna() {
+                return selectedRna;
+            }
+
+            /**
+             * Sets the value of the selectedRna property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setSelectedRna(Integer value) {
+                this.selectedRna = value;
+            }
+
+            /**
+             * Gets the value of the width property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getWidth() {
+                return width;
+            }
+
+            /**
+             * Sets the value of the width property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setWidth(Integer value) {
+                this.width = value;
+            }
+
+            /**
+             * Gets the value of the height property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getHeight() {
+                return height;
+            }
+
+            /**
+             * Sets the value of the height property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setHeight(Integer value) {
+                this.height = value;
+            }
+
+            /**
+             * Gets the value of the xpos property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getXpos() {
+                return xpos;
+            }
+
+            /**
+             * Sets the value of the xpos property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setXpos(Integer value) {
+                this.xpos = value;
+            }
+
+            /**
+             * Gets the value of the ypos property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getYpos() {
+                return ypos;
+            }
+
+            /**
+             * Sets the value of the ypos property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setYpos(Integer value) {
+                this.ypos = value;
+            }
+
+
+            /**
+             * <p>Java class for anonymous complex type.
+             * 
+             * <p>The following schema fragment specifies the expected content contained within this class.
+             * 
+             * <pre>
+             * &lt;complexType>
+             *   &lt;complexContent>
+             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+             *       &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     &lt;/restriction>
+             *   &lt;/complexContent>
+             * &lt;/complexType>
+             * </pre>
+             * 
+             * 
+             */
+            @XmlAccessorType(XmlAccessType.FIELD)
+            @XmlType(name = "")
+            public static class SecondaryStructure {
+
+                @XmlAttribute(name = "title")
+                protected String title;
+                @XmlAttribute(name = "annotationId", required = true)
+                protected String annotationId;
+                @XmlAttribute(name = "gapped")
+                protected Boolean gapped;
+                @XmlAttribute(name = "viewerState")
+                protected String viewerState;
+
+                /**
+                 * Gets the value of the title property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getTitle() {
+                    return title;
+                }
+
+                /**
+                 * Sets the value of the title property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setTitle(String value) {
+                    this.title = value;
+                }
+
+                /**
+                 * Gets the value of the annotationId property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getAnnotationId() {
+                    return annotationId;
+                }
+
+                /**
+                 * Sets the value of the annotationId property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setAnnotationId(String value) {
+                    this.annotationId = value;
+                }
+
+                /**
+                 * Gets the value of the gapped property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public Boolean isGapped() {
+                    return gapped;
+                }
+
+                /**
+                 * Sets the value of the gapped property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setGapped(Boolean value) {
+                    this.gapped = value;
+                }
+
+                /**
+                 * Gets the value of the viewerState property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getViewerState() {
+                    return viewerState;
+                }
+
+                /**
+                 * Sets the value of the viewerState property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setViewerState(String value) {
+                    this.viewerState = value;
+                }
+
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence minOccurs="0">
+     *         &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *         &lt;element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *       &lt;/sequence>
+     *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *       &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *       &lt;attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "title",
+        "newick"
+    })
+    public static class Tree {
+
+        @XmlElement(namespace = "www.jalview.org")
+        protected String title;
+        @XmlElement(namespace = "www.jalview.org")
+        protected String newick;
+        @XmlAttribute(name = "fontName")
+        protected String fontName;
+        @XmlAttribute(name = "fontSize")
+        protected Integer fontSize;
+        @XmlAttribute(name = "fontStyle")
+        protected Integer fontStyle;
+        @XmlAttribute(name = "threshold")
+        protected Float threshold;
+        @XmlAttribute(name = "showBootstrap")
+        protected Boolean showBootstrap;
+        @XmlAttribute(name = "showDistances")
+        protected Boolean showDistances;
+        @XmlAttribute(name = "markUnlinked")
+        protected Boolean markUnlinked;
+        @XmlAttribute(name = "fitToWindow")
+        protected Boolean fitToWindow;
+        @XmlAttribute(name = "currentTree")
+        protected Boolean currentTree;
+        @XmlAttribute(name = "id")
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        @XmlID
+        @XmlSchemaType(name = "ID")
+        protected String id;
+        @XmlAttribute(name = "width")
+        protected Integer width;
+        @XmlAttribute(name = "height")
+        protected Integer height;
+        @XmlAttribute(name = "xpos")
+        protected Integer xpos;
+        @XmlAttribute(name = "ypos")
+        protected Integer ypos;
+
+        /**
+         * Gets the value of the title property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getTitle() {
+            return title;
+        }
+
+        /**
+         * Sets the value of the title property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setTitle(String value) {
+            this.title = value;
+        }
+
+        /**
+         * Gets the value of the newick property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getNewick() {
+            return newick;
+        }
+
+        /**
+         * Sets the value of the newick property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setNewick(String value) {
+            this.newick = value;
+        }
+
+        /**
+         * Gets the value of the fontName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFontName() {
+            return fontName;
+        }
+
+        /**
+         * Sets the value of the fontName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFontName(String value) {
+            this.fontName = value;
+        }
+
+        /**
+         * Gets the value of the fontSize property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontSize() {
+            return fontSize;
+        }
+
+        /**
+         * Sets the value of the fontSize property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontSize(Integer value) {
+            this.fontSize = value;
+        }
+
+        /**
+         * Gets the value of the fontStyle property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontStyle() {
+            return fontStyle;
+        }
+
+        /**
+         * Sets the value of the fontStyle property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontStyle(Integer value) {
+            this.fontStyle = value;
+        }
+
+        /**
+         * Gets the value of the threshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Float }
+         *     
+         */
+        public Float getThreshold() {
+            return threshold;
+        }
+
+        /**
+         * Sets the value of the threshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Float }
+         *     
+         */
+        public void setThreshold(Float value) {
+            this.threshold = value;
+        }
+
+        /**
+         * Gets the value of the showBootstrap property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowBootstrap() {
+            return showBootstrap;
+        }
+
+        /**
+         * Sets the value of the showBootstrap property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowBootstrap(Boolean value) {
+            this.showBootstrap = value;
+        }
+
+        /**
+         * Gets the value of the showDistances property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowDistances() {
+            return showDistances;
+        }
+
+        /**
+         * Sets the value of the showDistances property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowDistances(Boolean value) {
+            this.showDistances = value;
+        }
+
+        /**
+         * Gets the value of the markUnlinked property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isMarkUnlinked() {
+            return markUnlinked;
+        }
+
+        /**
+         * Sets the value of the markUnlinked property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setMarkUnlinked(Boolean value) {
+            this.markUnlinked = value;
+        }
+
+        /**
+         * Gets the value of the fitToWindow property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isFitToWindow() {
+            return fitToWindow;
+        }
+
+        /**
+         * Sets the value of the fitToWindow property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setFitToWindow(Boolean value) {
+            this.fitToWindow = value;
+        }
+
+        /**
+         * Gets the value of the currentTree property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isCurrentTree() {
+            return currentTree;
+        }
+
+        /**
+         * Sets the value of the currentTree property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setCurrentTree(Boolean value) {
+            this.currentTree = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+        /**
+         * Gets the value of the width property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getWidth() {
+            return width;
+        }
+
+        /**
+         * Sets the value of the width property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setWidth(Integer value) {
+            this.width = value;
+        }
+
+        /**
+         * Gets the value of the height property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getHeight() {
+            return height;
+        }
+
+        /**
+         * Sets the value of the height property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setHeight(Integer value) {
+            this.height = value;
+        }
+
+        /**
+         * Gets the value of the xpos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getXpos() {
+            return xpos;
+        }
+
+        /**
+         * Sets the value of the xpos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setXpos(Integer value) {
+            this.xpos = value;
+        }
+
+        /**
+         * Gets the value of the ypos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getYpos() {
+            return ypos;
+        }
+
+        /**
+         * Sets the value of the ypos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setYpos(Integer value) {
+            this.ypos = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "userColourScheme"
+    })
+    public static class UserColours {
+
+        @XmlElement(name = "UserColourScheme", namespace = "www.jalview.org", required = true)
+        protected JalviewUserColours userColourScheme;
+        @XmlAttribute(name = "id")
+        protected String id;
+
+        /**
+         * Gets the value of the userColourScheme property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link JalviewUserColours }
+         *     
+         */
+        public JalviewUserColours getUserColourScheme() {
+            return userColourScheme;
+        }
+
+        /**
+         * Sets the value of the userColourScheme property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link JalviewUserColours }
+         *     
+         */
+        public void setUserColourScheme(JalviewUserColours value) {
+            this.userColourScheme = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+     *         &lt;element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="calcIdParam" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
+     *                 &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                 &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *               &lt;/extension>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *       &lt;attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+     *       &lt;attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "annotationColours",
+        "hiddenColumns",
+        "calcIdParam"
+    })
+    public static class Viewport {
+
+        @XmlElement(name = "AnnotationColours", namespace = "www.jalview.org")
+        protected AnnotationColourScheme annotationColours;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModel.Viewport.HiddenColumns> hiddenColumns;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModel.Viewport.CalcIdParam> calcIdParam;
+        @XmlAttribute(name = "conservationSelected")
+        protected Boolean conservationSelected;
+        @XmlAttribute(name = "pidSelected")
+        protected Boolean pidSelected;
+        @XmlAttribute(name = "bgColour")
+        protected String bgColour;
+        @XmlAttribute(name = "consThreshold")
+        protected Integer consThreshold;
+        @XmlAttribute(name = "pidThreshold")
+        protected Integer pidThreshold;
+        @XmlAttribute(name = "title")
+        protected String title;
+        @XmlAttribute(name = "showFullId")
+        protected Boolean showFullId;
+        @XmlAttribute(name = "rightAlignIds")
+        protected Boolean rightAlignIds;
+        @XmlAttribute(name = "showText")
+        protected Boolean showText;
+        @XmlAttribute(name = "showColourText")
+        protected Boolean showColourText;
+        @XmlAttribute(name = "showUnconserved")
+        protected Boolean showUnconserved;
+        @XmlAttribute(name = "showBoxes")
+        protected Boolean showBoxes;
+        @XmlAttribute(name = "wrapAlignment")
+        protected Boolean wrapAlignment;
+        @XmlAttribute(name = "renderGaps")
+        protected Boolean renderGaps;
+        @XmlAttribute(name = "showSequenceFeatures")
+        protected Boolean showSequenceFeatures;
+        @XmlAttribute(name = "showNPfeatureTooltip")
+        protected Boolean showNPfeatureTooltip;
+        @XmlAttribute(name = "showDbRefTooltip")
+        protected Boolean showDbRefTooltip;
+        @XmlAttribute(name = "followHighlight")
+        protected Boolean followHighlight;
+        @XmlAttribute(name = "followSelection")
+        protected Boolean followSelection;
+        @XmlAttribute(name = "showAnnotation")
+        protected Boolean showAnnotation;
+        @XmlAttribute(name = "centreColumnLabels")
+        protected Boolean centreColumnLabels;
+        @XmlAttribute(name = "showGroupConservation")
+        protected Boolean showGroupConservation;
+        @XmlAttribute(name = "showGroupConsensus")
+        protected Boolean showGroupConsensus;
+        @XmlAttribute(name = "showConsensusHistogram")
+        protected Boolean showConsensusHistogram;
+        @XmlAttribute(name = "showSequenceLogo")
+        protected Boolean showSequenceLogo;
+        @XmlAttribute(name = "normaliseSequenceLogo")
+        protected Boolean normaliseSequenceLogo;
+        @XmlAttribute(name = "ignoreGapsinConsensus")
+        protected Boolean ignoreGapsinConsensus;
+        @XmlAttribute(name = "startRes")
+        protected Integer startRes;
+        @XmlAttribute(name = "startSeq")
+        protected Integer startSeq;
+        @XmlAttribute(name = "fontName")
+        protected String fontName;
+        @XmlAttribute(name = "fontSize")
+        protected Integer fontSize;
+        @XmlAttribute(name = "fontStyle")
+        protected Integer fontStyle;
+        @XmlAttribute(name = "scaleProteinAsCdna")
+        protected Boolean scaleProteinAsCdna;
+        @XmlAttribute(name = "viewName")
+        protected String viewName;
+        @XmlAttribute(name = "sequenceSetId")
+        protected String sequenceSetId;
+        @XmlAttribute(name = "gatheredViews")
+        protected Boolean gatheredViews;
+        @XmlAttribute(name = "textCol1")
+        protected Integer textCol1;
+        @XmlAttribute(name = "textCol2")
+        protected Integer textCol2;
+        @XmlAttribute(name = "textColThreshold")
+        protected Integer textColThreshold;
+        @XmlAttribute(name = "id")
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        @XmlID
+        @XmlSchemaType(name = "ID")
+        protected String id;
+        @XmlAttribute(name = "complementId")
+        protected String complementId;
+        @XmlAttribute(name = "width")
+        protected Integer width;
+        @XmlAttribute(name = "height")
+        protected Integer height;
+        @XmlAttribute(name = "xpos")
+        protected Integer xpos;
+        @XmlAttribute(name = "ypos")
+        protected Integer ypos;
+
+        /**
+         * Gets the value of the annotationColours property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public AnnotationColourScheme getAnnotationColours() {
+            return annotationColours;
+        }
+
+        /**
+         * Sets the value of the annotationColours property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public void setAnnotationColours(AnnotationColourScheme value) {
+            this.annotationColours = value;
+        }
+
+        /**
+         * Gets the value of the hiddenColumns property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the hiddenColumns property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getHiddenColumns().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModel.Viewport.HiddenColumns }
+         * 
+         * 
+         */
+        public List<JalviewModel.Viewport.HiddenColumns> getHiddenColumns() {
+            if (hiddenColumns == null) {
+                hiddenColumns = new ArrayList<JalviewModel.Viewport.HiddenColumns>();
+            }
+            return this.hiddenColumns;
+        }
+
+        /**
+         * Gets the value of the calcIdParam property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the calcIdParam property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getCalcIdParam().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModel.Viewport.CalcIdParam }
+         * 
+         * 
+         */
+        public List<JalviewModel.Viewport.CalcIdParam> getCalcIdParam() {
+            if (calcIdParam == null) {
+                calcIdParam = new ArrayList<JalviewModel.Viewport.CalcIdParam>();
+            }
+            return this.calcIdParam;
+        }
+
+        /**
+         * Gets the value of the conservationSelected property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isConservationSelected() {
+            return conservationSelected;
+        }
+
+        /**
+         * Sets the value of the conservationSelected property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setConservationSelected(Boolean value) {
+            this.conservationSelected = value;
+        }
+
+        /**
+         * Gets the value of the pidSelected property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isPidSelected() {
+            return pidSelected;
+        }
+
+        /**
+         * Sets the value of the pidSelected property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setPidSelected(Boolean value) {
+            this.pidSelected = value;
+        }
+
+        /**
+         * Gets the value of the bgColour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getBgColour() {
+            return bgColour;
+        }
+
+        /**
+         * Sets the value of the bgColour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setBgColour(String value) {
+            this.bgColour = value;
+        }
+
+        /**
+         * Gets the value of the consThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getConsThreshold() {
+            return consThreshold;
+        }
+
+        /**
+         * Sets the value of the consThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setConsThreshold(Integer value) {
+            this.consThreshold = value;
+        }
+
+        /**
+         * Gets the value of the pidThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getPidThreshold() {
+            return pidThreshold;
+        }
+
+        /**
+         * Sets the value of the pidThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setPidThreshold(Integer value) {
+            this.pidThreshold = value;
+        }
+
+        /**
+         * Gets the value of the title property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getTitle() {
+            return title;
+        }
+
+        /**
+         * Sets the value of the title property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setTitle(String value) {
+            this.title = value;
+        }
+
+        /**
+         * Gets the value of the showFullId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowFullId() {
+            return showFullId;
+        }
+
+        /**
+         * Sets the value of the showFullId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowFullId(Boolean value) {
+            this.showFullId = value;
+        }
+
+        /**
+         * Gets the value of the rightAlignIds property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isRightAlignIds() {
+            return rightAlignIds;
+        }
+
+        /**
+         * Sets the value of the rightAlignIds property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setRightAlignIds(Boolean value) {
+            this.rightAlignIds = value;
+        }
+
+        /**
+         * Gets the value of the showText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowText() {
+            return showText;
+        }
+
+        /**
+         * Sets the value of the showText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowText(Boolean value) {
+            this.showText = value;
+        }
+
+        /**
+         * Gets the value of the showColourText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowColourText() {
+            return showColourText;
+        }
+
+        /**
+         * Sets the value of the showColourText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowColourText(Boolean value) {
+            this.showColourText = value;
+        }
+
+        /**
+         * Gets the value of the showUnconserved property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowUnconserved() {
+            if (showUnconserved == null) {
+                return false;
+            } else {
+                return showUnconserved;
+            }
+        }
+
+        /**
+         * Sets the value of the showUnconserved property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowUnconserved(Boolean value) {
+            this.showUnconserved = value;
+        }
+
+        /**
+         * Gets the value of the showBoxes property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowBoxes() {
+            return showBoxes;
+        }
+
+        /**
+         * Sets the value of the showBoxes property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowBoxes(Boolean value) {
+            this.showBoxes = value;
+        }
+
+        /**
+         * Gets the value of the wrapAlignment property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isWrapAlignment() {
+            return wrapAlignment;
+        }
+
+        /**
+         * Sets the value of the wrapAlignment property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setWrapAlignment(Boolean value) {
+            this.wrapAlignment = value;
+        }
+
+        /**
+         * Gets the value of the renderGaps property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isRenderGaps() {
+            return renderGaps;
+        }
+
+        /**
+         * Sets the value of the renderGaps property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setRenderGaps(Boolean value) {
+            this.renderGaps = value;
+        }
+
+        /**
+         * Gets the value of the showSequenceFeatures property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowSequenceFeatures() {
+            return showSequenceFeatures;
+        }
+
+        /**
+         * Sets the value of the showSequenceFeatures property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowSequenceFeatures(Boolean value) {
+            this.showSequenceFeatures = value;
+        }
+
+        /**
+         * Gets the value of the showNPfeatureTooltip property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowNPfeatureTooltip() {
+            return showNPfeatureTooltip;
+        }
+
+        /**
+         * Sets the value of the showNPfeatureTooltip property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowNPfeatureTooltip(Boolean value) {
+            this.showNPfeatureTooltip = value;
+        }
+
+        /**
+         * Gets the value of the showDbRefTooltip property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowDbRefTooltip() {
+            return showDbRefTooltip;
+        }
+
+        /**
+         * Sets the value of the showDbRefTooltip property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowDbRefTooltip(Boolean value) {
+            this.showDbRefTooltip = value;
+        }
+
+        /**
+         * Gets the value of the followHighlight property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isFollowHighlight() {
+            if (followHighlight == null) {
+                return true;
+            } else {
+                return followHighlight;
+            }
+        }
+
+        /**
+         * Sets the value of the followHighlight property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setFollowHighlight(Boolean value) {
+            this.followHighlight = value;
+        }
+
+        /**
+         * Gets the value of the followSelection property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isFollowSelection() {
+            if (followSelection == null) {
+                return true;
+            } else {
+                return followSelection;
+            }
+        }
+
+        /**
+         * Sets the value of the followSelection property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setFollowSelection(Boolean value) {
+            this.followSelection = value;
+        }
+
+        /**
+         * Gets the value of the showAnnotation property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowAnnotation() {
+            return showAnnotation;
+        }
+
+        /**
+         * Sets the value of the showAnnotation property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowAnnotation(Boolean value) {
+            this.showAnnotation = value;
+        }
+
+        /**
+         * Gets the value of the centreColumnLabels property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isCentreColumnLabels() {
+            if (centreColumnLabels == null) {
+                return false;
+            } else {
+                return centreColumnLabels;
+            }
+        }
+
+        /**
+         * Sets the value of the centreColumnLabels property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setCentreColumnLabels(Boolean value) {
+            this.centreColumnLabels = value;
+        }
+
+        /**
+         * Gets the value of the showGroupConservation property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowGroupConservation() {
+            if (showGroupConservation == null) {
+                return false;
+            } else {
+                return showGroupConservation;
+            }
+        }
+
+        /**
+         * Sets the value of the showGroupConservation property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowGroupConservation(Boolean value) {
+            this.showGroupConservation = value;
+        }
+
+        /**
+         * Gets the value of the showGroupConsensus property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowGroupConsensus() {
+            if (showGroupConsensus == null) {
+                return false;
+            } else {
+                return showGroupConsensus;
+            }
+        }
+
+        /**
+         * Sets the value of the showGroupConsensus property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowGroupConsensus(Boolean value) {
+            this.showGroupConsensus = value;
+        }
+
+        /**
+         * Gets the value of the showConsensusHistogram property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowConsensusHistogram() {
+            if (showConsensusHistogram == null) {
+                return true;
+            } else {
+                return showConsensusHistogram;
+            }
+        }
+
+        /**
+         * Sets the value of the showConsensusHistogram property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowConsensusHistogram(Boolean value) {
+            this.showConsensusHistogram = value;
+        }
+
+        /**
+         * Gets the value of the showSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowSequenceLogo() {
+            if (showSequenceLogo == null) {
+                return false;
+            } else {
+                return showSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the showSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowSequenceLogo(Boolean value) {
+            this.showSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the normaliseSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isNormaliseSequenceLogo() {
+            if (normaliseSequenceLogo == null) {
+                return false;
+            } else {
+                return normaliseSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the normaliseSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setNormaliseSequenceLogo(Boolean value) {
+            this.normaliseSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the ignoreGapsinConsensus property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isIgnoreGapsinConsensus() {
+            if (ignoreGapsinConsensus == null) {
+                return true;
+            } else {
+                return ignoreGapsinConsensus;
+            }
+        }
+
+        /**
+         * Sets the value of the ignoreGapsinConsensus property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setIgnoreGapsinConsensus(Boolean value) {
+            this.ignoreGapsinConsensus = value;
+        }
+
+        /**
+         * Gets the value of the startRes property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getStartRes() {
+            return startRes;
+        }
+
+        /**
+         * Sets the value of the startRes property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setStartRes(Integer value) {
+            this.startRes = value;
+        }
+
+        /**
+         * Gets the value of the startSeq property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getStartSeq() {
+            return startSeq;
+        }
+
+        /**
+         * Sets the value of the startSeq property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setStartSeq(Integer value) {
+            this.startSeq = value;
+        }
+
+        /**
+         * Gets the value of the fontName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFontName() {
+            return fontName;
+        }
+
+        /**
+         * Sets the value of the fontName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFontName(String value) {
+            this.fontName = value;
+        }
+
+        /**
+         * Gets the value of the fontSize property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontSize() {
+            return fontSize;
+        }
+
+        /**
+         * Sets the value of the fontSize property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontSize(Integer value) {
+            this.fontSize = value;
+        }
+
+        /**
+         * Gets the value of the fontStyle property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontStyle() {
+            return fontStyle;
+        }
+
+        /**
+         * Sets the value of the fontStyle property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontStyle(Integer value) {
+            this.fontStyle = value;
+        }
+
+        /**
+         * Gets the value of the scaleProteinAsCdna property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isScaleProteinAsCdna() {
+            if (scaleProteinAsCdna == null) {
+                return true;
+            } else {
+                return scaleProteinAsCdna;
+            }
+        }
+
+        /**
+         * Sets the value of the scaleProteinAsCdna property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setScaleProteinAsCdna(Boolean value) {
+            this.scaleProteinAsCdna = value;
+        }
+
+        /**
+         * Gets the value of the viewName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getViewName() {
+            return viewName;
+        }
+
+        /**
+         * Sets the value of the viewName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setViewName(String value) {
+            this.viewName = value;
+        }
+
+        /**
+         * Gets the value of the sequenceSetId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getSequenceSetId() {
+            return sequenceSetId;
+        }
+
+        /**
+         * Sets the value of the sequenceSetId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setSequenceSetId(String value) {
+            this.sequenceSetId = value;
+        }
+
+        /**
+         * Gets the value of the gatheredViews property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isGatheredViews() {
+            return gatheredViews;
+        }
+
+        /**
+         * Sets the value of the gatheredViews property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setGatheredViews(Boolean value) {
+            this.gatheredViews = value;
+        }
+
+        /**
+         * Gets the value of the textCol1 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol1() {
+            return textCol1;
+        }
+
+        /**
+         * Sets the value of the textCol1 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol1(Integer value) {
+            this.textCol1 = value;
+        }
+
+        /**
+         * Gets the value of the textCol2 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol2() {
+            return textCol2;
+        }
+
+        /**
+         * Sets the value of the textCol2 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol2(Integer value) {
+            this.textCol2 = value;
+        }
+
+        /**
+         * Gets the value of the textColThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextColThreshold() {
+            return textColThreshold;
+        }
+
+        /**
+         * Sets the value of the textColThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextColThreshold(Integer value) {
+            this.textColThreshold = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+        /**
+         * Gets the value of the complementId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getComplementId() {
+            return complementId;
+        }
+
+        /**
+         * Sets the value of the complementId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setComplementId(String value) {
+            this.complementId = value;
+        }
+
+        /**
+         * Gets the value of the width property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getWidth() {
+            return width;
+        }
+
+        /**
+         * Sets the value of the width property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setWidth(Integer value) {
+            this.width = value;
+        }
+
+        /**
+         * Gets the value of the height property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getHeight() {
+            return height;
+        }
+
+        /**
+         * Sets the value of the height property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setHeight(Integer value) {
+            this.height = value;
+        }
+
+        /**
+         * Gets the value of the xpos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getXpos() {
+            return xpos;
+        }
+
+        /**
+         * Sets the value of the xpos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setXpos(Integer value) {
+            this.xpos = value;
+        }
+
+        /**
+         * Gets the value of the ypos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getYpos() {
+            return ypos;
+        }
+
+        /**
+         * Sets the value of the ypos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setYpos(Integer value) {
+            this.ypos = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
+         *       &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *       &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *     &lt;/extension>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class CalcIdParam
+            extends WebServiceParameterSet
+        {
+
+            @XmlAttribute(name = "calcId", required = true)
+            protected String calcId;
+            @XmlAttribute(name = "needsUpdate")
+            protected Boolean needsUpdate;
+            @XmlAttribute(name = "autoUpdate", required = true)
+            protected boolean autoUpdate;
+
+            /**
+             * Gets the value of the calcId property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getCalcId() {
+                return calcId;
+            }
+
+            /**
+             * Sets the value of the calcId property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setCalcId(String value) {
+                this.calcId = value;
+            }
+
+            /**
+             * Gets the value of the needsUpdate property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isNeedsUpdate() {
+                if (needsUpdate == null) {
+                    return false;
+                } else {
+                    return needsUpdate;
+                }
+            }
+
+            /**
+             * Sets the value of the needsUpdate property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setNeedsUpdate(Boolean value) {
+                this.needsUpdate = value;
+            }
+
+            /**
+             * Gets the value of the autoUpdate property.
+             * 
+             */
+            public boolean isAutoUpdate() {
+                return autoUpdate;
+            }
+
+            /**
+             * Sets the value of the autoUpdate property.
+             * 
+             */
+            public void setAutoUpdate(boolean value) {
+                this.autoUpdate = value;
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class HiddenColumns {
+
+            @XmlAttribute(name = "start")
+            protected Integer start;
+            @XmlAttribute(name = "end")
+            protected Integer end;
+
+            /**
+             * Gets the value of the start property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getStart() {
+                return start;
+            }
+
+            /**
+             * Sets the value of the start property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setStart(Integer value) {
+                this.start = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setEnd(Integer value) {
+                this.end = value;
+            }
+
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/JalviewModelType.java b/src/jalview/xml/binding/jalview/JalviewModelType.java
new file mode 100644 (file)
index 0000000..f084bc3
--- /dev/null
@@ -0,0 +1,5090 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.18 at 01:33:02 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for JalviewModelType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="JalviewModelType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="creationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *         &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="vamsasModel" type="{www.vamsas.ac.uk/jalview/version2}VAMSAS"/>
+ *         &lt;sequence>
+ *           &lt;element name="JSeq" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/>
+ *                     &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;extension base="{www.jalview.org}pdbentry">
+ *                             &lt;sequence>
+ *                               &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0">
+ *                                 &lt;complexType>
+ *                                   &lt;simpleContent>
+ *                                     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                                       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                                       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                                       &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                       &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                                       &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                                       &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                                       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     &lt;/extension>
+ *                                   &lt;/simpleContent>
+ *                                 &lt;/complexType>
+ *                               &lt;/element>
+ *                             &lt;/sequence>
+ *                           &lt;/extension>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+ *                     &lt;element name="rnaViewer" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;sequence>
+ *                               &lt;element name="secondaryStructure" maxOccurs="unbounded">
+ *                                 &lt;complexType>
+ *                                   &lt;complexContent>
+ *                                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                       &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                       &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                                       &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                     &lt;/restriction>
+ *                                   &lt;/complexContent>
+ *                                 &lt;/complexType>
+ *                               &lt;/element>
+ *                             &lt;/sequence>
+ *                             &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                             &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="JGroup" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *                     &lt;element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="Viewport" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+ *                     &lt;element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="calcIdParam" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
+ *                             &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                             &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                           &lt;/extension>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                   &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                   &lt;attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                   &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                   &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *                   &lt;attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="UserColours" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="tree" maxOccurs="unbounded" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence minOccurs="0">
+ *                     &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                     &lt;element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   &lt;/sequence>
+ *                   &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+ *                   &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                   &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                   &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                   &lt;attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                   &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;element name="FeatureSettings" minOccurs="0">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="setting" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;sequence>
+ *                               &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+ *                               &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
+ *                             &lt;/sequence>
+ *                             &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                             &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+ *                             &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                             &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                             &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                             &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                     &lt;element name="group" maxOccurs="unbounded" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *         &lt;/sequence>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "JalviewModelType", namespace = "www.jalview.org", propOrder = {
+    "creationDate",
+    "version",
+    "vamsasModel",
+    "jSeq",
+    "jGroup",
+    "viewport",
+    "userColours",
+    "tree",
+    "featureSettings"
+})
+public class JalviewModelType {
+
+    @XmlElement(required = true)
+    @XmlSchemaType(name = "dateTime")
+    protected XMLGregorianCalendar creationDate;
+    @XmlElement(required = true)
+    protected String version;
+    @XmlElement(required = true)
+    protected VAMSAS vamsasModel;
+    @XmlElement(name = "JSeq")
+    protected List<JalviewModelType.JSeq> jSeq;
+    @XmlElement(name = "JGroup")
+    protected List<JalviewModelType.JGroup> jGroup;
+    @XmlElement(name = "Viewport")
+    protected List<JalviewModelType.Viewport> viewport;
+    @XmlElement(name = "UserColours")
+    protected List<JalviewModelType.UserColours> userColours;
+    protected List<JalviewModelType.Tree> tree;
+    @XmlElement(name = "FeatureSettings")
+    protected JalviewModelType.FeatureSettings featureSettings;
+
+    /**
+     * Gets the value of the creationDate property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getCreationDate() {
+        return creationDate;
+    }
+
+    /**
+     * Sets the value of the creationDate property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setCreationDate(XMLGregorianCalendar value) {
+        this.creationDate = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVersion(String value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the vamsasModel property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link VAMSAS }
+     *     
+     */
+    public VAMSAS getVamsasModel() {
+        return vamsasModel;
+    }
+
+    /**
+     * Sets the value of the vamsasModel property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link VAMSAS }
+     *     
+     */
+    public void setVamsasModel(VAMSAS value) {
+        this.vamsasModel = value;
+    }
+
+    /**
+     * Gets the value of the jSeq property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the jSeq property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getJSeq().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModelType.JSeq }
+     * 
+     * 
+     */
+    public List<JalviewModelType.JSeq> getJSeq() {
+        if (jSeq == null) {
+            jSeq = new ArrayList<JalviewModelType.JSeq>();
+        }
+        return this.jSeq;
+    }
+
+    /**
+     * Gets the value of the jGroup property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the jGroup property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getJGroup().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModelType.JGroup }
+     * 
+     * 
+     */
+    public List<JalviewModelType.JGroup> getJGroup() {
+        if (jGroup == null) {
+            jGroup = new ArrayList<JalviewModelType.JGroup>();
+        }
+        return this.jGroup;
+    }
+
+    /**
+     * Gets the value of the viewport property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the viewport property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getViewport().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModelType.Viewport }
+     * 
+     * 
+     */
+    public List<JalviewModelType.Viewport> getViewport() {
+        if (viewport == null) {
+            viewport = new ArrayList<JalviewModelType.Viewport>();
+        }
+        return this.viewport;
+    }
+
+    /**
+     * Gets the value of the userColours property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the userColours property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getUserColours().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModelType.UserColours }
+     * 
+     * 
+     */
+    public List<JalviewModelType.UserColours> getUserColours() {
+        if (userColours == null) {
+            userColours = new ArrayList<JalviewModelType.UserColours>();
+        }
+        return this.userColours;
+    }
+
+    /**
+     * Gets the value of the tree property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the tree property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getTree().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewModelType.Tree }
+     * 
+     * 
+     */
+    public List<JalviewModelType.Tree> getTree() {
+        if (tree == null) {
+            tree = new ArrayList<JalviewModelType.Tree>();
+        }
+        return this.tree;
+    }
+
+    /**
+     * Gets the value of the featureSettings property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link JalviewModelType.FeatureSettings }
+     *     
+     */
+    public JalviewModelType.FeatureSettings getFeatureSettings() {
+        return featureSettings;
+    }
+
+    /**
+     * Sets the value of the featureSettings property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link JalviewModelType.FeatureSettings }
+     *     
+     */
+    public void setFeatureSettings(JalviewModelType.FeatureSettings value) {
+        this.featureSettings = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="setting" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+     *                   &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
+     *                 &lt;/sequence>
+     *                 &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                 &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+     *                 &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *                 &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                 &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="group" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "setting",
+        "group"
+    })
+    public static class FeatureSettings {
+
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModelType.FeatureSettings.Setting> setting;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModelType.FeatureSettings.Group> group;
+
+        /**
+         * Gets the value of the setting property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the setting property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getSetting().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModelType.FeatureSettings.Setting }
+         * 
+         * 
+         */
+        public List<JalviewModelType.FeatureSettings.Setting> getSetting() {
+            if (setting == null) {
+                setting = new ArrayList<JalviewModelType.FeatureSettings.Setting>();
+            }
+            return this.setting;
+        }
+
+        /**
+         * Gets the value of the group property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the group property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getGroup().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModelType.FeatureSettings.Group }
+         * 
+         * 
+         */
+        public List<JalviewModelType.FeatureSettings.Group> getGroup() {
+            if (group == null) {
+                group = new ArrayList<JalviewModelType.FeatureSettings.Group>();
+            }
+            return this.group;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Group {
+
+            @XmlAttribute(name = "name", required = true)
+            protected String name;
+            @XmlAttribute(name = "display", required = true)
+            protected boolean display;
+
+            /**
+             * Gets the value of the name property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getName() {
+                return name;
+            }
+
+            /**
+             * Sets the value of the name property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setName(String value) {
+                this.name = value;
+            }
+
+            /**
+             * Gets the value of the display property.
+             * 
+             */
+            public boolean isDisplay() {
+                return display;
+            }
+
+            /**
+             * Sets the value of the display property.
+             * 
+             */
+            public void setDisplay(boolean value) {
+                this.display = value;
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+         *         &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
+         *       &lt;/sequence>
+         *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *       &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+         *       &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+         *       &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *       &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "attributeName",
+            "matcherSet"
+        })
+        public static class Setting {
+
+            @XmlElement(namespace = "www.jalview.org")
+            protected List<String> attributeName;
+            @XmlElement(namespace = "www.jalview.org")
+            protected FeatureMatcherSet matcherSet;
+            @XmlAttribute(name = "type", required = true)
+            protected String type;
+            @XmlAttribute(name = "colour", required = true)
+            protected int colour;
+            @XmlAttribute(name = "display", required = true)
+            protected boolean display;
+            @XmlAttribute(name = "order")
+            protected Float order;
+            @XmlAttribute(name = "mincolour")
+            protected Integer mincolour;
+            @XmlAttribute(name = "noValueColour")
+            protected NoValueColour noValueColour;
+            @XmlAttribute(name = "threshold")
+            protected Float threshold;
+            @XmlAttribute(name = "threshstate")
+            protected Integer threshstate;
+            @XmlAttribute(name = "max")
+            protected Float max;
+            @XmlAttribute(name = "min")
+            protected Float min;
+            @XmlAttribute(name = "colourByLabel")
+            protected Boolean colourByLabel;
+            @XmlAttribute(name = "autoScale")
+            protected Boolean autoScale;
+
+            /**
+             * Gets the value of the attributeName property.
+             * 
+             * <p>
+             * This accessor method returns a reference to the live list,
+             * not a snapshot. Therefore any modification you make to the
+             * returned list will be present inside the JAXB object.
+             * This is why there is not a <CODE>set</CODE> method for the attributeName property.
+             * 
+             * <p>
+             * For example, to add a new item, do as follows:
+             * <pre>
+             *    getAttributeName().add(newItem);
+             * </pre>
+             * 
+             * 
+             * <p>
+             * Objects of the following type(s) are allowed in the list
+             * {@link String }
+             * 
+             * 
+             */
+            public List<String> getAttributeName() {
+                if (attributeName == null) {
+                    attributeName = new ArrayList<String>();
+                }
+                return this.attributeName;
+            }
+
+            /**
+             * Gets the value of the matcherSet property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link FeatureMatcherSet }
+             *     
+             */
+            public FeatureMatcherSet getMatcherSet() {
+                return matcherSet;
+            }
+
+            /**
+             * Sets the value of the matcherSet property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link FeatureMatcherSet }
+             *     
+             */
+            public void setMatcherSet(FeatureMatcherSet value) {
+                this.matcherSet = value;
+            }
+
+            /**
+             * Gets the value of the type property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getType() {
+                return type;
+            }
+
+            /**
+             * Sets the value of the type property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setType(String value) {
+                this.type = value;
+            }
+
+            /**
+             * Gets the value of the colour property.
+             * 
+             */
+            public int getColour() {
+                return colour;
+            }
+
+            /**
+             * Sets the value of the colour property.
+             * 
+             */
+            public void setColour(int value) {
+                this.colour = value;
+            }
+
+            /**
+             * Gets the value of the display property.
+             * 
+             */
+            public boolean isDisplay() {
+                return display;
+            }
+
+            /**
+             * Sets the value of the display property.
+             * 
+             */
+            public void setDisplay(boolean value) {
+                this.display = value;
+            }
+
+            /**
+             * Gets the value of the order property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getOrder() {
+                return order;
+            }
+
+            /**
+             * Sets the value of the order property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setOrder(Float value) {
+                this.order = value;
+            }
+
+            /**
+             * Gets the value of the mincolour property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getMincolour() {
+                return mincolour;
+            }
+
+            /**
+             * Sets the value of the mincolour property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setMincolour(Integer value) {
+                this.mincolour = value;
+            }
+
+            /**
+             * Gets the value of the noValueColour property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link NoValueColour }
+             *     
+             */
+            public NoValueColour getNoValueColour() {
+                if (noValueColour == null) {
+                    return NoValueColour.MIN;
+                } else {
+                    return noValueColour;
+                }
+            }
+
+            /**
+             * Sets the value of the noValueColour property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link NoValueColour }
+             *     
+             */
+            public void setNoValueColour(NoValueColour value) {
+                this.noValueColour = value;
+            }
+
+            /**
+             * Gets the value of the threshold property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getThreshold() {
+                return threshold;
+            }
+
+            /**
+             * Sets the value of the threshold property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setThreshold(Float value) {
+                this.threshold = value;
+            }
+
+            /**
+             * Gets the value of the threshstate property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getThreshstate() {
+                return threshstate;
+            }
+
+            /**
+             * Sets the value of the threshstate property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setThreshstate(Integer value) {
+                this.threshstate = value;
+            }
+
+            /**
+             * Gets the value of the max property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getMax() {
+                return max;
+            }
+
+            /**
+             * Sets the value of the max property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setMax(Float value) {
+                this.max = value;
+            }
+
+            /**
+             * Gets the value of the min property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Float }
+             *     
+             */
+            public Float getMin() {
+                return min;
+            }
+
+            /**
+             * Sets the value of the min property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Float }
+             *     
+             */
+            public void setMin(Float value) {
+                this.min = value;
+            }
+
+            /**
+             * Gets the value of the colourByLabel property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public Boolean isColourByLabel() {
+                return colourByLabel;
+            }
+
+            /**
+             * Sets the value of the colourByLabel property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setColourByLabel(Boolean value) {
+                this.colourByLabel = value;
+            }
+
+            /**
+             * Gets the value of the autoScale property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public Boolean isAutoScale() {
+                return autoScale;
+            }
+
+            /**
+             * Sets the value of the autoScale property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setAutoScale(Boolean value) {
+                this.autoScale = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+     *         &lt;element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "seq",
+        "annotationColours"
+    })
+    public static class JGroup {
+
+        @XmlElement(namespace = "www.jalview.org", required = true)
+        protected List<String> seq;
+        @XmlElement(namespace = "www.jalview.org")
+        protected AnnotationColourScheme annotationColours;
+        @XmlAttribute(name = "start")
+        protected Integer start;
+        @XmlAttribute(name = "end")
+        protected Integer end;
+        @XmlAttribute(name = "name")
+        protected String name;
+        @XmlAttribute(name = "colour")
+        protected String colour;
+        @XmlAttribute(name = "consThreshold")
+        protected Integer consThreshold;
+        @XmlAttribute(name = "pidThreshold")
+        protected Integer pidThreshold;
+        @XmlAttribute(name = "outlineColour")
+        protected Integer outlineColour;
+        @XmlAttribute(name = "displayBoxes")
+        protected Boolean displayBoxes;
+        @XmlAttribute(name = "displayText")
+        protected Boolean displayText;
+        @XmlAttribute(name = "colourText")
+        protected Boolean colourText;
+        @XmlAttribute(name = "textCol1")
+        protected Integer textCol1;
+        @XmlAttribute(name = "textCol2")
+        protected Integer textCol2;
+        @XmlAttribute(name = "textColThreshold")
+        protected Integer textColThreshold;
+        @XmlAttribute(name = "showUnconserved")
+        protected Boolean showUnconserved;
+        @XmlAttribute(name = "ignoreGapsinConsensus")
+        protected Boolean ignoreGapsinConsensus;
+        @XmlAttribute(name = "showConsensusHistogram")
+        protected Boolean showConsensusHistogram;
+        @XmlAttribute(name = "showSequenceLogo")
+        protected Boolean showSequenceLogo;
+        @XmlAttribute(name = "normaliseSequenceLogo")
+        protected Boolean normaliseSequenceLogo;
+        @XmlAttribute(name = "id")
+        protected String id;
+
+        /**
+         * Gets the value of the seq property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the seq property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getSeq().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getSeq() {
+            if (seq == null) {
+                seq = new ArrayList<String>();
+            }
+            return this.seq;
+        }
+
+        /**
+         * Gets the value of the annotationColours property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public AnnotationColourScheme getAnnotationColours() {
+            return annotationColours;
+        }
+
+        /**
+         * Sets the value of the annotationColours property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public void setAnnotationColours(AnnotationColourScheme value) {
+            this.annotationColours = value;
+        }
+
+        /**
+         * Gets the value of the start property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getStart() {
+            return start;
+        }
+
+        /**
+         * Sets the value of the start property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setStart(Integer value) {
+            this.start = value;
+        }
+
+        /**
+         * Gets the value of the end property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getEnd() {
+            return end;
+        }
+
+        /**
+         * Sets the value of the end property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setEnd(Integer value) {
+            this.end = value;
+        }
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the colour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getColour() {
+            return colour;
+        }
+
+        /**
+         * Sets the value of the colour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setColour(String value) {
+            this.colour = value;
+        }
+
+        /**
+         * Gets the value of the consThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getConsThreshold() {
+            return consThreshold;
+        }
+
+        /**
+         * Sets the value of the consThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setConsThreshold(Integer value) {
+            this.consThreshold = value;
+        }
+
+        /**
+         * Gets the value of the pidThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getPidThreshold() {
+            return pidThreshold;
+        }
+
+        /**
+         * Sets the value of the pidThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setPidThreshold(Integer value) {
+            this.pidThreshold = value;
+        }
+
+        /**
+         * Gets the value of the outlineColour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getOutlineColour() {
+            return outlineColour;
+        }
+
+        /**
+         * Sets the value of the outlineColour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setOutlineColour(Integer value) {
+            this.outlineColour = value;
+        }
+
+        /**
+         * Gets the value of the displayBoxes property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isDisplayBoxes() {
+            return displayBoxes;
+        }
+
+        /**
+         * Sets the value of the displayBoxes property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setDisplayBoxes(Boolean value) {
+            this.displayBoxes = value;
+        }
+
+        /**
+         * Gets the value of the displayText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isDisplayText() {
+            return displayText;
+        }
+
+        /**
+         * Sets the value of the displayText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setDisplayText(Boolean value) {
+            this.displayText = value;
+        }
+
+        /**
+         * Gets the value of the colourText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isColourText() {
+            return colourText;
+        }
+
+        /**
+         * Sets the value of the colourText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setColourText(Boolean value) {
+            this.colourText = value;
+        }
+
+        /**
+         * Gets the value of the textCol1 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol1() {
+            return textCol1;
+        }
+
+        /**
+         * Sets the value of the textCol1 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol1(Integer value) {
+            this.textCol1 = value;
+        }
+
+        /**
+         * Gets the value of the textCol2 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol2() {
+            return textCol2;
+        }
+
+        /**
+         * Sets the value of the textCol2 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol2(Integer value) {
+            this.textCol2 = value;
+        }
+
+        /**
+         * Gets the value of the textColThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextColThreshold() {
+            return textColThreshold;
+        }
+
+        /**
+         * Sets the value of the textColThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextColThreshold(Integer value) {
+            this.textColThreshold = value;
+        }
+
+        /**
+         * Gets the value of the showUnconserved property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowUnconserved() {
+            return showUnconserved;
+        }
+
+        /**
+         * Sets the value of the showUnconserved property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowUnconserved(Boolean value) {
+            this.showUnconserved = value;
+        }
+
+        /**
+         * Gets the value of the ignoreGapsinConsensus property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isIgnoreGapsinConsensus() {
+            if (ignoreGapsinConsensus == null) {
+                return true;
+            } else {
+                return ignoreGapsinConsensus;
+            }
+        }
+
+        /**
+         * Sets the value of the ignoreGapsinConsensus property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setIgnoreGapsinConsensus(Boolean value) {
+            this.ignoreGapsinConsensus = value;
+        }
+
+        /**
+         * Gets the value of the showConsensusHistogram property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowConsensusHistogram() {
+            if (showConsensusHistogram == null) {
+                return true;
+            } else {
+                return showConsensusHistogram;
+            }
+        }
+
+        /**
+         * Sets the value of the showConsensusHistogram property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowConsensusHistogram(Boolean value) {
+            this.showConsensusHistogram = value;
+        }
+
+        /**
+         * Gets the value of the showSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowSequenceLogo() {
+            if (showSequenceLogo == null) {
+                return false;
+            } else {
+                return showSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the showSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowSequenceLogo(Boolean value) {
+            this.showSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the normaliseSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isNormaliseSequenceLogo() {
+            if (normaliseSequenceLogo == null) {
+                return false;
+            } else {
+                return normaliseSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the normaliseSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setNormaliseSequenceLogo(Boolean value) {
+            this.normaliseSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;extension base="{www.jalview.org}pdbentry">
+     *                 &lt;sequence>
+     *                   &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0">
+     *                     &lt;complexType>
+     *                       &lt;simpleContent>
+     *                         &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *                           &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *                           &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                           &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *                           &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                           &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *                           &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         &lt;/extension>
+     *                       &lt;/simpleContent>
+     *                     &lt;/complexType>
+     *                   &lt;/element>
+     *                 &lt;/sequence>
+     *               &lt;/extension>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="rnaViewer" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;sequence>
+     *                   &lt;element name="secondaryStructure" maxOccurs="unbounded">
+     *                     &lt;complexType>
+     *                       &lt;complexContent>
+     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                           &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *                           &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         &lt;/restriction>
+     *                       &lt;/complexContent>
+     *                     &lt;/complexType>
+     *                   &lt;/element>
+     *                 &lt;/sequence>
+     *                 &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *                 &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "features",
+        "pdbids",
+        "hiddenSequences",
+        "rnaViewer"
+    })
+    public static class JSeq {
+
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<Feature> features;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModelType.JSeq.Pdbids> pdbids;
+        @XmlElement(namespace = "www.jalview.org", type = Integer.class)
+        protected List<Integer> hiddenSequences;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModelType.JSeq.RnaViewer> rnaViewer;
+        @XmlAttribute(name = "colour")
+        protected Integer colour;
+        @XmlAttribute(name = "start", required = true)
+        protected int start;
+        @XmlAttribute(name = "end", required = true)
+        protected int end;
+        @XmlAttribute(name = "id", required = true)
+        protected String id;
+        @XmlAttribute(name = "hidden")
+        protected Boolean hidden;
+        @XmlAttribute(name = "viewreference")
+        protected Boolean viewreference;
+
+        /**
+         * Gets the value of the features property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the features property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getFeatures().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Feature }
+         * 
+         * 
+         */
+        public List<Feature> getFeatures() {
+            if (features == null) {
+                features = new ArrayList<Feature>();
+            }
+            return this.features;
+        }
+
+        /**
+         * Gets the value of the pdbids property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the pdbids property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getPdbids().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModelType.JSeq.Pdbids }
+         * 
+         * 
+         */
+        public List<JalviewModelType.JSeq.Pdbids> getPdbids() {
+            if (pdbids == null) {
+                pdbids = new ArrayList<JalviewModelType.JSeq.Pdbids>();
+            }
+            return this.pdbids;
+        }
+
+        /**
+         * Gets the value of the hiddenSequences property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the hiddenSequences property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getHiddenSequences().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getHiddenSequences() {
+            if (hiddenSequences == null) {
+                hiddenSequences = new ArrayList<Integer>();
+            }
+            return this.hiddenSequences;
+        }
+
+        /**
+         * Gets the value of the rnaViewer property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the rnaViewer property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getRnaViewer().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModelType.JSeq.RnaViewer }
+         * 
+         * 
+         */
+        public List<JalviewModelType.JSeq.RnaViewer> getRnaViewer() {
+            if (rnaViewer == null) {
+                rnaViewer = new ArrayList<JalviewModelType.JSeq.RnaViewer>();
+            }
+            return this.rnaViewer;
+        }
+
+        /**
+         * Gets the value of the colour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getColour() {
+            return colour;
+        }
+
+        /**
+         * Sets the value of the colour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setColour(Integer value) {
+            this.colour = value;
+        }
+
+        /**
+         * Gets the value of the start property.
+         * 
+         */
+        public int getStart() {
+            return start;
+        }
+
+        /**
+         * Sets the value of the start property.
+         * 
+         */
+        public void setStart(int value) {
+            this.start = value;
+        }
+
+        /**
+         * Gets the value of the end property.
+         * 
+         */
+        public int getEnd() {
+            return end;
+        }
+
+        /**
+         * Sets the value of the end property.
+         * 
+         */
+        public void setEnd(int value) {
+            this.end = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+        /**
+         * Gets the value of the hidden property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isHidden() {
+            return hidden;
+        }
+
+        /**
+         * Sets the value of the hidden property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setHidden(Boolean value) {
+            this.hidden = value;
+        }
+
+        /**
+         * Gets the value of the viewreference property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isViewreference() {
+            return viewreference;
+        }
+
+        /**
+         * Sets the value of the viewreference property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setViewreference(Boolean value) {
+            this.viewreference = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;extension base="{www.jalview.org}pdbentry">
+         *       &lt;sequence>
+         *         &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0">
+         *           &lt;complexType>
+         *             &lt;simpleContent>
+         *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+         *                 &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+         *                 &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *                 &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+         *                 &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *                 &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+         *                 &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               &lt;/extension>
+         *             &lt;/simpleContent>
+         *           &lt;/complexType>
+         *         &lt;/element>
+         *       &lt;/sequence>
+         *     &lt;/extension>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "structureState"
+        })
+        public static class Pdbids
+            extends Pdbentry
+        {
+
+            @XmlElement(namespace = "www.jalview.org")
+            protected List<JalviewModelType.JSeq.Pdbids.StructureState> structureState;
+
+            /**
+             * Gets the value of the structureState property.
+             * 
+             * <p>
+             * This accessor method returns a reference to the live list,
+             * not a snapshot. Therefore any modification you make to the
+             * returned list will be present inside the JAXB object.
+             * This is why there is not a <CODE>set</CODE> method for the structureState property.
+             * 
+             * <p>
+             * For example, to add a new item, do as follows:
+             * <pre>
+             *    getStructureState().add(newItem);
+             * </pre>
+             * 
+             * 
+             * <p>
+             * Objects of the following type(s) are allowed in the list
+             * {@link JalviewModelType.JSeq.Pdbids.StructureState }
+             * 
+             * 
+             */
+            public List<JalviewModelType.JSeq.Pdbids.StructureState> getStructureState() {
+                if (structureState == null) {
+                    structureState = new ArrayList<JalviewModelType.JSeq.Pdbids.StructureState>();
+                }
+                return this.structureState;
+            }
+
+
+            /**
+             * <p>Java class for anonymous complex type.
+             * 
+             * <p>The following schema fragment specifies the expected content contained within this class.
+             * 
+             * <pre>
+             * &lt;complexType>
+             *   &lt;simpleContent>
+             *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+             *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+             *       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+             *       &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+             *       &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+             *       &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+             *       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     &lt;/extension>
+             *   &lt;/simpleContent>
+             * &lt;/complexType>
+             * </pre>
+             * 
+             * 
+             */
+            @XmlAccessorType(XmlAccessType.FIELD)
+            @XmlType(name = "", propOrder = {
+                "value"
+            })
+            public static class StructureState {
+
+                @XmlValue
+                protected String value;
+                @XmlAttribute(name = "visible")
+                protected Boolean visible;
+                @XmlAttribute(name = "viewId")
+                protected String viewId;
+                @XmlAttribute(name = "alignwithAlignPanel")
+                protected Boolean alignwithAlignPanel;
+                @XmlAttribute(name = "colourwithAlignPanel")
+                protected Boolean colourwithAlignPanel;
+                @XmlAttribute(name = "colourByJmol")
+                protected Boolean colourByJmol;
+                @XmlAttribute(name = "type")
+                protected String type;
+                @XmlAttribute(name = "width")
+                protected Integer width;
+                @XmlAttribute(name = "height")
+                protected Integer height;
+                @XmlAttribute(name = "xpos")
+                protected Integer xpos;
+                @XmlAttribute(name = "ypos")
+                protected Integer ypos;
+
+                /**
+                 * Gets the value of the value property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getValue() {
+                    return value;
+                }
+
+                /**
+                 * Sets the value of the value property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setValue(String value) {
+                    this.value = value;
+                }
+
+                /**
+                 * Gets the value of the visible property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public Boolean isVisible() {
+                    return visible;
+                }
+
+                /**
+                 * Sets the value of the visible property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setVisible(Boolean value) {
+                    this.visible = value;
+                }
+
+                /**
+                 * Gets the value of the viewId property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getViewId() {
+                    return viewId;
+                }
+
+                /**
+                 * Sets the value of the viewId property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setViewId(String value) {
+                    this.viewId = value;
+                }
+
+                /**
+                 * Gets the value of the alignwithAlignPanel property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public boolean isAlignwithAlignPanel() {
+                    if (alignwithAlignPanel == null) {
+                        return true;
+                    } else {
+                        return alignwithAlignPanel;
+                    }
+                }
+
+                /**
+                 * Sets the value of the alignwithAlignPanel property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setAlignwithAlignPanel(Boolean value) {
+                    this.alignwithAlignPanel = value;
+                }
+
+                /**
+                 * Gets the value of the colourwithAlignPanel property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public boolean isColourwithAlignPanel() {
+                    if (colourwithAlignPanel == null) {
+                        return false;
+                    } else {
+                        return colourwithAlignPanel;
+                    }
+                }
+
+                /**
+                 * Sets the value of the colourwithAlignPanel property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setColourwithAlignPanel(Boolean value) {
+                    this.colourwithAlignPanel = value;
+                }
+
+                /**
+                 * Gets the value of the colourByJmol property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public boolean isColourByJmol() {
+                    if (colourByJmol == null) {
+                        return true;
+                    } else {
+                        return colourByJmol;
+                    }
+                }
+
+                /**
+                 * Sets the value of the colourByJmol property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setColourByJmol(Boolean value) {
+                    this.colourByJmol = value;
+                }
+
+                /**
+                 * Gets the value of the type property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getType() {
+                    return type;
+                }
+
+                /**
+                 * Sets the value of the type property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setType(String value) {
+                    this.type = value;
+                }
+
+                /**
+                 * Gets the value of the width property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getWidth() {
+                    return width;
+                }
+
+                /**
+                 * Sets the value of the width property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setWidth(Integer value) {
+                    this.width = value;
+                }
+
+                /**
+                 * Gets the value of the height property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getHeight() {
+                    return height;
+                }
+
+                /**
+                 * Sets the value of the height property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setHeight(Integer value) {
+                    this.height = value;
+                }
+
+                /**
+                 * Gets the value of the xpos property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getXpos() {
+                    return xpos;
+                }
+
+                /**
+                 * Sets the value of the xpos property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setXpos(Integer value) {
+                    this.xpos = value;
+                }
+
+                /**
+                 * Gets the value of the ypos property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public Integer getYpos() {
+                    return ypos;
+                }
+
+                /**
+                 * Sets the value of the ypos property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Integer }
+                 *     
+                 */
+                public void setYpos(Integer value) {
+                    this.ypos = value;
+                }
+
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;sequence>
+         *         &lt;element name="secondaryStructure" maxOccurs="unbounded">
+         *           &lt;complexType>
+         *             &lt;complexContent>
+         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                 &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *                 &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               &lt;/restriction>
+         *             &lt;/complexContent>
+         *           &lt;/complexType>
+         *         &lt;/element>
+         *       &lt;/sequence>
+         *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+         *       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "", propOrder = {
+            "secondaryStructure"
+        })
+        public static class RnaViewer {
+
+            @XmlElement(namespace = "www.jalview.org", required = true)
+            protected List<JalviewModelType.JSeq.RnaViewer.SecondaryStructure> secondaryStructure;
+            @XmlAttribute(name = "title")
+            protected String title;
+            @XmlAttribute(name = "viewId")
+            protected String viewId;
+            @XmlAttribute(name = "dividerLocation")
+            protected Integer dividerLocation;
+            @XmlAttribute(name = "selectedRna")
+            protected Integer selectedRna;
+            @XmlAttribute(name = "width")
+            protected Integer width;
+            @XmlAttribute(name = "height")
+            protected Integer height;
+            @XmlAttribute(name = "xpos")
+            protected Integer xpos;
+            @XmlAttribute(name = "ypos")
+            protected Integer ypos;
+
+            /**
+             * Gets the value of the secondaryStructure property.
+             * 
+             * <p>
+             * This accessor method returns a reference to the live list,
+             * not a snapshot. Therefore any modification you make to the
+             * returned list will be present inside the JAXB object.
+             * This is why there is not a <CODE>set</CODE> method for the secondaryStructure property.
+             * 
+             * <p>
+             * For example, to add a new item, do as follows:
+             * <pre>
+             *    getSecondaryStructure().add(newItem);
+             * </pre>
+             * 
+             * 
+             * <p>
+             * Objects of the following type(s) are allowed in the list
+             * {@link JalviewModelType.JSeq.RnaViewer.SecondaryStructure }
+             * 
+             * 
+             */
+            public List<JalviewModelType.JSeq.RnaViewer.SecondaryStructure> getSecondaryStructure() {
+                if (secondaryStructure == null) {
+                    secondaryStructure = new ArrayList<JalviewModelType.JSeq.RnaViewer.SecondaryStructure>();
+                }
+                return this.secondaryStructure;
+            }
+
+            /**
+             * Gets the value of the title property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getTitle() {
+                return title;
+            }
+
+            /**
+             * Sets the value of the title property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setTitle(String value) {
+                this.title = value;
+            }
+
+            /**
+             * Gets the value of the viewId property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getViewId() {
+                return viewId;
+            }
+
+            /**
+             * Sets the value of the viewId property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setViewId(String value) {
+                this.viewId = value;
+            }
+
+            /**
+             * Gets the value of the dividerLocation property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getDividerLocation() {
+                return dividerLocation;
+            }
+
+            /**
+             * Sets the value of the dividerLocation property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setDividerLocation(Integer value) {
+                this.dividerLocation = value;
+            }
+
+            /**
+             * Gets the value of the selectedRna property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getSelectedRna() {
+                return selectedRna;
+            }
+
+            /**
+             * Sets the value of the selectedRna property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setSelectedRna(Integer value) {
+                this.selectedRna = value;
+            }
+
+            /**
+             * Gets the value of the width property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getWidth() {
+                return width;
+            }
+
+            /**
+             * Sets the value of the width property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setWidth(Integer value) {
+                this.width = value;
+            }
+
+            /**
+             * Gets the value of the height property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getHeight() {
+                return height;
+            }
+
+            /**
+             * Sets the value of the height property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setHeight(Integer value) {
+                this.height = value;
+            }
+
+            /**
+             * Gets the value of the xpos property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getXpos() {
+                return xpos;
+            }
+
+            /**
+             * Sets the value of the xpos property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setXpos(Integer value) {
+                this.xpos = value;
+            }
+
+            /**
+             * Gets the value of the ypos property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getYpos() {
+                return ypos;
+            }
+
+            /**
+             * Sets the value of the ypos property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setYpos(Integer value) {
+                this.ypos = value;
+            }
+
+
+            /**
+             * <p>Java class for anonymous complex type.
+             * 
+             * <p>The following schema fragment specifies the expected content contained within this class.
+             * 
+             * <pre>
+             * &lt;complexType>
+             *   &lt;complexContent>
+             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *       &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+             *       &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     &lt;/restriction>
+             *   &lt;/complexContent>
+             * &lt;/complexType>
+             * </pre>
+             * 
+             * 
+             */
+            @XmlAccessorType(XmlAccessType.FIELD)
+            @XmlType(name = "")
+            public static class SecondaryStructure {
+
+                @XmlAttribute(name = "title")
+                protected String title;
+                @XmlAttribute(name = "annotationId", required = true)
+                protected String annotationId;
+                @XmlAttribute(name = "gapped")
+                protected Boolean gapped;
+                @XmlAttribute(name = "viewerState")
+                protected String viewerState;
+
+                /**
+                 * Gets the value of the title property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getTitle() {
+                    return title;
+                }
+
+                /**
+                 * Sets the value of the title property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setTitle(String value) {
+                    this.title = value;
+                }
+
+                /**
+                 * Gets the value of the annotationId property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getAnnotationId() {
+                    return annotationId;
+                }
+
+                /**
+                 * Sets the value of the annotationId property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setAnnotationId(String value) {
+                    this.annotationId = value;
+                }
+
+                /**
+                 * Gets the value of the gapped property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public Boolean isGapped() {
+                    return gapped;
+                }
+
+                /**
+                 * Sets the value of the gapped property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link Boolean }
+                 *     
+                 */
+                public void setGapped(Boolean value) {
+                    this.gapped = value;
+                }
+
+                /**
+                 * Gets the value of the viewerState property.
+                 * 
+                 * @return
+                 *     possible object is
+                 *     {@link String }
+                 *     
+                 */
+                public String getViewerState() {
+                    return viewerState;
+                }
+
+                /**
+                 * Sets the value of the viewerState property.
+                 * 
+                 * @param value
+                 *     allowed object is
+                 *     {@link String }
+                 *     
+                 */
+                public void setViewerState(String value) {
+                    this.viewerState = value;
+                }
+
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence minOccurs="0">
+     *         &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *         &lt;element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *       &lt;/sequence>
+     *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *       &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *       &lt;attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "title",
+        "newick"
+    })
+    public static class Tree {
+
+        @XmlElement(namespace = "www.jalview.org")
+        protected String title;
+        @XmlElement(namespace = "www.jalview.org")
+        protected String newick;
+        @XmlAttribute(name = "fontName")
+        protected String fontName;
+        @XmlAttribute(name = "fontSize")
+        protected Integer fontSize;
+        @XmlAttribute(name = "fontStyle")
+        protected Integer fontStyle;
+        @XmlAttribute(name = "threshold")
+        protected Float threshold;
+        @XmlAttribute(name = "showBootstrap")
+        protected Boolean showBootstrap;
+        @XmlAttribute(name = "showDistances")
+        protected Boolean showDistances;
+        @XmlAttribute(name = "markUnlinked")
+        protected Boolean markUnlinked;
+        @XmlAttribute(name = "fitToWindow")
+        protected Boolean fitToWindow;
+        @XmlAttribute(name = "currentTree")
+        protected Boolean currentTree;
+        @XmlAttribute(name = "id")
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        @XmlID
+        @XmlSchemaType(name = "ID")
+        protected String id;
+        @XmlAttribute(name = "width")
+        protected Integer width;
+        @XmlAttribute(name = "height")
+        protected Integer height;
+        @XmlAttribute(name = "xpos")
+        protected Integer xpos;
+        @XmlAttribute(name = "ypos")
+        protected Integer ypos;
+
+        /**
+         * Gets the value of the title property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getTitle() {
+            return title;
+        }
+
+        /**
+         * Sets the value of the title property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setTitle(String value) {
+            this.title = value;
+        }
+
+        /**
+         * Gets the value of the newick property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getNewick() {
+            return newick;
+        }
+
+        /**
+         * Sets the value of the newick property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setNewick(String value) {
+            this.newick = value;
+        }
+
+        /**
+         * Gets the value of the fontName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFontName() {
+            return fontName;
+        }
+
+        /**
+         * Sets the value of the fontName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFontName(String value) {
+            this.fontName = value;
+        }
+
+        /**
+         * Gets the value of the fontSize property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontSize() {
+            return fontSize;
+        }
+
+        /**
+         * Sets the value of the fontSize property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontSize(Integer value) {
+            this.fontSize = value;
+        }
+
+        /**
+         * Gets the value of the fontStyle property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontStyle() {
+            return fontStyle;
+        }
+
+        /**
+         * Sets the value of the fontStyle property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontStyle(Integer value) {
+            this.fontStyle = value;
+        }
+
+        /**
+         * Gets the value of the threshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Float }
+         *     
+         */
+        public Float getThreshold() {
+            return threshold;
+        }
+
+        /**
+         * Sets the value of the threshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Float }
+         *     
+         */
+        public void setThreshold(Float value) {
+            this.threshold = value;
+        }
+
+        /**
+         * Gets the value of the showBootstrap property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowBootstrap() {
+            return showBootstrap;
+        }
+
+        /**
+         * Sets the value of the showBootstrap property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowBootstrap(Boolean value) {
+            this.showBootstrap = value;
+        }
+
+        /**
+         * Gets the value of the showDistances property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowDistances() {
+            return showDistances;
+        }
+
+        /**
+         * Sets the value of the showDistances property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowDistances(Boolean value) {
+            this.showDistances = value;
+        }
+
+        /**
+         * Gets the value of the markUnlinked property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isMarkUnlinked() {
+            return markUnlinked;
+        }
+
+        /**
+         * Sets the value of the markUnlinked property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setMarkUnlinked(Boolean value) {
+            this.markUnlinked = value;
+        }
+
+        /**
+         * Gets the value of the fitToWindow property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isFitToWindow() {
+            return fitToWindow;
+        }
+
+        /**
+         * Sets the value of the fitToWindow property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setFitToWindow(Boolean value) {
+            this.fitToWindow = value;
+        }
+
+        /**
+         * Gets the value of the currentTree property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isCurrentTree() {
+            return currentTree;
+        }
+
+        /**
+         * Sets the value of the currentTree property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setCurrentTree(Boolean value) {
+            this.currentTree = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+        /**
+         * Gets the value of the width property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getWidth() {
+            return width;
+        }
+
+        /**
+         * Sets the value of the width property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setWidth(Integer value) {
+            this.width = value;
+        }
+
+        /**
+         * Gets the value of the height property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getHeight() {
+            return height;
+        }
+
+        /**
+         * Sets the value of the height property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setHeight(Integer value) {
+            this.height = value;
+        }
+
+        /**
+         * Gets the value of the xpos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getXpos() {
+            return xpos;
+        }
+
+        /**
+         * Sets the value of the xpos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setXpos(Integer value) {
+            this.xpos = value;
+        }
+
+        /**
+         * Gets the value of the ypos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getYpos() {
+            return ypos;
+        }
+
+        /**
+         * Sets the value of the ypos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setYpos(Integer value) {
+            this.ypos = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "userColourScheme"
+    })
+    public static class UserColours {
+
+        @XmlElement(name = "UserColourScheme", namespace = "www.jalview.org", required = true)
+        protected JalviewUserColours userColourScheme;
+        @XmlAttribute(name = "id")
+        protected String id;
+
+        /**
+         * Gets the value of the userColourScheme property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link JalviewUserColours }
+         *     
+         */
+        public JalviewUserColours getUserColourScheme() {
+            return userColourScheme;
+        }
+
+        /**
+         * Sets the value of the userColourScheme property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link JalviewUserColours }
+         *     
+         */
+        public void setUserColourScheme(JalviewUserColours value) {
+            this.userColourScheme = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
+     *         &lt;element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *                 &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *         &lt;element name="calcIdParam" maxOccurs="unbounded" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
+     *                 &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *                 &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *               &lt;/extension>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attGroup ref="{www.jalview.org}swingwindow"/>
+     *       &lt;attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+     *       &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *       &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+     *       &lt;attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "annotationColours",
+        "hiddenColumns",
+        "calcIdParam"
+    })
+    public static class Viewport {
+
+        @XmlElement(name = "AnnotationColours", namespace = "www.jalview.org")
+        protected AnnotationColourScheme annotationColours;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModelType.Viewport.HiddenColumns> hiddenColumns;
+        @XmlElement(namespace = "www.jalview.org")
+        protected List<JalviewModelType.Viewport.CalcIdParam> calcIdParam;
+        @XmlAttribute(name = "conservationSelected")
+        protected Boolean conservationSelected;
+        @XmlAttribute(name = "pidSelected")
+        protected Boolean pidSelected;
+        @XmlAttribute(name = "bgColour")
+        protected String bgColour;
+        @XmlAttribute(name = "consThreshold")
+        protected Integer consThreshold;
+        @XmlAttribute(name = "pidThreshold")
+        protected Integer pidThreshold;
+        @XmlAttribute(name = "title")
+        protected String title;
+        @XmlAttribute(name = "showFullId")
+        protected Boolean showFullId;
+        @XmlAttribute(name = "rightAlignIds")
+        protected Boolean rightAlignIds;
+        @XmlAttribute(name = "showText")
+        protected Boolean showText;
+        @XmlAttribute(name = "showColourText")
+        protected Boolean showColourText;
+        @XmlAttribute(name = "showUnconserved")
+        protected Boolean showUnconserved;
+        @XmlAttribute(name = "showBoxes")
+        protected Boolean showBoxes;
+        @XmlAttribute(name = "wrapAlignment")
+        protected Boolean wrapAlignment;
+        @XmlAttribute(name = "renderGaps")
+        protected Boolean renderGaps;
+        @XmlAttribute(name = "showSequenceFeatures")
+        protected Boolean showSequenceFeatures;
+        @XmlAttribute(name = "showNPfeatureTooltip")
+        protected Boolean showNPfeatureTooltip;
+        @XmlAttribute(name = "showDbRefTooltip")
+        protected Boolean showDbRefTooltip;
+        @XmlAttribute(name = "followHighlight")
+        protected Boolean followHighlight;
+        @XmlAttribute(name = "followSelection")
+        protected Boolean followSelection;
+        @XmlAttribute(name = "showAnnotation")
+        protected Boolean showAnnotation;
+        @XmlAttribute(name = "centreColumnLabels")
+        protected Boolean centreColumnLabels;
+        @XmlAttribute(name = "showGroupConservation")
+        protected Boolean showGroupConservation;
+        @XmlAttribute(name = "showGroupConsensus")
+        protected Boolean showGroupConsensus;
+        @XmlAttribute(name = "showConsensusHistogram")
+        protected Boolean showConsensusHistogram;
+        @XmlAttribute(name = "showSequenceLogo")
+        protected Boolean showSequenceLogo;
+        @XmlAttribute(name = "normaliseSequenceLogo")
+        protected Boolean normaliseSequenceLogo;
+        @XmlAttribute(name = "ignoreGapsinConsensus")
+        protected Boolean ignoreGapsinConsensus;
+        @XmlAttribute(name = "startRes")
+        protected Integer startRes;
+        @XmlAttribute(name = "startSeq")
+        protected Integer startSeq;
+        @XmlAttribute(name = "fontName")
+        protected String fontName;
+        @XmlAttribute(name = "fontSize")
+        protected Integer fontSize;
+        @XmlAttribute(name = "fontStyle")
+        protected Integer fontStyle;
+        @XmlAttribute(name = "scaleProteinAsCdna")
+        protected Boolean scaleProteinAsCdna;
+        @XmlAttribute(name = "viewName")
+        protected String viewName;
+        @XmlAttribute(name = "sequenceSetId")
+        protected String sequenceSetId;
+        @XmlAttribute(name = "gatheredViews")
+        protected Boolean gatheredViews;
+        @XmlAttribute(name = "textCol1")
+        protected Integer textCol1;
+        @XmlAttribute(name = "textCol2")
+        protected Integer textCol2;
+        @XmlAttribute(name = "textColThreshold")
+        protected Integer textColThreshold;
+        @XmlAttribute(name = "id")
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        @XmlID
+        @XmlSchemaType(name = "ID")
+        protected String id;
+        @XmlAttribute(name = "complementId")
+        protected String complementId;
+        @XmlAttribute(name = "width")
+        protected Integer width;
+        @XmlAttribute(name = "height")
+        protected Integer height;
+        @XmlAttribute(name = "xpos")
+        protected Integer xpos;
+        @XmlAttribute(name = "ypos")
+        protected Integer ypos;
+
+        /**
+         * Gets the value of the annotationColours property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public AnnotationColourScheme getAnnotationColours() {
+            return annotationColours;
+        }
+
+        /**
+         * Sets the value of the annotationColours property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link AnnotationColourScheme }
+         *     
+         */
+        public void setAnnotationColours(AnnotationColourScheme value) {
+            this.annotationColours = value;
+        }
+
+        /**
+         * Gets the value of the hiddenColumns property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the hiddenColumns property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getHiddenColumns().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModelType.Viewport.HiddenColumns }
+         * 
+         * 
+         */
+        public List<JalviewModelType.Viewport.HiddenColumns> getHiddenColumns() {
+            if (hiddenColumns == null) {
+                hiddenColumns = new ArrayList<JalviewModelType.Viewport.HiddenColumns>();
+            }
+            return this.hiddenColumns;
+        }
+
+        /**
+         * Gets the value of the calcIdParam property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the calcIdParam property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getCalcIdParam().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link JalviewModelType.Viewport.CalcIdParam }
+         * 
+         * 
+         */
+        public List<JalviewModelType.Viewport.CalcIdParam> getCalcIdParam() {
+            if (calcIdParam == null) {
+                calcIdParam = new ArrayList<JalviewModelType.Viewport.CalcIdParam>();
+            }
+            return this.calcIdParam;
+        }
+
+        /**
+         * Gets the value of the conservationSelected property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isConservationSelected() {
+            return conservationSelected;
+        }
+
+        /**
+         * Sets the value of the conservationSelected property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setConservationSelected(Boolean value) {
+            this.conservationSelected = value;
+        }
+
+        /**
+         * Gets the value of the pidSelected property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isPidSelected() {
+            return pidSelected;
+        }
+
+        /**
+         * Sets the value of the pidSelected property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setPidSelected(Boolean value) {
+            this.pidSelected = value;
+        }
+
+        /**
+         * Gets the value of the bgColour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getBgColour() {
+            return bgColour;
+        }
+
+        /**
+         * Sets the value of the bgColour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setBgColour(String value) {
+            this.bgColour = value;
+        }
+
+        /**
+         * Gets the value of the consThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getConsThreshold() {
+            return consThreshold;
+        }
+
+        /**
+         * Sets the value of the consThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setConsThreshold(Integer value) {
+            this.consThreshold = value;
+        }
+
+        /**
+         * Gets the value of the pidThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getPidThreshold() {
+            return pidThreshold;
+        }
+
+        /**
+         * Sets the value of the pidThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setPidThreshold(Integer value) {
+            this.pidThreshold = value;
+        }
+
+        /**
+         * Gets the value of the title property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getTitle() {
+            return title;
+        }
+
+        /**
+         * Sets the value of the title property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setTitle(String value) {
+            this.title = value;
+        }
+
+        /**
+         * Gets the value of the showFullId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowFullId() {
+            return showFullId;
+        }
+
+        /**
+         * Sets the value of the showFullId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowFullId(Boolean value) {
+            this.showFullId = value;
+        }
+
+        /**
+         * Gets the value of the rightAlignIds property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isRightAlignIds() {
+            return rightAlignIds;
+        }
+
+        /**
+         * Sets the value of the rightAlignIds property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setRightAlignIds(Boolean value) {
+            this.rightAlignIds = value;
+        }
+
+        /**
+         * Gets the value of the showText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowText() {
+            return showText;
+        }
+
+        /**
+         * Sets the value of the showText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowText(Boolean value) {
+            this.showText = value;
+        }
+
+        /**
+         * Gets the value of the showColourText property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowColourText() {
+            return showColourText;
+        }
+
+        /**
+         * Sets the value of the showColourText property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowColourText(Boolean value) {
+            this.showColourText = value;
+        }
+
+        /**
+         * Gets the value of the showUnconserved property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowUnconserved() {
+            if (showUnconserved == null) {
+                return false;
+            } else {
+                return showUnconserved;
+            }
+        }
+
+        /**
+         * Sets the value of the showUnconserved property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowUnconserved(Boolean value) {
+            this.showUnconserved = value;
+        }
+
+        /**
+         * Gets the value of the showBoxes property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowBoxes() {
+            return showBoxes;
+        }
+
+        /**
+         * Sets the value of the showBoxes property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowBoxes(Boolean value) {
+            this.showBoxes = value;
+        }
+
+        /**
+         * Gets the value of the wrapAlignment property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isWrapAlignment() {
+            return wrapAlignment;
+        }
+
+        /**
+         * Sets the value of the wrapAlignment property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setWrapAlignment(Boolean value) {
+            this.wrapAlignment = value;
+        }
+
+        /**
+         * Gets the value of the renderGaps property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isRenderGaps() {
+            return renderGaps;
+        }
+
+        /**
+         * Sets the value of the renderGaps property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setRenderGaps(Boolean value) {
+            this.renderGaps = value;
+        }
+
+        /**
+         * Gets the value of the showSequenceFeatures property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowSequenceFeatures() {
+            return showSequenceFeatures;
+        }
+
+        /**
+         * Sets the value of the showSequenceFeatures property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowSequenceFeatures(Boolean value) {
+            this.showSequenceFeatures = value;
+        }
+
+        /**
+         * Gets the value of the showNPfeatureTooltip property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowNPfeatureTooltip() {
+            return showNPfeatureTooltip;
+        }
+
+        /**
+         * Sets the value of the showNPfeatureTooltip property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowNPfeatureTooltip(Boolean value) {
+            this.showNPfeatureTooltip = value;
+        }
+
+        /**
+         * Gets the value of the showDbRefTooltip property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowDbRefTooltip() {
+            return showDbRefTooltip;
+        }
+
+        /**
+         * Sets the value of the showDbRefTooltip property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowDbRefTooltip(Boolean value) {
+            this.showDbRefTooltip = value;
+        }
+
+        /**
+         * Gets the value of the followHighlight property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isFollowHighlight() {
+            if (followHighlight == null) {
+                return true;
+            } else {
+                return followHighlight;
+            }
+        }
+
+        /**
+         * Sets the value of the followHighlight property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setFollowHighlight(Boolean value) {
+            this.followHighlight = value;
+        }
+
+        /**
+         * Gets the value of the followSelection property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isFollowSelection() {
+            if (followSelection == null) {
+                return true;
+            } else {
+                return followSelection;
+            }
+        }
+
+        /**
+         * Sets the value of the followSelection property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setFollowSelection(Boolean value) {
+            this.followSelection = value;
+        }
+
+        /**
+         * Gets the value of the showAnnotation property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isShowAnnotation() {
+            return showAnnotation;
+        }
+
+        /**
+         * Sets the value of the showAnnotation property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowAnnotation(Boolean value) {
+            this.showAnnotation = value;
+        }
+
+        /**
+         * Gets the value of the centreColumnLabels property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isCentreColumnLabels() {
+            if (centreColumnLabels == null) {
+                return false;
+            } else {
+                return centreColumnLabels;
+            }
+        }
+
+        /**
+         * Sets the value of the centreColumnLabels property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setCentreColumnLabels(Boolean value) {
+            this.centreColumnLabels = value;
+        }
+
+        /**
+         * Gets the value of the showGroupConservation property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowGroupConservation() {
+            if (showGroupConservation == null) {
+                return false;
+            } else {
+                return showGroupConservation;
+            }
+        }
+
+        /**
+         * Sets the value of the showGroupConservation property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowGroupConservation(Boolean value) {
+            this.showGroupConservation = value;
+        }
+
+        /**
+         * Gets the value of the showGroupConsensus property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowGroupConsensus() {
+            if (showGroupConsensus == null) {
+                return false;
+            } else {
+                return showGroupConsensus;
+            }
+        }
+
+        /**
+         * Sets the value of the showGroupConsensus property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowGroupConsensus(Boolean value) {
+            this.showGroupConsensus = value;
+        }
+
+        /**
+         * Gets the value of the showConsensusHistogram property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowConsensusHistogram() {
+            if (showConsensusHistogram == null) {
+                return true;
+            } else {
+                return showConsensusHistogram;
+            }
+        }
+
+        /**
+         * Sets the value of the showConsensusHistogram property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowConsensusHistogram(Boolean value) {
+            this.showConsensusHistogram = value;
+        }
+
+        /**
+         * Gets the value of the showSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isShowSequenceLogo() {
+            if (showSequenceLogo == null) {
+                return false;
+            } else {
+                return showSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the showSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setShowSequenceLogo(Boolean value) {
+            this.showSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the normaliseSequenceLogo property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isNormaliseSequenceLogo() {
+            if (normaliseSequenceLogo == null) {
+                return false;
+            } else {
+                return normaliseSequenceLogo;
+            }
+        }
+
+        /**
+         * Sets the value of the normaliseSequenceLogo property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setNormaliseSequenceLogo(Boolean value) {
+            this.normaliseSequenceLogo = value;
+        }
+
+        /**
+         * Gets the value of the ignoreGapsinConsensus property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isIgnoreGapsinConsensus() {
+            if (ignoreGapsinConsensus == null) {
+                return true;
+            } else {
+                return ignoreGapsinConsensus;
+            }
+        }
+
+        /**
+         * Sets the value of the ignoreGapsinConsensus property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setIgnoreGapsinConsensus(Boolean value) {
+            this.ignoreGapsinConsensus = value;
+        }
+
+        /**
+         * Gets the value of the startRes property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getStartRes() {
+            return startRes;
+        }
+
+        /**
+         * Sets the value of the startRes property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setStartRes(Integer value) {
+            this.startRes = value;
+        }
+
+        /**
+         * Gets the value of the startSeq property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getStartSeq() {
+            return startSeq;
+        }
+
+        /**
+         * Sets the value of the startSeq property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setStartSeq(Integer value) {
+            this.startSeq = value;
+        }
+
+        /**
+         * Gets the value of the fontName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFontName() {
+            return fontName;
+        }
+
+        /**
+         * Sets the value of the fontName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFontName(String value) {
+            this.fontName = value;
+        }
+
+        /**
+         * Gets the value of the fontSize property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontSize() {
+            return fontSize;
+        }
+
+        /**
+         * Sets the value of the fontSize property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontSize(Integer value) {
+            this.fontSize = value;
+        }
+
+        /**
+         * Gets the value of the fontStyle property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getFontStyle() {
+            return fontStyle;
+        }
+
+        /**
+         * Sets the value of the fontStyle property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setFontStyle(Integer value) {
+            this.fontStyle = value;
+        }
+
+        /**
+         * Gets the value of the scaleProteinAsCdna property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isScaleProteinAsCdna() {
+            if (scaleProteinAsCdna == null) {
+                return true;
+            } else {
+                return scaleProteinAsCdna;
+            }
+        }
+
+        /**
+         * Sets the value of the scaleProteinAsCdna property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setScaleProteinAsCdna(Boolean value) {
+            this.scaleProteinAsCdna = value;
+        }
+
+        /**
+         * Gets the value of the viewName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getViewName() {
+            return viewName;
+        }
+
+        /**
+         * Sets the value of the viewName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setViewName(String value) {
+            this.viewName = value;
+        }
+
+        /**
+         * Gets the value of the sequenceSetId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getSequenceSetId() {
+            return sequenceSetId;
+        }
+
+        /**
+         * Sets the value of the sequenceSetId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setSequenceSetId(String value) {
+            this.sequenceSetId = value;
+        }
+
+        /**
+         * Gets the value of the gatheredViews property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isGatheredViews() {
+            return gatheredViews;
+        }
+
+        /**
+         * Sets the value of the gatheredViews property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setGatheredViews(Boolean value) {
+            this.gatheredViews = value;
+        }
+
+        /**
+         * Gets the value of the textCol1 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol1() {
+            return textCol1;
+        }
+
+        /**
+         * Sets the value of the textCol1 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol1(Integer value) {
+            this.textCol1 = value;
+        }
+
+        /**
+         * Gets the value of the textCol2 property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextCol2() {
+            return textCol2;
+        }
+
+        /**
+         * Sets the value of the textCol2 property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextCol2(Integer value) {
+            this.textCol2 = value;
+        }
+
+        /**
+         * Gets the value of the textColThreshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getTextColThreshold() {
+            return textColThreshold;
+        }
+
+        /**
+         * Sets the value of the textColThreshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setTextColThreshold(Integer value) {
+            this.textColThreshold = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+        /**
+         * Gets the value of the complementId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getComplementId() {
+            return complementId;
+        }
+
+        /**
+         * Sets the value of the complementId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setComplementId(String value) {
+            this.complementId = value;
+        }
+
+        /**
+         * Gets the value of the width property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getWidth() {
+            return width;
+        }
+
+        /**
+         * Sets the value of the width property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setWidth(Integer value) {
+            this.width = value;
+        }
+
+        /**
+         * Gets the value of the height property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getHeight() {
+            return height;
+        }
+
+        /**
+         * Sets the value of the height property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setHeight(Integer value) {
+            this.height = value;
+        }
+
+        /**
+         * Gets the value of the xpos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getXpos() {
+            return xpos;
+        }
+
+        /**
+         * Sets the value of the xpos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setXpos(Integer value) {
+            this.xpos = value;
+        }
+
+        /**
+         * Gets the value of the ypos property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Integer }
+         *     
+         */
+        public Integer getYpos() {
+            return ypos;
+        }
+
+        /**
+         * Sets the value of the ypos property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Integer }
+         *     
+         */
+        public void setYpos(Integer value) {
+            this.ypos = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
+         *       &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+         *       &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+         *     &lt;/extension>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class CalcIdParam
+            extends WebServiceParameterSet
+        {
+
+            @XmlAttribute(name = "calcId", required = true)
+            protected String calcId;
+            @XmlAttribute(name = "needsUpdate")
+            protected Boolean needsUpdate;
+            @XmlAttribute(name = "autoUpdate", required = true)
+            protected boolean autoUpdate;
+
+            /**
+             * Gets the value of the calcId property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getCalcId() {
+                return calcId;
+            }
+
+            /**
+             * Sets the value of the calcId property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setCalcId(String value) {
+                this.calcId = value;
+            }
+
+            /**
+             * Gets the value of the needsUpdate property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Boolean }
+             *     
+             */
+            public boolean isNeedsUpdate() {
+                if (needsUpdate == null) {
+                    return false;
+                } else {
+                    return needsUpdate;
+                }
+            }
+
+            /**
+             * Sets the value of the needsUpdate property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Boolean }
+             *     
+             */
+            public void setNeedsUpdate(Boolean value) {
+                this.needsUpdate = value;
+            }
+
+            /**
+             * Gets the value of the autoUpdate property.
+             * 
+             */
+            public boolean isAutoUpdate() {
+                return autoUpdate;
+            }
+
+            /**
+             * Sets the value of the autoUpdate property.
+             * 
+             */
+            public void setAutoUpdate(boolean value) {
+                this.autoUpdate = value;
+            }
+
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *       &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class HiddenColumns {
+
+            @XmlAttribute(name = "start")
+            protected Integer start;
+            @XmlAttribute(name = "end")
+            protected Integer end;
+
+            /**
+             * Gets the value of the start property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getStart() {
+                return start;
+            }
+
+            /**
+             * Sets the value of the start property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setStart(Integer value) {
+                this.start = value;
+            }
+
+            /**
+             * Gets the value of the end property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getEnd() {
+                return end;
+            }
+
+            /**
+             * Sets the value of the end property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setEnd(Integer value) {
+                this.end = value;
+            }
+
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/JalviewUserColours.java b/src/jalview/xml/binding/jalview/JalviewUserColours.java
new file mode 100644 (file)
index 0000000..0de2ac0
--- /dev/null
@@ -0,0 +1,612 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for JalviewUserColours complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="JalviewUserColours">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="colour" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="RGB" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="minRGB" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+ *                 &lt;attribute name="threshType" type="{www.jalview.org/colours}ThresholdType" />
+ *                 &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                 &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                 &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *                 &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *                 &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="filter" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="featureType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="schemeName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "JalviewUserColours", namespace = "www.jalview.org/colours", propOrder = {
+    "version",
+    "colour",
+    "filter"
+})
+public class JalviewUserColours {
+
+    @XmlElement(name = "Version", namespace = "")
+    protected String version;
+    @XmlElement(namespace = "")
+    protected List<JalviewUserColours.Colour> colour;
+    @XmlElement(namespace = "")
+    protected List<JalviewUserColours.Filter> filter;
+    @XmlAttribute(name = "schemeName")
+    protected String schemeName;
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVersion(String value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the colour property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the colour property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getColour().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewUserColours.Colour }
+     * 
+     * 
+     */
+    public List<JalviewUserColours.Colour> getColour() {
+        if (colour == null) {
+            colour = new ArrayList<JalviewUserColours.Colour>();
+        }
+        return this.colour;
+    }
+
+    /**
+     * Gets the value of the filter property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the filter property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getFilter().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link JalviewUserColours.Filter }
+     * 
+     * 
+     */
+    public List<JalviewUserColours.Filter> getFilter() {
+        if (filter == null) {
+            filter = new ArrayList<JalviewUserColours.Filter>();
+        }
+        return this.filter;
+    }
+
+    /**
+     * Gets the value of the schemeName property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSchemeName() {
+        return schemeName;
+    }
+
+    /**
+     * Sets the value of the schemeName property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSchemeName(String value) {
+        this.schemeName = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="RGB" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="minRGB" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
+     *       &lt;attribute name="threshType" type="{www.jalview.org/colours}ThresholdType" />
+     *       &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *       &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *       &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
+     *       &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *       &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "attributeName"
+    })
+    public static class Colour {
+
+        @XmlElement(namespace = "")
+        protected List<String> attributeName;
+        @XmlAttribute(name = "Name")
+        protected String name;
+        @XmlAttribute(name = "RGB", required = true)
+        protected String rgb;
+        @XmlAttribute(name = "minRGB")
+        protected String minRGB;
+        @XmlAttribute(name = "noValueColour")
+        protected NoValueColour noValueColour;
+        @XmlAttribute(name = "threshType")
+        protected ThresholdType threshType;
+        @XmlAttribute(name = "threshold")
+        protected Float threshold;
+        @XmlAttribute(name = "max")
+        protected Float max;
+        @XmlAttribute(name = "min")
+        protected Float min;
+        @XmlAttribute(name = "colourByLabel")
+        protected Boolean colourByLabel;
+        @XmlAttribute(name = "autoScale")
+        protected Boolean autoScale;
+
+        /**
+         * Gets the value of the attributeName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the attributeName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getAttributeName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getAttributeName() {
+            if (attributeName == null) {
+                attributeName = new ArrayList<String>();
+            }
+            return this.attributeName;
+        }
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the rgb property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getRGB() {
+            return rgb;
+        }
+
+        /**
+         * Sets the value of the rgb property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setRGB(String value) {
+            this.rgb = value;
+        }
+
+        /**
+         * Gets the value of the minRGB property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getMinRGB() {
+            return minRGB;
+        }
+
+        /**
+         * Sets the value of the minRGB property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setMinRGB(String value) {
+            this.minRGB = value;
+        }
+
+        /**
+         * Gets the value of the noValueColour property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link NoValueColour }
+         *     
+         */
+        public NoValueColour getNoValueColour() {
+            if (noValueColour == null) {
+                return NoValueColour.MIN;
+            } else {
+                return noValueColour;
+            }
+        }
+
+        /**
+         * Sets the value of the noValueColour property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link NoValueColour }
+         *     
+         */
+        public void setNoValueColour(NoValueColour value) {
+            this.noValueColour = value;
+        }
+
+        /**
+         * Gets the value of the threshType property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link ThresholdType }
+         *     
+         */
+        public ThresholdType getThreshType() {
+            return threshType;
+        }
+
+        /**
+         * Sets the value of the threshType property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link ThresholdType }
+         *     
+         */
+        public void setThreshType(ThresholdType value) {
+            this.threshType = value;
+        }
+
+        /**
+         * Gets the value of the threshold property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Float }
+         *     
+         */
+        public Float getThreshold() {
+            return threshold;
+        }
+
+        /**
+         * Sets the value of the threshold property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Float }
+         *     
+         */
+        public void setThreshold(Float value) {
+            this.threshold = value;
+        }
+
+        /**
+         * Gets the value of the max property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Float }
+         *     
+         */
+        public Float getMax() {
+            return max;
+        }
+
+        /**
+         * Sets the value of the max property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Float }
+         *     
+         */
+        public void setMax(Float value) {
+            this.max = value;
+        }
+
+        /**
+         * Gets the value of the min property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Float }
+         *     
+         */
+        public Float getMin() {
+            return min;
+        }
+
+        /**
+         * Sets the value of the min property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Float }
+         *     
+         */
+        public void setMin(Float value) {
+            this.min = value;
+        }
+
+        /**
+         * Gets the value of the colourByLabel property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isColourByLabel() {
+            return colourByLabel;
+        }
+
+        /**
+         * Sets the value of the colourByLabel property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setColourByLabel(Boolean value) {
+            this.colourByLabel = value;
+        }
+
+        /**
+         * Gets the value of the autoScale property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public Boolean isAutoScale() {
+            return autoScale;
+        }
+
+        /**
+         * Sets the value of the autoScale property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setAutoScale(Boolean value) {
+            this.autoScale = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="featureType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "matcherSet"
+    })
+    public static class Filter {
+
+        @XmlElement(namespace = "", required = true)
+        protected FeatureMatcherSet matcherSet;
+        @XmlAttribute(name = "featureType", required = true)
+        protected String featureType;
+
+        /**
+         * Gets the value of the matcherSet property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link FeatureMatcherSet }
+         *     
+         */
+        public FeatureMatcherSet getMatcherSet() {
+            return matcherSet;
+        }
+
+        /**
+         * Sets the value of the matcherSet property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link FeatureMatcherSet }
+         *     
+         */
+        public void setMatcherSet(FeatureMatcherSet value) {
+            this.matcherSet = value;
+        }
+
+        /**
+         * Gets the value of the featureType property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getFeatureType() {
+            return featureType;
+        }
+
+        /**
+         * Sets the value of the featureType property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setFeatureType(String value) {
+            this.featureType = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/MapListType.java b/src/jalview/xml/binding/jalview/MapListType.java
new file mode 100644 (file)
index 0000000..345556f
--- /dev/null
@@ -0,0 +1,315 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * 
+ *                             This effectively represents a java.util.MapList object
+ *                     
+ * 
+ * <p>Java class for mapListType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="mapListType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="mapListFrom" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="mapListTo" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                 &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="mapFromUnit" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       &lt;attribute name="mapToUnit" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "mapListType", propOrder = {
+    "mapListFrom",
+    "mapListTo"
+})
+@XmlSeeAlso({
+    Mapping.class
+})
+public class MapListType {
+
+    protected List<MapListType.MapListFrom> mapListFrom;
+    protected List<MapListType.MapListTo> mapListTo;
+    @XmlAttribute(name = "mapFromUnit", required = true)
+    @XmlSchemaType(name = "positiveInteger")
+    protected BigInteger mapFromUnit;
+    @XmlAttribute(name = "mapToUnit", required = true)
+    @XmlSchemaType(name = "positiveInteger")
+    protected BigInteger mapToUnit;
+
+    /**
+     * Gets the value of the mapListFrom property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the mapListFrom property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getMapListFrom().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link MapListType.MapListFrom }
+     * 
+     * 
+     */
+    public List<MapListType.MapListFrom> getMapListFrom() {
+        if (mapListFrom == null) {
+            mapListFrom = new ArrayList<MapListType.MapListFrom>();
+        }
+        return this.mapListFrom;
+    }
+
+    /**
+     * Gets the value of the mapListTo property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the mapListTo property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getMapListTo().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link MapListType.MapListTo }
+     * 
+     * 
+     */
+    public List<MapListType.MapListTo> getMapListTo() {
+        if (mapListTo == null) {
+            mapListTo = new ArrayList<MapListType.MapListTo>();
+        }
+        return this.mapListTo;
+    }
+
+    /**
+     * Gets the value of the mapFromUnit property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getMapFromUnit() {
+        return mapFromUnit;
+    }
+
+    /**
+     * Sets the value of the mapFromUnit property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setMapFromUnit(BigInteger value) {
+        this.mapFromUnit = value;
+    }
+
+    /**
+     * Gets the value of the mapToUnit property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getMapToUnit() {
+        return mapToUnit;
+    }
+
+    /**
+     * Sets the value of the mapToUnit property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setMapToUnit(BigInteger value) {
+        this.mapToUnit = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class MapListFrom {
+
+        @XmlAttribute(name = "start", required = true)
+        protected int start;
+        @XmlAttribute(name = "end", required = true)
+        protected int end;
+
+        /**
+         * Gets the value of the start property.
+         * 
+         */
+        public int getStart() {
+            return start;
+        }
+
+        /**
+         * Sets the value of the start property.
+         * 
+         */
+        public void setStart(int value) {
+            this.start = value;
+        }
+
+        /**
+         * Gets the value of the end property.
+         * 
+         */
+        public int getEnd() {
+            return end;
+        }
+
+        /**
+         * Sets the value of the end property.
+         * 
+         */
+        public void setEnd(int value) {
+            this.end = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *       &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class MapListTo {
+
+        @XmlAttribute(name = "start", required = true)
+        protected int start;
+        @XmlAttribute(name = "end", required = true)
+        protected int end;
+
+        /**
+         * Gets the value of the start property.
+         * 
+         */
+        public int getStart() {
+            return start;
+        }
+
+        /**
+         * Sets the value of the start property.
+         * 
+         */
+        public void setStart(int value) {
+            this.start = value;
+        }
+
+        /**
+         * Gets the value of the end property.
+         * 
+         */
+        public int getEnd() {
+            return end;
+        }
+
+        /**
+         * Sets the value of the end property.
+         * 
+         */
+        public void setEnd(int value) {
+            this.end = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/Mapping.java b/src/jalview/xml/binding/jalview/Mapping.java
new file mode 100644 (file)
index 0000000..cd82a2a
--- /dev/null
@@ -0,0 +1,113 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * 
+ *                                     Represent the jalview.datamodel.Mapping object - it also provides
+ *                                     a way of storing sequences that are mapped 'to' without adding them
+ *                                     to the sequence set (which will mean they are then added to the alignment too).
+ *                             
+ * 
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;extension base="{www.vamsas.ac.uk/jalview/version2}mapListType">
+ *       &lt;sequence>
+ *         &lt;choice minOccurs="0">
+ *           &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Sequence"/>
+ *           &lt;element name="dseqFor">
+ *             &lt;simpleType>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *               &lt;/restriction>
+ *             &lt;/simpleType>
+ *           &lt;/element>
+ *         &lt;/choice>
+ *       &lt;/sequence>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "sequence",
+    "dseqFor"
+})
+@XmlRootElement(name = "Mapping")
+public class Mapping
+    extends MapListType
+{
+
+    @XmlElement(name = "Sequence")
+    protected Sequence sequence;
+    protected String dseqFor;
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Sequence }
+     *     
+     */
+    public Sequence getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Sequence }
+     *     
+     */
+    public void setSequence(Sequence value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the dseqFor property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDseqFor() {
+        return dseqFor;
+    }
+
+    /**
+     * Sets the value of the dseqFor property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDseqFor(String value) {
+        this.dseqFor = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/NoValueColour.java b/src/jalview/xml/binding/jalview/NoValueColour.java
new file mode 100644 (file)
index 0000000..8fd65f0
--- /dev/null
@@ -0,0 +1,61 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for NoValueColour.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * &lt;simpleType name="NoValueColour">
+ *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     &lt;enumeration value="None"/>
+ *     &lt;enumeration value="Min"/>
+ *     &lt;enumeration value="Max"/>
+ *   &lt;/restriction>
+ * &lt;/simpleType>
+ * </pre>
+ * 
+ */
+@XmlType(name = "NoValueColour", namespace = "www.jalview.org/colours")
+@XmlEnum
+public enum NoValueColour {
+
+    @XmlEnumValue("None")
+    NONE("None"),
+    @XmlEnumValue("Min")
+    MIN("Min"),
+    @XmlEnumValue("Max")
+    MAX("Max");
+    private final String value;
+
+    NoValueColour(String v) {
+        value = v;
+    }
+
+    public String value() {
+        return value;
+    }
+
+    public static NoValueColour fromValue(String v) {
+        for (NoValueColour c: NoValueColour.values()) {
+            if (c.value.equals(v)) {
+                return c;
+            }
+        }
+        throw new IllegalArgumentException(v);
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/ObjectFactory.java b/src/jalview/xml/binding/jalview/ObjectFactory.java
new file mode 100644 (file)
index 0000000..0903928
--- /dev/null
@@ -0,0 +1,424 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the jalview.xml.binding.jalview package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _WebServiceParameterSet_QNAME = new QName("www.jalview.org/xml/wsparamset", "WebServiceParameterSet");
+    private final static QName _JalviewModel_QNAME = new QName("www.jalview.org", "JalviewModel");
+    private final static QName _JalviewUserColours_QNAME = new QName("www.jalview.org/colours", "JalviewUserColours");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: jalview.xml.binding.jalview
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link AlcodonFrame }
+     * 
+     */
+    public AlcodonFrame createAlcodonFrame() {
+        return new AlcodonFrame();
+    }
+
+    /**
+     * Create an instance of {@link MapListType }
+     * 
+     */
+    public MapListType createMapListType() {
+        return new MapListType();
+    }
+
+    /**
+     * Create an instance of {@link Sequence }
+     * 
+     */
+    public Sequence createSequence() {
+        return new Sequence();
+    }
+
+    /**
+     * Create an instance of {@link Annotation }
+     * 
+     */
+    public Annotation createAnnotation() {
+        return new Annotation();
+    }
+
+    /**
+     * Create an instance of {@link SequenceSet }
+     * 
+     */
+    public SequenceSet createSequenceSet() {
+        return new SequenceSet();
+    }
+
+    /**
+     * Create an instance of {@link FeatureMatcherSet }
+     * 
+     */
+    public FeatureMatcherSet createFeatureMatcherSet() {
+        return new FeatureMatcherSet();
+    }
+
+    /**
+     * Create an instance of {@link JalviewUserColours }
+     * 
+     */
+    public JalviewUserColours createJalviewUserColours() {
+        return new JalviewUserColours();
+    }
+
+    /**
+     * Create an instance of {@link Pdbentry }
+     * 
+     */
+    public Pdbentry createPdbentry() {
+        return new Pdbentry();
+    }
+
+    /**
+     * Create an instance of {@link Feature }
+     * 
+     */
+    public Feature createFeature() {
+        return new Feature();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel }
+     * 
+     */
+    public JalviewModel createJalviewModel() {
+        return new JalviewModel();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.FeatureSettings }
+     * 
+     */
+    public JalviewModel.FeatureSettings createJalviewModelFeatureSettings() {
+        return new JalviewModel.FeatureSettings();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.Viewport }
+     * 
+     */
+    public JalviewModel.Viewport createJalviewModelViewport() {
+        return new JalviewModel.Viewport();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.JSeq }
+     * 
+     */
+    public JalviewModel.JSeq createJalviewModelJSeq() {
+        return new JalviewModel.JSeq();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.JSeq.RnaViewer }
+     * 
+     */
+    public JalviewModel.JSeq.RnaViewer createJalviewModelJSeqRnaViewer() {
+        return new JalviewModel.JSeq.RnaViewer();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.JSeq.Pdbids }
+     * 
+     */
+    public JalviewModel.JSeq.Pdbids createJalviewModelJSeqPdbids() {
+        return new JalviewModel.JSeq.Pdbids();
+    }
+
+    /**
+     * Create an instance of {@link AnnotationColourScheme }
+     * 
+     */
+    public AnnotationColourScheme createAnnotationColourScheme() {
+        return new AnnotationColourScheme();
+    }
+
+    /**
+     * Create an instance of {@link AlcodonFrame.Alcodon }
+     * 
+     */
+    public AlcodonFrame.Alcodon createAlcodonFrameAlcodon() {
+        return new AlcodonFrame.Alcodon();
+    }
+
+    /**
+     * Create an instance of {@link AlcodonFrame.AlcodMap }
+     * 
+     */
+    public AlcodonFrame.AlcodMap createAlcodonFrameAlcodMap() {
+        return new AlcodonFrame.AlcodMap();
+    }
+
+    /**
+     * Create an instance of {@link AnnotationElement }
+     * 
+     */
+    public AnnotationElement createAnnotationElement() {
+        return new AnnotationElement();
+    }
+
+    /**
+     * Create an instance of {@link Mapping }
+     * 
+     */
+    public Mapping createMapping() {
+        return new Mapping();
+    }
+
+    /**
+     * Create an instance of {@link MapListType.MapListFrom }
+     * 
+     */
+    public MapListType.MapListFrom createMapListTypeMapListFrom() {
+        return new MapListType.MapListFrom();
+    }
+
+    /**
+     * Create an instance of {@link MapListType.MapListTo }
+     * 
+     */
+    public MapListType.MapListTo createMapListTypeMapListTo() {
+        return new MapListType.MapListTo();
+    }
+
+    /**
+     * Create an instance of {@link SequenceType }
+     * 
+     */
+    public SequenceType createSequenceType() {
+        return new SequenceType();
+    }
+
+    /**
+     * Create an instance of {@link Sequence.DBRef }
+     * 
+     */
+    public Sequence.DBRef createSequenceDBRef() {
+        return new Sequence.DBRef();
+    }
+
+    /**
+     * Create an instance of {@link Annotation.ThresholdLine }
+     * 
+     */
+    public Annotation.ThresholdLine createAnnotationThresholdLine() {
+        return new Annotation.ThresholdLine();
+    }
+
+    /**
+     * Create an instance of {@link Annotation.Property }
+     * 
+     */
+    public Annotation.Property createAnnotationProperty() {
+        return new Annotation.Property();
+    }
+
+    /**
+     * Create an instance of {@link SequenceSet.SequenceSetProperties }
+     * 
+     */
+    public SequenceSet.SequenceSetProperties createSequenceSetSequenceSetProperties() {
+        return new SequenceSet.SequenceSetProperties();
+    }
+
+    /**
+     * Create an instance of {@link VAMSAS }
+     * 
+     */
+    public VAMSAS createVAMSAS() {
+        return new VAMSAS();
+    }
+
+    /**
+     * Create an instance of {@link FeatureMatcher }
+     * 
+     */
+    public FeatureMatcher createFeatureMatcher() {
+        return new FeatureMatcher();
+    }
+
+    /**
+     * Create an instance of {@link WebServiceParameterSet }
+     * 
+     */
+    public WebServiceParameterSet createWebServiceParameterSet() {
+        return new WebServiceParameterSet();
+    }
+
+    /**
+     * Create an instance of {@link FeatureMatcherSet.CompoundMatcher }
+     * 
+     */
+    public FeatureMatcherSet.CompoundMatcher createFeatureMatcherSetCompoundMatcher() {
+        return new FeatureMatcherSet.CompoundMatcher();
+    }
+
+    /**
+     * Create an instance of {@link JalviewUserColours.Colour }
+     * 
+     */
+    public JalviewUserColours.Colour createJalviewUserColoursColour() {
+        return new JalviewUserColours.Colour();
+    }
+
+    /**
+     * Create an instance of {@link JalviewUserColours.Filter }
+     * 
+     */
+    public JalviewUserColours.Filter createJalviewUserColoursFilter() {
+        return new JalviewUserColours.Filter();
+    }
+
+    /**
+     * Create an instance of {@link Pdbentry.Property }
+     * 
+     */
+    public Pdbentry.Property createPdbentryProperty() {
+        return new Pdbentry.Property();
+    }
+
+    /**
+     * Create an instance of {@link Feature.OtherData }
+     * 
+     */
+    public Feature.OtherData createFeatureOtherData() {
+        return new Feature.OtherData();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.JGroup }
+     * 
+     */
+    public JalviewModel.JGroup createJalviewModelJGroup() {
+        return new JalviewModel.JGroup();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.UserColours }
+     * 
+     */
+    public JalviewModel.UserColours createJalviewModelUserColours() {
+        return new JalviewModel.UserColours();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.Tree }
+     * 
+     */
+    public JalviewModel.Tree createJalviewModelTree() {
+        return new JalviewModel.Tree();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.FeatureSettings.Setting }
+     * 
+     */
+    public JalviewModel.FeatureSettings.Setting createJalviewModelFeatureSettingsSetting() {
+        return new JalviewModel.FeatureSettings.Setting();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.FeatureSettings.Group }
+     * 
+     */
+    public JalviewModel.FeatureSettings.Group createJalviewModelFeatureSettingsGroup() {
+        return new JalviewModel.FeatureSettings.Group();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.Viewport.HiddenColumns }
+     * 
+     */
+    public JalviewModel.Viewport.HiddenColumns createJalviewModelViewportHiddenColumns() {
+        return new JalviewModel.Viewport.HiddenColumns();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.Viewport.CalcIdParam }
+     * 
+     */
+    public JalviewModel.Viewport.CalcIdParam createJalviewModelViewportCalcIdParam() {
+        return new JalviewModel.Viewport.CalcIdParam();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.JSeq.RnaViewer.SecondaryStructure }
+     * 
+     */
+    public JalviewModel.JSeq.RnaViewer.SecondaryStructure createJalviewModelJSeqRnaViewerSecondaryStructure() {
+        return new JalviewModel.JSeq.RnaViewer.SecondaryStructure();
+    }
+
+    /**
+     * Create an instance of {@link JalviewModel.JSeq.Pdbids.StructureState }
+     * 
+     */
+    public JalviewModel.JSeq.Pdbids.StructureState createJalviewModelJSeqPdbidsStructureState() {
+        return new JalviewModel.JSeq.Pdbids.StructureState();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link WebServiceParameterSet }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "www.jalview.org/xml/wsparamset", name = "WebServiceParameterSet")
+    public JAXBElement<WebServiceParameterSet> createWebServiceParameterSet(WebServiceParameterSet value) {
+        return new JAXBElement<WebServiceParameterSet>(_WebServiceParameterSet_QNAME, WebServiceParameterSet.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link JalviewModel }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "www.jalview.org", name = "JalviewModel")
+    public JAXBElement<JalviewModel> createJalviewModel(JalviewModel value) {
+        return new JAXBElement<JalviewModel>(_JalviewModel_QNAME, JalviewModel.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link JalviewUserColours }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "www.jalview.org/colours", name = "JalviewUserColours")
+    public JAXBElement<JalviewUserColours> createJalviewUserColours(JalviewUserColours value) {
+        return new JAXBElement<JalviewUserColours>(_JalviewUserColours_QNAME, JalviewUserColours.class, null, value);
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/Pdbentry.java b/src/jalview/xml/binding/jalview/Pdbentry.java
new file mode 100644 (file)
index 0000000..4accccd
--- /dev/null
@@ -0,0 +1,247 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for pdbentry complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="pdbentry">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence maxOccurs="unbounded" minOccurs="0">
+ *         &lt;element name="property" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="file" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "pdbentry", namespace = "www.jalview.org", propOrder = {
+    "property"
+})
+@XmlSeeAlso({
+    jalview.xml.binding.jalview.JalviewModel.JSeq.Pdbids.class
+})
+public class Pdbentry {
+
+    protected List<Pdbentry.Property> property;
+    @XmlAttribute(name = "id", required = true)
+    protected String id;
+    @XmlAttribute(name = "type")
+    protected String type;
+    @XmlAttribute(name = "file")
+    protected String file;
+
+    /**
+     * Gets the value of the property property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the property property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProperty().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Pdbentry.Property }
+     * 
+     * 
+     */
+    public List<Pdbentry.Property> getProperty() {
+        if (property == null) {
+            property = new ArrayList<Pdbentry.Property>();
+        }
+        return this.property;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the file property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFile() {
+        return file;
+    }
+
+    /**
+     * Sets the value of the file property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFile(String value) {
+        this.file = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class Property {
+
+        @XmlAttribute(name = "name", required = true)
+        protected String name;
+        @XmlAttribute(name = "value", required = true)
+        protected String value;
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/Sequence.java b/src/jalview/xml/binding/jalview/Sequence.java
new file mode 100644 (file)
index 0000000..937142a
--- /dev/null
@@ -0,0 +1,257 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;extension base="{www.vamsas.ac.uk/jalview/version2}SequenceType">
+ *       &lt;sequence>
+ *         &lt;element name="DBRef" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Mapping" minOccurs="0"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="source" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="accessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="dsseqid" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "dbRef"
+})
+@XmlRootElement(name = "Sequence")
+public class Sequence
+    extends SequenceType
+{
+
+    @XmlElement(name = "DBRef")
+    protected List<Sequence.DBRef> dbRef;
+    @XmlAttribute(name = "dsseqid")
+    protected String dsseqid;
+
+    /**
+     * Gets the value of the dbRef property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the dbRef property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getDBRef().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Sequence.DBRef }
+     * 
+     * 
+     */
+    public List<Sequence.DBRef> getDBRef() {
+        if (dbRef == null) {
+            dbRef = new ArrayList<Sequence.DBRef>();
+        }
+        return this.dbRef;
+    }
+
+    /**
+     * Gets the value of the dsseqid property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDsseqid() {
+        return dsseqid;
+    }
+
+    /**
+     * Sets the value of the dsseqid property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDsseqid(String value) {
+        this.dsseqid = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Mapping" minOccurs="0"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="source" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="accessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "mapping"
+    })
+    public static class DBRef {
+
+        @XmlElement(name = "Mapping")
+        protected Mapping mapping;
+        @XmlAttribute(name = "source")
+        protected String source;
+        @XmlAttribute(name = "version")
+        protected String version;
+        @XmlAttribute(name = "accessionId")
+        protected String accessionId;
+
+        /**
+         * Gets the value of the mapping property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Mapping }
+         *     
+         */
+        public Mapping getMapping() {
+            return mapping;
+        }
+
+        /**
+         * Sets the value of the mapping property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Mapping }
+         *     
+         */
+        public void setMapping(Mapping value) {
+            this.mapping = value;
+        }
+
+        /**
+         * Gets the value of the source property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getSource() {
+            return source;
+        }
+
+        /**
+         * Sets the value of the source property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setSource(String value) {
+            this.source = value;
+        }
+
+        /**
+         * Gets the value of the version property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getVersion() {
+            return version;
+        }
+
+        /**
+         * Sets the value of the version property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setVersion(String value) {
+            this.version = value;
+        }
+
+        /**
+         * Gets the value of the accessionId property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getAccessionId() {
+            return accessionId;
+        }
+
+        /**
+         * Sets the value of the accessionId property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setAccessionId(String value) {
+            this.accessionId = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/SequenceSet.java b/src/jalview/xml/binding/jalview/SequenceSet.java
new file mode 100644 (file)
index 0000000..7bd7c1e
--- /dev/null
@@ -0,0 +1,318 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Sequence" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}Annotation" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="sequenceSetProperties" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="key" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}AlcodonFrame" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="gapChar" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="datasetId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "sequence",
+    "annotation",
+    "sequenceSetProperties",
+    "alcodonFrame"
+})
+@XmlRootElement(name = "SequenceSet")
+public class SequenceSet {
+
+    @XmlElement(name = "Sequence")
+    protected List<Sequence> sequence;
+    @XmlElement(name = "Annotation")
+    protected List<Annotation> annotation;
+    protected List<SequenceSet.SequenceSetProperties> sequenceSetProperties;
+    @XmlElement(name = "AlcodonFrame")
+    protected List<AlcodonFrame> alcodonFrame;
+    @XmlAttribute(name = "gapChar", required = true)
+    protected String gapChar;
+    @XmlAttribute(name = "datasetId")
+    protected String datasetId;
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the sequence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSequence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Sequence }
+     * 
+     * 
+     */
+    public List<Sequence> getSequence() {
+        if (sequence == null) {
+            sequence = new ArrayList<Sequence>();
+        }
+        return this.sequence;
+    }
+
+    /**
+     * Gets the value of the annotation property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the annotation property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAnnotation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Annotation }
+     * 
+     * 
+     */
+    public List<Annotation> getAnnotation() {
+        if (annotation == null) {
+            annotation = new ArrayList<Annotation>();
+        }
+        return this.annotation;
+    }
+
+    /**
+     * Gets the value of the sequenceSetProperties property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the sequenceSetProperties property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSequenceSetProperties().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link SequenceSet.SequenceSetProperties }
+     * 
+     * 
+     */
+    public List<SequenceSet.SequenceSetProperties> getSequenceSetProperties() {
+        if (sequenceSetProperties == null) {
+            sequenceSetProperties = new ArrayList<SequenceSet.SequenceSetProperties>();
+        }
+        return this.sequenceSetProperties;
+    }
+
+    /**
+     * Gets the value of the alcodonFrame property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the alcodonFrame property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAlcodonFrame().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link AlcodonFrame }
+     * 
+     * 
+     */
+    public List<AlcodonFrame> getAlcodonFrame() {
+        if (alcodonFrame == null) {
+            alcodonFrame = new ArrayList<AlcodonFrame>();
+        }
+        return this.alcodonFrame;
+    }
+
+    /**
+     * Gets the value of the gapChar property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getGapChar() {
+        return gapChar;
+    }
+
+    /**
+     * Sets the value of the gapChar property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setGapChar(String value) {
+        this.gapChar = value;
+    }
+
+    /**
+     * Gets the value of the datasetId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDatasetId() {
+        return datasetId;
+    }
+
+    /**
+     * Sets the value of the datasetId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDatasetId(String value) {
+        this.datasetId = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="key" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class SequenceSetProperties {
+
+        @XmlAttribute(name = "key")
+        protected String key;
+        @XmlAttribute(name = "value")
+        protected String value;
+
+        /**
+         * Gets the value of the key property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getKey() {
+            return key;
+        }
+
+        /**
+         * Sets the value of the key property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setKey(String value) {
+            this.key = value;
+        }
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/SequenceType.java b/src/jalview/xml/binding/jalview/SequenceType.java
new file mode 100644 (file)
index 0000000..004119f
--- /dev/null
@@ -0,0 +1,153 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for SequenceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="SequenceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SequenceType", propOrder = {
+    "sequence",
+    "name"
+})
+@XmlSeeAlso({
+    Sequence.class
+})
+public class SequenceType {
+
+    protected String sequence;
+    protected String name;
+    @XmlAttribute(name = "id")
+    protected String id;
+    @XmlAttribute(name = "description")
+    protected String description;
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequence(String value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/ThresholdType.java b/src/jalview/xml/binding/jalview/ThresholdType.java
new file mode 100644 (file)
index 0000000..7ec43c7
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ThresholdType.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * &lt;simpleType name="ThresholdType">
+ *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     &lt;enumeration value="NONE"/>
+ *     &lt;enumeration value="ABOVE"/>
+ *     &lt;enumeration value="BELOW"/>
+ *   &lt;/restriction>
+ * &lt;/simpleType>
+ * </pre>
+ * 
+ */
+@XmlType(name = "ThresholdType", namespace = "www.jalview.org/colours")
+@XmlEnum
+public enum ThresholdType {
+
+    NONE,
+    ABOVE,
+    BELOW;
+
+    public String value() {
+        return name();
+    }
+
+    public static ThresholdType fromValue(String v) {
+        return valueOf(v);
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/VAMSAS.java b/src/jalview/xml/binding/jalview/VAMSAS.java
new file mode 100644 (file)
index 0000000..70799ea
--- /dev/null
@@ -0,0 +1,109 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for VAMSAS complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="VAMSAS">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Tree" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element ref="{www.vamsas.ac.uk/jalview/version2}SequenceSet" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "VAMSAS", propOrder = {
+    "tree",
+    "sequenceSet"
+})
+public class VAMSAS {
+
+    @XmlElement(name = "Tree")
+    protected List<String> tree;
+    @XmlElement(name = "SequenceSet")
+    protected List<SequenceSet> sequenceSet;
+
+    /**
+     * Gets the value of the tree property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the tree property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getTree().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getTree() {
+        if (tree == null) {
+            tree = new ArrayList<String>();
+        }
+        return this.tree;
+    }
+
+    /**
+     * Gets the value of the sequenceSet property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the sequenceSet property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSequenceSet().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link SequenceSet }
+     * 
+     * 
+     */
+    public List<SequenceSet> getSequenceSet() {
+        if (sequenceSet == null) {
+            sequenceSet = new ArrayList<SequenceSet>();
+        }
+        return this.sequenceSet;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/WebServiceParameterSet.java b/src/jalview/xml/binding/jalview/WebServiceParameterSet.java
new file mode 100644 (file)
index 0000000..fea0324
--- /dev/null
@@ -0,0 +1,194 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+
+package jalview.xml.binding.jalview;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for WebServiceParameterSet complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="WebServiceParameterSet">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="serviceURL" type="{http://www.w3.org/2001/XMLSchema}anyURI" maxOccurs="unbounded"/>
+ *         &lt;element name="parameters" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "WebServiceParameterSet", namespace = "www.jalview.org/xml/wsparamset", propOrder = {
+    "version",
+    "description",
+    "serviceURL",
+    "parameters"
+})
+@XmlSeeAlso({
+    jalview.xml.binding.jalview.JalviewModel.Viewport.CalcIdParam.class
+})
+public class WebServiceParameterSet {
+
+    @XmlElement(name = "Version", namespace = "")
+    protected String version;
+    @XmlElement(namespace = "")
+    protected String description;
+    @XmlElement(namespace = "", required = true)
+    @XmlSchemaType(name = "anyURI")
+    protected List<String> serviceURL;
+    @XmlElement(namespace = "", required = true)
+    protected String parameters;
+    @XmlAttribute(name = "name", required = true)
+    protected String name;
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVersion(String value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the serviceURL property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the serviceURL property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getServiceURL().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getServiceURL() {
+        if (serviceURL == null) {
+            serviceURL = new ArrayList<String>();
+        }
+        return this.serviceURL;
+    }
+
+    /**
+     * Gets the value of the parameters property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getParameters() {
+        return parameters;
+    }
+
+    /**
+     * Sets the value of the parameters property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setParameters(String value) {
+        this.parameters = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/jalview/package-info.java b/src/jalview/xml/binding/jalview/package-info.java
new file mode 100644 (file)
index 0000000..4235c64
--- /dev/null
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.28 at 12:18:54 PM BST 
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "www.vamsas.ac.uk/jalview/version2", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package jalview.xml.binding.jalview;
diff --git a/src/jalview/xml/binding/uniprot/CitationType.java b/src/jalview/xml/binding/uniprot/CitationType.java
new file mode 100644 (file)
index 0000000..cc5f14e
--- /dev/null
@@ -0,0 +1,527 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes different types of citations.
+ *             Equivalent to the flat file RX-, RG-, RA-, RT- and RL-lines.
+ * 
+ * <p>Java class for citationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="citationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="editorList" type="{http://uniprot.org/uniprot}nameListType" minOccurs="0"/>
+ *         &lt;element name="authorList" type="{http://uniprot.org/uniprot}nameListType" minOccurs="0"/>
+ *         &lt;element name="locator" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="book"/>
+ *             &lt;enumeration value="journal article"/>
+ *             &lt;enumeration value="online journal article"/>
+ *             &lt;enumeration value="patent"/>
+ *             &lt;enumeration value="submission"/>
+ *             &lt;enumeration value="thesis"/>
+ *             &lt;enumeration value="unpublished observations"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="date">
+ *         &lt;simpleType>
+ *           &lt;union memberTypes=" {http://www.w3.org/2001/XMLSchema}date {http://www.w3.org/2001/XMLSchema}gYearMonth {http://www.w3.org/2001/XMLSchema}gYear">
+ *           &lt;/union>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="volume" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="first" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="last" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="publisher" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="city" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="db" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="number" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="institute" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="country" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "citationType", propOrder = {
+    "title",
+    "editorList",
+    "authorList",
+    "locator",
+    "dbReference"
+})
+public class CitationType {
+
+    protected String title;
+    protected NameListType editorList;
+    protected NameListType authorList;
+    protected String locator;
+    protected List<DbReferenceType> dbReference;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "date")
+    protected String date;
+    @XmlAttribute(name = "name")
+    protected String name;
+    @XmlAttribute(name = "volume")
+    protected String volume;
+    @XmlAttribute(name = "first")
+    protected String first;
+    @XmlAttribute(name = "last")
+    protected String last;
+    @XmlAttribute(name = "publisher")
+    protected String publisher;
+    @XmlAttribute(name = "city")
+    protected String city;
+    @XmlAttribute(name = "db")
+    protected String db;
+    @XmlAttribute(name = "number")
+    protected String number;
+    @XmlAttribute(name = "institute")
+    protected String institute;
+    @XmlAttribute(name = "country")
+    protected String country;
+
+    /**
+     * Gets the value of the title property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * Sets the value of the title property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setTitle(String value) {
+        this.title = value;
+    }
+
+    /**
+     * Gets the value of the editorList property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link NameListType }
+     *     
+     */
+    public NameListType getEditorList() {
+        return editorList;
+    }
+
+    /**
+     * Sets the value of the editorList property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link NameListType }
+     *     
+     */
+    public void setEditorList(NameListType value) {
+        this.editorList = value;
+    }
+
+    /**
+     * Gets the value of the authorList property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link NameListType }
+     *     
+     */
+    public NameListType getAuthorList() {
+        return authorList;
+    }
+
+    /**
+     * Sets the value of the authorList property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link NameListType }
+     *     
+     */
+    public void setAuthorList(NameListType value) {
+        this.authorList = value;
+    }
+
+    /**
+     * Gets the value of the locator property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLocator() {
+        return locator;
+    }
+
+    /**
+     * Sets the value of the locator property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLocator(String value) {
+        this.locator = value;
+    }
+
+    /**
+     * Gets the value of the dbReference property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the dbReference property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getDbReference().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link DbReferenceType }
+     * 
+     * 
+     */
+    public List<DbReferenceType> getDbReference() {
+        if (dbReference == null) {
+            dbReference = new ArrayList<DbReferenceType>();
+        }
+        return this.dbReference;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the date property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDate() {
+        return date;
+    }
+
+    /**
+     * Sets the value of the date property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDate(String value) {
+        this.date = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the volume property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVolume() {
+        return volume;
+    }
+
+    /**
+     * Sets the value of the volume property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVolume(String value) {
+        this.volume = value;
+    }
+
+    /**
+     * Gets the value of the first property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFirst() {
+        return first;
+    }
+
+    /**
+     * Sets the value of the first property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFirst(String value) {
+        this.first = value;
+    }
+
+    /**
+     * Gets the value of the last property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLast() {
+        return last;
+    }
+
+    /**
+     * Sets the value of the last property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLast(String value) {
+        this.last = value;
+    }
+
+    /**
+     * Gets the value of the publisher property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getPublisher() {
+        return publisher;
+    }
+
+    /**
+     * Sets the value of the publisher property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setPublisher(String value) {
+        this.publisher = value;
+    }
+
+    /**
+     * Gets the value of the city property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCity() {
+        return city;
+    }
+
+    /**
+     * Sets the value of the city property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCity(String value) {
+        this.city = value;
+    }
+
+    /**
+     * Gets the value of the db property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDb() {
+        return db;
+    }
+
+    /**
+     * Sets the value of the db property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDb(String value) {
+        this.db = value;
+    }
+
+    /**
+     * Gets the value of the number property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getNumber() {
+        return number;
+    }
+
+    /**
+     * Sets the value of the number property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setNumber(String value) {
+        this.number = value;
+    }
+
+    /**
+     * Gets the value of the institute property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getInstitute() {
+        return institute;
+    }
+
+    /**
+     * Sets the value of the institute property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setInstitute(String value) {
+        this.institute = value;
+    }
+
+    /**
+     * Gets the value of the country property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCountry() {
+        return country;
+    }
+
+    /**
+     * Sets the value of the country property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCountry(String value) {
+        this.country = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/CofactorType.java b/src/jalview/xml/binding/uniprot/CofactorType.java
new file mode 100644 (file)
index 0000000..9b91dc4
--- /dev/null
@@ -0,0 +1,134 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes a cofactor.
+ * 
+ * <p>Java class for cofactorType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="cofactorType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "cofactorType", propOrder = {
+    "name",
+    "dbReference"
+})
+public class CofactorType {
+
+    @XmlElement(required = true)
+    protected String name;
+    @XmlElement(required = true)
+    protected DbReferenceType dbReference;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the dbReference property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DbReferenceType }
+     *     
+     */
+    public DbReferenceType getDbReference() {
+        return dbReference;
+    }
+
+    /**
+     * Sets the value of the dbReference property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DbReferenceType }
+     *     
+     */
+    public void setDbReference(DbReferenceType value) {
+        this.dbReference = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/CommentType.java b/src/jalview/xml/binding/uniprot/CommentType.java
new file mode 100644 (file)
index 0000000..b0bbf77
--- /dev/null
@@ -0,0 +1,1730 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes different types of general annotations.
+ *             Equivalent to the flat file CC-line.
+ * 
+ * <p>Java class for commentType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="commentType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="molecule" type="{http://uniprot.org/uniprot}moleculeType" minOccurs="0"/>
+ *         &lt;choice minOccurs="0">
+ *           &lt;group ref="{http://uniprot.org/uniprot}bpcCommentGroup"/>
+ *           &lt;sequence>
+ *             &lt;element name="cofactor" type="{http://uniprot.org/uniprot}cofactorType" maxOccurs="unbounded"/>
+ *           &lt;/sequence>
+ *           &lt;sequence>
+ *             &lt;element name="subcellularLocation" type="{http://uniprot.org/uniprot}subcellularLocationType" maxOccurs="unbounded"/>
+ *           &lt;/sequence>
+ *           &lt;element name="conflict">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="sequence" minOccurs="0">
+ *                       &lt;complexType>
+ *                         &lt;complexContent>
+ *                           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                             &lt;attribute name="resource" use="required">
+ *                               &lt;simpleType>
+ *                                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *                                   &lt;enumeration value="EMBL-CDS"/>
+ *                                   &lt;enumeration value="EMBL"/>
+ *                                 &lt;/restriction>
+ *                               &lt;/simpleType>
+ *                             &lt;/attribute>
+ *                             &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                             &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *                           &lt;/restriction>
+ *                         &lt;/complexContent>
+ *                       &lt;/complexType>
+ *                     &lt;/element>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="type" use="required">
+ *                     &lt;simpleType>
+ *                       &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *                         &lt;enumeration value="frameshift"/>
+ *                         &lt;enumeration value="erroneous initiation"/>
+ *                         &lt;enumeration value="erroneous termination"/>
+ *                         &lt;enumeration value="erroneous gene model prediction"/>
+ *                         &lt;enumeration value="erroneous translation"/>
+ *                         &lt;enumeration value="miscellaneous discrepancy"/>
+ *                       &lt;/restriction>
+ *                     &lt;/simpleType>
+ *                   &lt;/attribute>
+ *                   &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *           &lt;sequence>
+ *             &lt;element name="link" maxOccurs="unbounded" minOccurs="0">
+ *               &lt;complexType>
+ *                 &lt;complexContent>
+ *                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                     &lt;attribute name="uri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *                   &lt;/restriction>
+ *                 &lt;/complexContent>
+ *               &lt;/complexType>
+ *             &lt;/element>
+ *           &lt;/sequence>
+ *           &lt;sequence>
+ *             &lt;element name="event" type="{http://uniprot.org/uniprot}eventType" maxOccurs="4"/>
+ *             &lt;element name="isoform" type="{http://uniprot.org/uniprot}isoformType" maxOccurs="unbounded" minOccurs="0"/>
+ *           &lt;/sequence>
+ *           &lt;sequence>
+ *             &lt;element name="interactant" type="{http://uniprot.org/uniprot}interactantType" maxOccurs="2" minOccurs="2"/>
+ *             &lt;element name="organismsDiffer" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *             &lt;element name="experiments" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *           &lt;/sequence>
+ *           &lt;element name="disease">
+ *             &lt;complexType>
+ *               &lt;complexContent>
+ *                 &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                   &lt;sequence>
+ *                     &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                     &lt;element name="acronym" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                     &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                     &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType"/>
+ *                   &lt;/sequence>
+ *                   &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 &lt;/restriction>
+ *               &lt;/complexContent>
+ *             &lt;/complexType>
+ *           &lt;/element>
+ *         &lt;/choice>
+ *         &lt;element name="location" type="{http://uniprot.org/uniprot}locationType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="allergen"/>
+ *             &lt;enumeration value="alternative products"/>
+ *             &lt;enumeration value="biotechnology"/>
+ *             &lt;enumeration value="biophysicochemical properties"/>
+ *             &lt;enumeration value="catalytic activity"/>
+ *             &lt;enumeration value="caution"/>
+ *             &lt;enumeration value="cofactor"/>
+ *             &lt;enumeration value="developmental stage"/>
+ *             &lt;enumeration value="disease"/>
+ *             &lt;enumeration value="domain"/>
+ *             &lt;enumeration value="disruption phenotype"/>
+ *             &lt;enumeration value="activity regulation"/>
+ *             &lt;enumeration value="function"/>
+ *             &lt;enumeration value="induction"/>
+ *             &lt;enumeration value="miscellaneous"/>
+ *             &lt;enumeration value="pathway"/>
+ *             &lt;enumeration value="pharmaceutical"/>
+ *             &lt;enumeration value="polymorphism"/>
+ *             &lt;enumeration value="PTM"/>
+ *             &lt;enumeration value="RNA editing"/>
+ *             &lt;enumeration value="similarity"/>
+ *             &lt;enumeration value="subcellular location"/>
+ *             &lt;enumeration value="sequence caution"/>
+ *             &lt;enumeration value="subunit"/>
+ *             &lt;enumeration value="tissue specificity"/>
+ *             &lt;enumeration value="toxic dose"/>
+ *             &lt;enumeration value="online information"/>
+ *             &lt;enumeration value="mass spectrometry"/>
+ *             &lt;enumeration value="interaction"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="locationType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="mass" type="{http://www.w3.org/2001/XMLSchema}float" />
+ *       &lt;attribute name="error" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="method" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "commentType", propOrder = {
+    "molecule",
+    "absorption",
+    "kinetics",
+    "phDependence",
+    "redoxPotential",
+    "temperatureDependence",
+    "cofactor",
+    "subcellularLocation",
+    "conflict",
+    "link",
+    "event",
+    "isoform",
+    "interactant",
+    "organismsDiffer",
+    "experiments",
+    "disease",
+    "location",
+    "text"
+})
+public class CommentType {
+
+    protected MoleculeType molecule;
+    protected CommentType.Absorption absorption;
+    protected CommentType.Kinetics kinetics;
+    protected CommentType.PhDependence phDependence;
+    protected CommentType.RedoxPotential redoxPotential;
+    protected CommentType.TemperatureDependence temperatureDependence;
+    protected List<CofactorType> cofactor;
+    protected List<SubcellularLocationType> subcellularLocation;
+    protected CommentType.Conflict conflict;
+    protected List<CommentType.Link> link;
+    protected List<EventType> event;
+    protected List<IsoformType> isoform;
+    protected List<InteractantType> interactant;
+    @XmlElement(defaultValue = "false")
+    protected Boolean organismsDiffer;
+    protected Integer experiments;
+    protected CommentType.Disease disease;
+    protected List<LocationType> location;
+    protected List<EvidencedStringType> text;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "locationType")
+    protected String locationType;
+    @XmlAttribute(name = "name")
+    protected String name;
+    @XmlAttribute(name = "mass")
+    protected Float mass;
+    @XmlAttribute(name = "error")
+    protected String error;
+    @XmlAttribute(name = "method")
+    protected String method;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+
+    /**
+     * Gets the value of the molecule property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link MoleculeType }
+     *     
+     */
+    public MoleculeType getMolecule() {
+        return molecule;
+    }
+
+    /**
+     * Sets the value of the molecule property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link MoleculeType }
+     *     
+     */
+    public void setMolecule(MoleculeType value) {
+        this.molecule = value;
+    }
+
+    /**
+     * Gets the value of the absorption property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.Absorption }
+     *     
+     */
+    public CommentType.Absorption getAbsorption() {
+        return absorption;
+    }
+
+    /**
+     * Sets the value of the absorption property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.Absorption }
+     *     
+     */
+    public void setAbsorption(CommentType.Absorption value) {
+        this.absorption = value;
+    }
+
+    /**
+     * Gets the value of the kinetics property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.Kinetics }
+     *     
+     */
+    public CommentType.Kinetics getKinetics() {
+        return kinetics;
+    }
+
+    /**
+     * Sets the value of the kinetics property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.Kinetics }
+     *     
+     */
+    public void setKinetics(CommentType.Kinetics value) {
+        this.kinetics = value;
+    }
+
+    /**
+     * Gets the value of the phDependence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.PhDependence }
+     *     
+     */
+    public CommentType.PhDependence getPhDependence() {
+        return phDependence;
+    }
+
+    /**
+     * Sets the value of the phDependence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.PhDependence }
+     *     
+     */
+    public void setPhDependence(CommentType.PhDependence value) {
+        this.phDependence = value;
+    }
+
+    /**
+     * Gets the value of the redoxPotential property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.RedoxPotential }
+     *     
+     */
+    public CommentType.RedoxPotential getRedoxPotential() {
+        return redoxPotential;
+    }
+
+    /**
+     * Sets the value of the redoxPotential property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.RedoxPotential }
+     *     
+     */
+    public void setRedoxPotential(CommentType.RedoxPotential value) {
+        this.redoxPotential = value;
+    }
+
+    /**
+     * Gets the value of the temperatureDependence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.TemperatureDependence }
+     *     
+     */
+    public CommentType.TemperatureDependence getTemperatureDependence() {
+        return temperatureDependence;
+    }
+
+    /**
+     * Sets the value of the temperatureDependence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.TemperatureDependence }
+     *     
+     */
+    public void setTemperatureDependence(CommentType.TemperatureDependence value) {
+        this.temperatureDependence = value;
+    }
+
+    /**
+     * Gets the value of the cofactor property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the cofactor property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getCofactor().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link CofactorType }
+     * 
+     * 
+     */
+    public List<CofactorType> getCofactor() {
+        if (cofactor == null) {
+            cofactor = new ArrayList<CofactorType>();
+        }
+        return this.cofactor;
+    }
+
+    /**
+     * Gets the value of the subcellularLocation property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the subcellularLocation property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSubcellularLocation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link SubcellularLocationType }
+     * 
+     * 
+     */
+    public List<SubcellularLocationType> getSubcellularLocation() {
+        if (subcellularLocation == null) {
+            subcellularLocation = new ArrayList<SubcellularLocationType>();
+        }
+        return this.subcellularLocation;
+    }
+
+    /**
+     * Gets the value of the conflict property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.Conflict }
+     *     
+     */
+    public CommentType.Conflict getConflict() {
+        return conflict;
+    }
+
+    /**
+     * Sets the value of the conflict property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.Conflict }
+     *     
+     */
+    public void setConflict(CommentType.Conflict value) {
+        this.conflict = value;
+    }
+
+    /**
+     * Gets the value of the link property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the link property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getLink().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link CommentType.Link }
+     * 
+     * 
+     */
+    public List<CommentType.Link> getLink() {
+        if (link == null) {
+            link = new ArrayList<CommentType.Link>();
+        }
+        return this.link;
+    }
+
+    /**
+     * Gets the value of the event property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the event property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvent().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EventType }
+     * 
+     * 
+     */
+    public List<EventType> getEvent() {
+        if (event == null) {
+            event = new ArrayList<EventType>();
+        }
+        return this.event;
+    }
+
+    /**
+     * Gets the value of the isoform property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the isoform property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getIsoform().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link IsoformType }
+     * 
+     * 
+     */
+    public List<IsoformType> getIsoform() {
+        if (isoform == null) {
+            isoform = new ArrayList<IsoformType>();
+        }
+        return this.isoform;
+    }
+
+    /**
+     * Gets the value of the interactant property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the interactant property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getInteractant().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link InteractantType }
+     * 
+     * 
+     */
+    public List<InteractantType> getInteractant() {
+        if (interactant == null) {
+            interactant = new ArrayList<InteractantType>();
+        }
+        return this.interactant;
+    }
+
+    /**
+     * Gets the value of the organismsDiffer property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isOrganismsDiffer() {
+        return organismsDiffer;
+    }
+
+    /**
+     * Sets the value of the organismsDiffer property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setOrganismsDiffer(Boolean value) {
+        this.organismsDiffer = value;
+    }
+
+    /**
+     * Gets the value of the experiments property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Integer }
+     *     
+     */
+    public Integer getExperiments() {
+        return experiments;
+    }
+
+    /**
+     * Sets the value of the experiments property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Integer }
+     *     
+     */
+    public void setExperiments(Integer value) {
+        this.experiments = value;
+    }
+
+    /**
+     * Gets the value of the disease property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CommentType.Disease }
+     *     
+     */
+    public CommentType.Disease getDisease() {
+        return disease;
+    }
+
+    /**
+     * Sets the value of the disease property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CommentType.Disease }
+     *     
+     */
+    public void setDisease(CommentType.Disease value) {
+        this.disease = value;
+    }
+
+    /**
+     * Gets the value of the location property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the location property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getLocation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link LocationType }
+     * 
+     * 
+     */
+    public List<LocationType> getLocation() {
+        if (location == null) {
+            location = new ArrayList<LocationType>();
+        }
+        return this.location;
+    }
+
+    /**
+     * Gets the value of the text property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the text property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getText().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getText() {
+        if (text == null) {
+            text = new ArrayList<EvidencedStringType>();
+        }
+        return this.text;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the locationType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLocationType() {
+        return locationType;
+    }
+
+    /**
+     * Sets the value of the locationType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLocationType(String value) {
+        this.locationType = value;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the mass property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Float }
+     *     
+     */
+    public Float getMass() {
+        return mass;
+    }
+
+    /**
+     * Sets the value of the mass property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Float }
+     *     
+     */
+    public void setMass(Float value) {
+        this.mass = value;
+    }
+
+    /**
+     * Gets the value of the error property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getError() {
+        return error;
+    }
+
+    /**
+     * Sets the value of the error property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setError(String value) {
+        this.error = value;
+    }
+
+    /**
+     * Gets the value of the method property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getMethod() {
+        return method;
+    }
+
+    /**
+     * Sets the value of the method property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setMethod(String value) {
+        this.method = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="max" type="{http://uniprot.org/uniprot}evidencedStringType" minOccurs="0"/>
+     *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "max",
+        "text"
+    })
+    public static class Absorption {
+
+        protected EvidencedStringType max;
+        protected List<EvidencedStringType> text;
+
+        /**
+         * Gets the value of the max property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getMax() {
+            return max;
+        }
+
+        /**
+         * Sets the value of the max property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setMax(EvidencedStringType value) {
+            this.max = value;
+        }
+
+        /**
+         * Gets the value of the text property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the text property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getText().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getText() {
+            if (text == null) {
+                text = new ArrayList<EvidencedStringType>();
+            }
+            return this.text;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="sequence" minOccurs="0">
+     *           &lt;complexType>
+     *             &lt;complexContent>
+     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 &lt;attribute name="resource" use="required">
+     *                   &lt;simpleType>
+     *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+     *                       &lt;enumeration value="EMBL-CDS"/>
+     *                       &lt;enumeration value="EMBL"/>
+     *                     &lt;/restriction>
+     *                   &lt;/simpleType>
+     *                 &lt;/attribute>
+     *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}int" />
+     *               &lt;/restriction>
+     *             &lt;/complexContent>
+     *           &lt;/complexType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *       &lt;attribute name="type" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+     *             &lt;enumeration value="frameshift"/>
+     *             &lt;enumeration value="erroneous initiation"/>
+     *             &lt;enumeration value="erroneous termination"/>
+     *             &lt;enumeration value="erroneous gene model prediction"/>
+     *             &lt;enumeration value="erroneous translation"/>
+     *             &lt;enumeration value="miscellaneous discrepancy"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *       &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "sequence"
+    })
+    public static class Conflict {
+
+        protected CommentType.Conflict.Sequence sequence;
+        @XmlAttribute(name = "type", required = true)
+        protected String type;
+        @XmlAttribute(name = "ref")
+        protected String ref;
+
+        /**
+         * Gets the value of the sequence property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link CommentType.Conflict.Sequence }
+         *     
+         */
+        public CommentType.Conflict.Sequence getSequence() {
+            return sequence;
+        }
+
+        /**
+         * Sets the value of the sequence property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link CommentType.Conflict.Sequence }
+         *     
+         */
+        public void setSequence(CommentType.Conflict.Sequence value) {
+            this.sequence = value;
+        }
+
+        /**
+         * Gets the value of the type property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getType() {
+            return type;
+        }
+
+        /**
+         * Sets the value of the type property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setType(String value) {
+            this.type = value;
+        }
+
+        /**
+         * Gets the value of the ref property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getRef() {
+            return ref;
+        }
+
+        /**
+         * Sets the value of the ref property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setRef(String value) {
+            this.ref = value;
+        }
+
+
+        /**
+         * <p>Java class for anonymous complex type.
+         * 
+         * <p>The following schema fragment specifies the expected content contained within this class.
+         * 
+         * <pre>
+         * &lt;complexType>
+         *   &lt;complexContent>
+         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       &lt;attribute name="resource" use="required">
+         *         &lt;simpleType>
+         *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+         *             &lt;enumeration value="EMBL-CDS"/>
+         *             &lt;enumeration value="EMBL"/>
+         *           &lt;/restriction>
+         *         &lt;/simpleType>
+         *       &lt;/attribute>
+         *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}int" />
+         *     &lt;/restriction>
+         *   &lt;/complexContent>
+         * &lt;/complexType>
+         * </pre>
+         * 
+         * 
+         */
+        @XmlAccessorType(XmlAccessType.FIELD)
+        @XmlType(name = "")
+        public static class Sequence {
+
+            @XmlAttribute(name = "resource", required = true)
+            protected String resource;
+            @XmlAttribute(name = "id", required = true)
+            protected String id;
+            @XmlAttribute(name = "version")
+            protected Integer version;
+
+            /**
+             * Gets the value of the resource property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getResource() {
+                return resource;
+            }
+
+            /**
+             * Sets the value of the resource property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setResource(String value) {
+                this.resource = value;
+            }
+
+            /**
+             * Gets the value of the id property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link String }
+             *     
+             */
+            public String getId() {
+                return id;
+            }
+
+            /**
+             * Sets the value of the id property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link String }
+             *     
+             */
+            public void setId(String value) {
+                this.id = value;
+            }
+
+            /**
+             * Gets the value of the version property.
+             * 
+             * @return
+             *     possible object is
+             *     {@link Integer }
+             *     
+             */
+            public Integer getVersion() {
+                return version;
+            }
+
+            /**
+             * Sets the value of the version property.
+             * 
+             * @param value
+             *     allowed object is
+             *     {@link Integer }
+             *     
+             */
+            public void setVersion(Integer value) {
+                this.version = value;
+            }
+
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *         &lt;element name="acronym" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "name",
+        "acronym",
+        "description",
+        "dbReference"
+    })
+    public static class Disease {
+
+        @XmlElement(required = true)
+        protected String name;
+        @XmlElement(required = true)
+        protected String acronym;
+        @XmlElement(required = true)
+        protected String description;
+        @XmlElement(required = true)
+        protected DbReferenceType dbReference;
+        @XmlAttribute(name = "id", required = true)
+        protected String id;
+
+        /**
+         * Gets the value of the name property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the value of the name property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setName(String value) {
+            this.name = value;
+        }
+
+        /**
+         * Gets the value of the acronym property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getAcronym() {
+            return acronym;
+        }
+
+        /**
+         * Sets the value of the acronym property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setAcronym(String value) {
+            this.acronym = value;
+        }
+
+        /**
+         * Gets the value of the description property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getDescription() {
+            return description;
+        }
+
+        /**
+         * Sets the value of the description property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setDescription(String value) {
+            this.description = value;
+        }
+
+        /**
+         * Gets the value of the dbReference property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link DbReferenceType }
+         *     
+         */
+        public DbReferenceType getDbReference() {
+            return dbReference;
+        }
+
+        /**
+         * Sets the value of the dbReference property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link DbReferenceType }
+         *     
+         */
+        public void setDbReference(DbReferenceType value) {
+            this.dbReference = value;
+        }
+
+        /**
+         * Gets the value of the id property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getId() {
+            return id;
+        }
+
+        /**
+         * Sets the value of the id property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setId(String value) {
+            this.id = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="KM" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="Vmax" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "km",
+        "vmax",
+        "text"
+    })
+    public static class Kinetics {
+
+        @XmlElement(name = "KM")
+        protected List<EvidencedStringType> km;
+        @XmlElement(name = "Vmax")
+        protected List<EvidencedStringType> vmax;
+        protected List<EvidencedStringType> text;
+
+        /**
+         * Gets the value of the km property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the km property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getKM().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getKM() {
+            if (km == null) {
+                km = new ArrayList<EvidencedStringType>();
+            }
+            return this.km;
+        }
+
+        /**
+         * Gets the value of the vmax property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the vmax property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getVmax().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getVmax() {
+            if (vmax == null) {
+                vmax = new ArrayList<EvidencedStringType>();
+            }
+            return this.vmax;
+        }
+
+        /**
+         * Gets the value of the text property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the text property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getText().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getText() {
+            if (text == null) {
+                text = new ArrayList<EvidencedStringType>();
+            }
+            return this.text;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="uri" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class Link {
+
+        @XmlAttribute(name = "uri", required = true)
+        @XmlSchemaType(name = "anyURI")
+        protected String uri;
+
+        /**
+         * Gets the value of the uri property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getUri() {
+            return uri;
+        }
+
+        /**
+         * Sets the value of the uri property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setUri(String value) {
+            this.uri = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "text"
+    })
+    public static class PhDependence {
+
+        @XmlElement(required = true)
+        protected List<EvidencedStringType> text;
+
+        /**
+         * Gets the value of the text property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the text property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getText().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getText() {
+            if (text == null) {
+                text = new ArrayList<EvidencedStringType>();
+            }
+            return this.text;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "text"
+    })
+    public static class RedoxPotential {
+
+        @XmlElement(required = true)
+        protected List<EvidencedStringType> text;
+
+        /**
+         * Gets the value of the text property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the text property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getText().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getText() {
+            if (text == null) {
+                text = new ArrayList<EvidencedStringType>();
+            }
+            return this.text;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "text"
+    })
+    public static class TemperatureDependence {
+
+        @XmlElement(required = true)
+        protected List<EvidencedStringType> text;
+
+        /**
+         * Gets the value of the text property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the text property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getText().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getText() {
+            if (text == null) {
+                text = new ArrayList<EvidencedStringType>();
+            }
+            return this.text;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/ConsortiumType.java b/src/jalview/xml/binding/uniprot/ConsortiumType.java
new file mode 100644 (file)
index 0000000..c74c1e7
--- /dev/null
@@ -0,0 +1,68 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the authors of a citation when these are represented by a consortium.
+ *             Equivalent to the flat file RG-line.
+ * 
+ * <p>Java class for consortiumType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="consortiumType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "consortiumType")
+public class ConsortiumType {
+
+    @XmlAttribute(name = "name", required = true)
+    protected String name;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/DbReferenceType.java b/src/jalview/xml/binding/uniprot/DbReferenceType.java
new file mode 100644 (file)
index 0000000..184ee40
--- /dev/null
@@ -0,0 +1,192 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes a database cross-reference.
+ *             Equivalent to the flat file DR-line.
+ *             
+ * 
+ * <p>Java class for dbReferenceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="dbReferenceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="molecule" type="{http://uniprot.org/uniprot}moleculeType" minOccurs="0"/>
+ *         &lt;element name="property" type="{http://uniprot.org/uniprot}propertyType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "dbReferenceType", propOrder = {
+    "molecule",
+    "property"
+})
+public class DbReferenceType {
+
+    protected MoleculeType molecule;
+    protected List<PropertyType> property;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "id", required = true)
+    protected String id;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+
+    /**
+     * Gets the value of the molecule property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link MoleculeType }
+     *     
+     */
+    public MoleculeType getMolecule() {
+        return molecule;
+    }
+
+    /**
+     * Sets the value of the molecule property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link MoleculeType }
+     *     
+     */
+    public void setMolecule(MoleculeType value) {
+        this.molecule = value;
+    }
+
+    /**
+     * Gets the value of the property property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the property property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProperty().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link PropertyType }
+     * 
+     * 
+     */
+    public List<PropertyType> getProperty() {
+        if (property == null) {
+            property = new ArrayList<PropertyType>();
+        }
+        return this.property;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/Entry.java b/src/jalview/xml/binding/uniprot/Entry.java
new file mode 100644 (file)
index 0000000..1ca91bc
--- /dev/null
@@ -0,0 +1,625 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="accession" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *         &lt;element name="protein" type="{http://uniprot.org/uniprot}proteinType"/>
+ *         &lt;element name="gene" type="{http://uniprot.org/uniprot}geneType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="organism" type="{http://uniprot.org/uniprot}organismType"/>
+ *         &lt;element name="organismHost" type="{http://uniprot.org/uniprot}organismType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="geneLocation" type="{http://uniprot.org/uniprot}geneLocationType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="reference" type="{http://uniprot.org/uniprot}referenceType" maxOccurs="unbounded"/>
+ *         &lt;element name="comment" type="{http://uniprot.org/uniprot}commentType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="proteinExistence" type="{http://uniprot.org/uniprot}proteinExistenceType"/>
+ *         &lt;element name="keyword" type="{http://uniprot.org/uniprot}keywordType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="feature" type="{http://uniprot.org/uniprot}featureType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="evidence" type="{http://uniprot.org/uniprot}evidenceType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="sequence" type="{http://uniprot.org/uniprot}sequenceType"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="dataset" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="Swiss-Prot"/>
+ *             &lt;enumeration value="TrEMBL"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="created" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="modified" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "accession",
+    "name",
+    "protein",
+    "gene",
+    "organism",
+    "organismHost",
+    "geneLocation",
+    "reference",
+    "comment",
+    "dbReference",
+    "proteinExistence",
+    "keyword",
+    "feature",
+    "evidence",
+    "sequence"
+})
+@XmlRootElement(name = "entry")
+public class Entry {
+
+    @XmlElement(required = true)
+    protected List<String> accession;
+    @XmlElement(required = true)
+    protected List<String> name;
+    @XmlElement(required = true)
+    protected ProteinType protein;
+    protected List<GeneType> gene;
+    @XmlElement(required = true)
+    protected OrganismType organism;
+    protected List<OrganismType> organismHost;
+    protected List<GeneLocationType> geneLocation;
+    @XmlElement(required = true)
+    protected List<ReferenceType> reference;
+    @XmlElement(nillable = true)
+    protected List<CommentType> comment;
+    protected List<DbReferenceType> dbReference;
+    @XmlElement(required = true)
+    protected ProteinExistenceType proteinExistence;
+    protected List<KeywordType> keyword;
+    protected List<FeatureType> feature;
+    protected List<EvidenceType> evidence;
+    @XmlElement(required = true)
+    protected SequenceType sequence;
+    @XmlAttribute(name = "dataset", required = true)
+    protected String dataset;
+    @XmlAttribute(name = "created", required = true)
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar created;
+    @XmlAttribute(name = "modified", required = true)
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar modified;
+    @XmlAttribute(name = "version", required = true)
+    protected int version;
+
+    /**
+     * Gets the value of the accession property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the accession property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAccession().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getAccession() {
+        if (accession == null) {
+            accession = new ArrayList<String>();
+        }
+        return this.accession;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the name property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getName() {
+        if (name == null) {
+            name = new ArrayList<String>();
+        }
+        return this.name;
+    }
+
+    /**
+     * Gets the value of the protein property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link ProteinType }
+     *     
+     */
+    public ProteinType getProtein() {
+        return protein;
+    }
+
+    /**
+     * Sets the value of the protein property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link ProteinType }
+     *     
+     */
+    public void setProtein(ProteinType value) {
+        this.protein = value;
+    }
+
+    /**
+     * Gets the value of the gene property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the gene property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getGene().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link GeneType }
+     * 
+     * 
+     */
+    public List<GeneType> getGene() {
+        if (gene == null) {
+            gene = new ArrayList<GeneType>();
+        }
+        return this.gene;
+    }
+
+    /**
+     * Gets the value of the organism property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link OrganismType }
+     *     
+     */
+    public OrganismType getOrganism() {
+        return organism;
+    }
+
+    /**
+     * Sets the value of the organism property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link OrganismType }
+     *     
+     */
+    public void setOrganism(OrganismType value) {
+        this.organism = value;
+    }
+
+    /**
+     * Gets the value of the organismHost property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the organismHost property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getOrganismHost().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link OrganismType }
+     * 
+     * 
+     */
+    public List<OrganismType> getOrganismHost() {
+        if (organismHost == null) {
+            organismHost = new ArrayList<OrganismType>();
+        }
+        return this.organismHost;
+    }
+
+    /**
+     * Gets the value of the geneLocation property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the geneLocation property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getGeneLocation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link GeneLocationType }
+     * 
+     * 
+     */
+    public List<GeneLocationType> getGeneLocation() {
+        if (geneLocation == null) {
+            geneLocation = new ArrayList<GeneLocationType>();
+        }
+        return this.geneLocation;
+    }
+
+    /**
+     * Gets the value of the reference property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the reference property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getReference().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ReferenceType }
+     * 
+     * 
+     */
+    public List<ReferenceType> getReference() {
+        if (reference == null) {
+            reference = new ArrayList<ReferenceType>();
+        }
+        return this.reference;
+    }
+
+    /**
+     * Gets the value of the comment property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the comment property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getComment().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link CommentType }
+     * 
+     * 
+     */
+    public List<CommentType> getComment() {
+        if (comment == null) {
+            comment = new ArrayList<CommentType>();
+        }
+        return this.comment;
+    }
+
+    /**
+     * Gets the value of the dbReference property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the dbReference property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getDbReference().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link DbReferenceType }
+     * 
+     * 
+     */
+    public List<DbReferenceType> getDbReference() {
+        if (dbReference == null) {
+            dbReference = new ArrayList<DbReferenceType>();
+        }
+        return this.dbReference;
+    }
+
+    /**
+     * Gets the value of the proteinExistence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link ProteinExistenceType }
+     *     
+     */
+    public ProteinExistenceType getProteinExistence() {
+        return proteinExistence;
+    }
+
+    /**
+     * Sets the value of the proteinExistence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link ProteinExistenceType }
+     *     
+     */
+    public void setProteinExistence(ProteinExistenceType value) {
+        this.proteinExistence = value;
+    }
+
+    /**
+     * Gets the value of the keyword property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the keyword property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getKeyword().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link KeywordType }
+     * 
+     * 
+     */
+    public List<KeywordType> getKeyword() {
+        if (keyword == null) {
+            keyword = new ArrayList<KeywordType>();
+        }
+        return this.keyword;
+    }
+
+    /**
+     * Gets the value of the feature property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the feature property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getFeature().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link FeatureType }
+     * 
+     * 
+     */
+    public List<FeatureType> getFeature() {
+        if (feature == null) {
+            feature = new ArrayList<FeatureType>();
+        }
+        return this.feature;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidenceType }
+     * 
+     * 
+     */
+    public List<EvidenceType> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<EvidenceType>();
+        }
+        return this.evidence;
+    }
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link SequenceType }
+     *     
+     */
+    public SequenceType getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link SequenceType }
+     *     
+     */
+    public void setSequence(SequenceType value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the dataset property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDataset() {
+        return dataset;
+    }
+
+    /**
+     * Sets the value of the dataset property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDataset(String value) {
+        this.dataset = value;
+    }
+
+    /**
+     * Gets the value of the created property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getCreated() {
+        return created;
+    }
+
+    /**
+     * Sets the value of the created property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setCreated(XMLGregorianCalendar value) {
+        this.created = value;
+    }
+
+    /**
+     * Gets the value of the modified property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getModified() {
+        return modified;
+    }
+
+    /**
+     * Sets the value of the modified property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setModified(XMLGregorianCalendar value) {
+        this.modified = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     */
+    public int getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     */
+    public void setVersion(int value) {
+        this.version = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/EventType.java b/src/jalview/xml/binding/uniprot/EventType.java
new file mode 100644 (file)
index 0000000..3b5b8a0
--- /dev/null
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the type of events that cause alternative products.
+ * 
+ * <p>Java class for eventType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="eventType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="alternative splicing"/>
+ *             &lt;enumeration value="alternative initiation"/>
+ *             &lt;enumeration value="alternative promoter"/>
+ *             &lt;enumeration value="ribosomal frameshifting"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "eventType")
+public class EventType {
+
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/EvidenceType.java b/src/jalview/xml/binding/uniprot/EvidenceType.java
new file mode 100644 (file)
index 0000000..77a7561
--- /dev/null
@@ -0,0 +1,153 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the evidence for an annotation.
+ *             No flat file equivalent.
+ * 
+ * <p>Java class for evidenceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="evidenceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="source" type="{http://uniprot.org/uniprot}sourceType" minOccurs="0"/>
+ *         &lt;element name="importedFrom" type="{http://uniprot.org/uniprot}importedFromType" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "evidenceType", propOrder = {
+    "source",
+    "importedFrom"
+})
+public class EvidenceType {
+
+    protected SourceType source;
+    protected ImportedFromType importedFrom;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "key", required = true)
+    protected BigInteger key;
+
+    /**
+     * Gets the value of the source property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link SourceType }
+     *     
+     */
+    public SourceType getSource() {
+        return source;
+    }
+
+    /**
+     * Sets the value of the source property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link SourceType }
+     *     
+     */
+    public void setSource(SourceType value) {
+        this.source = value;
+    }
+
+    /**
+     * Gets the value of the importedFrom property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link ImportedFromType }
+     *     
+     */
+    public ImportedFromType getImportedFrom() {
+        return importedFrom;
+    }
+
+    /**
+     * Sets the value of the importedFrom property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link ImportedFromType }
+     *     
+     */
+    public void setImportedFrom(ImportedFromType value) {
+        this.importedFrom = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the key property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getKey() {
+        return key;
+    }
+
+    /**
+     * Sets the value of the key property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setKey(BigInteger value) {
+        this.key = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/EvidencedStringType.java b/src/jalview/xml/binding/uniprot/EvidencedStringType.java
new file mode 100644 (file)
index 0000000..4c1fa7b
--- /dev/null
@@ -0,0 +1,136 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for evidencedStringType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="evidencedStringType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *       &lt;attribute name="status">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="by similarity"/>
+ *             &lt;enumeration value="probable"/>
+ *             &lt;enumeration value="potential"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "evidencedStringType", propOrder = {
+    "value"
+})
+public class EvidencedStringType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+    @XmlAttribute(name = "status")
+    protected String status;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+    /**
+     * Gets the value of the status property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getStatus() {
+        return status;
+    }
+
+    /**
+     * Sets the value of the status property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setStatus(String value) {
+        this.status = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/FeatureType.java b/src/jalview/xml/binding/uniprot/FeatureType.java
new file mode 100644 (file)
index 0000000..0ef367c
--- /dev/null
@@ -0,0 +1,353 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes different types of sequence annotations.
+ *             Equivalent to the flat file FT-line.
+ * 
+ * <p>Java class for featureType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="featureType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="original" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         &lt;element name="variation" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="location" type="{http://uniprot.org/uniprot}locationType"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="active site"/>
+ *             &lt;enumeration value="binding site"/>
+ *             &lt;enumeration value="calcium-binding region"/>
+ *             &lt;enumeration value="chain"/>
+ *             &lt;enumeration value="coiled-coil region"/>
+ *             &lt;enumeration value="compositionally biased region"/>
+ *             &lt;enumeration value="cross-link"/>
+ *             &lt;enumeration value="disulfide bond"/>
+ *             &lt;enumeration value="DNA-binding region"/>
+ *             &lt;enumeration value="domain"/>
+ *             &lt;enumeration value="glycosylation site"/>
+ *             &lt;enumeration value="helix"/>
+ *             &lt;enumeration value="initiator methionine"/>
+ *             &lt;enumeration value="lipid moiety-binding region"/>
+ *             &lt;enumeration value="metal ion-binding site"/>
+ *             &lt;enumeration value="modified residue"/>
+ *             &lt;enumeration value="mutagenesis site"/>
+ *             &lt;enumeration value="non-consecutive residues"/>
+ *             &lt;enumeration value="non-terminal residue"/>
+ *             &lt;enumeration value="nucleotide phosphate-binding region"/>
+ *             &lt;enumeration value="peptide"/>
+ *             &lt;enumeration value="propeptide"/>
+ *             &lt;enumeration value="region of interest"/>
+ *             &lt;enumeration value="repeat"/>
+ *             &lt;enumeration value="non-standard amino acid"/>
+ *             &lt;enumeration value="sequence conflict"/>
+ *             &lt;enumeration value="sequence variant"/>
+ *             &lt;enumeration value="short sequence motif"/>
+ *             &lt;enumeration value="signal peptide"/>
+ *             &lt;enumeration value="site"/>
+ *             &lt;enumeration value="splice variant"/>
+ *             &lt;enumeration value="strand"/>
+ *             &lt;enumeration value="topological domain"/>
+ *             &lt;enumeration value="transit peptide"/>
+ *             &lt;enumeration value="transmembrane region"/>
+ *             &lt;enumeration value="turn"/>
+ *             &lt;enumeration value="unsure residue"/>
+ *             &lt;enumeration value="zinc finger region"/>
+ *             &lt;enumeration value="intramembrane region"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="status">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="by similarity"/>
+ *             &lt;enumeration value="probable"/>
+ *             &lt;enumeration value="potential"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *       &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "featureType", propOrder = {
+    "original",
+    "variation",
+    "location"
+})
+public class FeatureType {
+
+    protected String original;
+    protected List<String> variation;
+    @XmlElement(required = true)
+    protected LocationType location;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "status")
+    protected String status;
+    @XmlAttribute(name = "id")
+    protected String id;
+    @XmlAttribute(name = "description")
+    protected String description;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+    @XmlAttribute(name = "ref")
+    protected String ref;
+
+    /**
+     * Gets the value of the original property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getOriginal() {
+        return original;
+    }
+
+    /**
+     * Sets the value of the original property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setOriginal(String value) {
+        this.original = value;
+    }
+
+    /**
+     * Gets the value of the variation property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the variation property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getVariation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getVariation() {
+        if (variation == null) {
+            variation = new ArrayList<String>();
+        }
+        return this.variation;
+    }
+
+    /**
+     * Gets the value of the location property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link LocationType }
+     *     
+     */
+    public LocationType getLocation() {
+        return location;
+    }
+
+    /**
+     * Sets the value of the location property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link LocationType }
+     *     
+     */
+    public void setLocation(LocationType value) {
+        this.location = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the status property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getStatus() {
+        return status;
+    }
+
+    /**
+     * Sets the value of the status property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setStatus(String value) {
+        this.status = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+    /**
+     * Gets the value of the ref property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getRef() {
+        return ref;
+    }
+
+    /**
+     * Sets the value of the ref property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setRef(String value) {
+        this.ref = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/GeneLocationType.java b/src/jalview/xml/binding/uniprot/GeneLocationType.java
new file mode 100644 (file)
index 0000000..5a2ebcf
--- /dev/null
@@ -0,0 +1,152 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes non-nuclear gene locations (organelles and plasmids).
+ *             Equivalent to the flat file OG-line.
+ * 
+ * <p>Java class for geneLocationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="geneLocationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="name" type="{http://uniprot.org/uniprot}statusType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="apicoplast"/>
+ *             &lt;enumeration value="chloroplast"/>
+ *             &lt;enumeration value="organellar chromatophore"/>
+ *             &lt;enumeration value="cyanelle"/>
+ *             &lt;enumeration value="hydrogenosome"/>
+ *             &lt;enumeration value="mitochondrion"/>
+ *             &lt;enumeration value="non-photosynthetic plastid"/>
+ *             &lt;enumeration value="nucleomorph"/>
+ *             &lt;enumeration value="plasmid"/>
+ *             &lt;enumeration value="plastid"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "geneLocationType", propOrder = {
+    "name"
+})
+public class GeneLocationType {
+
+    protected List<StatusType> name;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the name property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link StatusType }
+     * 
+     * 
+     */
+    public List<StatusType> getName() {
+        if (name == null) {
+            name = new ArrayList<StatusType>();
+        }
+        return this.name;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/GeneNameType.java b/src/jalview/xml/binding/uniprot/GeneNameType.java
new file mode 100644 (file)
index 0000000..1716731
--- /dev/null
@@ -0,0 +1,140 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * Describes different types of gene designations.
+ *             Equivalent to the flat file GN-line.
+ * 
+ * <p>Java class for geneNameType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="geneNameType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="primary"/>
+ *             &lt;enumeration value="synonym"/>
+ *             &lt;enumeration value="ordered locus"/>
+ *             &lt;enumeration value="ORF"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "geneNameType", propOrder = {
+    "value"
+})
+public class GeneNameType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/GeneType.java b/src/jalview/xml/binding/uniprot/GeneType.java
new file mode 100644 (file)
index 0000000..b466644
--- /dev/null
@@ -0,0 +1,79 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes a gene.
+ *             Equivalent to the flat file GN-line.
+ * 
+ * <p>Java class for geneType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="geneType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="name" type="{http://uniprot.org/uniprot}geneNameType" maxOccurs="unbounded"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "geneType", propOrder = {
+    "name"
+})
+public class GeneType {
+
+    @XmlElement(required = true)
+    protected List<GeneNameType> name;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the name property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link GeneNameType }
+     * 
+     * 
+     */
+    public List<GeneNameType> getName() {
+        if (name == null) {
+            name = new ArrayList<GeneNameType>();
+        }
+        return this.name;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/ImportedFromType.java b/src/jalview/xml/binding/uniprot/ImportedFromType.java
new file mode 100644 (file)
index 0000000..92fa6f4
--- /dev/null
@@ -0,0 +1,71 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the source of the evidence, when it is not assigned by UniProt, but imported from an external database.
+ * 
+ * <p>Java class for importedFromType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="importedFromType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "importedFromType", propOrder = {
+    "dbReference"
+})
+public class ImportedFromType {
+
+    @XmlElement(required = true)
+    protected DbReferenceType dbReference;
+
+    /**
+     * Gets the value of the dbReference property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DbReferenceType }
+     *     
+     */
+    public DbReferenceType getDbReference() {
+        return dbReference;
+    }
+
+    /**
+     * Sets the value of the dbReference property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DbReferenceType }
+     *     
+     */
+    public void setDbReference(DbReferenceType value) {
+        this.dbReference = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/InteractantType.java b/src/jalview/xml/binding/uniprot/InteractantType.java
new file mode 100644 (file)
index 0000000..66ba19d
--- /dev/null
@@ -0,0 +1,119 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for interactantType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="interactantType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;group ref="{http://uniprot.org/uniprot}interactantGroup" minOccurs="0"/>
+ *       &lt;attribute name="intactId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "interactantType", propOrder = {
+    "id",
+    "label"
+})
+public class InteractantType {
+
+    protected String id;
+    protected String label;
+    @XmlAttribute(name = "intactId", required = true)
+    protected String intactId;
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the label property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLabel() {
+        return label;
+    }
+
+    /**
+     * Sets the value of the label property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLabel(String value) {
+        this.label = value;
+    }
+
+    /**
+     * Gets the value of the intactId property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getIntactId() {
+        return intactId;
+    }
+
+    /**
+     * Sets the value of the intactId property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setIntactId(String value) {
+        this.intactId = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/IsoformType.java b/src/jalview/xml/binding/uniprot/IsoformType.java
new file mode 100644 (file)
index 0000000..35a085a
--- /dev/null
@@ -0,0 +1,370 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * Describes isoforms in 'alternative products' annotations.
+ * 
+ * <p>Java class for isoformType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="isoformType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *         &lt;element name="name" maxOccurs="unbounded">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                 &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="sequence">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="type" use="required">
+ *                   &lt;simpleType>
+ *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *                       &lt;enumeration value="not described"/>
+ *                       &lt;enumeration value="described"/>
+ *                       &lt;enumeration value="displayed"/>
+ *                       &lt;enumeration value="external"/>
+ *                     &lt;/restriction>
+ *                   &lt;/simpleType>
+ *                 &lt;/attribute>
+ *                 &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="text" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isoformType", propOrder = {
+    "id",
+    "name",
+    "sequence",
+    "text"
+})
+public class IsoformType {
+
+    @XmlElement(required = true)
+    protected List<String> id;
+    @XmlElement(required = true)
+    protected List<IsoformType.Name> name;
+    @XmlElement(required = true)
+    protected IsoformType.Sequence sequence;
+    protected List<EvidencedStringType> text;
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the id property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getId().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getId() {
+        if (id == null) {
+            id = new ArrayList<String>();
+        }
+        return this.id;
+    }
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the name property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link IsoformType.Name }
+     * 
+     * 
+     */
+    public List<IsoformType.Name> getName() {
+        if (name == null) {
+            name = new ArrayList<IsoformType.Name>();
+        }
+        return this.name;
+    }
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link IsoformType.Sequence }
+     *     
+     */
+    public IsoformType.Sequence getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link IsoformType.Sequence }
+     *     
+     */
+    public void setSequence(IsoformType.Sequence value) {
+        this.sequence = value;
+    }
+
+    /**
+     * Gets the value of the text property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the text property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getText().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getText() {
+        if (text == null) {
+            text = new ArrayList<EvidencedStringType>();
+        }
+        return this.text;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Name {
+
+        @XmlValue
+        protected String value;
+        @XmlAttribute(name = "evidence")
+        protected List<Integer> evidence;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the evidence property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the evidence property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEvidence().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getEvidence() {
+            if (evidence == null) {
+                evidence = new ArrayList<Integer>();
+            }
+            return this.evidence;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="type" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+     *             &lt;enumeration value="not described"/>
+     *             &lt;enumeration value="described"/>
+     *             &lt;enumeration value="displayed"/>
+     *             &lt;enumeration value="external"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *       &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class Sequence {
+
+        @XmlAttribute(name = "type", required = true)
+        protected String type;
+        @XmlAttribute(name = "ref")
+        protected String ref;
+
+        /**
+         * Gets the value of the type property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getType() {
+            return type;
+        }
+
+        /**
+         * Sets the value of the type property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setType(String value) {
+            this.type = value;
+        }
+
+        /**
+         * Gets the value of the ref property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getRef() {
+            return ref;
+        }
+
+        /**
+         * Sets the value of the ref property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setRef(String value) {
+            this.ref = value;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/KeywordType.java b/src/jalview/xml/binding/uniprot/KeywordType.java
new file mode 100644 (file)
index 0000000..5b7e0f7
--- /dev/null
@@ -0,0 +1,128 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for keywordType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="keywordType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "keywordType", propOrder = {
+    "value"
+})
+public class KeywordType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+    @XmlAttribute(name = "id", required = true)
+    protected String id;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/LocationType.java b/src/jalview/xml/binding/uniprot/LocationType.java
new file mode 100644 (file)
index 0000000..749871a
--- /dev/null
@@ -0,0 +1,153 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes a sequence location as either a range with a begin and end or as a position. The 'sequence' attribute is only used when the location is not on the canonical sequence displayed in the current entry.
+ * 
+ * <p>Java class for locationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="locationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;choice>
+ *         &lt;sequence>
+ *           &lt;element name="begin" type="{http://uniprot.org/uniprot}positionType"/>
+ *           &lt;element name="end" type="{http://uniprot.org/uniprot}positionType"/>
+ *         &lt;/sequence>
+ *         &lt;element name="position" type="{http://uniprot.org/uniprot}positionType"/>
+ *       &lt;/choice>
+ *       &lt;attribute name="sequence" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "locationType", propOrder = {
+    "begin",
+    "end",
+    "position"
+})
+public class LocationType {
+
+    protected PositionType begin;
+    protected PositionType end;
+    protected PositionType position;
+    @XmlAttribute(name = "sequence")
+    protected String sequence;
+
+    /**
+     * Gets the value of the begin property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link PositionType }
+     *     
+     */
+    public PositionType getBegin() {
+        return begin;
+    }
+
+    /**
+     * Sets the value of the begin property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link PositionType }
+     *     
+     */
+    public void setBegin(PositionType value) {
+        this.begin = value;
+    }
+
+    /**
+     * Gets the value of the end property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link PositionType }
+     *     
+     */
+    public PositionType getEnd() {
+        return end;
+    }
+
+    /**
+     * Sets the value of the end property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link PositionType }
+     *     
+     */
+    public void setEnd(PositionType value) {
+        this.end = value;
+    }
+
+    /**
+     * Gets the value of the position property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link PositionType }
+     *     
+     */
+    public PositionType getPosition() {
+        return position;
+    }
+
+    /**
+     * Sets the value of the position property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link PositionType }
+     *     
+     */
+    public void setPosition(PositionType value) {
+        this.position = value;
+    }
+
+    /**
+     * Gets the value of the sequence property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSequence() {
+        return sequence;
+    }
+
+    /**
+     * Sets the value of the sequence property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSequence(String value) {
+        this.sequence = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/MoleculeType.java b/src/jalview/xml/binding/uniprot/MoleculeType.java
new file mode 100644 (file)
index 0000000..0392a4b
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * Describes a molecule by name or unique identifier.
+ * 
+ * <p>Java class for moleculeType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="moleculeType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "moleculeType", propOrder = {
+    "value"
+})
+public class MoleculeType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "id")
+    protected String id;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/NameListType.java b/src/jalview/xml/binding/uniprot/NameListType.java
new file mode 100644 (file)
index 0000000..70d5e2f
--- /dev/null
@@ -0,0 +1,82 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for nameListType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="nameListType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;choice maxOccurs="unbounded">
+ *         &lt;element name="consortium" type="{http://uniprot.org/uniprot}consortiumType"/>
+ *         &lt;element name="person" type="{http://uniprot.org/uniprot}personType"/>
+ *       &lt;/choice>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "nameListType", propOrder = {
+    "consortiumOrPerson"
+})
+public class NameListType {
+
+    @XmlElements({
+        @XmlElement(name = "consortium", type = ConsortiumType.class),
+        @XmlElement(name = "person", type = PersonType.class)
+    })
+    protected List<Object> consortiumOrPerson;
+
+    /**
+     * Gets the value of the consortiumOrPerson property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the consortiumOrPerson property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getConsortiumOrPerson().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ConsortiumType }
+     * {@link PersonType }
+     * 
+     * 
+     */
+    public List<Object> getConsortiumOrPerson() {
+        if (consortiumOrPerson == null) {
+            consortiumOrPerson = new ArrayList<Object>();
+        }
+        return this.consortiumOrPerson;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/ObjectFactory.java b/src/jalview/xml/binding/uniprot/ObjectFactory.java
new file mode 100644 (file)
index 0000000..20cba73
--- /dev/null
@@ -0,0 +1,492 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the jalview.xml.binding.uniprot package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Copyright_QNAME = new QName("http://uniprot.org/uniprot", "copyright");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: jalview.xml.binding.uniprot
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link SourceDataType }
+     * 
+     */
+    public SourceDataType createSourceDataType() {
+        return new SourceDataType();
+    }
+
+    /**
+     * Create an instance of {@link IsoformType }
+     * 
+     */
+    public IsoformType createIsoformType() {
+        return new IsoformType();
+    }
+
+    /**
+     * Create an instance of {@link CommentType }
+     * 
+     */
+    public CommentType createCommentType() {
+        return new CommentType();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.Conflict }
+     * 
+     */
+    public CommentType.Conflict createCommentTypeConflict() {
+        return new CommentType.Conflict();
+    }
+
+    /**
+     * Create an instance of {@link OrganismType }
+     * 
+     */
+    public OrganismType createOrganismType() {
+        return new OrganismType();
+    }
+
+    /**
+     * Create an instance of {@link ProteinType }
+     * 
+     */
+    public ProteinType createProteinType() {
+        return new ProteinType();
+    }
+
+    /**
+     * Create an instance of {@link Entry }
+     * 
+     */
+    public Entry createEntry() {
+        return new Entry();
+    }
+
+    /**
+     * Create an instance of {@link GeneType }
+     * 
+     */
+    public GeneType createGeneType() {
+        return new GeneType();
+    }
+
+    /**
+     * Create an instance of {@link GeneLocationType }
+     * 
+     */
+    public GeneLocationType createGeneLocationType() {
+        return new GeneLocationType();
+    }
+
+    /**
+     * Create an instance of {@link ReferenceType }
+     * 
+     */
+    public ReferenceType createReferenceType() {
+        return new ReferenceType();
+    }
+
+    /**
+     * Create an instance of {@link DbReferenceType }
+     * 
+     */
+    public DbReferenceType createDbReferenceType() {
+        return new DbReferenceType();
+    }
+
+    /**
+     * Create an instance of {@link ProteinExistenceType }
+     * 
+     */
+    public ProteinExistenceType createProteinExistenceType() {
+        return new ProteinExistenceType();
+    }
+
+    /**
+     * Create an instance of {@link KeywordType }
+     * 
+     */
+    public KeywordType createKeywordType() {
+        return new KeywordType();
+    }
+
+    /**
+     * Create an instance of {@link FeatureType }
+     * 
+     */
+    public FeatureType createFeatureType() {
+        return new FeatureType();
+    }
+
+    /**
+     * Create an instance of {@link EvidenceType }
+     * 
+     */
+    public EvidenceType createEvidenceType() {
+        return new EvidenceType();
+    }
+
+    /**
+     * Create an instance of {@link SequenceType }
+     * 
+     */
+    public SequenceType createSequenceType() {
+        return new SequenceType();
+    }
+
+    /**
+     * Create an instance of {@link Uniprot }
+     * 
+     */
+    public Uniprot createUniprot() {
+        return new Uniprot();
+    }
+
+    /**
+     * Create an instance of {@link StatusType }
+     * 
+     */
+    public StatusType createStatusType() {
+        return new StatusType();
+    }
+
+    /**
+     * Create an instance of {@link PositionType }
+     * 
+     */
+    public PositionType createPositionType() {
+        return new PositionType();
+    }
+
+    /**
+     * Create an instance of {@link ConsortiumType }
+     * 
+     */
+    public ConsortiumType createConsortiumType() {
+        return new ConsortiumType();
+    }
+
+    /**
+     * Create an instance of {@link GeneNameType }
+     * 
+     */
+    public GeneNameType createGeneNameType() {
+        return new GeneNameType();
+    }
+
+    /**
+     * Create an instance of {@link LocationType }
+     * 
+     */
+    public LocationType createLocationType() {
+        return new LocationType();
+    }
+
+    /**
+     * Create an instance of {@link CitationType }
+     * 
+     */
+    public CitationType createCitationType() {
+        return new CitationType();
+    }
+
+    /**
+     * Create an instance of {@link PropertyType }
+     * 
+     */
+    public PropertyType createPropertyType() {
+        return new PropertyType();
+    }
+
+    /**
+     * Create an instance of {@link CofactorType }
+     * 
+     */
+    public CofactorType createCofactorType() {
+        return new CofactorType();
+    }
+
+    /**
+     * Create an instance of {@link EvidencedStringType }
+     * 
+     */
+    public EvidencedStringType createEvidencedStringType() {
+        return new EvidencedStringType();
+    }
+
+    /**
+     * Create an instance of {@link PersonType }
+     * 
+     */
+    public PersonType createPersonType() {
+        return new PersonType();
+    }
+
+    /**
+     * Create an instance of {@link ImportedFromType }
+     * 
+     */
+    public ImportedFromType createImportedFromType() {
+        return new ImportedFromType();
+    }
+
+    /**
+     * Create an instance of {@link EventType }
+     * 
+     */
+    public EventType createEventType() {
+        return new EventType();
+    }
+
+    /**
+     * Create an instance of {@link InteractantType }
+     * 
+     */
+    public InteractantType createInteractantType() {
+        return new InteractantType();
+    }
+
+    /**
+     * Create an instance of {@link NameListType }
+     * 
+     */
+    public NameListType createNameListType() {
+        return new NameListType();
+    }
+
+    /**
+     * Create an instance of {@link SourceType }
+     * 
+     */
+    public SourceType createSourceType() {
+        return new SourceType();
+    }
+
+    /**
+     * Create an instance of {@link MoleculeType }
+     * 
+     */
+    public MoleculeType createMoleculeType() {
+        return new MoleculeType();
+    }
+
+    /**
+     * Create an instance of {@link OrganismNameType }
+     * 
+     */
+    public OrganismNameType createOrganismNameType() {
+        return new OrganismNameType();
+    }
+
+    /**
+     * Create an instance of {@link SubcellularLocationType }
+     * 
+     */
+    public SubcellularLocationType createSubcellularLocationType() {
+        return new SubcellularLocationType();
+    }
+
+    /**
+     * Create an instance of {@link SourceDataType.Strain }
+     * 
+     */
+    public SourceDataType.Strain createSourceDataTypeStrain() {
+        return new SourceDataType.Strain();
+    }
+
+    /**
+     * Create an instance of {@link SourceDataType.Plasmid }
+     * 
+     */
+    public SourceDataType.Plasmid createSourceDataTypePlasmid() {
+        return new SourceDataType.Plasmid();
+    }
+
+    /**
+     * Create an instance of {@link SourceDataType.Transposon }
+     * 
+     */
+    public SourceDataType.Transposon createSourceDataTypeTransposon() {
+        return new SourceDataType.Transposon();
+    }
+
+    /**
+     * Create an instance of {@link SourceDataType.Tissue }
+     * 
+     */
+    public SourceDataType.Tissue createSourceDataTypeTissue() {
+        return new SourceDataType.Tissue();
+    }
+
+    /**
+     * Create an instance of {@link IsoformType.Name }
+     * 
+     */
+    public IsoformType.Name createIsoformTypeName() {
+        return new IsoformType.Name();
+    }
+
+    /**
+     * Create an instance of {@link IsoformType.Sequence }
+     * 
+     */
+    public IsoformType.Sequence createIsoformTypeSequence() {
+        return new IsoformType.Sequence();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.Absorption }
+     * 
+     */
+    public CommentType.Absorption createCommentTypeAbsorption() {
+        return new CommentType.Absorption();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.Kinetics }
+     * 
+     */
+    public CommentType.Kinetics createCommentTypeKinetics() {
+        return new CommentType.Kinetics();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.PhDependence }
+     * 
+     */
+    public CommentType.PhDependence createCommentTypePhDependence() {
+        return new CommentType.PhDependence();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.RedoxPotential }
+     * 
+     */
+    public CommentType.RedoxPotential createCommentTypeRedoxPotential() {
+        return new CommentType.RedoxPotential();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.TemperatureDependence }
+     * 
+     */
+    public CommentType.TemperatureDependence createCommentTypeTemperatureDependence() {
+        return new CommentType.TemperatureDependence();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.Link }
+     * 
+     */
+    public CommentType.Link createCommentTypeLink() {
+        return new CommentType.Link();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.Disease }
+     * 
+     */
+    public CommentType.Disease createCommentTypeDisease() {
+        return new CommentType.Disease();
+    }
+
+    /**
+     * Create an instance of {@link CommentType.Conflict.Sequence }
+     * 
+     */
+    public CommentType.Conflict.Sequence createCommentTypeConflictSequence() {
+        return new CommentType.Conflict.Sequence();
+    }
+
+    /**
+     * Create an instance of {@link OrganismType.Lineage }
+     * 
+     */
+    public OrganismType.Lineage createOrganismTypeLineage() {
+        return new OrganismType.Lineage();
+    }
+
+    /**
+     * Create an instance of {@link ProteinType.RecommendedName }
+     * 
+     */
+    public ProteinType.RecommendedName createProteinTypeRecommendedName() {
+        return new ProteinType.RecommendedName();
+    }
+
+    /**
+     * Create an instance of {@link ProteinType.AlternativeName }
+     * 
+     */
+    public ProteinType.AlternativeName createProteinTypeAlternativeName() {
+        return new ProteinType.AlternativeName();
+    }
+
+    /**
+     * Create an instance of {@link ProteinType.SubmittedName }
+     * 
+     */
+    public ProteinType.SubmittedName createProteinTypeSubmittedName() {
+        return new ProteinType.SubmittedName();
+    }
+
+    /**
+     * Create an instance of {@link ProteinType.Domain }
+     * 
+     */
+    public ProteinType.Domain createProteinTypeDomain() {
+        return new ProteinType.Domain();
+    }
+
+    /**
+     * Create an instance of {@link ProteinType.Component }
+     * 
+     */
+    public ProteinType.Component createProteinTypeComponent() {
+        return new ProteinType.Component();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://uniprot.org/uniprot", name = "copyright")
+    public JAXBElement<String> createCopyright(String value) {
+        return new JAXBElement<String>(_Copyright_QNAME, String.class, null, value);
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/OrganismNameType.java b/src/jalview/xml/binding/uniprot/OrganismNameType.java
new file mode 100644 (file)
index 0000000..a658e36
--- /dev/null
@@ -0,0 +1,106 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * Describes different types of source organism names.
+ * 
+ * <p>Java class for organismNameType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="organismNameType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="common"/>
+ *             &lt;enumeration value="full"/>
+ *             &lt;enumeration value="scientific"/>
+ *             &lt;enumeration value="synonym"/>
+ *             &lt;enumeration value="abbreviation"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "organismNameType", propOrder = {
+    "value"
+})
+public class OrganismNameType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/OrganismType.java b/src/jalview/xml/binding/uniprot/OrganismType.java
new file mode 100644 (file)
index 0000000..feabacd
--- /dev/null
@@ -0,0 +1,241 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the source organism.
+ * 
+ * <p>Java class for organismType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="organismType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="name" type="{http://uniprot.org/uniprot}organismNameType" maxOccurs="unbounded"/>
+ *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType" maxOccurs="unbounded"/>
+ *         &lt;element name="lineage" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="taxon" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "organismType", propOrder = {
+    "name",
+    "dbReference",
+    "lineage"
+})
+public class OrganismType {
+
+    @XmlElement(required = true)
+    protected List<OrganismNameType> name;
+    @XmlElement(required = true)
+    protected List<DbReferenceType> dbReference;
+    protected OrganismType.Lineage lineage;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the name property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link OrganismNameType }
+     * 
+     * 
+     */
+    public List<OrganismNameType> getName() {
+        if (name == null) {
+            name = new ArrayList<OrganismNameType>();
+        }
+        return this.name;
+    }
+
+    /**
+     * Gets the value of the dbReference property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the dbReference property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getDbReference().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link DbReferenceType }
+     * 
+     * 
+     */
+    public List<DbReferenceType> getDbReference() {
+        if (dbReference == null) {
+            dbReference = new ArrayList<DbReferenceType>();
+        }
+        return this.dbReference;
+    }
+
+    /**
+     * Gets the value of the lineage property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link OrganismType.Lineage }
+     *     
+     */
+    public OrganismType.Lineage getLineage() {
+        return lineage;
+    }
+
+    /**
+     * Sets the value of the lineage property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link OrganismType.Lineage }
+     *     
+     */
+    public void setLineage(OrganismType.Lineage value) {
+        this.lineage = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="taxon" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "taxon"
+    })
+    public static class Lineage {
+
+        @XmlElement(required = true)
+        protected List<String> taxon;
+
+        /**
+         * Gets the value of the taxon property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the taxon property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getTaxon().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link String }
+         * 
+         * 
+         */
+        public List<String> getTaxon() {
+            if (taxon == null) {
+                taxon = new ArrayList<String>();
+            }
+            return this.taxon;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/PersonType.java b/src/jalview/xml/binding/uniprot/PersonType.java
new file mode 100644 (file)
index 0000000..2a3e8bd
--- /dev/null
@@ -0,0 +1,65 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for personType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="personType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "personType")
+public class PersonType {
+
+    @XmlAttribute(name = "name", required = true)
+    protected String name;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/PositionType.java b/src/jalview/xml/binding/uniprot/PositionType.java
new file mode 100644 (file)
index 0000000..92d8906
--- /dev/null
@@ -0,0 +1,143 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for positionType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="positionType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="position" type="{http://www.w3.org/2001/XMLSchema}unsignedLong" />
+ *       &lt;attribute name="status" default="certain">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="certain"/>
+ *             &lt;enumeration value="uncertain"/>
+ *             &lt;enumeration value="less than"/>
+ *             &lt;enumeration value="greater than"/>
+ *             &lt;enumeration value="unknown"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "positionType")
+public class PositionType {
+
+    @XmlAttribute(name = "position")
+    @XmlSchemaType(name = "unsignedLong")
+    protected BigInteger position;
+    @XmlAttribute(name = "status")
+    protected String status;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+
+    /**
+     * Gets the value of the position property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getPosition() {
+        return position;
+    }
+
+    /**
+     * Sets the value of the position property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setPosition(BigInteger value) {
+        this.position = value;
+    }
+
+    /**
+     * Gets the value of the status property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getStatus() {
+        if (status == null) {
+            return "certain";
+        } else {
+            return status;
+        }
+    }
+
+    /**
+     * Sets the value of the status property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setStatus(String value) {
+        this.status = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/PropertyType.java b/src/jalview/xml/binding/uniprot/PropertyType.java
new file mode 100644 (file)
index 0000000..a9299f4
--- /dev/null
@@ -0,0 +1,92 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for propertyType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="propertyType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "propertyType")
+public class PropertyType {
+
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+    @XmlAttribute(name = "value", required = true)
+    protected String value;
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/ProteinExistenceType.java b/src/jalview/xml/binding/uniprot/ProteinExistenceType.java
new file mode 100644 (file)
index 0000000..315f62d
--- /dev/null
@@ -0,0 +1,78 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the evidence for the protein's existence.
+ *             Equivalent to the flat file PE-line.
+ * 
+ * <p>Java class for proteinExistenceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="proteinExistenceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="type" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="evidence at protein level"/>
+ *             &lt;enumeration value="evidence at transcript level"/>
+ *             &lt;enumeration value="inferred from homology"/>
+ *             &lt;enumeration value="predicted"/>
+ *             &lt;enumeration value="uncertain"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "proteinExistenceType")
+public class ProteinExistenceType {
+
+    @XmlAttribute(name = "type", required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/ProteinType.java b/src/jalview/xml/binding/uniprot/ProteinType.java
new file mode 100644 (file)
index 0000000..dd5a8be
--- /dev/null
@@ -0,0 +1,1109 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the names for the protein and parts thereof.
+ *             Equivalent to the flat file DE-line.
+ * 
+ * <p>Java class for proteinType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="proteinType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;group ref="{http://uniprot.org/uniprot}proteinNameGroup"/>
+ *         &lt;element name="domain" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;group ref="{http://uniprot.org/uniprot}proteinNameGroup"/>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="component" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;group ref="{http://uniprot.org/uniprot}proteinNameGroup"/>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "proteinType", propOrder = {
+    "recommendedName",
+    "alternativeName",
+    "submittedName",
+    "allergenName",
+    "biotechName",
+    "cdAntigenName",
+    "innName",
+    "domain",
+    "component"
+})
+public class ProteinType {
+
+    protected ProteinType.RecommendedName recommendedName;
+    protected List<ProteinType.AlternativeName> alternativeName;
+    protected List<ProteinType.SubmittedName> submittedName;
+    protected EvidencedStringType allergenName;
+    protected EvidencedStringType biotechName;
+    protected List<EvidencedStringType> cdAntigenName;
+    protected List<EvidencedStringType> innName;
+    protected List<ProteinType.Domain> domain;
+    protected List<ProteinType.Component> component;
+
+    /**
+     * Gets the value of the recommendedName property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link ProteinType.RecommendedName }
+     *     
+     */
+    public ProteinType.RecommendedName getRecommendedName() {
+        return recommendedName;
+    }
+
+    /**
+     * Sets the value of the recommendedName property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link ProteinType.RecommendedName }
+     *     
+     */
+    public void setRecommendedName(ProteinType.RecommendedName value) {
+        this.recommendedName = value;
+    }
+
+    /**
+     * Gets the value of the alternativeName property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the alternativeName property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAlternativeName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ProteinType.AlternativeName }
+     * 
+     * 
+     */
+    public List<ProteinType.AlternativeName> getAlternativeName() {
+        if (alternativeName == null) {
+            alternativeName = new ArrayList<ProteinType.AlternativeName>();
+        }
+        return this.alternativeName;
+    }
+
+    /**
+     * Gets the value of the submittedName property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the submittedName property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getSubmittedName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ProteinType.SubmittedName }
+     * 
+     * 
+     */
+    public List<ProteinType.SubmittedName> getSubmittedName() {
+        if (submittedName == null) {
+            submittedName = new ArrayList<ProteinType.SubmittedName>();
+        }
+        return this.submittedName;
+    }
+
+    /**
+     * Gets the value of the allergenName property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EvidencedStringType }
+     *     
+     */
+    public EvidencedStringType getAllergenName() {
+        return allergenName;
+    }
+
+    /**
+     * Sets the value of the allergenName property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EvidencedStringType }
+     *     
+     */
+    public void setAllergenName(EvidencedStringType value) {
+        this.allergenName = value;
+    }
+
+    /**
+     * Gets the value of the biotechName property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link EvidencedStringType }
+     *     
+     */
+    public EvidencedStringType getBiotechName() {
+        return biotechName;
+    }
+
+    /**
+     * Sets the value of the biotechName property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link EvidencedStringType }
+     *     
+     */
+    public void setBiotechName(EvidencedStringType value) {
+        this.biotechName = value;
+    }
+
+    /**
+     * Gets the value of the cdAntigenName property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the cdAntigenName property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getCdAntigenName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getCdAntigenName() {
+        if (cdAntigenName == null) {
+            cdAntigenName = new ArrayList<EvidencedStringType>();
+        }
+        return this.cdAntigenName;
+    }
+
+    /**
+     * Gets the value of the innName property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the innName property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getInnName().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getInnName() {
+        if (innName == null) {
+            innName = new ArrayList<EvidencedStringType>();
+        }
+        return this.innName;
+    }
+
+    /**
+     * Gets the value of the domain property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the domain property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getDomain().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ProteinType.Domain }
+     * 
+     * 
+     */
+    public List<ProteinType.Domain> getDomain() {
+        if (domain == null) {
+            domain = new ArrayList<ProteinType.Domain>();
+        }
+        return this.domain;
+    }
+
+    /**
+     * Gets the value of the component property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the component property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getComponent().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ProteinType.Component }
+     * 
+     * 
+     */
+    public List<ProteinType.Component> getComponent() {
+        if (component == null) {
+            component = new ArrayList<ProteinType.Component>();
+        }
+        return this.component;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="fullName" type="{http://uniprot.org/uniprot}evidencedStringType" minOccurs="0"/>
+     *         &lt;element name="shortName" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="ecNumber" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "fullName",
+        "shortName",
+        "ecNumber"
+    })
+    public static class AlternativeName {
+
+        protected EvidencedStringType fullName;
+        protected List<EvidencedStringType> shortName;
+        protected List<EvidencedStringType> ecNumber;
+
+        /**
+         * Gets the value of the fullName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getFullName() {
+            return fullName;
+        }
+
+        /**
+         * Sets the value of the fullName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setFullName(EvidencedStringType value) {
+            this.fullName = value;
+        }
+
+        /**
+         * Gets the value of the shortName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the shortName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getShortName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getShortName() {
+            if (shortName == null) {
+                shortName = new ArrayList<EvidencedStringType>();
+            }
+            return this.shortName;
+        }
+
+        /**
+         * Gets the value of the ecNumber property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the ecNumber property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEcNumber().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getEcNumber() {
+            if (ecNumber == null) {
+                ecNumber = new ArrayList<EvidencedStringType>();
+            }
+            return this.ecNumber;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;group ref="{http://uniprot.org/uniprot}proteinNameGroup"/>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "recommendedName",
+        "alternativeName",
+        "submittedName",
+        "allergenName",
+        "biotechName",
+        "cdAntigenName",
+        "innName"
+    })
+    public static class Component {
+
+        protected ProteinType.RecommendedName recommendedName;
+        protected List<ProteinType.AlternativeName> alternativeName;
+        protected List<ProteinType.SubmittedName> submittedName;
+        protected EvidencedStringType allergenName;
+        protected EvidencedStringType biotechName;
+        protected List<EvidencedStringType> cdAntigenName;
+        protected List<EvidencedStringType> innName;
+
+        /**
+         * Gets the value of the recommendedName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link ProteinType.RecommendedName }
+         *     
+         */
+        public ProteinType.RecommendedName getRecommendedName() {
+            return recommendedName;
+        }
+
+        /**
+         * Sets the value of the recommendedName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link ProteinType.RecommendedName }
+         *     
+         */
+        public void setRecommendedName(ProteinType.RecommendedName value) {
+            this.recommendedName = value;
+        }
+
+        /**
+         * Gets the value of the alternativeName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the alternativeName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getAlternativeName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link ProteinType.AlternativeName }
+         * 
+         * 
+         */
+        public List<ProteinType.AlternativeName> getAlternativeName() {
+            if (alternativeName == null) {
+                alternativeName = new ArrayList<ProteinType.AlternativeName>();
+            }
+            return this.alternativeName;
+        }
+
+        /**
+         * Gets the value of the submittedName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the submittedName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getSubmittedName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link ProteinType.SubmittedName }
+         * 
+         * 
+         */
+        public List<ProteinType.SubmittedName> getSubmittedName() {
+            if (submittedName == null) {
+                submittedName = new ArrayList<ProteinType.SubmittedName>();
+            }
+            return this.submittedName;
+        }
+
+        /**
+         * Gets the value of the allergenName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getAllergenName() {
+            return allergenName;
+        }
+
+        /**
+         * Sets the value of the allergenName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setAllergenName(EvidencedStringType value) {
+            this.allergenName = value;
+        }
+
+        /**
+         * Gets the value of the biotechName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getBiotechName() {
+            return biotechName;
+        }
+
+        /**
+         * Sets the value of the biotechName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setBiotechName(EvidencedStringType value) {
+            this.biotechName = value;
+        }
+
+        /**
+         * Gets the value of the cdAntigenName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the cdAntigenName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getCdAntigenName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getCdAntigenName() {
+            if (cdAntigenName == null) {
+                cdAntigenName = new ArrayList<EvidencedStringType>();
+            }
+            return this.cdAntigenName;
+        }
+
+        /**
+         * Gets the value of the innName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the innName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getInnName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getInnName() {
+            if (innName == null) {
+                innName = new ArrayList<EvidencedStringType>();
+            }
+            return this.innName;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;group ref="{http://uniprot.org/uniprot}proteinNameGroup"/>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "recommendedName",
+        "alternativeName",
+        "submittedName",
+        "allergenName",
+        "biotechName",
+        "cdAntigenName",
+        "innName"
+    })
+    public static class Domain {
+
+        protected ProteinType.RecommendedName recommendedName;
+        protected List<ProteinType.AlternativeName> alternativeName;
+        protected List<ProteinType.SubmittedName> submittedName;
+        protected EvidencedStringType allergenName;
+        protected EvidencedStringType biotechName;
+        protected List<EvidencedStringType> cdAntigenName;
+        protected List<EvidencedStringType> innName;
+
+        /**
+         * Gets the value of the recommendedName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link ProteinType.RecommendedName }
+         *     
+         */
+        public ProteinType.RecommendedName getRecommendedName() {
+            return recommendedName;
+        }
+
+        /**
+         * Sets the value of the recommendedName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link ProteinType.RecommendedName }
+         *     
+         */
+        public void setRecommendedName(ProteinType.RecommendedName value) {
+            this.recommendedName = value;
+        }
+
+        /**
+         * Gets the value of the alternativeName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the alternativeName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getAlternativeName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link ProteinType.AlternativeName }
+         * 
+         * 
+         */
+        public List<ProteinType.AlternativeName> getAlternativeName() {
+            if (alternativeName == null) {
+                alternativeName = new ArrayList<ProteinType.AlternativeName>();
+            }
+            return this.alternativeName;
+        }
+
+        /**
+         * Gets the value of the submittedName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the submittedName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getSubmittedName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link ProteinType.SubmittedName }
+         * 
+         * 
+         */
+        public List<ProteinType.SubmittedName> getSubmittedName() {
+            if (submittedName == null) {
+                submittedName = new ArrayList<ProteinType.SubmittedName>();
+            }
+            return this.submittedName;
+        }
+
+        /**
+         * Gets the value of the allergenName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getAllergenName() {
+            return allergenName;
+        }
+
+        /**
+         * Sets the value of the allergenName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setAllergenName(EvidencedStringType value) {
+            this.allergenName = value;
+        }
+
+        /**
+         * Gets the value of the biotechName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getBiotechName() {
+            return biotechName;
+        }
+
+        /**
+         * Sets the value of the biotechName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setBiotechName(EvidencedStringType value) {
+            this.biotechName = value;
+        }
+
+        /**
+         * Gets the value of the cdAntigenName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the cdAntigenName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getCdAntigenName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getCdAntigenName() {
+            if (cdAntigenName == null) {
+                cdAntigenName = new ArrayList<EvidencedStringType>();
+            }
+            return this.cdAntigenName;
+        }
+
+        /**
+         * Gets the value of the innName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the innName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getInnName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getInnName() {
+            if (innName == null) {
+                innName = new ArrayList<EvidencedStringType>();
+            }
+            return this.innName;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="fullName" type="{http://uniprot.org/uniprot}evidencedStringType"/>
+     *         &lt;element name="shortName" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *         &lt;element name="ecNumber" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "fullName",
+        "shortName",
+        "ecNumber"
+    })
+    public static class RecommendedName {
+
+        @XmlElement(required = true)
+        protected EvidencedStringType fullName;
+        protected List<EvidencedStringType> shortName;
+        protected List<EvidencedStringType> ecNumber;
+
+        /**
+         * Gets the value of the fullName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getFullName() {
+            return fullName;
+        }
+
+        /**
+         * Sets the value of the fullName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setFullName(EvidencedStringType value) {
+            this.fullName = value;
+        }
+
+        /**
+         * Gets the value of the shortName property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the shortName property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getShortName().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getShortName() {
+            if (shortName == null) {
+                shortName = new ArrayList<EvidencedStringType>();
+            }
+            return this.shortName;
+        }
+
+        /**
+         * Gets the value of the ecNumber property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the ecNumber property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEcNumber().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getEcNumber() {
+            if (ecNumber == null) {
+                ecNumber = new ArrayList<EvidencedStringType>();
+            }
+            return this.ecNumber;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="fullName" type="{http://uniprot.org/uniprot}evidencedStringType"/>
+     *         &lt;element name="ecNumber" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "fullName",
+        "ecNumber"
+    })
+    public static class SubmittedName {
+
+        @XmlElement(required = true)
+        protected EvidencedStringType fullName;
+        protected List<EvidencedStringType> ecNumber;
+
+        /**
+         * Gets the value of the fullName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public EvidencedStringType getFullName() {
+            return fullName;
+        }
+
+        /**
+         * Sets the value of the fullName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link EvidencedStringType }
+         *     
+         */
+        public void setFullName(EvidencedStringType value) {
+            this.fullName = value;
+        }
+
+        /**
+         * Gets the value of the ecNumber property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the ecNumber property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEcNumber().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link EvidencedStringType }
+         * 
+         * 
+         */
+        public List<EvidencedStringType> getEcNumber() {
+            if (ecNumber == null) {
+                ecNumber = new ArrayList<EvidencedStringType>();
+            }
+            return this.ecNumber;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/ReferenceType.java b/src/jalview/xml/binding/uniprot/ReferenceType.java
new file mode 100644 (file)
index 0000000..33e6251
--- /dev/null
@@ -0,0 +1,193 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes a citation and a summary of its content.
+ *             Equivalent to the flat file RN-, RP-, RC-, RX-, RG-, RA-, RT- and RL-lines.
+ * 
+ * <p>Java class for referenceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="referenceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="citation" type="{http://uniprot.org/uniprot}citationType"/>
+ *         &lt;group ref="{http://uniprot.org/uniprot}sptrCitationGroup"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *       &lt;attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "referenceType", propOrder = {
+    "citation",
+    "scope",
+    "source"
+})
+public class ReferenceType {
+
+    @XmlElement(required = true)
+    protected CitationType citation;
+    @XmlElement(required = true)
+    protected List<String> scope;
+    protected SourceDataType source;
+    @XmlAttribute(name = "evidence")
+    protected List<Integer> evidence;
+    @XmlAttribute(name = "key", required = true)
+    protected String key;
+
+    /**
+     * Gets the value of the citation property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CitationType }
+     *     
+     */
+    public CitationType getCitation() {
+        return citation;
+    }
+
+    /**
+     * Sets the value of the citation property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CitationType }
+     *     
+     */
+    public void setCitation(CitationType value) {
+        this.citation = value;
+    }
+
+    /**
+     * Gets the value of the scope property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the scope property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getScope().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getScope() {
+        if (scope == null) {
+            scope = new ArrayList<String>();
+        }
+        return this.scope;
+    }
+
+    /**
+     * Gets the value of the source property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link SourceDataType }
+     *     
+     */
+    public SourceDataType getSource() {
+        return source;
+    }
+
+    /**
+     * Sets the value of the source property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link SourceDataType }
+     *     
+     */
+    public void setSource(SourceDataType value) {
+        this.source = value;
+    }
+
+    /**
+     * Gets the value of the evidence property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the evidence property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEvidence().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Integer }
+     * 
+     * 
+     */
+    public List<Integer> getEvidence() {
+        if (evidence == null) {
+            evidence = new ArrayList<Integer>();
+        }
+        return this.evidence;
+    }
+
+    /**
+     * Gets the value of the key property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getKey() {
+        return key;
+    }
+
+    /**
+     * Sets the value of the key property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setKey(String value) {
+        this.key = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/SequenceType.java b/src/jalview/xml/binding/uniprot/SequenceType.java
new file mode 100644 (file)
index 0000000..f0b110b
--- /dev/null
@@ -0,0 +1,242 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for sequenceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="sequenceType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="mass" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="checksum" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="modified" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       &lt;attribute name="precursor" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       &lt;attribute name="fragment">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="single"/>
+ *             &lt;enumeration value="multiple"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sequenceType", propOrder = {
+    "value"
+})
+public class SequenceType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "length", required = true)
+    protected int length;
+    @XmlAttribute(name = "mass", required = true)
+    protected int mass;
+    @XmlAttribute(name = "checksum", required = true)
+    protected String checksum;
+    @XmlAttribute(name = "modified", required = true)
+    @XmlSchemaType(name = "date")
+    protected XMLGregorianCalendar modified;
+    @XmlAttribute(name = "version", required = true)
+    protected int version;
+    @XmlAttribute(name = "precursor")
+    protected Boolean precursor;
+    @XmlAttribute(name = "fragment")
+    protected String fragment;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the length property.
+     * 
+     */
+    public int getLength() {
+        return length;
+    }
+
+    /**
+     * Sets the value of the length property.
+     * 
+     */
+    public void setLength(int value) {
+        this.length = value;
+    }
+
+    /**
+     * Gets the value of the mass property.
+     * 
+     */
+    public int getMass() {
+        return mass;
+    }
+
+    /**
+     * Sets the value of the mass property.
+     * 
+     */
+    public void setMass(int value) {
+        this.mass = value;
+    }
+
+    /**
+     * Gets the value of the checksum property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getChecksum() {
+        return checksum;
+    }
+
+    /**
+     * Sets the value of the checksum property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setChecksum(String value) {
+        this.checksum = value;
+    }
+
+    /**
+     * Gets the value of the modified property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public XMLGregorianCalendar getModified() {
+        return modified;
+    }
+
+    /**
+     * Sets the value of the modified property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link XMLGregorianCalendar }
+     *     
+     */
+    public void setModified(XMLGregorianCalendar value) {
+        this.modified = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     */
+    public int getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     */
+    public void setVersion(int value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the precursor property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public Boolean isPrecursor() {
+        return precursor;
+    }
+
+    /**
+     * Sets the value of the precursor property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setPrecursor(Boolean value) {
+        this.precursor = value;
+    }
+
+    /**
+     * Gets the value of the fragment property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFragment() {
+        return fragment;
+    }
+
+    /**
+     * Sets the value of the fragment property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFragment(String value) {
+        this.fragment = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/SourceDataType.java b/src/jalview/xml/binding/uniprot/SourceDataType.java
new file mode 100644 (file)
index 0000000..03cace3
--- /dev/null
@@ -0,0 +1,461 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * Describes the source of the sequence according to the citation.
+ *             Equivalent to the flat file RC-line.
+ * 
+ * <p>Java class for sourceDataType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="sourceDataType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;choice maxOccurs="unbounded">
+ *         &lt;element name="strain">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                 &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="plasmid">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                 &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="transposon">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                 &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="tissue">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *                 &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/choice>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sourceDataType", propOrder = {
+    "strainOrPlasmidOrTransposon"
+})
+public class SourceDataType {
+
+    @XmlElements({
+        @XmlElement(name = "strain", type = SourceDataType.Strain.class),
+        @XmlElement(name = "plasmid", type = SourceDataType.Plasmid.class),
+        @XmlElement(name = "transposon", type = SourceDataType.Transposon.class),
+        @XmlElement(name = "tissue", type = SourceDataType.Tissue.class)
+    })
+    protected List<Object> strainOrPlasmidOrTransposon;
+
+    /**
+     * Gets the value of the strainOrPlasmidOrTransposon property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the strainOrPlasmidOrTransposon property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getStrainOrPlasmidOrTransposon().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link SourceDataType.Strain }
+     * {@link SourceDataType.Plasmid }
+     * {@link SourceDataType.Transposon }
+     * {@link SourceDataType.Tissue }
+     * 
+     * 
+     */
+    public List<Object> getStrainOrPlasmidOrTransposon() {
+        if (strainOrPlasmidOrTransposon == null) {
+            strainOrPlasmidOrTransposon = new ArrayList<Object>();
+        }
+        return this.strainOrPlasmidOrTransposon;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Plasmid {
+
+        @XmlValue
+        protected String value;
+        @XmlAttribute(name = "evidence")
+        protected List<Integer> evidence;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the evidence property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the evidence property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEvidence().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getEvidence() {
+            if (evidence == null) {
+                evidence = new ArrayList<Integer>();
+            }
+            return this.evidence;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Strain {
+
+        @XmlValue
+        protected String value;
+        @XmlAttribute(name = "evidence")
+        protected List<Integer> evidence;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the evidence property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the evidence property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEvidence().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getEvidence() {
+            if (evidence == null) {
+                evidence = new ArrayList<Integer>();
+            }
+            return this.evidence;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Tissue {
+
+        @XmlValue
+        protected String value;
+        @XmlAttribute(name = "evidence")
+        protected List<Integer> evidence;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the evidence property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the evidence property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEvidence().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getEvidence() {
+            if (evidence == null) {
+                evidence = new ArrayList<Integer>();
+            }
+            return this.evidence;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+     *       &lt;attribute name="evidence" type="{http://uniprot.org/uniprot}intListType" />
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Transposon {
+
+        @XmlValue
+        protected String value;
+        @XmlAttribute(name = "evidence")
+        protected List<Integer> evidence;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the evidence property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the evidence property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getEvidence().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Integer }
+         * 
+         * 
+         */
+        public List<Integer> getEvidence() {
+            if (evidence == null) {
+                evidence = new ArrayList<Integer>();
+            }
+            return this.evidence;
+        }
+
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/SourceType.java b/src/jalview/xml/binding/uniprot/SourceType.java
new file mode 100644 (file)
index 0000000..44edbba
--- /dev/null
@@ -0,0 +1,98 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the source of the data using a database cross-reference (or a 'ref' attribute when the source cannot be found in a public data source, such as PubMed, and is cited only within the UniProtKB entry).
+ * 
+ * <p>Java class for sourceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="sourceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="dbReference" type="{http://uniprot.org/uniprot}dbReferenceType" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sourceType", propOrder = {
+    "dbReference"
+})
+public class SourceType {
+
+    protected DbReferenceType dbReference;
+    @XmlAttribute(name = "ref")
+    protected BigInteger ref;
+
+    /**
+     * Gets the value of the dbReference property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DbReferenceType }
+     *     
+     */
+    public DbReferenceType getDbReference() {
+        return dbReference;
+    }
+
+    /**
+     * Sets the value of the dbReference property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DbReferenceType }
+     *     
+     */
+    public void setDbReference(DbReferenceType value) {
+        this.dbReference = value;
+    }
+
+    /**
+     * Gets the value of the ref property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BigInteger }
+     *     
+     */
+    public BigInteger getRef() {
+        return ref;
+    }
+
+    /**
+     * Sets the value of the ref property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BigInteger }
+     *     
+     */
+    public void setRef(BigInteger value) {
+        this.ref = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/StatusType.java b/src/jalview/xml/binding/uniprot/StatusType.java
new file mode 100644 (file)
index 0000000..29fb34e
--- /dev/null
@@ -0,0 +1,107 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * Indicates whether the name of a plasmid is known or unknown.
+ * 
+ * <p>Java class for statusType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="statusType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="status" default="known">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             &lt;enumeration value="known"/>
+ *             &lt;enumeration value="unknown"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "statusType", propOrder = {
+    "value"
+})
+public class StatusType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(name = "status")
+    protected String status;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the status property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getStatus() {
+        if (status == null) {
+            return "known";
+        } else {
+            return status;
+        }
+    }
+
+    /**
+     * Sets the value of the status property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setStatus(String value) {
+        this.status = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/SubcellularLocationType.java b/src/jalview/xml/binding/uniprot/SubcellularLocationType.java
new file mode 100644 (file)
index 0000000..29848d7
--- /dev/null
@@ -0,0 +1,142 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Describes the subcellular location and optionally the topology and orientation of a molecule.
+ * 
+ * <p>Java class for subcellularLocationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="subcellularLocationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="location" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded"/>
+ *         &lt;element name="topology" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="orientation" type="{http://uniprot.org/uniprot}evidencedStringType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "subcellularLocationType", propOrder = {
+    "location",
+    "topology",
+    "orientation"
+})
+public class SubcellularLocationType {
+
+    @XmlElement(required = true)
+    protected List<EvidencedStringType> location;
+    protected List<EvidencedStringType> topology;
+    protected List<EvidencedStringType> orientation;
+
+    /**
+     * Gets the value of the location property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the location property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getLocation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getLocation() {
+        if (location == null) {
+            location = new ArrayList<EvidencedStringType>();
+        }
+        return this.location;
+    }
+
+    /**
+     * Gets the value of the topology property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the topology property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getTopology().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getTopology() {
+        if (topology == null) {
+            topology = new ArrayList<EvidencedStringType>();
+        }
+        return this.topology;
+    }
+
+    /**
+     * Gets the value of the orientation property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the orientation property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getOrientation().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link EvidencedStringType }
+     * 
+     * 
+     */
+    public List<EvidencedStringType> getOrientation() {
+        if (orientation == null) {
+            orientation = new ArrayList<EvidencedStringType>();
+        }
+        return this.orientation;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/Uniprot.java b/src/jalview/xml/binding/uniprot/Uniprot.java
new file mode 100644 (file)
index 0000000..4e2cdb0
--- /dev/null
@@ -0,0 +1,105 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+
+package jalview.xml.binding.uniprot;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element ref="{http://uniprot.org/uniprot}entry" maxOccurs="unbounded"/>
+ *         &lt;element ref="{http://uniprot.org/uniprot}copyright" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "entry",
+    "copyright"
+})
+@XmlRootElement(name = "uniprot")
+public class Uniprot {
+
+    @XmlElement(required = true)
+    protected List<Entry> entry;
+    protected String copyright;
+
+    /**
+     * Gets the value of the entry property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the entry property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getEntry().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Entry }
+     * 
+     * 
+     */
+    public List<Entry> getEntry() {
+        if (entry == null) {
+            entry = new ArrayList<Entry>();
+        }
+        return this.entry;
+    }
+
+    /**
+     * Gets the value of the copyright property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCopyright() {
+        return copyright;
+    }
+
+    /**
+     * Sets the value of the copyright property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCopyright(String value) {
+        this.copyright = value;
+    }
+
+}
diff --git a/src/jalview/xml/binding/uniprot/package-info.java b/src/jalview/xml/binding/uniprot/package-info.java
new file mode 100644 (file)
index 0000000..9741acc
--- /dev/null
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2018.09.13 at 10:18:53 AM BST 
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://uniprot.org/uniprot", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package jalview.xml.binding.uniprot;
diff --git a/src/org/stackoverflowusers/file/WindowsShortcut.java b/src/org/stackoverflowusers/file/WindowsShortcut.java
new file mode 100644 (file)
index 0000000..671e002
--- /dev/null
@@ -0,0 +1,215 @@
+package org.stackoverflowusers.file;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+
+/**
+ * Represents a Windows shortcut (typically visible to Java only as a '.lnk' file).
+ *
+ * Retrieved 2011-09-23 from http://stackoverflow.com/questions/309495/windows-shortcut-lnk-parser-in-java/672775#672775
+ * Originally called LnkParser
+ *
+ * Written by: (the stack overflow users, obviously!)
+ *   Apache Commons VFS dependency removed by crysxd (why were we using that!?) https://github.com/crysxd
+ *   Headerified, refactored and commented by Code Bling http://stackoverflow.com/users/675721/code-bling
+ *   Network file support added by Stefan Cordes http://stackoverflow.com/users/81330/stefan-cordes
+ *   Adapted by Sam Brightman http://stackoverflow.com/users/2492/sam-brightman
+ *   Based on information in 'The Windows Shortcut File Format' by Jesse Hager &lt;jessehager@iname.com&gt;
+ *   And somewhat based on code from the book 'Swing Hacks: Tips and Tools for Killer GUIs'
+ *     by Joshua Marinacci and Chris Adamson
+ *     ISBN: 0-596-00907-0
+ *     http://www.oreilly.com/catalog/swinghks/
+ */
+public class WindowsShortcut
+{
+    private boolean isDirectory;
+    private boolean isLocal;
+    private String real_file;
+
+    /**
+     * Provides a quick test to see if this could be a valid link !
+     * If you try to instantiate a new WindowShortcut and the link is not valid,
+     * Exceptions may be thrown and Exceptions are extremely slow to generate,
+     * therefore any code needing to loop through several files should first check this.
+     *
+     * @param file the potential link
+     * @return true if may be a link, false otherwise
+     * @throws IOException if an IOException is thrown while reading from the file
+     */
+    public static boolean isPotentialValidLink(File file) throws IOException {
+        final int minimum_length = 0x64;
+        InputStream fis = new FileInputStream(file);
+        boolean isPotentiallyValid = false;
+        try {
+            isPotentiallyValid = file.isFile()
+                && file.getName().toLowerCase().endsWith(".lnk")
+                && fis.available() >= minimum_length
+                && isMagicPresent(getBytes(fis, 32));
+        } finally {
+            fis.close();
+        }
+        return isPotentiallyValid;
+    }
+
+    public WindowsShortcut(File file) throws IOException, ParseException {
+        InputStream in = new FileInputStream(file);
+        try {
+            parseLink(getBytes(in));
+        } finally {
+            in.close();
+        }
+    }
+
+    /**
+     * @return the name of the filesystem object pointed to by this shortcut
+     */
+    public String getRealFilename() {
+        return real_file;
+    }
+
+    /**
+     * Tests if the shortcut points to a local resource.
+     * @return true if the 'local' bit is set in this shortcut, false otherwise
+     */
+    public boolean isLocal() {
+        return isLocal;
+    }
+
+    /**
+     * Tests if the shortcut points to a directory.
+     * @return true if the 'directory' bit is set in this shortcut, false otherwise
+     */
+    public boolean isDirectory() {
+        return isDirectory;
+    }
+
+    /**
+     * Gets all the bytes from an InputStream
+     * @param in the InputStream from which to read bytes
+     * @return array of all the bytes contained in 'in'
+     * @throws IOException if an IOException is encountered while reading the data from the InputStream
+     */
+    private static byte[] getBytes(InputStream in) throws IOException {
+        return getBytes(in, null);
+    }
+    
+    /**
+     * Gets up to max bytes from an InputStream
+     * @param in the InputStream from which to read bytes
+     * @param max maximum number of bytes to read
+     * @return array of all the bytes contained in 'in'
+     * @throws IOException if an IOException is encountered while reading the data from the InputStream
+     */
+    private static byte[] getBytes(InputStream in, Integer max) throws IOException {
+        // read the entire file into a byte buffer
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        byte[] buff = new byte[256];
+        while (max == null || max > 0) {
+            int n = in.read(buff);
+            if (n == -1) {
+                break;
+            }
+            bout.write(buff, 0, n);
+            if (max != null)
+                max -= n;
+        }
+        in.close();
+        return bout.toByteArray();
+    }
+
+    private static boolean isMagicPresent(byte[] link) {
+        final int magic = 0x0000004C;
+        final int magic_offset = 0x00;
+        return link.length >= 32 && bytesToDword(link, magic_offset) == magic;
+    }
+
+    /**
+     * Gobbles up link data by parsing it and storing info in member fields
+     * @param link all the bytes from the .lnk file
+     */
+    private void parseLink(byte[] link) throws ParseException {
+        try {
+            if (!isMagicPresent(link))
+                throw new ParseException("Invalid shortcut; magic is missing", 0);
+
+            // get the flags byte
+            byte flags = link[0x14];
+
+            // get the file attributes byte
+            final int file_atts_offset = 0x18;
+            byte file_atts = link[file_atts_offset];
+            byte is_dir_mask = (byte)0x10;
+            if ((file_atts & is_dir_mask) > 0) {
+                isDirectory = true;
+            } else {
+                isDirectory = false;
+            }
+
+            // if the shell settings are present, skip them
+            final int shell_offset = 0x4c;
+            final byte has_shell_mask = (byte)0x01;
+            int shell_len = 0;
+            if ((flags & has_shell_mask) > 0) {
+                // the plus 2 accounts for the length marker itself
+                shell_len = bytesToWord(link, shell_offset) + 2;
+            }
+
+            // get to the file settings
+            int file_start = 0x4c + shell_len;
+
+            final int file_location_info_flag_offset_offset = 0x08;
+            int file_location_info_flag = link[file_start + file_location_info_flag_offset_offset];
+            isLocal = (file_location_info_flag & 2) == 0;
+            // get the local volume and local system values
+            //final int localVolumeTable_offset_offset = 0x0C;
+            final int basename_offset_offset = 0x10;
+            final int networkVolumeTable_offset_offset = 0x14;
+            final int finalname_offset_offset = 0x18;
+            int finalname_offset = link[file_start + finalname_offset_offset] + file_start;
+            String finalname = getNullDelimitedString(link, finalname_offset);
+            if (isLocal) {
+                int basename_offset = link[file_start + basename_offset_offset] + file_start;
+                String basename = getNullDelimitedString(link, basename_offset);
+                real_file = basename + finalname;
+            } else {
+                int networkVolumeTable_offset = link[file_start + networkVolumeTable_offset_offset] + file_start;
+                int shareName_offset_offset = 0x08;
+                int shareName_offset = link[networkVolumeTable_offset + shareName_offset_offset]
+                    + networkVolumeTable_offset;
+                String shareName = getNullDelimitedString(link, shareName_offset);
+                real_file = shareName + "\\" + finalname;
+            }
+        } catch (ArrayIndexOutOfBoundsException e) {
+            throw new ParseException("Could not be parsed, probably not a valid WindowsShortcut", 0);
+        }
+    }
+
+    private static String getNullDelimitedString(byte[] bytes, int off) {
+        int len = 0;
+        // count bytes until the null character (0)
+        while (true) {
+            if (bytes[off + len] == 0) {
+                break;
+            }
+            len++;
+        }
+        return new String(bytes, off, len);
+    }
+
+    /*
+     * convert two bytes into a short note, this is little endian because it's
+     * for an Intel only OS.
+     */
+    private static int bytesToWord(byte[] bytes, int off) {
+        return ((bytes[off + 1] & 0xff) << 8) | (bytes[off] & 0xff);
+    }
+
+    private static int bytesToDword(byte[] bytes, int off) {
+        return (bytesToWord(bytes, off + 2) << 16) | bytesToWord(bytes, off);
+    }
+
+}
index defcdbc..533c0af 100644 (file)
@@ -91,7 +91,7 @@ public class PDBChainTest
     a3.resName = "ASP";
     a3.resNumber = 41;
 
-    Vector<Bond> v = new Vector<Bond>();
+    Vector<Bond> v = new Vector<>();
     v.add(new Bond(a1, a2));
     v.add(new Bond(a2, a3));
     v.add(new Bond(a3, a1));
@@ -234,7 +234,7 @@ public class PDBChainTest
   @Test(groups = { "Functional" })
   public void testMakeResidueList_noAnnotation()
   {
-    Vector<Atom> atoms = new Vector<Atom>();
+    Vector<Atom> atoms = new Vector<>();
     c.atoms = atoms;
     c.isNa = true;
     atoms.add(makeAtom(4, "N", "MET"));
@@ -292,7 +292,7 @@ public class PDBChainTest
   @Test(groups = { "Functional" })
   public void testMakeResidueList_withTempFactor()
   {
-    Vector<Atom> atoms = new Vector<Atom>();
+    Vector<Atom> atoms = new Vector<>();
     c.atoms = atoms;
     atoms.add(makeAtom(4, "N", "MET"));
     atoms.get(atoms.size() - 1).tfactor = 1f;
@@ -307,7 +307,7 @@ public class PDBChainTest
     atoms.add(makeAtom(5, "CA", "LYS"));
     atoms.get(atoms.size() - 1).tfactor = 9f;
     atoms.add(makeAtom(6, "O", "LEU"));
-    atoms.get(atoms.size() - 1).tfactor = 4f;
+    atoms.get(atoms.size() - 1).tfactor = -4f;
     atoms.add(makeAtom(6, "N", "LEU"));
     atoms.get(atoms.size() - 1).tfactor = 5f;
     atoms.add(makeAtom(6, "CA", "LEU"));
@@ -320,7 +320,7 @@ public class PDBChainTest
 
     /*
      * Verify annotations; note the tempFactor is read from the first atom in
-     * each residue i.e. we expect values 1, 7, 4 for the residues
+     * each residue i.e. we expect values 1, 7, -4 for the residues
      */
     AlignmentAnnotation[] ann = c.sequence.getAnnotation();
     assertEquals(1, ann.length);
@@ -328,12 +328,12 @@ public class PDBChainTest
     assertEquals("Temperature Factor for 1gaqA", ann[0].description);
     assertSame(c.sequence, ann[0].sequenceRef);
     assertEquals(AlignmentAnnotation.LINE_GRAPH, ann[0].graph);
-    assertEquals(0f, ann[0].graphMin, 0.001f);
+    assertEquals(-4f, ann[0].graphMin, 0.001f);
     assertEquals(7f, ann[0].graphMax, 0.001f);
     assertEquals(3, ann[0].annotations.length);
     assertEquals(1f, ann[0].annotations[0].value, 0.001f);
     assertEquals(7f, ann[0].annotations[1].value, 0.001f);
-    assertEquals(4f, ann[0].annotations[2].value, 0.001f);
+    assertEquals(-4f, ann[0].annotations[2].value, 0.001f);
   }
 
   /**
@@ -344,7 +344,7 @@ public class PDBChainTest
   public void testMakeCaBondList()
   {
     c.isNa = true;
-    Vector<Atom> atoms = new Vector<Atom>();
+    Vector<Atom> atoms = new Vector<>();
     c.atoms = atoms;
     atoms.add(makeAtom(4, "N", "MET"));
     atoms.add(makeAtom(4, "CA", "MET"));
@@ -375,7 +375,7 @@ public class PDBChainTest
   public void testMakeCaBondList_nucleotide()
   {
     c.isNa = false;
-    Vector<Atom> atoms = new Vector<Atom>();
+    Vector<Atom> atoms = new Vector<>();
     c.atoms = atoms;
     atoms.add(makeAtom(4, "N", "G"));
     atoms.add(makeAtom(4, "P", "G"));
@@ -406,7 +406,7 @@ public class PDBChainTest
   @Test(groups = { "Functional" })
   public void testMakeExactMapping()
   {
-    Vector<Atom> atoms = new Vector<Atom>();
+    Vector<Atom> atoms = new Vector<>();
     c.atoms = atoms;
     atoms.add(makeAtom(4, "N", "MET"));
     atoms.add(makeAtom(4, "CA", "MET"));
index 92bf0ce..a7a7d34 100644 (file)
@@ -2685,14 +2685,14 @@ public class AlignmentUtilsTests
     assertEquals(2, toMap.getFromRanges().get(0).length);
     assertEquals(1, toMap.getFromRanges().get(0)[0]);
     assertEquals(12, toMap.getFromRanges().get(0)[1]);
-    assertEquals(1, toMap.getToRanges().size());
-    assertEquals(4, toMap.getToRanges().get(0).length);
+    assertEquals(2, toMap.getToRanges().size());
+    assertEquals(2, toMap.getToRanges().get(0).length);
     assertEquals(158, toMap.getToRanges().get(0)[0]);
     assertEquals(164, toMap.getToRanges().get(0)[1]);
-    assertEquals(210, toMap.getToRanges().get(0)[2]);
-    assertEquals(214, toMap.getToRanges().get(0)[3]);
+    assertEquals(210, toMap.getToRanges().get(1)[0]);
+    assertEquals(214, toMap.getToRanges().get(1)[1]);
     // or summarised as (but toString might change in future):
-    assertEquals("[ [1, 12] ] 1:1 to [ [158, 164, 210, 214] ]",
+    assertEquals("[ [1, 12] ] 1:1 to [ [158, 164] [210, 214] ]",
             toMap.toString());
 
     /*
@@ -2704,7 +2704,7 @@ public class AlignmentUtilsTests
     assertEquals("GRCh38", toLoci.getAssemblyId());
     assertEquals("7", toLoci.getChromosomeId());
     toMap = toLoci.getMap();
-    assertEquals("[ [1, 12] ] 1:1 to [ [158, 164, 210, 214] ]",
+    assertEquals("[ [1, 12] ] 1:1 to [ [158, 164] [210, 214] ]",
             toMap.toString());
   }
 
index 0265af3..b3c78be 100644 (file)
@@ -427,7 +427,7 @@ public class CrossRefTest
      * argument false suppresses adding DAS sources
      * todo: define an interface type SequenceFetcherI and mock that
      */
-    SequenceFetcher mockFetcher = new SequenceFetcher(false)
+    SequenceFetcher mockFetcher = new SequenceFetcher()
     {
       @Override
       public boolean isFetchable(String source)
@@ -505,7 +505,7 @@ public class CrossRefTest
      * argument false suppresses adding DAS sources
      * todo: define an interface type SequenceFetcherI and mock that
      */
-    SequenceFetcher mockFetcher = new SequenceFetcher(false)
+    SequenceFetcher mockFetcher = new SequenceFetcher()
     {
       @Override
       public boolean isFetchable(String source)
@@ -651,7 +651,7 @@ public class CrossRefTest
      * passed in calls to getSequences() - important to verify that
      * duplicate sequence fetches are not requested
      */
-    SequenceFetcher mockFetcher = new SequenceFetcher(false)
+    SequenceFetcher mockFetcher = new SequenceFetcher()
     {
       int call = 0;
 
index 69a3ef7..3ac8656 100644 (file)
@@ -35,6 +35,9 @@ import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+import io.github.classgraph.ClassGraph;
+import io.github.classgraph.ScanResult;
+
 public class CommandLineOperations
 {
 
@@ -45,7 +48,7 @@ public class CommandLineOperations
     JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
   }
 
-  private static final int TEST_TIMEOUT = 4500; // Note longer timeout needed on
+  private static final int TEST_TIMEOUT = 9000; // Note longer timeout needed on
                                                 // full test run than on
                                                 // individual tests
 
@@ -55,7 +58,7 @@ public class CommandLineOperations
 
   private static final int MINFILESIZE_BIG = 4096;
 
-  private ArrayList<String> successfulCMDs = new ArrayList<String>();
+  private ArrayList<String> successfulCMDs = new ArrayList<>();
 
   /***
    * from
@@ -113,13 +116,39 @@ public class CommandLineOperations
     }
   }
 
+  private static ClassGraph scanner = null;
+
+  private static String classpath = null;
+
+  public synchronized static String getClassPath()
+  {
+    if (scanner == null)
+    {
+      scanner = new ClassGraph();
+      ScanResult scan = scanner.scan();
+      classpath = scan.getClasspath();
+    }
+    while (classpath == null)
+    {
+      try
+      {
+        Thread.sleep(10);
+      } catch (InterruptedException x)
+      {
+
+      }
+    }
+    return classpath;
+  }
   private Worker jalviewDesktopRunner(boolean withAwt, String cmd,
           int timeout)
   {
+    // Note: JAL-3065 - don't include quotes for lib/* because the arguments are
+    // not expanded by the shell
+    String classpath = getClassPath();
     String _cmd = "java "
             + (withAwt ? "-Djava.awt.headless=true" : "")
-            + " -Djava.ext.dirs=./lib -classpath ./classes jalview.bin.Jalview ";
-    System.out.println("CMD [" + cmd + "]");
+            + " -classpath " + classpath + " jalview.bin.Jalview ";
     Process ls2_proc = null;
     Worker worker = null;
     try
index 5a14514..79bb2bb 100644 (file)
@@ -247,7 +247,9 @@ public class SequenceTest
     sq.sequenceChanged();
     assertEquals(6, sq.findIndex(9));
 
-    sq = new Sequence("test/8-13", "-A--B-C-D-E-F--");
+    final String aligned = "-A--B-C-D-E-F--";
+    assertEquals(15, aligned.length());
+    sq = new Sequence("test/8-13", aligned);
     assertEquals(2, sq.findIndex(8));
     sq.sequenceChanged();
     assertEquals(5, sq.findIndex(9));
@@ -263,6 +265,29 @@ public class SequenceTest
     // beyond end returns last residue column
     sq.sequenceChanged();
     assertEquals(13, sq.findIndex(99));
+
+    /*
+     * residue before sequence 'end' but beyond end of sequence returns 
+     * length of sequence (last column) (rightly or wrongly!)
+     */
+    sq = new Sequence("test/8-15", "A-B-C-"); // trailing gap case
+    assertEquals(6, sq.getLength());
+    sq.sequenceChanged();
+    assertEquals(sq.getLength(), sq.findIndex(14));
+    sq = new Sequence("test/8-99", "-A--B-C-D"); // trailing residue case
+    sq.sequenceChanged();
+    assertEquals(sq.getLength(), sq.findIndex(65));
+
+    /*
+     * residue after sequence 'start' but before first residue returns 
+     * zero (before first column) (rightly or wrongly!)
+     */
+    sq = new Sequence("test/8-15", "-A-B-C-"); // leading gap case
+    sq.sequenceChanged();
+    assertEquals(0, sq.findIndex(3));
+    sq = new Sequence("test/8-15", "A-B-C-"); // leading residue case
+    sq.sequenceChanged();
+    assertEquals(0, sq.findIndex(2));
   }
 
   /**
@@ -1402,14 +1427,61 @@ public class SequenceTest
   {
     Sequence sq = new Sequence("test/8-13", "-A--BCD-EF--");
 
-    // find F given A
+    // find F given A, check cursor is now at the found position
     assertEquals(10, sq.findIndex(13, new SequenceCursor(sq, 8, 2, 0)));
+    SequenceCursor cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertEquals(13, cursor.residuePosition);
+    assertEquals(10, cursor.columnPosition);
 
     // find A given F
     assertEquals(2, sq.findIndex(8, new SequenceCursor(sq, 13, 10, 0)));
+    cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertEquals(8, cursor.residuePosition);
+    assertEquals(2, cursor.columnPosition);
 
-    // find C given C
+    // find C given C (no cursor update is done for this case)
     assertEquals(6, sq.findIndex(10, new SequenceCursor(sq, 10, 6, 0)));
+    SequenceCursor cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertSame(cursor2, cursor);
+
+    /*
+     * sequence 'end' beyond end of sequence returns length of sequence 
+     *  (for compatibility with pre-cursor code)
+     *  - also verify the cursor is left in a valid state
+     */
+    sq = new Sequence("test/8-99", "-A--B-C-D-E-F--"); // trailing gap case
+    assertEquals(7, sq.findIndex(10)); // establishes a cursor
+    cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertEquals(10, cursor.residuePosition);
+    assertEquals(7, cursor.columnPosition);
+    assertEquals(sq.getLength(), sq.findIndex(65));
+    cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertSame(cursor, cursor2); // not updated for this case!
+
+    sq = new Sequence("test/8-99", "-A--B-C-D-E-F"); // trailing residue case
+    sq.findIndex(10); // establishes a cursor
+    cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertEquals(sq.getLength(), sq.findIndex(65));
+    cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertSame(cursor, cursor2); // not updated for this case!
+
+    /*
+     * residue after sequence 'start' but before first residue should return 
+     * zero (for compatibility with pre-cursor code)
+     */
+    sq = new Sequence("test/8-15", "-A-B-C-"); // leading gap case
+    sq.findIndex(10); // establishes a cursor
+    cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertEquals(0, sq.findIndex(3));
+    cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertSame(cursor, cursor2); // not updated for this case!
+
+    sq = new Sequence("test/8-15", "A-B-C-"); // leading residue case
+    sq.findIndex(10); // establishes a cursor
+    cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertEquals(0, sq.findIndex(2));
+    cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+    assertSame(cursor, cursor2); // not updated for this case!
   }
 
   @Test(groups = { "Functional" })
index e47c787..0846ec2 100644 (file)
@@ -23,7 +23,7 @@ public class FeatureAttributesTest
   /**
    * clear down attributes map before tests
    */
-  @BeforeClass
+  @BeforeClass(alwaysRun = true)
   public void setUp()
   {
     FeatureAttributes fa = FeatureAttributes.getInstance();
@@ -33,7 +33,7 @@ public class FeatureAttributesTest
   /**
    * clear down attributes map after tests
    */
-  @AfterMethod
+  @AfterMethod(alwaysRun = true)
   public void tearDown()
   {
     FeatureAttributes fa = FeatureAttributes.getInstance();
@@ -76,12 +76,14 @@ public class FeatureAttributesTest
     assertNull(fa.getMinMax("Pfam", "kd"));
     sf.setValue("domain", "xyz");
     assertNull(fa.getMinMax("Pfam", "kd"));
-    sf.setValue("kd", "some text");
-    assertNull(fa.getMinMax("Pfam", "kd"));
     sf.setValue("kd", "1.3");
     assertEquals(fa.getMinMax("Pfam", "kd"), new float[] { 1.3f, 1.3f });
     sf.setValue("kd", "-2.6");
     assertEquals(fa.getMinMax("Pfam", "kd"), new float[] { -2.6f, 1.3f });
+    // setting 'mixed' character and numeric values wipes the min/max value
+    sf.setValue("kd", "some text");
+    assertNull(fa.getMinMax("Pfam", "kd"));
+
     Map<String, String> csq = new HashMap<>();
     csq.put("AF", "-3");
     sf.setValue("CSQ", csq);
index 39d6dce..32987b0 100644 (file)
@@ -13,10 +13,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import junit.extensions.PA;
-
 import org.testng.annotations.Test;
 
+import junit.extensions.PA;
+
 public class SequenceFeaturesTest
 {
   @Test(groups = "Functional")
@@ -1005,33 +1005,44 @@ public class SequenceFeaturesTest
     assertTrue(store.getFeaturesByOntology(new String[] {}).isEmpty());
     assertTrue(store.getFeaturesByOntology((String[]) null).isEmpty());
   
-    SequenceFeature sf1 = new SequenceFeature("transcript", "desc", 10, 20,
+    SequenceFeature transcriptFeature = new SequenceFeature("transcript", "desc", 10, 20,
             Float.NaN, null);
-    store.add(sf1);
+    store.add(transcriptFeature);
 
-    // mRNA isA transcript; added here 'as if' non-positional
-    // just to show that non-positional features are included in results
-    SequenceFeature sf2 = new SequenceFeature("mRNA", "desc", 0, 0,
+    /*
+     * mRNA is a sub-type of transcript; added here 'as if' non-positional
+     * just to show that non-positional features are included in results
+     */
+    SequenceFeature mrnaFeature = new SequenceFeature("mRNA", "desc", 0, 0,
             Float.NaN, null);
-    store.add(sf2);
+    store.add(mrnaFeature);
 
-    SequenceFeature sf3 = new SequenceFeature("Pfam", "desc", 30, 40,
+    SequenceFeature pfamFeature = new SequenceFeature("Pfam", "desc", 30, 40,
             Float.NaN, null);
-    store.add(sf3);
+    store.add(pfamFeature);
 
+    /*
+     * "transcript" matches both itself and the sub-term "mRNA"
+     */
     features = store.getFeaturesByOntology("transcript");
     assertEquals(features.size(), 2);
-    assertTrue(features.contains(sf1));
-    assertTrue(features.contains(sf2));
+    assertTrue(features.contains(transcriptFeature));
+    assertTrue(features.contains(mrnaFeature));
 
+    /*
+     * "mRNA" matches itself but not parent term "transcript"
+     */
     features = store.getFeaturesByOntology("mRNA");
     assertEquals(features.size(), 1);
-    assertTrue(features.contains(sf2));
+    assertTrue(features.contains(mrnaFeature));
 
+    /*
+     * "pfam" is not an SO term but is included as an exact match
+     */
     features = store.getFeaturesByOntology("mRNA", "Pfam");
     assertEquals(features.size(), 2);
-    assertTrue(features.contains(sf2));
-    assertTrue(features.contains(sf3));
+    assertTrue(features.contains(mrnaFeature));
+    assertTrue(features.contains(pfamFeature));
 
     features = store.getFeaturesByOntology("sequence_variant");
     assertTrue(features.isEmpty());
@@ -1040,7 +1051,7 @@ public class SequenceFeaturesTest
   @Test(groups = "Functional")
   public void testSortFeatures()
   {
-    List<SequenceFeature> sfs = new ArrayList<SequenceFeature>();
+    List<SequenceFeature> sfs = new ArrayList<>();
     SequenceFeature sf1 = new SequenceFeature("Pfam", "desc", 30, 80,
             Float.NaN, null);
     sfs.add(sf1);
diff --git a/test/jalview/datamodel/xdb/embl/EmblEntryTest.java b/test/jalview/datamodel/xdb/embl/EmblEntryTest.java
deleted file mode 100644 (file)
index 4672574..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertSame;
-
-import jalview.analysis.SequenceIdMatcher;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.SequenceI;
-import jalview.gui.JvOptionPane;
-import jalview.util.MapList;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class EmblEntryTest
-{
-
-  @BeforeClass(alwaysRun = true)
-  public void setUpJvOptionPane()
-  {
-    JvOptionPane.setInteractiveMode(false);
-    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
-  }
-
-  @Test(groups = "Functional")
-  public void testGetCdsRanges()
-  {
-    EmblEntry testee = new EmblEntry();
-
-    /*
-     * Make a (CDS) Feature with 5 locations
-     */
-    EmblFeature cds = new EmblFeature();
-    cds.setLocation("join(10..20,complement(30..40),50..60,70..80,complement(110..120))");
-
-    int[] exons = testee.getCdsRanges(cds);
-    assertEquals("[10, 20, 40, 30, 50, 60, 70, 80, 120, 110]",
-            Arrays.toString(exons));
-  }
-
-  @Test(groups = "Functional")
-  public void testParseCodingFeature()
-  {
-    // not the whole sequence but enough for this test...
-    List<SequenceI> peptides = new ArrayList<SequenceI>();
-    SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
-    EmblFile ef = EmblTestHelper.getEmblFile();
-    assertEquals(1, ef.getEntries().size());
-    EmblEntry testee = ef.getEntries().get(0);
-    String sourceDb = "EMBL";
-    SequenceI dna = testee.makeSequence(sourceDb);
-
-    /*
-     * parse three CDS features, with two/one/no Uniprot cross-refs
-     */
-    for (EmblFeature feature : ef.getEntries().get(0).getFeatures())
-    {
-      if ("CDS".equals(feature.getName()))
-      {
-        testee.parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
-      }
-    }
-
-    /*
-     * peptides should now have five entries:
-     * EMBL product and two Uniprot accessions for the first CDS / translation
-     * EMBL product and one Uniprot accession for the second CDS / "
-     * EMBL product only for the third
-     */
-    assertEquals(6, peptides.size());
-    assertEquals("CAA30420.1", peptides.get(0).getName());
-    assertEquals("MLCF", peptides.get(0).getSequenceAsString());
-    assertEquals("UNIPROT|B0BCM4", peptides.get(1).getName());
-    assertEquals("MLCF", peptides.get(1).getSequenceAsString());
-    assertEquals("UNIPROT|P0CE20", peptides.get(2).getName());
-    assertEquals("MLCF", peptides.get(2).getSequenceAsString());
-    assertEquals("CAA30421.1", peptides.get(3).getName());
-    assertEquals("MSSS", peptides.get(3).getSequenceAsString());
-    assertEquals("UNIPROT|B0BCM3", peptides.get(4).getName());
-    assertEquals("MSSS", peptides.get(4).getSequenceAsString());
-    assertEquals("CAA12345.6", peptides.get(5).getName());
-    assertEquals("MSS", peptides.get(5).getSequenceAsString());
-
-    /*
-     * verify dna sequence has dbrefs with CDS mappings to the peptide 'products'
-     */
-    MapList cds1Map = new MapList(new int[] { 57, 46 }, new int[] { 1, 4 },
-            3, 1);
-    MapList cds2Map = new MapList(new int[] { 4, 15 }, new int[] { 1, 4 },
-            3, 1);
-    MapList cds3Map = new MapList(new int[] { 4, 6, 10, 15 }, new int[] {
-        1, 3 }, 3, 1);
-    DBRefEntry[] dbrefs = dna.getDBRefs();
-    assertEquals(4, dbrefs.length);
-    DBRefEntry dbRefEntry = dbrefs[0];
-    assertEquals("UNIPROT", dbRefEntry.getSource());
-    assertEquals("B0BCM4", dbRefEntry.getAccessionId());
-    assertSame(peptides.get(1), dbRefEntry.getMap().getTo());
-    assertEquals(cds1Map, dbRefEntry.getMap().getMap());
-
-    dbRefEntry = dbrefs[1];
-    assertEquals("UNIPROT", dbRefEntry.getSource());
-    assertEquals("P0CE20", dbRefEntry.getAccessionId());
-    assertSame(peptides.get(2), dbRefEntry.getMap().getTo());
-    assertEquals(cds1Map, dbRefEntry.getMap().getMap());
-
-    dbRefEntry = dbrefs[2];
-    assertEquals("UNIPROT", dbRefEntry.getSource());
-    assertEquals("B0BCM3", dbRefEntry.getAccessionId());
-    assertSame(peptides.get(4), dbRefEntry.getMap().getTo());
-    assertEquals(cds2Map, dbRefEntry.getMap().getMap());
-
-    dbRefEntry = dbrefs[3];
-    assertEquals("EMBLCDSPROTEIN", dbRefEntry.getSource());
-    assertEquals("CAA12345.6", dbRefEntry.getAccessionId());
-    assertSame(peptides.get(5), dbRefEntry.getMap().getTo());
-    assertEquals(cds3Map, dbRefEntry.getMap().getMap());
-
-    /*
-     * verify peptides have dbrefs
-     * - to EMBL sequence (with inverse 1:3 cds mapping)
-     * - to EMBLCDS (with 1:3 mapping)
-     * - direct (no mapping) to other protein accessions
-     */
-    MapList proteinToCdsMap1 = new MapList(new int[] { 1, 4 }, new int[] {
-        1, 12 }, 1, 3);
-    MapList proteinToCdsMap2 = new MapList(new int[] { 1, 3 }, new int[] {
-        1, 9 }, 1, 3);
-
-    // dbrefs for first CDS EMBL product CAA30420.1
-    dbrefs = peptides.get(0).getDBRefs();
-    assertEquals(5, dbrefs.length);
-    assertEquals(DBRefSource.EMBL, dbrefs[0].getSource());
-    assertEquals("CAA30420.1", dbrefs[0].getAccessionId());
-    // TODO: verify getPrimaryDBRefs() for peptide products
-    assertEquals(cds1Map.getInverse(), dbrefs[0].getMap().getMap());
-    assertEquals(DBRefSource.EMBLCDS, dbrefs[1].getSource());
-    assertEquals("CAA30420.1", dbrefs[1].getAccessionId());
-    assertEquals(proteinToCdsMap1, dbrefs[1].getMap().getMap());
-    assertEquals(DBRefSource.EMBLCDSProduct, dbrefs[2].getSource());
-    assertEquals("CAA30420.1", dbrefs[2].getAccessionId());
-    assertNull(dbrefs[2].getMap());
-    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "2.1", "B0BCM4"),
-            dbrefs[3]);
-    assertNull(dbrefs[3].getMap());
-    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "P0CE20"),
-            dbrefs[4]);
-    assertNull(dbrefs[4].getMap());
-
-    // dbrefs for first CDS first Uniprot xref
-    dbrefs = peptides.get(1).getDBRefs();
-    assertEquals(2, dbrefs.length);
-    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "2.1", "B0BCM4"),
-            dbrefs[0]);
-    assertNull(dbrefs[0].getMap());
-    assertEquals(DBRefSource.EMBL, dbrefs[1].getSource());
-    assertEquals("X07547", dbrefs[1].getAccessionId());
-    assertEquals(cds1Map.getInverse(), dbrefs[1].getMap().getMap());
-
-    // dbrefs for first CDS second Uniprot xref
-    dbrefs = peptides.get(2).getDBRefs();
-    assertEquals(2, dbrefs.length);
-    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "P0CE20"),
-            dbrefs[0]);
-    assertNull(dbrefs[0].getMap());
-    assertEquals(DBRefSource.EMBL, dbrefs[1].getSource());
-    assertEquals("X07547", dbrefs[1].getAccessionId());
-    assertEquals(cds1Map.getInverse(), dbrefs[1].getMap().getMap());
-
-    // dbrefs for second CDS EMBL product CAA30421.1
-    dbrefs = peptides.get(3).getDBRefs();
-    assertEquals(4, dbrefs.length);
-    assertEquals(DBRefSource.EMBL, dbrefs[0].getSource());
-    assertEquals("CAA30421.1", dbrefs[0].getAccessionId());
-    assertEquals(cds2Map.getInverse(), dbrefs[0].getMap().getMap());
-    assertEquals(DBRefSource.EMBLCDS, dbrefs[1].getSource());
-    assertEquals("CAA30421.1", dbrefs[1].getAccessionId());
-    assertEquals(proteinToCdsMap1, dbrefs[1].getMap().getMap());
-    assertEquals(DBRefSource.EMBLCDSProduct, dbrefs[2].getSource());
-    assertEquals("CAA30421.1", dbrefs[2].getAccessionId());
-    assertNull(dbrefs[2].getMap());
-    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "B0BCM3"),
-            dbrefs[3]);
-    assertNull(dbrefs[3].getMap());
-
-    // dbrefs for second CDS second Uniprot xref
-    dbrefs = peptides.get(4).getDBRefs();
-    assertEquals(2, dbrefs.length);
-    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "B0BCM3"),
-            dbrefs[0]);
-    assertNull(dbrefs[0].getMap());
-    assertEquals(DBRefSource.EMBL, dbrefs[1].getSource());
-    assertEquals("X07547", dbrefs[1].getAccessionId());
-    assertEquals(cds2Map.getInverse(), dbrefs[1].getMap().getMap());
-
-    // dbrefs for third CDS inferred EMBL product CAA12345.6
-    dbrefs = peptides.get(5).getDBRefs();
-    assertEquals(3, dbrefs.length);
-    assertEquals(DBRefSource.EMBL, dbrefs[0].getSource());
-    assertEquals("CAA12345.6", dbrefs[0].getAccessionId());
-    assertEquals(cds3Map.getInverse(), dbrefs[0].getMap().getMap());
-    assertEquals(DBRefSource.EMBLCDS, dbrefs[1].getSource());
-    assertEquals("CAA12345.6", dbrefs[1].getAccessionId());
-    assertEquals(proteinToCdsMap2, dbrefs[1].getMap().getMap());
-    assertEquals(DBRefSource.EMBLCDSProduct, dbrefs[2].getSource());
-    assertEquals("CAA12345.6", dbrefs[2].getAccessionId());
-    assertNull(dbrefs[2].getMap());
-  }
-
-  @Test(groups = "Functional")
-  public void testAdjustForProteinLength()
-  {
-    int[] exons = new int[] { 11, 15, 21, 25, 31, 38 }; // 18 bp
-
-    // exact length match:
-    assertSame(exons, EmblEntry.adjustForProteinLength(6, exons));
-
-    // match if we assume exons include stop codon not in protein:
-    assertSame(exons, EmblEntry.adjustForProteinLength(5, exons));
-
-    // truncate last exon by 6bp
-    int[] truncated = EmblEntry.adjustForProteinLength(4, exons);
-    assertEquals("[11, 15, 21, 25, 31, 32]", Arrays.toString(truncated));
-
-    // remove last exon and truncate preceding by 1bp
-    truncated = EmblEntry.adjustForProteinLength(3, exons);
-    assertEquals("[11, 15, 21, 24]", Arrays.toString(truncated));
-
-    // exact removal of exon case:
-    exons = new int[] { 11, 15, 21, 27, 33, 38 }; // 18 bp
-    truncated = EmblEntry.adjustForProteinLength(4, exons);
-    assertEquals("[11, 15, 21, 27]", Arrays.toString(truncated));
-
-    // what if exons are too short for protein?
-    truncated = EmblEntry.adjustForProteinLength(7, exons);
-    assertSame(exons, truncated);
-  }
-}
diff --git a/test/jalview/datamodel/xdb/embl/EmblFileTest.java b/test/jalview/datamodel/xdb/embl/EmblFileTest.java
deleted file mode 100644 (file)
index 7510de1..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNull;
-
-import jalview.datamodel.DBRefEntry;
-import jalview.gui.JvOptionPane;
-
-import java.util.Vector;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class EmblFileTest
-{
-
-  @BeforeClass(alwaysRun = true)
-  public void setUpJvOptionPane()
-  {
-    JvOptionPane.setInteractiveMode(false);
-    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
-  }
-
-  @Test(groups = { "Functional" })
-  public void testGetEmblFile()
-  {
-    Vector<EmblEntry> entries = EmblTestHelper.getEmblFile().getEntries();
-    assertEquals(1, entries.size());
-    EmblEntry entry = entries.get(0);
-
-    assertEquals("X07547", entry.getAccession());
-    assertEquals("C. trachomatis plasmid", entry.getDescription());
-    assertEquals("STD", entry.getDataClass());
-    assertEquals("PRO", entry.getTaxonomicDivision());
-    assertEquals("1999-02-10", entry.getLastUpdatedDate());
-    assertEquals("58", entry.getLastUpdatedRelease());
-    assertEquals("1988-11-10", entry.getFirstPublicDate());
-    assertEquals("18", entry.getFirstPublicRelease());
-    assertEquals("genomic DNA", entry.getMoleculeType());
-    assertEquals("1", entry.getSequenceVersion());
-    assertEquals("8", entry.getEntryVersion());
-    assertEquals("linear", entry.getTopology());
-    assertEquals("7499", entry.getSequenceLength());
-
-    /*
-     * FIXME these assertions fail - values are null - why?? Adding or removing
-     * attributes in the test XML modifies behaviour. eg. inserting an attribute
-     * _before_ lastUpdated results in a null value in this field.
-     */
-    assertEquals("1988-11-10", entry.getFirstPublicDate());
-    assertEquals("18", entry.getFirstPublicRelease());
-
-    assertEquals(2, entry.getKeywords().size());
-    assertEquals("plasmid", entry.getKeywords().get(0));
-    assertEquals("unidentified reading frame", entry.getKeywords().get(1));
-
-    /*
-     * dbrefs
-     */
-    assertEquals(2, entry.getDbRefs().size());
-    DBRefEntry dbref = entry.getDbRefs().get(0);
-    assertEquals("EuropePMC", dbref.getSource());
-    assertEquals("PMC107176", dbref.getAccessionId());
-    assertEquals("9573186", dbref.getVersion());
-    dbref = entry.getDbRefs().get(1);
-    assertEquals("MD5", dbref.getSource());
-    assertEquals("ac73317", dbref.getAccessionId());
-    // blank version has been converted to "0"
-    assertEquals("0", dbref.getVersion());
-
-    /*
-     * three sequence features for CDS
-     */
-    assertEquals(3, entry.getFeatures().size());
-    /*
-     * first CDS
-     */
-    EmblFeature ef = entry.getFeatures().get(0);
-    assertEquals("CDS", ef.getName());
-    assertEquals("complement(46..57)", ef.getLocation());
-    assertEquals(2, ef.getDbRefs().size());
-    dbref = ef.getDbRefs().get(0);
-    assertEquals("UniProtKB/Swiss-Prot", dbref.getSource());
-    assertEquals("B0BCM4", dbref.getAccessionId());
-    assertEquals("2.1", dbref.getVersion());
-    dbref = ef.getDbRefs().get(1);
-    assertEquals("UniProtKB/Swiss-Prot", dbref.getSource());
-    assertEquals("P0CE20", dbref.getAccessionId());
-    // blank version gets converted to "0":
-    assertEquals("0", dbref.getVersion());
-    // CDS feature qualifiers
-    assertEquals(3, ef.getQualifiers().size());
-    Qualifier q = ef.getQualifiers().get(0);
-    assertEquals("note", q.getName());
-    assertEquals(2, q.getValues().length);
-    assertEquals("ORF 8 (AA 1-330)", q.getValues()[0]);
-    assertEquals("pickle", q.getValues()[1]);
-    assertNull(q.getEvidence());
-    q = ef.getQualifiers().get(1);
-    assertEquals("protein_id", q.getName());
-    assertEquals(1, q.getValues().length);
-    assertEquals("CAA30420.1", q.getValues()[0]);
-    q = ef.getQualifiers().get(2);
-    assertEquals("translation", q.getName());
-    assertEquals(1, q.getValues().length);
-    assertEquals("MLCF", q.getValues()[0]);
-    assertEquals(1, q.getEvidence().length);
-    assertEquals("Keith", q.getEvidence()[0]);
-
-    /*
-     * second CDS
-     */
-    ef = entry.getFeatures().get(1);
-    assertEquals("CDS", ef.getName());
-    assertEquals("4..15", ef.getLocation());
-    assertEquals(1, ef.getDbRefs().size());
-    dbref = ef.getDbRefs().get(0);
-    assertEquals("UniProtKB/Swiss-Prot", dbref.getSource());
-    assertEquals("B0BCM3", dbref.getAccessionId());
-    assertEquals("0", dbref.getVersion());
-    assertEquals(2, ef.getQualifiers().size());
-    q = ef.getQualifiers().get(0);
-    assertEquals("protein_id", q.getName());
-    assertEquals(1, q.getValues().length);
-    assertEquals("CAA30421.1", q.getValues()[0]);
-    q = ef.getQualifiers().get(1);
-    assertEquals("translation", q.getName());
-    assertEquals(1, q.getValues().length);
-    assertEquals("MSSS", q.getValues()[0]);
-
-    /*
-     * third CDS
-     */
-    ef = entry.getFeatures().get(2);
-    assertEquals("CDS", ef.getName());
-    assertEquals("join(4..6,10..15)", ef.getLocation());
-    assertNull(ef.getDbRefs());
-    assertEquals(2, ef.getQualifiers().size());
-    q = ef.getQualifiers().get(0);
-    assertEquals("protein_id", q.getName());
-    assertEquals(1, q.getValues().length);
-    assertEquals("CAA12345.6", q.getValues()[0]);
-    q = ef.getQualifiers().get(1);
-    assertEquals("translation", q.getName());
-    assertEquals(1, q.getValues().length);
-    assertEquals("MSS", q.getValues()[0]);
-
-    /*
-     * Sequence - verify newline not converted to space (JAL-2029)
-     */
-    EmblSequence seq = entry.getSequence();
-    assertEquals(
-            "GGTATGTCCTCTAGTACAAACACCCCCAATATTGTGATATAATTAAAAACATAGCAT",
-            seq.getSequence());
-
-    /*
-     * getSequence() converts empty DBRefEntry.version to "0"
-     */
-    assertEquals("0", entry.getDbRefs().get(1).getVersion());
-    assertEquals("0", entry.getFeatures().get(0).getDbRefs().get(1)
-            .getVersion());
-  }
-}
diff --git a/test/jalview/datamodel/xdb/embl/EmblTestHelper.java b/test/jalview/datamodel/xdb/embl/EmblTestHelper.java
deleted file mode 100644 (file)
index 0c7624f..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.datamodel.xdb.embl;
-
-import java.io.StringReader;
-
-public class EmblTestHelper
-{
-  // adapted from http://www.ebi.ac.uk/ena/data/view/X07547&display=xml
-  // dna and translations truncated for convenience
-  private static final String TESTDATA = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-          + "<ROOT>"
-          + "<entry accession=\"X07547\" version=\"1\" entryVersion=\"8\""
-          + " dataClass=\"STD\" taxonomicDivision=\"PRO\""
-          + " moleculeType=\"genomic DNA\" sequenceLength=\"7499\" topology=\"linear\""
-          + " firstPublic=\"1988-11-10\" firstPublicRelease=\"18\""
-          + " lastUpdated=\"1999-02-10\" lastUpdatedRelease=\"58\">"
-          + "<secondaryAccession>X07574</secondaryAccession>"
-          + "<description>C. trachomatis plasmid</description>"
-          + "<keyword>plasmid</keyword><keyword>unidentified reading frame</keyword>"
-          + "<xref db=\"EuropePMC\" id=\"PMC107176\" secondaryId=\"9573186\" />"
-          + "<xref db=\"MD5\" id=\"ac73317\" />"
-          /*
-           * first CDS (range and translation changed to keep test data manageable)
-           */
-          + "<feature name=\"CDS\" location=\"complement(46..57)\">"
-          // test the case of >1 cross-ref to the same database (JAL-2029)
-          + "<xref db=\"UniProtKB/Swiss-Prot\" id=\"B0BCM4\" secondaryId=\"2.1\" />"
-          + "<xref db=\"UniProtKB/Swiss-Prot\" id=\"P0CE20\" />"
-          + "<qualifier name=\"note\"><value>ORF 8 (AA 1-330)</value><value>pickle</value></qualifier>"
-          + "<qualifier name=\"protein_id\"><value>CAA30420.1</value></qualifier>"
-          + "<qualifier name=\"translation\"><value>MLCF</value><evidence>Keith</evidence></qualifier>"
-          + "</feature>"
-          /*
-           * second CDS (range and translation changed to keep test data manageable)
-           */
-          + "<feature name=\"CDS\" location=\"4..15\">"
-          + "<xref db=\"UniProtKB/Swiss-Prot\" id=\"B0BCM3\" />"
-          + "<qualifier name=\"protein_id\"><value>CAA30421.1</value></qualifier>"
-          + "<qualifier name=\"translation\"><value>MSSS</value></qualifier>"
-          + "</feature>"
-          /*
-           * third CDS is made up - has no xref - code should synthesize 
-           * one to an assumed EMBLCDSPROTEIN accession
-           */
-          + "<feature name=\"CDS\" location=\"join(4..6,10..15)\">"
-          + "<qualifier name=\"protein_id\"><value>CAA12345.6</value></qualifier>"
-          + "<qualifier name=\"translation\"><value>MSS</value></qualifier>"
-          + "</feature>"
-          /*
-           * sequence (modified for test purposes)
-           * emulates EMBL XML 1.2 which splits sequence data every 60 characters
-           * see EmblSequence.setSequence
-           */
-          + "<sequence>GGTATGTCCTCTAGTACAAAC\n"
-          + "ACCCCCAATATTGTGATATAATTAAAAACATAGCAT"
-          + "</sequence></entry></ROOT>";
-
-  static EmblFile getEmblFile()
-  {
-    return EmblFile.getEmblFile(new StringReader(TESTDATA));
-  }
-}
index 779962c..c9d8deb 100644 (file)
@@ -25,6 +25,7 @@ import static org.testng.AssertJUnit.assertFalse;
 import static org.testng.AssertJUnit.assertNull;
 import static org.testng.AssertJUnit.assertTrue;
 
+import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceDummy;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
@@ -241,37 +242,51 @@ public class EnsemblCdnaTest
    * accession id as parent
    */
   @Test(groups = "Functional")
-  public void testIdentifiesSequence()
+  public void testGetIdentifyingFeatures()
   {
     String accId = "ABC123";
-    EnsemblCdna testee = new EnsemblCdna();
+    SequenceI seq = new Sequence(accId, "MKLNFRQIE");
 
-    // exon with no parent not valid
-    SequenceFeature sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    // exon with no parent: not valid
+    SequenceFeature sf1 = new SequenceFeature("exon", "", 1, 2, 0f, null);
+    seq.addSequenceFeature(sf1);
 
-    // exon with wrong parent not valid
-    sf.setValue("Parent", "transcript:XYZ");
-    assertFalse(testee.identifiesSequence(sf, accId));
+    // exon with wrong parent: not valid
+    SequenceFeature sf2 = new SequenceFeature("exon", "", 1, 2, 0f, null);
+    sf2.setValue("Parent", "transcript:XYZ");
+    seq.addSequenceFeature(sf2);
 
     // exon with right parent is valid
-    sf.setValue("Parent", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf3 = new SequenceFeature("exon", "", 1, 2, 0f, null);
+    sf3.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf3);
 
     // exon sub-type with right parent is valid
-    sf = new SequenceFeature("coding_exon", "", 1, 2, 0f, null);
-    sf.setValue("Parent", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf4 = new SequenceFeature("coding_exon", "", 1, 2, 0f,
+            null);
+    sf4.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf4);
 
     // transcript not valid:
-    sf = new SequenceFeature("transcript", "", 1, 2, 0f, null);
-    sf.setValue("Parent", "transcript:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf5 = new SequenceFeature("transcript", "", 1, 2, 0f,
+            null);
+    sf5.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf5);
 
     // CDS not valid:
-    sf = new SequenceFeature("CDS", "", 1, 2, 0f, null);
-    sf.setValue("Parent", "transcript:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf6 = new SequenceFeature("transcript", "", 1, 2, 0f,
+            null);
+    sf6.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf6);
+
+    List<SequenceFeature> sfs = new EnsemblCdna()
+            .getIdentifyingFeatures(seq, accId);
+    assertFalse(sfs.contains(sf1));
+    assertFalse(sfs.contains(sf2));
+    assertTrue(sfs.contains(sf3));
+    assertTrue(sfs.contains(sf4));
+    assertFalse(sfs.contains(sf5));
+    assertFalse(sfs.contains(sf6));
   }
 
   @Test(groups = "Functional")
index 8482c90..a44ab7f 100644 (file)
@@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertFalse;
 import static org.testng.AssertJUnit.assertTrue;
 
+import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceDummy;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
@@ -152,37 +153,50 @@ public class EnsemblCdsTest
    * accession id as parent
    */
   @Test(groups = "Functional")
-  public void testIdentifiesSequence()
+  public void testGetIdentifyingFeatures()
   {
     String accId = "ABC123";
-    EnsemblCds testee = new EnsemblCds();
+    SequenceI seq = new Sequence(accId, "MKDONS");
 
     // cds with no parent not valid
-    SequenceFeature sf = new SequenceFeature("CDS", "", 1, 2, 0f, null);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf1 = new SequenceFeature("CDS", "", 1, 2, 0f, null);
+    seq.addSequenceFeature(sf1);
 
     // cds with wrong parent not valid
-    sf.setValue("Parent", "transcript:XYZ");
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf2 = new SequenceFeature("CDS", "", 1, 2, 0f, null);
+    sf2.setValue("Parent", "transcript:XYZ");
+    seq.addSequenceFeature(sf2);
 
     // cds with right parent is valid
-    sf.setValue("Parent", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf3 = new SequenceFeature("CDS", "", 1, 2, 0f, null);
+    sf3.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf3);
 
     // cds sub-type with right parent is valid
-    sf = new SequenceFeature("CDS_predicted", "", 1, 2, 0f, null);
-    sf.setValue("Parent", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf4 = new SequenceFeature("CDS_predicted", "", 1, 2, 0f,
+            null);
+    sf4.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf4);
 
     // transcript not valid:
-    sf = new SequenceFeature("transcript", "", 1, 2, 0f, null);
-    sf.setValue("Parent", "transcript:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf5 = new SequenceFeature("transcript", "", 1, 2, 0f,
+            null);
+    sf5.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf5);
 
     // exon not valid:
-    sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
-    sf.setValue("Parent", "transcript:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf6 = new SequenceFeature("exon", "", 1, 2, 0f, null);
+    sf6.setValue("Parent", "transcript:" + accId);
+    seq.addSequenceFeature(sf6);
+
+    List<SequenceFeature> sfs = new EnsemblCds().getIdentifyingFeatures(seq,
+            accId);
+    assertFalse(sfs.contains(sf1));
+    assertFalse(sfs.contains(sf2));
+    assertTrue(sfs.contains(sf3));
+    assertTrue(sfs.contains(sf4));
+    assertFalse(sfs.contains(sf5));
+    assertFalse(sfs.contains(sf6));
   }
 
   @Test(groups = "Functional")
index 217742d..446b4f7 100644 (file)
@@ -26,6 +26,7 @@ import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.api.FeatureSettingsModelI;
 import jalview.bin.Cache;
+import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceDummy;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
@@ -77,17 +78,9 @@ public class EnsemblGeneTest
     genomic.setEnd(50000);
     String geneId = "ABC123";
 
-    // gene at (start+20000) length 501
-    // should be ignored - the first 'gene' found defines the whole range
-    // (note features are found in position order, not addition order)
-    SequenceFeature sf = new SequenceFeature("gene", "", 20000, 20500, 0f,
-            null);
-    sf.setValue("ID", "gene:" + geneId);
-    sf.setStrand("+");
-    genomic.addSequenceFeature(sf);
-
     // gene at (start + 10500) length 101
-    sf = new SequenceFeature("gene", "", 10500, 10600, 0f, null);
+    SequenceFeature sf = new SequenceFeature("gene", "", 10500, 10600, 0f,
+            null);
     sf.setValue("ID", "gene:" + geneId);
     sf.setStrand("+");
     genomic.addSequenceFeature(sf);
@@ -117,17 +110,9 @@ public class EnsemblGeneTest
     genomic.setEnd(50000);
     String geneId = "ABC123";
 
-    // gene at (start+20000) length 501
-    // should be ignored - the first 'gene' found defines the whole range
-    // (real data would only have one such feature)
-    SequenceFeature sf = new SequenceFeature("ncRNA_gene", "", 20000,
-            20500, 0f, null);
-    sf.setValue("ID", "gene:" + geneId);
-    sf.setStrand("-");
-    genomic.addSequenceFeature(sf);
-
     // gene at (start + 10500) length 101
-    sf = new SequenceFeature("gene", "", 10500, 10600, 0f, null);
+    SequenceFeature sf = new SequenceFeature("gene", "", 10500, 10600, 0f,
+            null);
     sf.setValue("ID", "gene:" + geneId);
     sf.setStrand("+");
     genomic.addSequenceFeature(sf);
@@ -240,40 +225,48 @@ public class EnsemblGeneTest
    * accession id as ID
    */
   @Test(groups = "Functional")
-  public void testIdentifiesSequence()
+  public void testGetIdentifyingFeatures()
   {
     String accId = "ABC123";
-    EnsemblGene testee = new EnsemblGene();
+    SequenceI seq = new Sequence(accId, "HIBEES");
 
     // gene with no ID not valid
-    SequenceFeature sf = new SequenceFeature("gene", "", 1, 2, 0f, null);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf1 = new SequenceFeature("gene", "", 1, 2, 0f, null);
+    seq.addSequenceFeature(sf1);
 
     // gene with wrong ID not valid
-    sf.setValue("ID", "gene:XYZ");
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf2 = new SequenceFeature("gene", "", 1, 2, 0f, null);
+    sf2.setValue("ID", "gene:XYZ");
+    seq.addSequenceFeature(sf2);
 
     // gene with right ID is valid
-    sf.setValue("ID", "gene:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf3 = new SequenceFeature("gene", "", 1, 2, 0f, null);
+    sf3.setValue("ID", "gene:" + accId);
+    seq.addSequenceFeature(sf3);
 
     // gene sub-type with right ID is valid
-    sf = new SequenceFeature("snRNA_gene", "", 1, 2, 0f, null);
-    sf.setValue("ID", "gene:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
-
-    // test is not case-sensitive
-    assertTrue(testee.identifiesSequence(sf, accId.toLowerCase()));
+    SequenceFeature sf4 = new SequenceFeature("snRNA_gene", "", 1, 2, 0f, null);
+    sf4.setValue("ID", "gene:" + accId);
+    seq.addSequenceFeature(sf4);
 
     // transcript not valid:
-    sf = new SequenceFeature("transcript", "", 1, 2, 0f, null);
-    sf.setValue("ID", "gene:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf5 = new SequenceFeature("transcript", "", 1, 2, 0f, null);
+    sf5.setValue("ID", "gene:" + accId);
+    seq.addSequenceFeature(sf5);
 
     // exon not valid:
-    sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
-    sf.setValue("ID", "gene:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf6 = new SequenceFeature("exon", "", 1, 2, 0f, null);
+    sf6.setValue("ID", "gene:" + accId);
+    seq.addSequenceFeature(sf6);
+    
+    List<SequenceFeature> sfs = new EnsemblGene()
+            .getIdentifyingFeatures(seq, accId);
+    assertFalse(sfs.contains(sf1));
+    assertFalse(sfs.contains(sf2));
+    assertTrue(sfs.contains(sf3));
+    assertTrue(sfs.contains(sf4));
+    assertFalse(sfs.contains(sf5));
+    assertFalse(sfs.contains(sf6));
   }
 
   /**
index 8687da9..72ee492 100644 (file)
@@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertFalse;
 import static org.testng.AssertJUnit.assertTrue;
 
+import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceDummy;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
@@ -162,43 +163,58 @@ public class EnsemblGenomeTest
    * accession id as ID
    */
   @Test(groups = "Functional")
-  public void testIdentifiesSequence()
+  public void testGetIdentifyingFeatures()
   {
     String accId = "ABC123";
-    EnsemblGenome testee = new EnsemblGenome();
+    SequenceI seq = new Sequence(accId, "HEARTS");
 
     // transcript with no ID not valid
-    SequenceFeature sf = new SequenceFeature("transcript", "", 1, 2, 0f,
+    SequenceFeature sf1 = new SequenceFeature("transcript", "", 1, 2, 0f,
             null);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    seq.addSequenceFeature(sf1);
 
     // transcript with wrong ID not valid
-    sf.setValue("ID", "transcript");
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf2 = new SequenceFeature("transcript", "", 1, 2, 0f,
+            null);
+    sf2.setValue("ID", "transcript");
+    seq.addSequenceFeature(sf2);
 
     // transcript with right ID is valid
-    sf.setValue("ID", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf3 = new SequenceFeature("transcript", "", 1, 2, 0f,
+            null);
+    sf3.setValue("ID", "transcript:" + accId);
+    seq.addSequenceFeature(sf3);
 
     // transcript sub-type with right ID is valid
-    sf = new SequenceFeature("ncRNA", "", 1, 2, 0f, null);
-    sf.setValue("ID", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf4 = new SequenceFeature("ncRNA", "", 1, 2, 0f, null);
+    sf4.setValue("ID", "transcript:" + accId);
+    seq.addSequenceFeature(sf4);
 
     // Ensembl treats NMD_transcript_variant as if a transcript
-    sf = new SequenceFeature("NMD_transcript_variant", "", 1, 2, 0f, null);
-    sf.setValue("ID", "transcript:" + accId);
-    assertTrue(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf5 = new SequenceFeature("NMD_transcript_variant", "",
+            1, 2, 0f, null);
+    sf5.setValue("ID", "transcript:" + accId);
+    seq.addSequenceFeature(sf5);
 
     // gene not valid:
-    sf = new SequenceFeature("gene", "", 1, 2, 0f, null);
-    sf.setValue("ID", "transcript:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf6 = new SequenceFeature("gene", "", 1, 2, 0f, null);
+    sf6.setValue("ID", "transcript:" + accId);
+    seq.addSequenceFeature(sf6);
 
     // exon not valid:
-    sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
-    sf.setValue("ID", "transcript:" + accId);
-    assertFalse(testee.identifiesSequence(sf, accId));
+    SequenceFeature sf7 = new SequenceFeature("exon", "", 1, 2, 0f, null);
+    sf7.setValue("ID", "transcript:" + accId);
+    seq.addSequenceFeature(sf7);
+
+    List<SequenceFeature> sfs = new EnsemblGenome()
+            .getIdentifyingFeatures(seq, accId);
+    assertFalse(sfs.contains(sf1));
+    assertFalse(sfs.contains(sf2));
+    assertTrue(sfs.contains(sf3));
+    assertTrue(sfs.contains(sf4));
+    assertTrue(sfs.contains(sf5));
+    assertFalse(sfs.contains(sf6));
+    assertFalse(sfs.contains(sf7));
   }
 
 }
index cc3a3db..460d16c 100644 (file)
@@ -79,19 +79,6 @@ public class EnsemblRestClientTest
       {
         return false;
       }
-
-      @Override
-      protected String getRequestMimeType(boolean b)
-      {
-        return null;
-      }
-
-      @Override
-      protected String getResponseMimeType()
-      {
-        return null;
-      }
-
     };
   }
 
index 9fad30e..be7bdf2 100644 (file)
 package jalview.ext.ensembl;
 
 import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A convenience class to simplify writing unit tests (pending Mockito or
@@ -65,9 +69,10 @@ public class EnsemblSeqProxyAdapter extends EnsemblSeqProxy
   }
 
   @Override
-  protected boolean identifiesSequence(SequenceFeature sf, String accId)
+  protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq,
+          String accId)
   {
-    return false;
+    return new ArrayList<>();
   }
 
 }
index 42afa82..69b2ad4 100644 (file)
@@ -23,14 +23,13 @@ package jalview.ext.ensembl;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertSame;
 
-import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.features.SequenceFeatures;
 import jalview.gui.JvOptionPane;
 import jalview.io.DataSourceType;
 import jalview.io.FastaFile;
-import jalview.io.FileParse;
 import jalview.io.gff.SequenceOntologyFactory;
 import jalview.io.gff.SequenceOntologyLite;
 
@@ -125,7 +124,11 @@ public class EnsemblSeqProxyTest
                   + "LKKALMMRGLIPECCAVYRIQDGEKKPIGWDTDISWLTGEELHVEVLENVPLTTHNFVRK\n"
                   + "TFFTLAFCDFCRKLLFQGFRCQTCGYKFHQRCSTEVPLMCVNYDQLDLLFVSKFFEHHPI\n"
                   + "PQEEASLAETALTSGSSPSAPASDSIGPQILTSPSPSKSIPIPQPFRPADEDHRNQFGQR\n"
-                  + "DRSSSAPNVHINTIEPVNIDDLIRDQGFRGDGGSTTGLSATPPASLPGSLTNVKALQKSP\n"
+                  + "DRSSSAPNVHINTIEPVNIDDLIRDQGFRGDG\n"
+                  // ? insertion added in ENSP00000288602.11, not in P15056
+                  + "APLNQLMRCLRKYQSRTPSPLLHSVPSEIVFDFEPGPVFR\n"
+                  // end insertion
+                  + "GSTTGLSATPPASLPGSLTNVKALQKSP\n"
                   + "GPQRERKSSSSSEDRNRMKTLGRRDSSDDWEIPDGQITVGQRIGSGSFGTVYKGKWHGDV\n"
                   + "AVKMLNVTAPTPQQLQAFKNEVGVLRKTRHVNILLFMGYSTKPQLAIVTQWCEGSSLYHH\n"
                   + "LHIIETKFEMIKLIDIARQTAQGMDYLHAKSIIHRDLKSNNIFLHEDLTVKIGDFGLATV\n"
@@ -153,22 +156,21 @@ public class EnsemblSeqProxyTest
   }
 
   @Test(dataProvider = "ens_seqs", suiteName = "live")
-  public void testGetOneSeqs(EnsemblRestClient proxy, String sq,
+  public void testGetSequenceRecords(EnsemblSeqProxy proxy, String sq,
           String fastasq) throws Exception
   {
-    FileParse fp = proxy.getSequenceReader(Arrays
-            .asList(new String[] { sq }));
-    SequenceI[] sqs = new FastaFile(fp).getSeqsAsArray();
     FastaFile trueRes = new FastaFile(fastasq, DataSourceType.PASTE);
-    SequenceI[] trueSqs = trueRes.getSeqsAsArray();
-    Assert.assertEquals(sqs.length, trueSqs.length,
+    SequenceI[] expected = trueRes.getSeqsAsArray();
+    AlignmentI retrieved = proxy.getSequenceRecords(sq);
+
+    Assert.assertEquals(retrieved.getHeight(), expected.length,
             "Different number of sequences retrieved for query " + sq);
-    Alignment ral = new Alignment(sqs);
-    for (SequenceI tr : trueSqs)
+
+    for (SequenceI tr : expected)
     {
       SequenceI[] rseq;
       Assert.assertNotNull(
-              rseq = ral.findSequenceMatch(tr.getName()),
+              rseq = retrieved.findSequenceMatch(tr.getName()),
               "Couldn't find sequences matching expected sequence "
                       + tr.getName());
       Assert.assertEquals(rseq.length, 1,
@@ -179,7 +181,6 @@ public class EnsemblSeqProxyTest
               "Sequences differ for " + tr.getName() + "\n" + "Exp:"
                       + tr.getSequenceAsString() + "\n" + "Got:"
                       + rseq[0].getSequenceAsString());
-
     }
   }
 
index 792f7ad..e451ed2 100644 (file)
  */
 package jalview.ext.jmol;
 
+import static org.junit.Assert.assertNotNull;
+import static org.testng.Assert.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.Cache;
 import jalview.bin.Jalview;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SearchResultsI;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
 import jalview.gui.JvOptionPane;
@@ -32,6 +36,10 @@ import jalview.gui.Preferences;
 import jalview.gui.StructureViewer;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
+import jalview.io.FileLoader;
+
+import java.lang.reflect.InvocationTargetException;
 
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -54,8 +62,10 @@ public class JmolViewerTest
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    Jalview.main(new String[] { "-noquestionnaire", "-nonews", "-props",
-        "test/jalview/ext/rbvi/chimera/testProps.jvprops" });
+    Jalview.main(
+            new String[]
+            { "-noquestionnaire", "-nonews", "-props",
+                "test/jalview/ext/rbvi/chimera/testProps.jvprops" });
   }
 
   /**
@@ -70,10 +80,11 @@ public class JmolViewerTest
   @Test(groups = { "Functional" })
   public void testSingleSeqViewJMol()
   {
-    Cache.setProperty(Preferences.STRUCTURE_DISPLAY, ViewerType.JMOL.name());
+    Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+            ViewerType.JMOL.name());
     String inFile = "examples/1gaq.txt";
-    AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            inFile, DataSourceType.FILE);
+    AlignFrame af = new jalview.io.FileLoader()
+            .LoadFileWaitTillLoaded(inFile, DataSourceType.FILE);
     assertTrue("Didn't read input file " + inFile, af != null);
     for (SequenceI sq : af.getViewport().getAlignment().getSequences())
     {
@@ -87,13 +98,13 @@ public class JmolViewerTest
       {
         for (int q = 0; q < dsq.getAllPDBEntries().size(); q++)
         {
-          final StructureViewer structureViewer = new StructureViewer(af
-                  .getViewport().getStructureSelectionManager());
+          final StructureViewer structureViewer = new StructureViewer(
+                  af.getViewport().getStructureSelectionManager());
           structureViewer.setViewerType(ViewerType.JMOL);
           JalviewStructureDisplayI jmolViewer = structureViewer
                   .viewStructures(dsq.getAllPDBEntries().elementAt(q),
-                          new SequenceI[] { sq }, af.getCurrentView()
-                                  .getAlignPanel());
+                          new SequenceI[]
+                          { sq }, af.getCurrentView().getAlignPanel());
           /*
            * Wait for viewer load thread to complete
            */
@@ -116,5 +127,86 @@ public class JmolViewerTest
     }
   }
 
+  @Test(groups = { "Functional" })
+  public void testAddStrToSingleSeqViewJMol()
+          throws InvocationTargetException, InterruptedException
+  {
+    Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+            ViewerType.JMOL.name());
+    String inFile = "examples/1gaq.txt";
+    AlignFrame af = new jalview.io.FileLoader(true)
+            .LoadFileWaitTillLoaded(inFile, DataSourceType.FILE);
+    assertTrue("Didn't read input file " + inFile, af != null);
+    // show a structure for 4th Sequence
+    SequenceI sq1 = af.getViewport().getAlignment().getSequences().get(0);
+    final StructureViewer structureViewer = new StructureViewer(
+            af.getViewport().getStructureSelectionManager());
+    structureViewer.setViewerType(ViewerType.JMOL);
+    JalviewStructureDisplayI jmolViewer = structureViewer.viewStructures(
+            sq1.getDatasetSequence().getAllPDBEntries().elementAt(0),
+            new SequenceI[]
+            { sq1 }, af.getCurrentView().getAlignPanel());
+    /*
+     * Wait for viewer load thread to complete
+     */
+    try
+    {
+      while (!jmolViewer.getBinding().isFinishedInit())
+      {
+        Thread.sleep(500);
+      }
+    } catch (InterruptedException e)
+    {
+    }
+
+    assertTrue(jmolViewer.isVisible());
+
+    // add another pdb file and add it to view
+    final String _inFile = "examples/3W5V.pdb";
+    inFile = _inFile;
+    FileLoader fl = new FileLoader();
+    fl.LoadFile(af.getCurrentView(), _inFile, DataSourceType.FILE,
+            FileFormat.PDB);
+    try
+    {
+      int time = 0;
+      do
+      {
+        Thread.sleep(50); // hope we can avoid race condition
+
+      } while (++time < 30
+              && af.getViewport().getAlignment().getHeight() == 3);
+    } catch (Exception q)
+    {
+    }
+    ;
+    assertTrue("Didn't paste additional structure" + inFile,
+            af.getViewport().getAlignment().getHeight() > 3);
+    SequenceI sq2 = af.getViewport().getAlignment().getSequenceAt(3);
+    PDBEntry pdbe = sq2.getDatasetSequence().getAllPDBEntries().get(0);
+    assertTrue(pdbe.getFile().contains(inFile));
+    structureViewer.viewStructures(pdbe, new SequenceI[] { sq2 },
+            af.alignPanel);
+    /*
+     * Wait for viewer load thread to complete
+     */
+    try
+    {
+      while (structureViewer.isBusy())
+      {
+        Thread.sleep(500);
+      }
+    } catch (InterruptedException e)
+    {
+    }
+    assertEquals(jmolViewer.getBinding().getPdbCount(), 2);
+    String mouseOverTest = "[GLY]293:A.CA/2.1 #2164";
+    ((JalviewJmolBinding) jmolViewer.getBinding()).mouseOverStructure(2164,
+            mouseOverTest);
+    SearchResultsI highlight = af.alignPanel.getSeqPanel()
+            .getLastSearchResults();
+    assertNotNull("Didn't find highlight from second structure mouseover",
+            highlight.getResults(sq2, sq2.getStart(), sq2.getEnd()));
+  }
 
 }
index b0aaab9..60ca11f 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import static org.junit.Assert.assertNotEquals;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotSame;
@@ -599,4 +600,26 @@ public class AlignFrameTest
     sp.valueChanged(22);
     assertEquals(av2.getResidueShading().getConservationInc(), 22);
   }
+
+  /**
+   * Verify that making a New View preserves the dataset reference for the
+   * alignment. Otherwise, see a 'duplicate jar entry' reference when trying to
+   * save alignments with multiple views, and codon mappings will not be shared
+   * across all panels in a split frame.
+   * 
+   * @see Jalview2xmlTests#testStoreAndRecoverColourThresholds()
+   */
+  @Test(groups = "Functional")
+  public void testNewView_dsRefPreserved()
+  {
+    AlignViewport av = af.getViewport();
+    AlignmentI al = av.getAlignment();
+    AlignmentI original_ds = al.getDataset();
+    af.newView_actionPerformed(null);
+    assertNotEquals("New view didn't select the a new panel", av,
+            af.getViewport());
+    org.testng.Assert.assertEquals(original_ds,
+            af.getViewport().getAlignment().getDataset(),
+            "Dataset was not preserved in new view");
+  }
 }
index 05b9aea..5298680 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.gui;
 
 import static org.testng.Assert.assertEquals;
@@ -28,17 +48,17 @@ public class SeqCanvasTest
     AlignmentI al = av.getAlignment();
     assertEquals(al.getWidth(), 157);
     assertEquals(al.getHeight(), 15);
+    av.getRanges().setStartEndSeq(0, 14);
+
+    SeqCanvas testee = af.alignPanel.getSeqPanel().seqCanvas;
 
     av.setWrapAlignment(true);
-    av.getRanges().setStartEndSeq(0, 14);
     av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
     int charHeight = av.getCharHeight();
     int charWidth = av.getCharWidth();
     assertEquals(charHeight, 17);
     assertEquals(charWidth, 12);
 
-    SeqCanvas testee = af.alignPanel.getSeqPanel().seqCanvas;
-
     /*
      * first with scales above, left, right
      */
@@ -278,4 +298,42 @@ public class SeqCanvasTest
     testee.calculateWrappedGeometry(canvasWidth, canvasHeight);
     assertEquals(PA.getValue(testee, "wrappedVisibleWidths"), 3);
   }
+
+  /**
+   * Test simulates loading an unwrapped alignment, shrinking it vertically so
+   * not all sequences are visible, then changing to wrapped mode. The ranges
+   * endSeq should be unchanged, but the vertical repeat height should include
+   * all sequences.
+   */
+  @Test(groups = "Functional")
+  public void testCalculateWrappedGeometry_fromScrolled()
+  {
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/uniref50.fa", DataSourceType.FILE);
+    AlignViewport av = af.getViewport();
+    AlignmentI al = av.getAlignment();
+    assertEquals(al.getWidth(), 157);
+    assertEquals(al.getHeight(), 15);
+    av.getRanges().setStartEndSeq(0, 3);
+    av.setShowAnnotation(false);
+    av.setScaleAboveWrapped(true);
+
+    SeqCanvas testee = af.alignPanel.getSeqPanel().seqCanvas;
+
+    av.setWrapAlignment(true);
+    av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
+    int charHeight = av.getCharHeight();
+    int charWidth = av.getCharWidth();
+    assertEquals(charHeight, 17);
+    assertEquals(charWidth, 12);
+
+    int canvasWidth = 400;
+    int canvasHeight = 300;
+    testee.calculateWrappedGeometry(canvasWidth, canvasHeight);
+
+    assertEquals(av.getRanges().getEndSeq(), 3); // unchanged
+    int repeatingHeight = (int) PA.getValue(testee,
+            "wrappedRepeatHeightPx");
+    assertEquals(repeatingHeight, charHeight * (2 + al.getHeight()));
+  }
 }
index 91fe602..f69e6b5 100644 (file)
@@ -21,6 +21,7 @@
 package jalview.gui;
 
 import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
 import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.datamodel.DBRefEntry;
@@ -28,8 +29,10 @@ import jalview.datamodel.DBRefSource;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
+import jalview.fts.api.FTSData;
 import jalview.jbgui.GStructureChooser.FilterOption;
 
+import java.util.Collection;
 import java.util.Vector;
 
 import org.testng.annotations.AfterMethod;
@@ -37,6 +40,8 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import junit.extensions.PA;
+
 public class StructureChooserTest
 {
 
@@ -142,8 +147,10 @@ public class StructureChooserTest
     SequenceI[] selectedSeqs = new SequenceI[] { seq };
     StructureChooser sc = new StructureChooser(selectedSeqs, seq, null);
     sc.fetchStructuresMetaData();
-    assertTrue(sc.getDiscoveredStructuresSet() != null);
-    assertTrue(sc.getDiscoveredStructuresSet().size() > 0);
+    Collection<FTSData> ss = (Collection<FTSData>) PA.getValue(sc,
+            "discoveredStructuresSet");
+    assertNotNull(ss);
+    assertTrue(ss.size() > 0);
 
   }
 
diff --git a/test/jalview/io/ClustalFileTest.java b/test/jalview/io/ClustalFileTest.java
new file mode 100644 (file)
index 0000000..1da2c75
--- /dev/null
@@ -0,0 +1,67 @@
+package jalview.io;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import jalview.datamodel.SequenceI;
+
+import java.io.IOException;
+
+import org.testng.annotations.Test;
+
+public class ClustalFileTest
+{
+  @Test(groups="Functional")
+  public void testParse_withNumbering() throws IOException
+  {
+    //@formatter:off
+    String data = "CLUSTAL\n\n"
+            + "FER_CAPAA/1-8      -----------------------------------------------------------A\t1\n"
+            + "FER_CAPAN/1-55     MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA 48\n"
+            + "FER1_SOLLC/1-55    MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA 48\n"
+            + "Q93XJ9_SOLTU/1-55  MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA 48\n"
+            + "FER1_PEA/1-60      MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA 53\n\n"
+            + "FER_CAPAA/1-8      SYKVKLI 8\n"
+            + "FER_CAPAN/1-55     SYKVKLI 55\n"
+            + "FER1_SOLLC/1-55    SYKVKLI 55\n"
+            + "Q93XJ9_SOLTU/1-55  SYKVKLI 55\n"
+            + "FER1_PEA/1-60      SYKVKLV 60\n"
+            + "                   .*     .:....*******..** ..........**  ********...*:::*  ...\n"
+            + "\t\t.:.::.  *\n";
+    //@formatter:on
+    ClustalFile cf = new ClustalFile(data, DataSourceType.PASTE);
+    cf.parse();
+    SequenceI[] seqs = cf.getSeqsAsArray();
+    assertEquals(seqs.length, 5);
+    assertEquals(seqs[0].getName(), "FER_CAPAA");
+    assertEquals(seqs[0].getStart(), 1);
+    assertEquals(seqs[0].getEnd(), 8);
+    assertTrue(seqs[0].getSequenceAsString().endsWith("ASYKVKLI"));
+  }
+
+  @Test(groups="Functional")
+  public void testParse_noNumbering() throws IOException
+  {
+    //@formatter:off
+    String data = "CLUSTAL\n\n"
+            + "FER_CAPAA/1-8      -----------------------------------------------------------A\n"
+            + "FER_CAPAN/1-55     MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA\n"
+            + "FER1_SOLLC/1-55    MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA\n"
+            + "Q93XJ9_SOLTU/1-55  MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA\n"
+            + "FER1_PEA/1-60      MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA\n\n"
+            + "FER_CAPAA/1-8      SYKVKLI\n"
+            + "FER_CAPAN/1-55     SYKVKLI\n"
+            + "FER1_SOLLC/1-55    SYKVKLI\n"
+            + "Q93XJ9_SOLTU/1-55  SYKVKLI\n"
+            + "FER1_PEA/1-60      SYKVKLV\n";
+    //@formatter:on
+    ClustalFile cf = new ClustalFile(data, DataSourceType.PASTE);
+    cf.parse();
+    SequenceI[] seqs = cf.getSeqsAsArray();
+    assertEquals(seqs.length, 5);
+    assertEquals(seqs[0].getName(), "FER_CAPAA");
+    assertEquals(seqs[0].getStart(), 1);
+    assertEquals(seqs[0].getEnd(), 8);
+    assertTrue(seqs[0].getSequenceAsString().endsWith("ASYKVKLI"));
+  }
+}
index 66d1aec..3baacc8 100644 (file)
@@ -284,6 +284,31 @@ public class Jalview2xmlTests extends Jalview2xmlBase
 
   }
 
+  /**
+   * Test for JAL-2223 - multiple mappings in View Mapping report
+   * 
+   * @throws Exception
+   */
+  @Test(groups = { "Functional" })
+  public void noDuplicatePdbMappingsMade() throws Exception
+  {
+    StructureImportSettings.setProcessSecondaryStructure(true);
+    StructureImportSettings.setVisibleChainAnnotation(true);
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+
+    // locate Jmol viewer
+    // count number of PDB mappings the structure selection manager holds -
+    String pdbFile = af.getCurrentView().getStructureSelectionManager()
+            .findFileForPDBId("1A70");
+    assertEquals(
+            af.getCurrentView().getStructureSelectionManager()
+                    .getMapping(pdbFile).length,
+            2, "Expected only two mappings for 1A70");
+
+  }
+
   @Test(groups = { "Functional" })
   public void viewRefPdbAnnotation() throws Exception
   {
index 4273e6c..e86c8ad 100644 (file)
@@ -38,6 +38,8 @@ import java.util.BitSet;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
@@ -54,7 +56,8 @@ public class StockholmFileTest
   }
 
   static String PfamFile = "examples/PF00111_seed.stk",
-          RfamFile = "examples/RF00031_folded.stk";
+          RfamFile = "examples/RF00031_folded.stk",
+          RnaSSTestFile = "examples/rna_ss_test.stk";
 
   @Test(groups = { "Functional" })
   public void pfamFileIO() throws Exception
@@ -230,8 +233,8 @@ public class StockholmFileTest
     // we might want to revise this in future
     int aa_new_size = (aa_new == null ? 0 : aa_new.length);
     int aa_original_size = (aa_original == null ? 0 : aa_original.length);
-    Map<Integer, BitSet> orig_groups = new HashMap<Integer, BitSet>();
-    Map<Integer, BitSet> new_groups = new HashMap<Integer, BitSet>();
+    Map<Integer, BitSet> orig_groups = new HashMap<>();
+    Map<Integer, BitSet> new_groups = new HashMap<>();
 
     if (aa_new != null && aa_original != null)
     {
@@ -623,13 +626,13 @@ public class StockholmFileTest
   {
     for (char ch : new char[] { '{', '}', '[', ']', '(', ')', '<', '>' })
     {
-      Assert.assertTrue(StockholmFile.DETECT_BRACKETS.matchAt("" + ch, 0),
-              "Didn't recognise " + ch + " as a WUSS bracket");
+      Assert.assertTrue(StockholmFile.RNASS_BRACKETS.indexOf(ch) >= 0,
+              "Didn't recognise '" + ch + "' as a WUSS bracket");
     }
-    for (char ch : new char[] { '@', '!', 'V', 'Q', '*', ' ', '-', '.' })
+    for (char ch : new char[] { '@', '!', '*', ' ', '-', '.' })
     {
-      Assert.assertFalse(StockholmFile.DETECT_BRACKETS.matchAt("" + ch, 0),
-              "Shouldn't recognise " + ch + " as a WUSS bracket");
+      Assert.assertFalse(StockholmFile.RNASS_BRACKETS.indexOf(ch) >= 0,
+              "Shouldn't recognise '" + ch + "' as a WUSS bracket");
     }
   }
   private static void roundTripSSForRNA(String aliFile, String annFile)
@@ -654,4 +657,191 @@ public class StockholmFileTest
     testAlignmentEquivalence(al, newAl, true, true, true);
 
   }
+
+  // this is the single sequence alignment and the SS annotations equivalent to
+  // the ones in file RnaSSTestFile
+  String aliFileRnaSS = ">Test.sequence/1-14\n"
+          + "GUACAAAAAAAAAA";
+  String annFileRnaSSAlphaChars = "JALVIEW_ANNOTATION\n"
+          + "# Created: Thu Aug 02 14:54:57 BST 2018\n" + "\n"
+          + "NO_GRAPH\tSecondary Structure\tSecondary Structure\t<,<|(,(|E,E|H,H|B,B|h,h|e,e|b,b|(,(|E,E|),)|e,e|),)|>,>|\t2.0\n"
+          + "\n"
+          + "ROWPROPERTIES\tSecondary Structure\tscaletofit=true\tshowalllabs=true\tcentrelabs=false\n"
+          + "\n" + "\n" + "ALIGNMENT\tID=RNA.SS.TEST\tTP=RNA;";
+  String wrongAnnFileRnaSSAlphaChars = "JALVIEW_ANNOTATION\n"
+          + "# Created: Thu Aug 02 14:54:57 BST 2018\n" + "\n"
+          + "NO_GRAPH\tSecondary Structure\tSecondary Structure\t<,<|(,(|H,H|E,E|B,B|h,h|e,e|b,b|(,(|E,E|),)|e,e|),)|>,>|\t2.0\n"
+          + "\n"
+          + "ROWPROPERTIES\tSecondary Structure\tscaletofit=true\tshowalllabs=true\tcentrelabs=false\n"
+          + "\n" + "\n" + "ALIGNMENT\tID=RNA.SS.TEST\tTP=RNA;";
+  @Test(groups = { "Functional" })
+  public void stockholmFileRnaSSAlphaChars() throws Exception
+  {
+    AppletFormatAdapter af = new AppletFormatAdapter();
+    AlignmentI al = af.readFile(RnaSSTestFile, DataSourceType.FILE,
+            jalview.io.FileFormat.Stockholm);
+    Iterable<AlignmentAnnotation> aai = al.findAnnotations(null, null,
+            "Secondary Structure");
+    AlignmentAnnotation aa = aai.iterator().next();
+    Assert.assertTrue(aa.isRNA(),
+            "'" + RnaSSTestFile + "' not recognised as RNA SS");
+    Assert.assertTrue(aa.isValidStruc(),
+            "'" + RnaSSTestFile + "' not recognised as valid structure");
+    Annotation[] as = aa.annotations;
+    char[] As = new char[as.length];
+    for (int i = 0; i < as.length; i++)
+    {
+      As[i] = as[i].secondaryStructure;
+    }
+    char[] shouldBe = { '<', '(', 'E', 'H', 'B', 'h', 'e', 'b', '(', 'E',
+        ')', 'e', ')', '>' };
+    Assert.assertTrue(
+            Arrays.equals(As, shouldBe),
+            "Annotation is " + new String(As) + " but should be "
+                    + new String(shouldBe));
+
+    // this should result in the same RNA SS Annotations
+    AlignmentI newAl = new AppletFormatAdapter().readFile(
+            aliFileRnaSS,
+            DataSourceType.PASTE, jalview.io.FileFormat.Fasta);
+    AnnotationFile aaf = new AnnotationFile();
+    aaf.readAnnotationFile(newAl, annFileRnaSSAlphaChars,
+            DataSourceType.PASTE);
+
+    Assert.assertTrue(
+            testRnaSSAnnotationsEquivalent(al.getAlignmentAnnotation()[0],
+                    newAl.getAlignmentAnnotation()[0]),
+            "RNA SS Annotations SHOULD be pair-wise equivalent (but apparently aren't): \n"
+                    + "RNA SS A 1:" + al.getAlignmentAnnotation()[0] + "\n"
+                    + "RNA SS A 2:" + newAl.getAlignmentAnnotation()[0]);
+
+    // this should NOT result in the same RNA SS Annotations
+    newAl = new AppletFormatAdapter().readFile(
+            aliFileRnaSS, DataSourceType.PASTE,
+            jalview.io.FileFormat.Fasta);
+    aaf = new AnnotationFile();
+    aaf.readAnnotationFile(newAl, wrongAnnFileRnaSSAlphaChars,
+            DataSourceType.PASTE);
+
+    boolean mismatch = testRnaSSAnnotationsEquivalent(al.getAlignmentAnnotation()[0],
+            newAl.getAlignmentAnnotation()[0]);
+    Assert.assertFalse(mismatch,
+            "RNA SS Annotations SHOULD NOT be pair-wise equivalent (but apparently are): \n"
+                    + "RNA SS A 1:" + al.getAlignmentAnnotation()[0] + "\n"
+                    + "RNA SS A 2:" + newAl.getAlignmentAnnotation()[0]);
+  }
+
+  private static boolean testRnaSSAnnotationsEquivalent(
+          AlignmentAnnotation a1,
+          AlignmentAnnotation a2)
+  {
+    return a1.rnaSecondaryStructureEquivalent(a2);
+  }
+
+  String annFileRnaSSWithSpaceChars = "JALVIEW_ANNOTATION\n"
+          + "# Created: Thu Aug 02 14:54:57 BST 2018\n" + "\n"
+          + "NO_GRAPH\tSecondary Structure\tSecondary Structure\t<,<|.,.|H,H| , |B,B|h,h| , |b,b|(,(|E,E|.,.|e,e|),)|>,>|\t2.0\n"
+          + "\n"
+          + "ROWPROPERTIES\tSecondary Structure\tscaletofit=true\tshowalllabs=true\tcentrelabs=false\n"
+          + "\n" + "\n" + "ALIGNMENT\tID=RNA.SS.TEST\tTP=RNA;";
+  String annFileRnaSSWithoutSpaceChars = "JALVIEW_ANNOTATION\n"
+          + "# Created: Thu Aug 02 14:54:57 BST 2018\n" + "\n"
+          + "NO_GRAPH\tSecondary Structure\tSecondary Structure\t<,<|.,.|H,H|.,.|B,B|h,h|.,.|b,b|(,(|E,E|.,.|e,e|),)|>,>|\t2.0\n"
+          + "\n"
+          + "ROWPROPERTIES\tSecondary Structure\tscaletofit=true\tshowalllabs=true\tcentrelabs=false\n"
+          + "\n" + "\n" + "ALIGNMENT\tID=RNA.SS.TEST\tTP=RNA;";
+
+  String wrongAnnFileRnaSSWithoutSpaceChars = "JALVIEW_ANNOTATION\n"
+          + "# Created: Thu Aug 02 14:54:57 BST 2018\n" + "\n"
+          + "NO_GRAPH\tSecondary Structure\tSecondary Structure\t<,<|.,.|H,H|Z,Z|B,B|h,h|z,z|b,b|(,(|E,E|.,.|e,e|),)|>,>|\t2.0\n"
+          + "\n"
+          + "ROWPROPERTIES\tSecondary Structure\tscaletofit=true\tshowalllabs=true\tcentrelabs=false\n"
+          + "\n" + "\n" + "ALIGNMENT\tID=RNA.SS.TEST\tTP=RNA;";
+
+  @Test(groups = { "Functional" })
+  public void stockholmFileRnaSSSpaceChars() throws Exception
+  {
+    AlignmentI alWithSpaces = new AppletFormatAdapter().readFile(
+            aliFileRnaSS, DataSourceType.PASTE,
+            jalview.io.FileFormat.Fasta);
+    AnnotationFile afWithSpaces = new AnnotationFile();
+    afWithSpaces.readAnnotationFile(alWithSpaces,
+            annFileRnaSSWithSpaceChars, DataSourceType.PASTE);
+
+    Iterable<AlignmentAnnotation> aaiWithSpaces = alWithSpaces
+            .findAnnotations(null, null, "Secondary Structure");
+    AlignmentAnnotation aaWithSpaces = aaiWithSpaces.iterator().next();
+    Assert.assertTrue(aaWithSpaces.isRNA(),
+            "'" + aaWithSpaces + "' not recognised as RNA SS");
+    Assert.assertTrue(aaWithSpaces.isValidStruc(),
+            "'" + aaWithSpaces + "' not recognised as valid structure");
+    Annotation[] annWithSpaces = aaWithSpaces.annotations;
+    char[] As = new char[annWithSpaces.length];
+    for (int i = 0; i < annWithSpaces.length; i++)
+    {
+      As[i] = annWithSpaces[i].secondaryStructure;
+    }
+    // check all spaces and dots are spaces in the internal representation
+    char[] shouldBe = { '<', ' ', 'H', ' ', 'B', 'h', ' ', 'b', '(', 'E',
+        ' ', 'e', ')', '>' };
+    Assert.assertTrue(Arrays.equals(As, shouldBe), "Annotation is "
+            + new String(As) + " but should be " + new String(shouldBe));
+
+    // this should result in the same RNA SS Annotations
+    AlignmentI alWithoutSpaces = new AppletFormatAdapter().readFile(
+            aliFileRnaSS, DataSourceType.PASTE,
+            jalview.io.FileFormat.Fasta);
+    AnnotationFile afWithoutSpaces = new AnnotationFile();
+    afWithoutSpaces.readAnnotationFile(alWithoutSpaces,
+            annFileRnaSSWithoutSpaceChars,
+            DataSourceType.PASTE);
+
+    Assert.assertTrue(
+            testRnaSSAnnotationsEquivalent(
+                    alWithSpaces.getAlignmentAnnotation()[0],
+                    alWithoutSpaces.getAlignmentAnnotation()[0]),
+            "RNA SS Annotations SHOULD be pair-wise equivalent (but apparently aren't): \n"
+                    + "RNA SS A 1:"
+                    + alWithSpaces.getAlignmentAnnotation()[0]
+                            .getRnaSecondaryStructure()
+                    + "\n" + "RNA SS A 2:"
+                    + alWithoutSpaces.getAlignmentAnnotation()[0]
+                            .getRnaSecondaryStructure());
+
+    // this should NOT result in the same RNA SS Annotations
+    AlignmentI wrongAlWithoutSpaces = new AppletFormatAdapter().readFile(
+            aliFileRnaSS, DataSourceType.PASTE,
+            jalview.io.FileFormat.Fasta);
+    AnnotationFile wrongAfWithoutSpaces = new AnnotationFile();
+    wrongAfWithoutSpaces.readAnnotationFile(wrongAlWithoutSpaces,
+            wrongAnnFileRnaSSWithoutSpaceChars,
+            DataSourceType.PASTE);
+
+    Assert.assertFalse(
+            testRnaSSAnnotationsEquivalent(
+                    alWithSpaces.getAlignmentAnnotation()[0],
+                    wrongAlWithoutSpaces.getAlignmentAnnotation()[0]),
+            "RNA SS Annotations SHOULD NOT be pair-wise equivalent (but apparently are): \n"
+                    + "RNA SS A 1:"
+                    + alWithSpaces.getAlignmentAnnotation()[0]
+                            .getRnaSecondaryStructure()
+                    + "\n" + "RNA SS A 2:"
+                    + wrongAlWithoutSpaces.getAlignmentAnnotation()[0]
+                            .getRnaSecondaryStructure());
+
+    // check no spaces in the output
+    // TODO: create a better 'save as <format>' pattern
+    alWithSpaces.getAlignmentAnnotation()[0].visible = true;
+    StockholmFile sf = new StockholmFile(alWithSpaces);
+
+    String stockholmFile = sf.print(alWithSpaces.getSequencesArray(), true);
+    Pattern noSpacesInRnaSSAnnotation = Pattern
+            .compile("\\n#=GC SS_cons\\s+\\S{14}\\n");
+    Matcher m = noSpacesInRnaSSAnnotation.matcher(stockholmFile);
+    boolean matches = m.find();
+    Assert.assertTrue(matches,
+            "StockholmFile output does not contain expected output (may contain spaces):\n"
+                    + stockholmFile);
+
+  }
 }
diff --git a/test/jalview/project/Jalview2xmlTests.java b/test/jalview/project/Jalview2xmlTests.java
new file mode 100644 (file)
index 0000000..6739cab
--- /dev/null
@@ -0,0 +1,1105 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.project;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertSame;
+import static org.testng.Assert.assertTrue;
+
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.FeatureColourI;
+import jalview.api.ViewStyleI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.HiddenSequences;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.PDBEntry.Type;
+import jalview.datamodel.SequenceCollectionI;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.datamodel.features.FeatureMatcher;
+import jalview.datamodel.features.FeatureMatcherSet;
+import jalview.datamodel.features.FeatureMatcherSetI;
+import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
+import jalview.gui.AlignmentPanel;
+import jalview.gui.Desktop;
+import jalview.gui.FeatureRenderer;
+import jalview.gui.JvOptionPane;
+import jalview.gui.PopupMenu;
+import jalview.gui.SliderPanel;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
+import jalview.io.FileLoader;
+import jalview.io.Jalview2xmlBase;
+import jalview.renderer.ResidueShaderI;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.FeatureColour;
+import jalview.schemes.JalviewColourScheme;
+import jalview.schemes.RNAHelicesColour;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TCoffeeColourScheme;
+import jalview.structure.StructureImportSettings;
+import jalview.util.matcher.Condition;
+import jalview.viewmodel.AlignmentViewport;
+
+import java.awt.Color;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+@Test(singleThreaded = true)
+public class Jalview2xmlTests extends Jalview2xmlBase
+{
+
+  @Override
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
+  @Test(groups = { "Functional" })
+  public void testRNAStructureRecovery() throws Exception
+  {
+    String inFile = "examples/RF00031_folded.stk";
+    String tfile = File.createTempFile("JalviewTest", ".jvp")
+            .getAbsolutePath();
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+            DataSourceType.FILE);
+    assertNotNull(af, "Didn't read input file " + inFile);
+    int olddsann = countDsAnn(af.getViewport());
+    assertTrue(olddsann > 0, "Didn't find any dataset annotations");
+    af.changeColour_actionPerformed(JalviewColourScheme.RNAHelices
+            .toString());
+    assertTrue(
+            af.getViewport().getGlobalColourScheme() instanceof RNAHelicesColour,
+            "Couldn't apply RNA helices colourscheme");
+    assertTrue(af.saveAlignment(tfile, FileFormat.Jalview),
+            "Failed to store as a project.");
+    af.closeMenuItem_actionPerformed(true);
+    af = null;
+    af = new FileLoader()
+            .LoadFileWaitTillLoaded(tfile, DataSourceType.FILE);
+    assertNotNull(af, "Failed to import new project");
+    int newdsann = countDsAnn(af.getViewport());
+    assertEquals(olddsann, newdsann,
+            "Differing numbers of dataset sequence annotation\nOriginally "
+                    + olddsann + " and now " + newdsann);
+    System.out
+            .println("Read in same number of annotations as originally present ("
+                    + olddsann + ")");
+    assertTrue(
+
+    af.getViewport().getGlobalColourScheme() instanceof RNAHelicesColour,
+            "RNA helices colourscheme was not applied on import.");
+  }
+
+  @Test(groups = { "Functional" })
+  public void testTCoffeeScores() throws Exception
+  {
+    String inFile = "examples/uniref50.fa", inAnnot = "examples/uniref50.score_ascii";
+    String tfile = File.createTempFile("JalviewTest", ".jvp")
+            .getAbsolutePath();
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+            DataSourceType.FILE);
+    assertNotNull(af, "Didn't read input file " + inFile);
+    af.loadJalviewDataFile(inAnnot, DataSourceType.FILE, null, null);
+    assertSame(af.getViewport().getGlobalColourScheme().getClass(),
+            TCoffeeColourScheme.class, "Didn't set T-coffee colourscheme");
+    assertNotNull(ColourSchemeProperty.getColourScheme(af.getViewport()
+            .getAlignment(), af.getViewport().getGlobalColourScheme()
+            .getSchemeName()), "Recognise T-Coffee score from string");
+
+    assertTrue(af.saveAlignment(tfile, FileFormat.Jalview),
+            "Failed to store as a project.");
+    af.closeMenuItem_actionPerformed(true);
+    af = null;
+    af = new FileLoader()
+            .LoadFileWaitTillLoaded(tfile, DataSourceType.FILE);
+    assertNotNull(af, "Failed to import new project");
+    assertSame(af.getViewport().getGlobalColourScheme().getClass(),
+            TCoffeeColourScheme.class,
+            "Didn't set T-coffee colourscheme for imported project.");
+    System.out
+            .println("T-Coffee score shading successfully recovered from project.");
+  }
+
+  @Test(groups = { "Functional" })
+  public void testColourByAnnotScores() throws Exception
+  {
+    String inFile = "examples/uniref50.fa", inAnnot = "examples/testdata/uniref50_iupred.jva";
+    String tfile = File.createTempFile("JalviewTest", ".jvp")
+            .getAbsolutePath();
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+            DataSourceType.FILE);
+    assertNotNull(af, "Didn't read input file " + inFile);
+    af.loadJalviewDataFile(inAnnot, DataSourceType.FILE, null, null);
+    AlignmentAnnotation[] aa = af.getViewport().getAlignment()
+            .getSequenceAt(0).getAnnotation("IUPredWS (Short)");
+    assertTrue(
+
+    aa != null && aa.length > 0,
+            "Didn't find any IUPred annotation to use to shade alignment.");
+    AnnotationColourGradient cs = new AnnotationColourGradient(aa[0], null,
+            AnnotationColourGradient.ABOVE_THRESHOLD);
+    AnnotationColourGradient gcs = new AnnotationColourGradient(aa[0],
+            null, AnnotationColourGradient.BELOW_THRESHOLD);
+    cs.setSeqAssociated(true);
+    gcs.setSeqAssociated(true);
+    af.changeColour(cs);
+    SequenceGroup sg = new SequenceGroup();
+    sg.setStartRes(57);
+    sg.setEndRes(92);
+    sg.cs.setColourScheme(gcs);
+    af.getViewport().getAlignment().addGroup(sg);
+    sg.addSequence(af.getViewport().getAlignment().getSequenceAt(1), false);
+    sg.addSequence(af.getViewport().getAlignment().getSequenceAt(2), true);
+    af.alignPanel.alignmentChanged();
+    assertTrue(af.saveAlignment(tfile, FileFormat.Jalview),
+            "Failed to store as a project.");
+    af.closeMenuItem_actionPerformed(true);
+    af = null;
+    af = new FileLoader()
+            .LoadFileWaitTillLoaded(tfile, DataSourceType.FILE);
+    assertNotNull(af, "Failed to import new project");
+
+    // check for group and alignment colourschemes
+
+    ColourSchemeI _rcs = af.getViewport().getGlobalColourScheme();
+    ColourSchemeI _rgcs = af.getViewport().getAlignment().getGroups()
+            .get(0).getColourScheme();
+    assertNotNull(_rcs, "Didn't recover global colourscheme");
+    assertTrue(_rcs instanceof AnnotationColourGradient,
+            "Didn't recover annotation colour global scheme");
+    AnnotationColourGradient __rcs = (AnnotationColourGradient) _rcs;
+    assertTrue(__rcs.isSeqAssociated(),
+            "Annotation colourscheme wasn't sequence associated");
+
+    boolean diffseqcols = false, diffgseqcols = false;
+    SequenceI[] sqs = af.getViewport().getAlignment().getSequencesArray();
+    for (int p = 0, pSize = af.getViewport().getAlignment().getWidth(); p < pSize
+            && (!diffseqcols || !diffgseqcols); p++)
+    {
+      if (_rcs.findColour(sqs[0].getCharAt(p), p, sqs[0], null, 0f) != _rcs
+              .findColour(sqs[5].getCharAt(p), p, sqs[5], null, 0f))
+      {
+        diffseqcols = true;
+      }
+    }
+    assertTrue(diffseqcols, "Got Different sequence colours");
+    System.out
+            .println("Per sequence colourscheme (Background) successfully applied and recovered.");
+
+    assertNotNull(_rgcs, "Didn't recover group colourscheme");
+    assertTrue(_rgcs instanceof AnnotationColourGradient,
+            "Didn't recover annotation colour group colourscheme");
+    __rcs = (AnnotationColourGradient) _rgcs;
+    assertTrue(__rcs.isSeqAssociated(),
+            "Group Annotation colourscheme wasn't sequence associated");
+
+    for (int p = 0, pSize = af.getViewport().getAlignment().getWidth(); p < pSize
+            && (!diffseqcols || !diffgseqcols); p++)
+    {
+      if (_rgcs.findColour(sqs[1].getCharAt(p), p, sqs[1], null, 0f) != _rgcs
+              .findColour(sqs[2].getCharAt(p), p, sqs[2], null, 0f))
+      {
+        diffgseqcols = true;
+      }
+    }
+    assertTrue(diffgseqcols, "Got Different group sequence colours");
+    System.out
+            .println("Per sequence (Group) colourscheme successfully applied and recovered.");
+  }
+
+  @Test(groups = { "Functional" })
+  public void gatherViewsHere() throws Exception
+  {
+    int origCount = Desktop.getAlignFrames() == null ? 0 : Desktop
+            .getAlignFrames().length;
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+    assertTrue(Desktop.getAlignFrames().length == 1 + origCount,
+            "Didn't gather the views in the example file.");
+
+  }
+
+  /**
+   * Test for JAL-2223 - multiple mappings in View Mapping report
+   * 
+   * @throws Exception
+   */
+  @Test(groups = { "Functional" })
+  public void noDuplicatePdbMappingsMade() throws Exception
+  {
+    StructureImportSettings.setProcessSecondaryStructure(true);
+    StructureImportSettings.setVisibleChainAnnotation(true);
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+
+    // locate Jmol viewer
+    // count number of PDB mappings the structure selection manager holds -
+    String pdbFile = af.getCurrentView().getStructureSelectionManager()
+            .findFileForPDBId("1A70");
+    assertEquals(
+            af.getCurrentView().getStructureSelectionManager()
+                    .getMapping(pdbFile).length,
+            2, "Expected only two mappings for 1A70");
+
+  }
+
+  @Test(groups = { "Functional" })
+  public void viewRefPdbAnnotation() throws Exception
+  {
+    StructureImportSettings.setProcessSecondaryStructure(true);
+    StructureImportSettings.setVisibleChainAnnotation(true);
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+    AlignmentViewPanel sps = null;
+    for (AlignmentViewPanel ap : af.alignPanel.alignFrame.getAlignPanels())
+    {
+      if ("Spinach Feredoxin Structure".equals(ap.getViewName()))
+      {
+        sps = ap;
+        break;
+      }
+    }
+    assertNotNull(sps, "Couldn't find the structure view");
+    AlignmentAnnotation refan = null;
+    for (AlignmentAnnotation ra : sps.getAlignment()
+            .getAlignmentAnnotation())
+    {
+      if (ra.graph != 0)
+      {
+        refan = ra;
+        break;
+      }
+    }
+    assertNotNull(refan, "Annotation secondary structure not found.");
+    SequenceI sq = sps.getAlignment().findName("1A70|");
+    assertNotNull(sq, "Couldn't find 1a70 null chain");
+    // compare the manually added temperature factor annotation
+    // to the track automatically transferred from the pdb structure on load
+    assertNotNull(sq.getDatasetSequence().getAnnotation(),
+            "1a70 has no annotation");
+    for (AlignmentAnnotation ala : sq.getDatasetSequence().getAnnotation())
+    {
+      AlignmentAnnotation alaa;
+      sq.addAlignmentAnnotation(alaa = new AlignmentAnnotation(ala));
+      alaa.adjustForAlignment();
+      if (ala.graph == refan.graph)
+      {
+        for (int p = 0; p < ala.annotations.length; p++)
+        {
+          sq.findPosition(p);
+          try
+          {
+            assertTrue(
+                    (alaa.annotations[p] == null && refan.annotations[p] == null)
+                            || alaa.annotations[p].value == refan.annotations[p].value,
+                    "Mismatch at alignment position " + p);
+          } catch (NullPointerException q)
+          {
+            Assert.fail("Mismatch of alignment annotations at position "
+                    + p + " Ref seq ann: " + refan.annotations[p]
+                    + " alignment " + alaa.annotations[p]);
+          }
+        }
+      }
+    }
+
+  }
+
+  @Test(groups = { "Functional" })
+  public void testCopyViewSettings() throws Exception
+  {
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+    AlignmentViewPanel sps = null, groups = null;
+    for (AlignmentViewPanel ap : af.alignPanel.alignFrame.getAlignPanels())
+    {
+      if ("Spinach Feredoxin Structure".equals(ap.getViewName()))
+      {
+        sps = ap;
+      }
+      if (ap.getViewName().contains("MAFFT"))
+      {
+        groups = ap;
+      }
+    }
+    assertNotNull(sps, "Couldn't find the structure view");
+    assertNotNull(groups, "Couldn't find the MAFFT view");
+
+    ViewStyleI structureStyle = sps.getAlignViewport().getViewStyle();
+    ViewStyleI groupStyle = groups.getAlignViewport().getViewStyle();
+    AssertJUnit.assertFalse(structureStyle.sameStyle(groupStyle));
+
+    groups.getAlignViewport().setViewStyle(structureStyle);
+    AssertJUnit.assertFalse(groupStyle.sameStyle(groups.getAlignViewport()
+            .getViewStyle()));
+    Assert.assertTrue(structureStyle.sameStyle(groups.getAlignViewport()
+            .getViewStyle()));
+
+  }
+
+  /**
+   * test store and recovery of expanded views
+   * 
+   * @throws Exception
+   */
+  @Test(groups = { "Functional" }, enabled = true)
+  public void testStoreAndRecoverExpandedviews() throws Exception
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    Assert.assertEquals(Desktop.getAlignFrames().length, 1);
+    String afid = af.getViewport().getSequenceSetId();
+
+    // check FileLoader returned a reference to the one alignFrame that is
+    // actually on the Desktop
+    assertSame(
+            af,
+            Desktop.getAlignFrameFor(af.getViewport()),
+            "Jalview2XML.loadAlignFrame() didn't return correct AlignFrame reference for multiple view window");
+
+    Desktop.explodeViews(af);
+
+    int oldviews = Desktop.getAlignFrames().length;
+    Assert.assertEquals(Desktop.getAlignFrames().length,
+            Desktop.getAlignmentPanels(afid).length);
+    File tfile = File.createTempFile("testStoreAndRecoverExpanded", ".jvp");
+    try
+    {
+      new Jalview2XML(false).saveState(tfile);
+    } catch (Error e)
+    {
+      Assert.fail("Didn't save the expanded view state", e);
+    } catch (Exception e)
+    {
+      Assert.fail("Didn't save the expanded view state", e);
+    }
+    Desktop.instance.closeAll_actionPerformed(null);
+    if (Desktop.getAlignFrames() != null)
+    {
+      Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+    }
+    af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+            DataSourceType.FILE);
+    Assert.assertNotNull(af);
+    Assert.assertEquals(
+            Desktop.getAlignFrames().length,
+            Desktop.getAlignmentPanels(af.getViewport().getSequenceSetId()).length);
+    Assert.assertEquals(
+            Desktop.getAlignmentPanels(af.getViewport().getSequenceSetId()).length,
+            oldviews);
+  }
+
+  /**
+   * Test save and reload of a project with a different representative sequence
+   * in each view.
+   * 
+   * @throws Exception
+   */
+  @Test(groups = { "Functional" })
+  public void testStoreAndRecoverReferenceSeqSettings() throws Exception
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+    String afid = af.getViewport().getSequenceSetId();
+
+    // remember reference sequence for each panel
+    Map<String, SequenceI> refseqs = new HashMap<>();
+
+    /*
+     * mark sequence 2, 3, 4.. in panels 1, 2, 3...
+     * as reference sequence for itself and the preceding sequence
+     */
+    int n = 1;
+    for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))
+    {
+      AlignViewportI av = ap.getAlignViewport();
+      AlignmentI alignment = ap.getAlignment();
+      int repIndex = n % alignment.getHeight();
+      SequenceI rep = alignment.getSequenceAt(repIndex);
+      refseqs.put(ap.getViewName(), rep);
+
+      // code from mark/unmark sequence as reference in jalview.gui.PopupMenu
+      // todo refactor this to an alignment view controller
+      av.setDisplayReferenceSeq(true);
+      av.setColourByReferenceSeq(true);
+      av.getAlignment().setSeqrep(rep);
+
+      n++;
+    }
+    File tfile = File.createTempFile("testStoreAndRecoverReferenceSeq",
+            ".jvp");
+    try
+    {
+      new Jalview2XML(false).saveState(tfile);
+    } catch (Throwable e)
+    {
+      Assert.fail("Didn't save the expanded view state", e);
+    }
+    Desktop.instance.closeAll_actionPerformed(null);
+    if (Desktop.getAlignFrames() != null)
+    {
+      Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+    }
+
+    af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+            DataSourceType.FILE);
+    afid = af.getViewport().getSequenceSetId();
+
+    for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))
+    {
+      // check representative
+      AlignmentI alignment = ap.getAlignment();
+      SequenceI rep = alignment.getSeqrep();
+      Assert.assertNotNull(rep,
+              "Couldn't restore sequence representative from project");
+      // can't use a strong equals here, because by definition, the sequence IDs
+      // will be different.
+      // could set vamsas session save/restore flag to preserve IDs across
+      // load/saves.
+      Assert.assertEquals(refseqs.get(ap.getViewName()).toString(),
+              rep.toString(),
+              "Representative wasn't the same when recovered.");
+      Assert.assertTrue(ap.getAlignViewport().isDisplayReferenceSeq(),
+              "Display reference sequence view setting not set.");
+      Assert.assertTrue(ap.getAlignViewport().isColourByReferenceSeq(),
+              "Colour By Reference Seq view setting not set.");
+    }
+  }
+
+  @Test(groups = { "Functional" })
+  public void testIsVersionStringLaterThan()
+  {
+    /*
+     * No version / development / test / autobuild is leniently assumed to be
+     * compatible
+     */
+    assertTrue(Jalview2XML.isVersionStringLaterThan(null, null));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", null));
+    assertTrue(Jalview2XML.isVersionStringLaterThan(null, "2.8.3"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan(null,
+            "Development Build"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan(null,
+            "DEVELOPMENT BUILD"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3",
+            "Development Build"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan(null, "Test"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan(null, "TEST"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", "Test"));
+    assertTrue(Jalview2XML
+            .isVersionStringLaterThan(null, "Automated Build"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3",
+            "Automated Build"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3",
+            "AUTOMATED BUILD"));
+
+    /*
+     * same version returns true i.e. compatible
+     */
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8", "2.8"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.8.3"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3b1", "2.8.3b1"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3B1", "2.8.3b1"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3b1", "2.8.3B1"));
+
+    /*
+     * later version returns true
+     */
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.8.4"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.9"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.9.2"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8", "2.8.3"));
+    assertTrue(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.8.3b1"));
+
+    /*
+     * earlier version returns false
+     */
+    assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.8"));
+    assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.4", "2.8.3"));
+    assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.3b1", "2.8.3"));
+    assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.8.2b1"));
+    assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.0b2", "2.8.0b1"));
+  }
+
+  /**
+   * Test save and reload of a project with a different sequence group (and
+   * representative sequence) in each view.
+   * 
+   * @throws Exception
+   */
+  @Test(groups = { "Functional" })
+  public void testStoreAndRecoverGroupRepSeqs() throws Exception
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/uniref50.fa", DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+    String afid = af.getViewport().getSequenceSetId();
+    // make a second view of the alignment
+    af.newView_actionPerformed(null);
+
+    /*
+     * remember representative and hidden sequences marked 
+     * on each panel
+     */
+    Map<String, SequenceI> repSeqs = new HashMap<>();
+    Map<String, List<String>> hiddenSeqNames = new HashMap<>();
+
+    /*
+     * mark sequence 2, 3, 4.. in panels 1, 2, 3...
+     * as reference sequence for itself and the preceding sequence
+     */
+    int n = 1;
+    for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))
+    {
+      AlignViewportI av = ap.getAlignViewport();
+      AlignmentI alignment = ap.getAlignment();
+      int repIndex = n % alignment.getHeight();
+      // ensure at least one preceding sequence i.e. index >= 1
+      repIndex = Math.max(repIndex, 1);
+      SequenceI repSeq = alignment.getSequenceAt(repIndex);
+      repSeqs.put(ap.getViewName(), repSeq);
+      List<String> hiddenNames = new ArrayList<>();
+      hiddenSeqNames.put(ap.getViewName(), hiddenNames);
+
+      /*
+       * have rep sequence represent itself and the one before it
+       * this hides the group (except for the rep seq)
+       */
+      SequenceGroup sg = new SequenceGroup();
+      sg.addSequence(repSeq, false);
+      SequenceI precedingSeq = alignment.getSequenceAt(repIndex - 1);
+      sg.addSequence(precedingSeq, false);
+      sg.setSeqrep(repSeq);
+      assertTrue(sg.getSequences().contains(repSeq));
+      assertTrue(sg.getSequences().contains(precedingSeq));
+      av.setSelectionGroup(sg);
+      assertSame(repSeq, sg.getSeqrep());
+
+      /*
+       * represent group with sequence adds to a map of hidden rep sequences
+       * (it does not create a group on the alignment) 
+       */
+      ((AlignmentViewport) av).hideSequences(repSeq, true);
+      assertSame(repSeq, sg.getSeqrep());
+      assertTrue(sg.getSequences().contains(repSeq));
+      assertTrue(sg.getSequences().contains(precedingSeq));
+      assertTrue(alignment.getGroups().isEmpty(), "alignment has groups");
+      Map<SequenceI, SequenceCollectionI> hiddenRepSeqsMap = av
+              .getHiddenRepSequences();
+      assertNotNull(hiddenRepSeqsMap);
+      assertEquals(1, hiddenRepSeqsMap.size());
+      assertSame(sg, hiddenRepSeqsMap.get(repSeq));
+      assertTrue(alignment.getHiddenSequences().isHidden(precedingSeq));
+      assertFalse(alignment.getHiddenSequences().isHidden(repSeq));
+      hiddenNames.add(precedingSeq.getName());
+
+      n++;
+    }
+    File tfile = File
+            .createTempFile("testStoreAndRecoverGroupReps", ".jvp");
+    try
+    {
+      new Jalview2XML(false).saveState(tfile);
+    } catch (Throwable e)
+    {
+      Assert.fail("Didn't save the expanded view state", e);
+    }
+    Desktop.instance.closeAll_actionPerformed(null);
+    if (Desktop.getAlignFrames() != null)
+    {
+      Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+    }
+
+    af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+            DataSourceType.FILE);
+    afid = af.getViewport().getSequenceSetId();
+
+    for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))
+    {
+      String viewName = ap.getViewName();
+      AlignViewportI av = ap.getAlignViewport();
+      AlignmentI alignment = ap.getAlignment();
+      List<SequenceGroup> groups = alignment.getGroups();
+      assertNotNull(groups);
+      assertTrue(groups.isEmpty(), "Alignment has groups");
+      Map<SequenceI, SequenceCollectionI> hiddenRepSeqsMap = av
+              .getHiddenRepSequences();
+      assertNotNull(hiddenRepSeqsMap, "No hidden represented sequences");
+      assertEquals(1, hiddenRepSeqsMap.size());
+      assertEquals(repSeqs.get(viewName).getDisplayId(true),
+              hiddenRepSeqsMap.keySet().iterator().next()
+                      .getDisplayId(true));
+
+      /*
+       * verify hidden sequences in restored panel
+       */
+      List<String> hidden = hiddenSeqNames.get(ap.getViewName());
+      HiddenSequences hs = alignment.getHiddenSequences();
+      assertEquals(
+              hidden.size(),
+              hs.getSize(),
+              "wrong number of restored hidden sequences in "
+                      + ap.getViewName());
+    }
+  }
+
+  /**
+   * Test save and reload of PDBEntry in Jalview project
+   * 
+   * @throws Exception
+   */
+  @Test(groups = { "Functional" })
+  public void testStoreAndRecoverPDBEntry() throws Exception
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+    String exampleFile = "examples/3W5V.pdb";
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(exampleFile,
+            DataSourceType.FILE);
+    assertNotNull(af, "Didn't read in the example file correctly.");
+    String afid = af.getViewport().getSequenceSetId();
+
+    AlignmentPanel[] alignPanels = Desktop.getAlignmentPanels(afid);
+    System.out.println();
+    AlignmentViewPanel ap = alignPanels[0];
+    String tfileBase = new File(".").getAbsolutePath().replace(".", "");
+    String testFile = tfileBase + exampleFile;
+    AlignmentI alignment = ap.getAlignment();
+    System.out.println("blah");
+    SequenceI[] seqs = alignment.getSequencesArray();
+    Assert.assertNotNull(seqs[0]);
+    Assert.assertNotNull(seqs[1]);
+    Assert.assertNotNull(seqs[2]);
+    Assert.assertNotNull(seqs[3]);
+    Assert.assertNotNull(seqs[0].getDatasetSequence());
+    Assert.assertNotNull(seqs[1].getDatasetSequence());
+    Assert.assertNotNull(seqs[2].getDatasetSequence());
+    Assert.assertNotNull(seqs[3].getDatasetSequence());
+    PDBEntry[] pdbEntries = new PDBEntry[4];
+    pdbEntries[0] = new PDBEntry("3W5V", "A", Type.PDB, testFile);
+    pdbEntries[1] = new PDBEntry("3W5V", "B", Type.PDB, testFile);
+    pdbEntries[2] = new PDBEntry("3W5V", "C", Type.PDB, testFile);
+    pdbEntries[3] = new PDBEntry("3W5V", "D", Type.PDB, testFile);
+    Assert.assertEquals(seqs[0].getDatasetSequence().getAllPDBEntries()
+            .get(0), pdbEntries[0]);
+    Assert.assertEquals(seqs[1].getDatasetSequence().getAllPDBEntries()
+            .get(0), pdbEntries[1]);
+    Assert.assertEquals(seqs[2].getDatasetSequence().getAllPDBEntries()
+            .get(0), pdbEntries[2]);
+    Assert.assertEquals(seqs[3].getDatasetSequence().getAllPDBEntries()
+            .get(0), pdbEntries[3]);
+
+    File tfile = File.createTempFile("testStoreAndRecoverPDBEntry", ".jvp");
+    try
+    {
+      new Jalview2XML(false).saveState(tfile);
+    } catch (Throwable e)
+    {
+      Assert.fail("Didn't save the state", e);
+    }
+    Desktop.instance.closeAll_actionPerformed(null);
+    if (Desktop.getAlignFrames() != null)
+    {
+      Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+    }
+
+    AlignFrame restoredFrame = new FileLoader().LoadFileWaitTillLoaded(
+            tfile.getAbsolutePath(), DataSourceType.FILE);
+    String rfid = restoredFrame.getViewport().getSequenceSetId();
+    AlignmentPanel[] rAlignPanels = Desktop.getAlignmentPanels(rfid);
+    AlignmentViewPanel rap = rAlignPanels[0];
+    AlignmentI rAlignment = rap.getAlignment();
+    System.out.println("blah");
+    SequenceI[] rseqs = rAlignment.getSequencesArray();
+    Assert.assertNotNull(rseqs[0]);
+    Assert.assertNotNull(rseqs[1]);
+    Assert.assertNotNull(rseqs[2]);
+    Assert.assertNotNull(rseqs[3]);
+    Assert.assertNotNull(rseqs[0].getDatasetSequence());
+    Assert.assertNotNull(rseqs[1].getDatasetSequence());
+    Assert.assertNotNull(rseqs[2].getDatasetSequence());
+    Assert.assertNotNull(rseqs[3].getDatasetSequence());
+
+    // The Asserts below are expected to fail until the PDB chainCode is
+    // recoverable from a Jalview projects
+    for (int chain = 0; chain < 4; chain++)
+    {
+      PDBEntry recov = rseqs[chain].getDatasetSequence().getAllPDBEntries()
+              .get(0);
+      PDBEntry expected = pdbEntries[chain];
+      Assert.assertEquals(recov.getId(), expected.getId(),
+              "Mismatch PDB ID");
+      Assert.assertEquals(recov.getChainCode(), expected.getChainCode(),
+              "Mismatch PDB ID");
+      Assert.assertEquals(recov.getType(), expected.getType(),
+              "Mismatch PDBEntry 'Type'");
+      Assert.assertNotNull(recov.getFile(),
+              "Recovered PDBEntry should have a non-null file entry");
+    }
+  }
+
+  /**
+   * Configure an alignment and a sub-group each with distinct colour schemes,
+   * Conservation and PID thresholds, and confirm these are restored from the
+   * saved project.
+   * 
+   * @throws IOException
+   */
+  @Test(groups = { "Functional" })
+  public void testStoreAndRecoverColourThresholds() throws IOException
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/uniref50.fa", DataSourceType.FILE);
+
+    AlignViewport av = af.getViewport();
+    AlignmentI al = av.getAlignment();
+
+    /*
+     * Colour alignment by Buried Index, Above 10% PID, By Conservation 20%
+     */
+    af.changeColour_actionPerformed(JalviewColourScheme.Buried.toString());
+    assertTrue(av.getGlobalColourScheme() instanceof BuriedColourScheme);
+    af.abovePIDThreshold_actionPerformed(true);
+    SliderPanel sp = SliderPanel.getSliderPanel();
+    assertFalse(sp.isForConservation());
+    sp.valueChanged(10);
+    af.conservationMenuItem_actionPerformed(true);
+    sp = SliderPanel.getSliderPanel();
+    assertTrue(sp.isForConservation());
+    sp.valueChanged(20);
+    ResidueShaderI rs = av.getResidueShading();
+    assertEquals(rs.getThreshold(), 10);
+    assertTrue(rs.conservationApplied());
+    assertEquals(rs.getConservationInc(), 20);
+
+    /*
+     * create a group with Strand colouring, 30% Conservation
+     * and 40% PID threshold
+     */
+    SequenceGroup sg = new SequenceGroup();
+    sg.addSequence(al.getSequenceAt(0), false);
+    sg.setStartRes(15);
+    sg.setEndRes(25);
+    av.setSelectionGroup(sg);
+    PopupMenu popupMenu = new PopupMenu(af.alignPanel, null, null);
+    popupMenu.changeColour_actionPerformed(JalviewColourScheme.Strand
+            .toString());
+    assertTrue(sg.getColourScheme() instanceof StrandColourScheme);
+    assertEquals(al.getGroups().size(), 1);
+    assertSame(al.getGroups().get(0), sg);
+    popupMenu.conservationMenuItem_actionPerformed(true);
+    sp = SliderPanel.getSliderPanel();
+    assertTrue(sp.isForConservation());
+    sp.valueChanged(30);
+    popupMenu.abovePIDColour_actionPerformed(true);
+    sp = SliderPanel.getSliderPanel();
+    assertFalse(sp.isForConservation());
+    sp.valueChanged(40);
+    assertTrue(sg.getGroupColourScheme().conservationApplied());
+    assertEquals(sg.getGroupColourScheme().getConservationInc(), 30);
+    assertEquals(sg.getGroupColourScheme().getThreshold(), 40);
+
+    /*
+     * save project, close windows, reload project, verify
+     */
+    File tfile = File.createTempFile("testStoreAndRecoverColourThresholds",
+            ".jvp");
+    tfile.deleteOnExit();
+    new Jalview2XML(false).saveState(tfile);
+    Desktop.instance.closeAll_actionPerformed(null);
+    af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+            DataSourceType.FILE);
+    Assert.assertNotNull(af, "Failed to reload project");
+
+    /*
+     * verify alignment (background) colouring
+     */
+    rs = af.getViewport().getResidueShading();
+    assertTrue(rs.getColourScheme() instanceof BuriedColourScheme);
+    assertEquals(rs.getThreshold(), 10);
+    assertTrue(rs.conservationApplied());
+    assertEquals(rs.getConservationInc(), 20);
+
+    /*
+     * verify group colouring
+     */
+    assertEquals(1, af.getViewport().getAlignment().getGroups().size(), 1);
+    rs = af.getViewport().getAlignment().getGroups().get(0)
+            .getGroupColourScheme();
+    assertTrue(rs.getColourScheme() instanceof StrandColourScheme);
+    assertEquals(rs.getThreshold(), 40);
+    assertTrue(rs.conservationApplied());
+    assertEquals(rs.getConservationInc(), 30);
+  }
+
+  /**
+   * Test save and reload of feature colour schemes and filter settings
+   * 
+   * @throws IOException
+   */
+  @Test(groups = { "Functional" })
+  public void testSaveLoadFeatureColoursAndFilters() throws IOException
+  {
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            ">Seq1\nACDEFGHIKLM", DataSourceType.PASTE);
+    SequenceI seq1 = af.getViewport().getAlignment().getSequenceAt(0);
+
+    /*
+     * add some features to the sequence
+     */
+    int score = 1;
+    addFeatures(seq1, "type1", score++);
+    addFeatures(seq1, "type2", score++);
+    addFeatures(seq1, "type3", score++);
+    addFeatures(seq1, "type4", score++);
+    addFeatures(seq1, "type5", score++);
+
+    /*
+     * set colour schemes for features
+     */
+    FeatureRenderer fr = af.getFeatureRenderer();
+    fr.findAllFeatures(true);
+
+    // type1: red
+    fr.setColour("type1", new FeatureColour(Color.red));
+
+    // type2: by label
+    FeatureColourI byLabel = new FeatureColour();
+    byLabel.setColourByLabel(true);
+    fr.setColour("type2", byLabel);
+
+    // type3: by score above threshold
+    FeatureColourI byScore = new FeatureColour(Color.BLACK, Color.BLUE, 1,
+            10);
+    byScore.setAboveThreshold(true);
+    byScore.setThreshold(2f);
+    fr.setColour("type3", byScore);
+
+    // type4: by attribute AF
+    FeatureColourI byAF = new FeatureColour();
+    byAF.setColourByLabel(true);
+    byAF.setAttributeName("AF");
+    fr.setColour("type4", byAF);
+
+    // type5: by attribute CSQ:PolyPhen below threshold
+    FeatureColourI byPolyPhen = new FeatureColour(Color.BLACK, Color.BLUE,
+            1, 10);
+    byPolyPhen.setBelowThreshold(true);
+    byPolyPhen.setThreshold(3f);
+    byPolyPhen.setAttributeName("CSQ", "PolyPhen");
+    fr.setColour("type5", byPolyPhen);
+
+    /*
+     * set filters for feature types
+     */
+
+    // filter type1 features by (label contains "x")
+    FeatureMatcherSetI filterByX = new FeatureMatcherSet();
+    filterByX.and(FeatureMatcher.byLabel(Condition.Contains, "x"));
+    fr.setFeatureFilter("type1", filterByX);
+
+    // filter type2 features by (score <= 2.4 and score > 1.1)
+    FeatureMatcherSetI filterByScore = new FeatureMatcherSet();
+    filterByScore.and(FeatureMatcher.byScore(Condition.LE, "2.4"));
+    filterByScore.and(FeatureMatcher.byScore(Condition.GT, "1.1"));
+    fr.setFeatureFilter("type2", filterByScore);
+
+    // filter type3 features by (AF contains X OR CSQ:PolyPhen != 0)
+    FeatureMatcherSetI filterByXY = new FeatureMatcherSet();
+    filterByXY
+            .and(FeatureMatcher.byAttribute(Condition.Contains, "X", "AF"));
+    filterByXY.or(FeatureMatcher.byAttribute(Condition.NE, "0", "CSQ",
+            "PolyPhen"));
+    fr.setFeatureFilter("type3", filterByXY);
+
+    /*
+     * save as Jalview project
+     */
+    File tfile = File.createTempFile("JalviewTest", ".jvp");
+    tfile.deleteOnExit();
+    String filePath = tfile.getAbsolutePath();
+    assertTrue(af.saveAlignment(filePath, FileFormat.Jalview),
+            "Failed to store as a project.");
+
+    /*
+     * close current alignment and load the saved project
+     */
+    af.closeMenuItem_actionPerformed(true);
+    af = null;
+    af = new FileLoader()
+            .LoadFileWaitTillLoaded(filePath, DataSourceType.FILE);
+    assertNotNull(af, "Failed to import new project");
+
+    /*
+     * verify restored feature colour schemes and filters
+     */
+    fr = af.getFeatureRenderer();
+    FeatureColourI fc = fr.getFeatureStyle("type1");
+    assertTrue(fc.isSimpleColour());
+    assertEquals(fc.getColour(), Color.red);
+    fc = fr.getFeatureStyle("type2");
+    assertTrue(fc.isColourByLabel());
+    fc = fr.getFeatureStyle("type3");
+    assertTrue(fc.isGraduatedColour());
+    assertNull(fc.getAttributeName());
+    assertTrue(fc.isAboveThreshold());
+    assertEquals(fc.getThreshold(), 2f);
+    fc = fr.getFeatureStyle("type4");
+    assertTrue(fc.isColourByLabel());
+    assertTrue(fc.isColourByAttribute());
+    assertEquals(fc.getAttributeName(), new String[] { "AF" });
+    fc = fr.getFeatureStyle("type5");
+    assertTrue(fc.isGraduatedColour());
+    assertTrue(fc.isColourByAttribute());
+    assertEquals(fc.getAttributeName(), new String[] { "CSQ", "PolyPhen" });
+    assertTrue(fc.isBelowThreshold());
+    assertEquals(fc.getThreshold(), 3f);
+
+    assertEquals(fr.getFeatureFilter("type1").toStableString(),
+            "Label Contains x");
+    assertEquals(fr.getFeatureFilter("type2").toStableString(),
+            "(Score LE 2.4) AND (Score GT 1.1)");
+    assertEquals(fr.getFeatureFilter("type3").toStableString(),
+            "(AF Contains X) OR (CSQ:PolyPhen NE 0.0)");
+  }
+
+  private void addFeature(SequenceI seq, String featureType, int score)
+  {
+    SequenceFeature sf = new SequenceFeature(featureType, "desc", 1, 2,
+            score, "grp");
+    sf.setValue("AF", score);
+    sf.setValue("CSQ", new HashMap<String, String>()
+    {
+      {
+        put("PolyPhen", Integer.toString(score));
+      }
+    });
+    seq.addSequenceFeature(sf);
+  }
+
+  /**
+   * Adds two features of the given type to the given sequence, also setting the
+   * score as the value of attribute "AF" and sub-attribute "CSQ:PolyPhen"
+   * 
+   * @param seq
+   * @param featureType
+   * @param score
+   */
+  private void addFeatures(SequenceI seq, String featureType, int score)
+  {
+    addFeature(seq, featureType, score++);
+    addFeature(seq, featureType, score);
+  }
+
+  /**
+   * pre 2.11 - jalview 2.10 erroneously created new dataset entries for each
+   * view (JAL-3171) this test ensures we can import and merge those views
+   */
+  @Test(groups = { "Functional" })
+  public void testMergeDatasetsforViews() throws IOException
+  {
+    // simple project - two views on one alignment
+    AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded(
+            "examples/testdata/projects/twoViews.jvp", DataSourceType.FILE);
+    assertNotNull(af);
+    assertTrue(af.getAlignPanels().size() > 1);
+    verifyDs(af);
+  }
+
+  /**
+   * pre 2.11 - jalview 2.10 erroneously created new dataset entries for each
+   * view (JAL-3171) this test ensures we can import and merge those views This
+   * is a more complex project
+   */
+  @Test(groups = { "Functional" })
+  public void testMergeDatasetsforManyViews() throws IOException
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+
+    // complex project - one dataset, several views on several alignments
+    AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded(
+            "examples/testdata/projects/manyViews.jvp",
+            DataSourceType.FILE);
+    assertNotNull(af);
+
+    AlignmentI ds = null;
+    for (AlignFrame alignFrame : Desktop.getAlignFrames())
+    {
+      if (ds == null)
+      {
+        ds = verifyDs(alignFrame);
+      }
+      else
+      {
+        // check that this frame's dataset matches the last
+        assertTrue(ds == verifyDs(alignFrame));
+      }
+    }
+  }
+
+  private AlignmentI verifyDs(AlignFrame af)
+  {
+    AlignmentI ds = null;
+    for (AlignmentViewPanel ap : af.getAlignPanels())
+    {
+      if (ds == null)
+      {
+        ds = ap.getAlignment().getDataset();
+      }
+      else
+      {
+        assertTrue(ap.getAlignment().getDataset() == ds,
+                "Dataset was not the same for imported 2.10.5 project with several alignment views");
+      }
+    }
+    return ds;
+  }
+}
index bc9c2e4..1d532f7 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.renderer;
 
 import static org.testng.Assert.assertEquals;
index da7cada..11b129e 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.renderer.seqfeatures;
 
 import static org.testng.Assert.assertEquals;
index 85aea40..4bee3f5 100644 (file)
@@ -260,6 +260,8 @@ public class Mapping
   @Test(groups = { "Functional" })
   public void compareTransferredToRefPDBAnnot() throws Exception
   {
+    StructureImportSettings.setProcessSecondaryStructure(true);
+    StructureImportSettings.setVisibleChainAnnotation(true);
     StructureImportSettings.setShowSeqFeatures(true);
     AlignFrame ref = new FileLoader(false)
             .LoadFileWaitTillLoaded("test/jalview/ext/jmol/1QCF.pdb",
index f26c5f1..808e662 100644 (file)
@@ -1,8 +1,34 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.structure;
 
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
+import jalview.datamodel.Mapping;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.util.MapList;
+
 import java.util.HashMap;
 import java.util.List;
 
@@ -11,9 +37,9 @@ import org.testng.annotations.Test;
 public class StructureMappingTest
 {
   @Test(groups = "Functional")
-  public void testgetPDBResNumRanges()
+  public void testGetPDBResNumRanges()
   {
-    HashMap<Integer, int[]> map = new HashMap<Integer, int[]>();
+    HashMap<Integer, int[]> map = new HashMap<>();
 
     StructureMapping mapping = new StructureMapping(null, null, null, null,
             map, null);
@@ -43,4 +69,75 @@ public class StructureMappingTest
     assertEquals(ranges.get(1)[0], 15);
     assertEquals(ranges.get(1)[1], 15);
   }
+
+  @Test(groups = "Functional")
+  public void testEquals()
+  {
+    SequenceI seq1 = new Sequence("seq1", "ABCDE");
+    SequenceI seq2 = new Sequence("seq1", "ABCDE");
+    String pdbFile = "a/b/file1.pdb";
+    String pdbId = "1a70";
+    String chain = "A";
+    String mappingDetails = "these are the mapping details, honest";
+    HashMap<Integer, int[]> map = new HashMap<>();
+
+    Mapping seqToPdbMapping = new Mapping(seq1,
+            new MapList(new int[]
+            { 1, 5 }, new int[] { 2, 6 }, 1, 1));
+    StructureMapping sm1 = new StructureMapping(seq1, pdbFile, pdbId, chain,
+            map, mappingDetails, seqToPdbMapping);
+    assertFalse(sm1.equals(null));
+    assertFalse(sm1.equals("x"));
+
+    StructureMapping sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain,
+            map, mappingDetails, seqToPdbMapping);
+    assertTrue(sm1.equals(sm2));
+    assertTrue(sm2.equals(sm1));
+    assertEquals(sm1.hashCode(), sm2.hashCode());
+
+    // with different sequence
+    sm2 = new StructureMapping(seq2, pdbFile, pdbId, chain, map,
+            mappingDetails, seqToPdbMapping);
+    assertFalse(sm1.equals(sm2));
+    assertFalse(sm2.equals(sm1));
+
+    // with different file
+    sm2 = new StructureMapping(seq1, "a/b/file2.pdb", pdbId, chain, map,
+            mappingDetails, seqToPdbMapping);
+    assertFalse(sm1.equals(sm2));
+    assertFalse(sm2.equals(sm1));
+
+    // with different pdbid (case sensitive)
+    sm2 = new StructureMapping(seq1, pdbFile, "1A70", chain, map,
+            mappingDetails, seqToPdbMapping);
+    assertFalse(sm1.equals(sm2));
+    assertFalse(sm2.equals(sm1));
+
+    // with different chain
+    sm2 = new StructureMapping(seq1, pdbFile, pdbId, "B", map,
+            mappingDetails, seqToPdbMapping);
+    assertFalse(sm1.equals(sm2));
+    assertFalse(sm2.equals(sm1));
+
+    // map is ignore for this test
+    sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain, null,
+            mappingDetails, seqToPdbMapping);
+    assertTrue(sm1.equals(sm2));
+    assertTrue(sm2.equals(sm1));
+
+    // with different mapping details
+    sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain, map,
+            "different details!", seqToPdbMapping);
+    assertFalse(sm1.equals(sm2));
+    assertFalse(sm2.equals(sm1));
+
+    // with different seq to pdb mapping
+    Mapping map2 = new Mapping(seq1,
+            new MapList(new int[]
+            { 1, 5 }, new int[] { 3, 7 }, 1, 1));
+    sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain, map,
+            mappingDetails, map2);
+    assertFalse(sm1.equals(sm2));
+    assertFalse(sm2.equals(sm1));
+  }
 }
index 029b681..86dcc39 100644 (file)
@@ -391,7 +391,9 @@ public class MapListTest
     MapList ml7 = new MapList(codons, protein, 3, 1); // toShifts differ
 
     assertTrue(ml.equals(ml));
+    assertEquals(ml.hashCode(), ml.hashCode());
     assertTrue(ml.equals(ml1));
+    assertEquals(ml.hashCode(), ml1.hashCode());
     assertTrue(ml1.equals(ml));
 
     assertFalse(ml.equals(null));
@@ -826,22 +828,31 @@ public class MapListTest
      */
     MapList ml1 = new MapList(new int[] { 3, 4, 8, 12 }, new int[] { 5, 8,
         11, 13 }, 1, 1);
+    assertEquals("{[3, 4], [8, 12]}", prettyPrint(ml1.getFromRanges()));
+    assertEquals("{[5, 8], [11, 13]}", prettyPrint(ml1.getToRanges()));
+
     MapList ml2 = new MapList(new int[] { 1, 50 }, new int[] { 40, 45, 70,
         75, 90, 127 }, 1, 1);
+    assertEquals("{[1, 50]}", prettyPrint(ml2.getFromRanges()));
+    assertEquals("{[40, 45], [70, 75], [90, 127]}",
+            prettyPrint(ml2.getToRanges()));
+
     MapList compound = ml1.traverse(ml2);
 
-    assertEquals(compound.getFromRatio(), 1);
-    assertEquals(compound.getToRatio(), 1);
+    assertEquals(1, compound.getFromRatio());
+    assertEquals(1, compound.getToRatio());
     List<int[]> fromRanges = compound.getFromRanges();
-    assertEquals(fromRanges.size(), 2);
+    assertEquals(2, fromRanges.size());
     assertArrayEquals(new int[] { 3, 4 }, fromRanges.get(0));
     assertArrayEquals(new int[] { 8, 12 }, fromRanges.get(1));
     List<int[]> toRanges = compound.getToRanges();
-    assertEquals(toRanges.size(), 2);
+    assertEquals(4, toRanges.size());
     // 5-8 maps to 44-45,70-71
     // 11-13 maps to 74-75,90
-    assertArrayEquals(new int[] { 44, 45, 70, 71 }, toRanges.get(0));
-    assertArrayEquals(new int[] { 74, 75, 90, 90 }, toRanges.get(1));
+    assertArrayEquals(new int[] { 44, 45 }, toRanges.get(0));
+    assertArrayEquals(new int[] { 70, 71 }, toRanges.get(1));
+    assertArrayEquals(new int[] { 74, 75 }, toRanges.get(2));
+    assertArrayEquals(new int[] { 90, 90 }, toRanges.get(3));
 
     /*
      * 1:1 over 1:1 backwards ('reverse strand')
@@ -851,14 +862,15 @@ public class MapListTest
             new int[] { 1000, 901, 600, 201 }, 1, 1);
     compound = ml1.traverse(ml2);
 
-    assertEquals(compound.getFromRatio(), 1);
-    assertEquals(compound.getToRatio(), 1);
+    assertEquals(1, compound.getFromRatio());
+    assertEquals(1, compound.getToRatio());
     fromRanges = compound.getFromRanges();
-    assertEquals(fromRanges.size(), 1);
+    assertEquals(1, fromRanges.size());
     assertArrayEquals(new int[] { 1, 50 }, fromRanges.get(0));
     toRanges = compound.getToRanges();
-    assertEquals(toRanges.size(), 1);
-    assertArrayEquals(new int[] { 931, 901, 600, 582 }, toRanges.get(0));
+    assertEquals(2, toRanges.size());
+    assertArrayEquals(new int[] { 931, 901 }, toRanges.get(0));
+    assertArrayEquals(new int[] { 600, 582 }, toRanges.get(1));
 
     /*
      * 1:1 plus 1:3 should result in 1:3
@@ -868,15 +880,16 @@ public class MapListTest
             1, 3);
     compound = ml1.traverse(ml2);
 
-    assertEquals(compound.getFromRatio(), 1);
-    assertEquals(compound.getToRatio(), 3);
+    assertEquals(1, compound.getFromRatio());
+    assertEquals(3, compound.getToRatio());
     fromRanges = compound.getFromRanges();
-    assertEquals(fromRanges.size(), 1);
+    assertEquals(1, fromRanges.size());
     assertArrayEquals(new int[] { 1, 30 }, fromRanges.get(0));
     // 11-40 maps to 31-50,91-160
     toRanges = compound.getToRanges();
-    assertEquals(toRanges.size(), 1);
-    assertArrayEquals(new int[] { 31, 50, 91, 160 }, toRanges.get(0));
+    assertEquals(2, toRanges.size());
+    assertArrayEquals(new int[] { 31, 50 }, toRanges.get(0));
+    assertArrayEquals(new int[] { 91, 160 }, toRanges.get(1));
 
     /*
      * 3:1 plus 1:1 should result in 3:1
@@ -886,15 +899,16 @@ public class MapListTest
             1, 1);
     compound = ml1.traverse(ml2);
 
-    assertEquals(compound.getFromRatio(), 3);
-    assertEquals(compound.getToRatio(), 1);
+    assertEquals(3, compound.getFromRatio());
+    assertEquals(1, compound.getToRatio());
     fromRanges = compound.getFromRanges();
-    assertEquals(fromRanges.size(), 1);
+    assertEquals(1, fromRanges.size());
     assertArrayEquals(new int[] { 1, 30 }, fromRanges.get(0));
     // 11-20 maps to 11-15, 91-95
     toRanges = compound.getToRanges();
-    assertEquals(toRanges.size(), 1);
-    assertArrayEquals(new int[] { 11, 15, 91, 95 }, toRanges.get(0));
+    assertEquals(2, toRanges.size());
+    assertArrayEquals(new int[] { 11, 15 }, toRanges.get(0));
+    assertArrayEquals(new int[] { 91, 95 }, toRanges.get(1));
 
     /*
      * 1:3 plus 3:1 should result in 1:1
@@ -904,15 +918,16 @@ public class MapListTest
             3, 1);
     compound = ml1.traverse(ml2);
 
-    assertEquals(compound.getFromRatio(), 1);
-    assertEquals(compound.getToRatio(), 1);
+    assertEquals(1, compound.getFromRatio());
+    assertEquals(1, compound.getToRatio());
     fromRanges = compound.getFromRanges();
-    assertEquals(fromRanges.size(), 1);
+    assertEquals(1, fromRanges.size());
     assertArrayEquals(new int[] { 21, 40 }, fromRanges.get(0));
     // 13-72 maps 3:1 to 55-70, 121-124
     toRanges = compound.getToRanges();
-    assertEquals(toRanges.size(), 1);
-    assertArrayEquals(new int[] { 55, 70, 121, 124 }, toRanges.get(0));
+    assertEquals(2, toRanges.size());
+    assertArrayEquals(new int[] { 55, 70 }, toRanges.get(0));
+    assertArrayEquals(new int[] { 121, 124 }, toRanges.get(1));
 
     /*
      * 3:1 plus 1:3 should result in 1:1
@@ -922,15 +937,16 @@ public class MapListTest
             1, 3);
     compound = ml1.traverse(ml2);
 
-    assertEquals(compound.getFromRatio(), 1);
-    assertEquals(compound.getToRatio(), 1);
+    assertEquals(1, compound.getFromRatio());
+    assertEquals(1, compound.getToRatio());
     fromRanges = compound.getFromRanges();
-    assertEquals(fromRanges.size(), 1);
+    assertEquals(1, fromRanges.size());
     assertArrayEquals(new int[] { 31, 90 }, fromRanges.get(0));
     // 13-32 maps to 47-50,71-126
     toRanges = compound.getToRanges();
-    assertEquals(toRanges.size(), 1);
-    assertArrayEquals(new int[] { 47, 50, 71, 126 }, toRanges.get(0));
+    assertEquals(2, toRanges.size());
+    assertArrayEquals(new int[] { 47, 50 }, toRanges.get(0));
+    assertArrayEquals(new int[] { 71, 126 }, toRanges.get(1));
 
     /*
      * method returns null if not all regions are mapped through
index cc3dca8..d1e32b9 100644 (file)
@@ -62,7 +62,7 @@ public class PDBSequenceFetcherTest
     Cache.applicationProperties.setProperty("ADD_SS_ANN",
             Boolean.TRUE.toString());
 
-    sf = new SequenceFetcher(false);
+    sf = new SequenceFetcher();
   }
 
   /**
index 32afd5f..0b501ee 100644 (file)
@@ -52,26 +52,24 @@ public class SequenceFetcherTest
    */
   public static void main(String[] argv)
   {
-    // TODO: extracted from SequenceFetcher - convert to proper unit test with
+    // TODO: extracted from SequenceFetcher - convert to network dependent
+    // functional integration test with
     // assertions
 
     String usage = "SequenceFetcher.main [-nodas] [<DBNAME> [<ACCNO>]]\n"
             + "With no arguments, all DbSources will be queried with their test Accession number.\n"
             + "With one argument, the argument will be resolved to one or more db sources and each will be queried with their test accession only.\n"
-            + "If given two arguments, SequenceFetcher will try to find the DbFetcher corresponding to <DBNAME> and retrieve <ACCNO> from it.\n"
-            + "The -nodas option will exclude DAS sources from the database fetchers Jalview will try to use.";
-    boolean withDas = true;
-    if (argv != null && argv.length > 0
-            && argv[0].toLowerCase().startsWith("-nodas"))
+            + "If given two arguments, SequenceFetcher will try to find the DbFetcher corresponding to <DBNAME> and retrieve <ACCNO> from it.";
+
+    if (argv != null && argv.length > 0)
     {
-      withDas = false;
       String targs[] = new String[argv.length - 1];
       System.arraycopy(argv, 1, targs, 0, targs.length);
       argv = targs;
     }
     if (argv != null && argv.length > 0)
     {
-      List<DbSourceProxy> sps = new SequenceFetcher(withDas)
+      List<DbSourceProxy> sps = new SequenceFetcher()
               .getSourceProxy(argv[0]);
 
       if (sps != null)
@@ -102,7 +100,7 @@ public class SequenceFetcherTest
       System.out.println(usage);
       return;
     }
-    ASequenceFetcher sfetcher = new SequenceFetcher(withDas);
+    ASequenceFetcher sfetcher = new SequenceFetcher();
     String[] dbSources = sfetcher.getSupportedDb();
     for (int dbsource = 0; dbsource < dbSources.length; dbsource++)
     {
@@ -124,7 +122,7 @@ public class SequenceFetcherTest
           String testQuery)
   {
     AlignmentI ds = null;
-    Vector<Object[]> noProds = new Vector<Object[]>();
+    Vector<Object[]> noProds = new Vector<>();
     System.out.println("Source: " + sp.getDbName() + " (" + db
             + "): retrieving test:" + sp.getTestQuery());
     {
diff --git a/test/jalview/ws/dbsources/EmblSourceTest.java b/test/jalview/ws/dbsources/EmblSourceTest.java
new file mode 100644 (file)
index 0000000..d450495
--- /dev/null
@@ -0,0 +1,463 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.ws.dbsources;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertTrue;
+
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.SequenceI;
+import jalview.util.MapList;
+import jalview.xml.binding.embl.EntryType;
+import jalview.xml.binding.embl.EntryType.Feature;
+import jalview.xml.binding.embl.EntryType.Feature.Qualifier;
+import jalview.xml.binding.embl.XrefType;
+
+import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.testng.annotations.Test;
+
+public class EmblSourceTest
+{
+
+  // adapted from http://www.ebi.ac.uk/ena/data/view/X07547&display=xml
+  // dna and translations truncated for convenience
+  static final String TESTDATA = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
+          + "<ROOT>"
+          + "<entry accession=\"X07547\" version=\"1\" entryVersion=\"8\""
+          + " dataClass=\"STD\" taxonomicDivision=\"PRO\""
+          + " moleculeType=\"genomic DNA\" sequenceLength=\"7499\" topology=\"linear\""
+          + " firstPublic=\"1988-11-10\" firstPublicRelease=\"18\""
+          + " lastUpdated=\"1999-02-10\" lastUpdatedRelease=\"58\">"
+          + "<secondaryAccession>X07574</secondaryAccession>"
+          + "<description>C. trachomatis plasmid</description>"
+          + "<keyword>plasmid</keyword><keyword>unidentified reading frame</keyword>"
+          + "<xref db=\"EuropePMC\" id=\"PMC107176\" secondaryId=\"9573186\" />"
+          + "<xref db=\"MD5\" id=\"ac73317\" />"
+          /*
+           * first CDS (range and translation changed to keep test data manageable)
+           */
+          + "<feature name=\"CDS\" location=\"complement(46..57)\">"
+          // test the case of >1 cross-ref to the same database (JAL-2029)
+          + "<xref db=\"UniProtKB/Swiss-Prot\" id=\"B0BCM4\" secondaryId=\"2.1\" />"
+          + "<xref db=\"UniProtKB/Swiss-Prot\" id=\"P0CE20\" />"
+          + "<qualifier name=\"note\"><value>ORF 8 (AA 1-330)</value></qualifier>"
+          + "<qualifier name=\"protein_id\"><value>CAA30420.1</value></qualifier>"
+          + "<qualifier name=\"translation\"><value>MLCF</value></qualifier>"
+          + "</feature>"
+          /*
+           * second CDS (range and translation changed to keep test data manageable)
+           */
+          + "<feature name=\"CDS\" location=\"4..15\">"
+          + "<xref db=\"UniProtKB/Swiss-Prot\" id=\"B0BCM3\" />"
+          + "<qualifier name=\"protein_id\"><value>CAA30421.1</value></qualifier>"
+          + "<qualifier name=\"translation\"><value>MSSS</value></qualifier>"
+          + "</feature>"
+          /*
+           * third CDS is made up - has no xref - code should synthesize 
+           * one to an assumed EMBLCDSPROTEIN accession
+           */
+          + "<feature name=\"CDS\" location=\"join(4..6,10..15)\">"
+          + "<qualifier name=\"protein_id\"><value>CAA12345.6</value></qualifier>"
+          + "<qualifier name=\"translation\"><value>MSS</value></qualifier>"
+          + "</feature>"
+          /*
+           * sequence (modified for test purposes)
+           * emulates EMBL XML 1.2 which splits sequence data every 60 characters
+           * see EmblSequence.setSequence
+           */
+          + "<sequence>GGTATGTCCTCTAGTACAAAC\n"
+          + "ACCCCCAATATTGTGATATAATTAAAAACATAGCAT"
+          + "</sequence></entry></ROOT>";
+
+  @Test(groups = "Functional")
+  public void testGetCdsRanges()
+  {
+    EmblSource testee = new EmblSource();
+
+    /*
+     * Make a (CDS) Feature with 5 locations
+     */
+    Feature cds = new Feature();
+    cds.setLocation("join(10..20,complement(30..40),50..60,70..80,complement(110..120))");
+
+    int[] exons = testee.getCdsRanges("EMBL", cds);
+    assertEquals("[10, 20, 40, 30, 50, 60, 70, 80, 120, 110]",
+            Arrays.toString(exons));
+  }
+
+  @Test(groups = "Functional")
+  public void testGetSequence()
+  {
+    // not the whole sequence but enough for this test...
+    List<SequenceI> peptides = new ArrayList<>();
+    List<EntryType> entries = EmblSourceTest.getEmblEntries();
+    assertEquals(1, entries.size());
+    EntryType entry = entries.get(0);
+    EmblSource testee = new EmblSource();
+    String sourceDb = "EMBL";
+    SequenceI dna = testee.getSequence(sourceDb, entry, peptides);
+
+    /*
+     * newline has been removed from sequence
+     */
+    String seq = dna.getSequenceAsString();
+    assertEquals(
+            "GGTATGTCCTCTAGTACAAACACCCCCAATATTGTGATATAATTAAAAACATAGCAT",
+            seq);
+
+    /*
+     * peptides should now have five entries:
+     * EMBL product and two Uniprot accessions for the first CDS / translation
+     * EMBL product and one Uniprot accession for the second CDS / "
+     * EMBL product only for the third
+     */
+    assertEquals(6, peptides.size());
+    assertEquals("CAA30420.1", peptides.get(0).getName());
+    assertEquals("MLCF", peptides.get(0).getSequenceAsString());
+    assertEquals("UNIPROT|B0BCM4", peptides.get(1).getName());
+    assertEquals("MLCF", peptides.get(1).getSequenceAsString());
+    assertEquals("UNIPROT|P0CE20", peptides.get(2).getName());
+    assertEquals("MLCF", peptides.get(2).getSequenceAsString());
+    assertEquals("CAA30421.1", peptides.get(3).getName());
+    assertEquals("MSSS", peptides.get(3).getSequenceAsString());
+    assertEquals("UNIPROT|B0BCM3", peptides.get(4).getName());
+    assertEquals("MSSS", peptides.get(4).getSequenceAsString());
+    assertEquals("CAA12345.6", peptides.get(5).getName());
+    assertEquals("MSS", peptides.get(5).getSequenceAsString());
+
+    /*
+     * verify dna sequence has dbrefs
+     * - to 'self' (synthesized dbref)
+     * - to EuropePMC
+     * - to MD5 (with null version as "0") 
+     * - with CDS mappings to the peptide 'products'
+     */
+    MapList mapToSelf = new MapList(new int[] { 1, 57 },
+            new int[]
+            { 1, 57 }, 1, 1);
+    MapList cds1Map = new MapList(new int[] { 57, 46 }, new int[] { 1, 4 },
+            3, 1);
+    MapList cds2Map = new MapList(new int[] { 4, 15 }, new int[] { 1, 4 },
+            3, 1);
+    MapList cds3Map = new MapList(new int[] { 4, 6, 10, 15 }, new int[] {
+        1, 3 }, 3, 1);
+
+    DBRefEntry[] dbrefs = dna.getDBRefs();
+    assertEquals(7, dbrefs.length);
+
+    DBRefEntry dbRefEntry = dbrefs[0];
+    assertEquals("EMBL", dbRefEntry.getSource());
+    assertEquals("X07547", dbRefEntry.getAccessionId());
+    assertEquals("1", dbRefEntry.getVersion());
+    assertNotNull(dbRefEntry.getMap());
+    assertNull(dbRefEntry.getMap().getTo());
+    assertEquals(mapToSelf, dbRefEntry.getMap().getMap());
+
+    dbRefEntry = dbrefs[1];
+    // DBRefEntry constructor puts dbSource in upper case
+    assertEquals("EUROPEPMC", dbRefEntry.getSource());
+    assertEquals("PMC107176", dbRefEntry.getAccessionId());
+    assertEquals("9573186", dbRefEntry.getVersion());
+    assertNull(dbRefEntry.getMap());
+
+    dbRefEntry = dbrefs[2];
+    assertEquals("MD5", dbRefEntry.getSource());
+    assertEquals("ac73317", dbRefEntry.getAccessionId());
+    assertEquals("0", dbRefEntry.getVersion());
+    assertNull(dbRefEntry.getMap());
+
+    dbRefEntry = dbrefs[3];
+    assertEquals("UNIPROT", dbRefEntry.getSource());
+    assertEquals("B0BCM4", dbRefEntry.getAccessionId());
+    assertSame(peptides.get(1), dbRefEntry.getMap().getTo());
+    assertEquals(cds1Map, dbRefEntry.getMap().getMap());
+
+    dbRefEntry = dbrefs[4];
+    assertEquals("UNIPROT", dbRefEntry.getSource());
+    assertEquals("P0CE20", dbRefEntry.getAccessionId());
+    assertSame(peptides.get(2), dbRefEntry.getMap().getTo());
+    assertEquals(cds1Map, dbRefEntry.getMap().getMap());
+
+    dbRefEntry = dbrefs[5];
+    assertEquals("UNIPROT", dbRefEntry.getSource());
+    assertEquals("B0BCM3", dbRefEntry.getAccessionId());
+    assertSame(peptides.get(4), dbRefEntry.getMap().getTo());
+    assertEquals(cds2Map, dbRefEntry.getMap().getMap());
+
+    dbRefEntry = dbrefs[6];
+    assertEquals("EMBLCDSPROTEIN", dbRefEntry.getSource());
+    assertEquals("CAA12345.6", dbRefEntry.getAccessionId());
+    assertSame(peptides.get(5), dbRefEntry.getMap().getTo());
+    assertEquals(cds3Map, dbRefEntry.getMap().getMap());
+
+    /*
+     * verify peptides have dbrefs
+     * - to EMBL sequence (with inverse 1:3 cds mapping)
+     * - to EMBLCDS (with 1:3 mapping)
+     * - direct (no mapping) to other protein accessions
+     */
+    MapList proteinToCdsMap1 = new MapList(new int[] { 1, 4 }, new int[] {
+        1, 12 }, 1, 3);
+    MapList proteinToCdsMap2 = new MapList(new int[] { 1, 3 }, new int[] {
+        1, 9 }, 1, 3);
+
+    // dbrefs for first CDS EMBL product CAA30420.1
+    dbrefs = peptides.get(0).getDBRefs();
+    assertEquals(5, dbrefs.length);
+    assertEquals(DBRefSource.EMBL, dbrefs[0].getSource());
+    assertEquals("CAA30420.1", dbrefs[0].getAccessionId());
+    // TODO: verify getPrimaryDBRefs() for peptide products
+    assertEquals(cds1Map.getInverse(), dbrefs[0].getMap().getMap());
+    assertEquals(DBRefSource.EMBLCDS, dbrefs[1].getSource());
+    assertEquals("CAA30420.1", dbrefs[1].getAccessionId());
+    assertEquals(proteinToCdsMap1, dbrefs[1].getMap().getMap());
+    assertEquals(DBRefSource.EMBLCDSProduct, dbrefs[2].getSource());
+    assertEquals("CAA30420.1", dbrefs[2].getAccessionId());
+    assertNull(dbrefs[2].getMap());
+    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "2.1", "B0BCM4"),
+            dbrefs[3]);
+    assertNull(dbrefs[3].getMap());
+    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "P0CE20"),
+            dbrefs[4]);
+    assertNull(dbrefs[4].getMap());
+
+    // dbrefs for first CDS first Uniprot xref
+    dbrefs = peptides.get(1).getDBRefs();
+    assertEquals(2, dbrefs.length);
+    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "2.1", "B0BCM4"),
+            dbrefs[0]);
+    assertNull(dbrefs[0].getMap());
+    assertEquals(DBRefSource.EMBL, dbrefs[1].getSource());
+    assertEquals("X07547", dbrefs[1].getAccessionId());
+    assertEquals(cds1Map.getInverse(), dbrefs[1].getMap().getMap());
+
+    // dbrefs for first CDS second Uniprot xref
+    dbrefs = peptides.get(2).getDBRefs();
+    assertEquals(2, dbrefs.length);
+    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "P0CE20"),
+            dbrefs[0]);
+    assertNull(dbrefs[0].getMap());
+    assertEquals(DBRefSource.EMBL, dbrefs[1].getSource());
+    assertEquals("X07547", dbrefs[1].getAccessionId());
+    assertEquals(cds1Map.getInverse(), dbrefs[1].getMap().getMap());
+
+    // dbrefs for second CDS EMBL product CAA30421.1
+    dbrefs = peptides.get(3).getDBRefs();
+    assertEquals(4, dbrefs.length);
+    assertEquals(DBRefSource.EMBL, dbrefs[0].getSource());
+    assertEquals("CAA30421.1", dbrefs[0].getAccessionId());
+    assertEquals(cds2Map.getInverse(), dbrefs[0].getMap().getMap());
+    assertEquals(DBRefSource.EMBLCDS, dbrefs[1].getSource());
+    assertEquals("CAA30421.1", dbrefs[1].getAccessionId());
+    assertEquals(proteinToCdsMap1, dbrefs[1].getMap().getMap());
+    assertEquals(DBRefSource.EMBLCDSProduct, dbrefs[2].getSource());
+    assertEquals("CAA30421.1", dbrefs[2].getAccessionId());
+    assertNull(dbrefs[2].getMap());
+    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "B0BCM3"),
+            dbrefs[3]);
+    assertNull(dbrefs[3].getMap());
+
+    // dbrefs for second CDS second Uniprot xref
+    dbrefs = peptides.get(4).getDBRefs();
+    assertEquals(2, dbrefs.length);
+    assertEquals(new DBRefEntry(DBRefSource.UNIPROT, "0", "B0BCM3"),
+            dbrefs[0]);
+    assertNull(dbrefs[0].getMap());
+    assertEquals(DBRefSource.EMBL, dbrefs[1].getSource());
+    assertEquals("X07547", dbrefs[1].getAccessionId());
+    assertEquals(cds2Map.getInverse(), dbrefs[1].getMap().getMap());
+
+    // dbrefs for third CDS inferred EMBL product CAA12345.6
+    dbrefs = peptides.get(5).getDBRefs();
+    assertEquals(3, dbrefs.length);
+    assertEquals(DBRefSource.EMBL, dbrefs[0].getSource());
+    assertEquals("CAA12345.6", dbrefs[0].getAccessionId());
+    assertEquals(cds3Map.getInverse(), dbrefs[0].getMap().getMap());
+    assertEquals(DBRefSource.EMBLCDS, dbrefs[1].getSource());
+    assertEquals("CAA12345.6", dbrefs[1].getAccessionId());
+    assertEquals(proteinToCdsMap2, dbrefs[1].getMap().getMap());
+    assertEquals(DBRefSource.EMBLCDSProduct, dbrefs[2].getSource());
+    assertEquals("CAA12345.6", dbrefs[2].getAccessionId());
+    assertNull(dbrefs[2].getMap());
+  }
+
+  @Test(groups = "Functional")
+  public void testAdjustForProteinLength()
+  {
+    int[] exons = new int[] { 11, 15, 21, 25, 31, 38 }; // 18 bp
+
+    // exact length match:
+    assertSame(exons, EmblXmlSource.adjustForProteinLength(6, exons));
+
+    // match if we assume exons include stop codon not in protein:
+    assertSame(exons, EmblXmlSource.adjustForProteinLength(5, exons));
+
+    // truncate last exon by 6bp
+    int[] truncated = EmblXmlSource.adjustForProteinLength(4, exons);
+    assertEquals("[11, 15, 21, 25, 31, 32]", Arrays.toString(truncated));
+
+    // remove last exon and truncate preceding by 1bp
+    truncated = EmblXmlSource.adjustForProteinLength(3, exons);
+    assertEquals("[11, 15, 21, 24]", Arrays.toString(truncated));
+
+    // exact removal of exon case:
+    exons = new int[] { 11, 15, 21, 27, 33, 38 }; // 18 bp
+    truncated = EmblXmlSource.adjustForProteinLength(4, exons);
+    assertEquals("[11, 15, 21, 27]", Arrays.toString(truncated));
+
+    // what if exons are too short for protein?
+    truncated = EmblXmlSource.adjustForProteinLength(7, exons);
+    assertSame(exons, truncated);
+  }
+
+  @Test(groups = { "Functional" })
+  public void testGetEmblEntries()
+  {
+    List<EntryType> entries = EmblSourceTest.getEmblEntries();
+    assertEquals(1, entries.size());
+    EntryType entry = entries.get(0);
+  
+    assertEquals("X07547", entry.getAccession());
+    assertEquals("C. trachomatis plasmid", entry.getDescription());
+    assertEquals("STD", entry.getDataClass());
+    assertEquals("PRO", entry.getTaxonomicDivision());
+    assertEquals("1999-02-10", entry.getLastUpdated().toString());
+    assertEquals(58, entry.getLastUpdatedRelease().intValue());
+    assertEquals("1988-11-10", entry.getFirstPublic().toString());
+    assertEquals(18, entry.getFirstPublicRelease().intValue());
+    assertEquals("genomic DNA", entry.getMoleculeType());
+    assertEquals(1, entry.getVersion().intValue());
+    assertEquals(8, entry.getEntryVersion().intValue());
+    assertEquals("linear", entry.getTopology());
+    assertEquals(7499, entry.getSequenceLength().intValue());
+    assertEquals(2, entry.getKeyword().size());
+    assertEquals("plasmid", entry.getKeyword().get(0));
+    assertEquals("unidentified reading frame", entry.getKeyword().get(1));
+  
+    /*
+     * dbrefs
+     */
+    assertEquals(2, entry.getXref().size());
+    XrefType dbref = entry.getXref().get(0);
+    assertEquals("EuropePMC", dbref.getDb());
+    assertEquals("PMC107176", dbref.getId());
+    assertEquals("9573186", dbref.getSecondaryId());
+    dbref = entry.getXref().get(1);
+    assertEquals("MD5", dbref.getDb());
+    assertEquals("ac73317", dbref.getId());
+    assertNull(dbref.getSecondaryId());
+  
+    /*
+     * three sequence features for CDS
+     */
+    assertEquals(3, entry.getFeature().size());
+    /*
+     * first CDS
+     */
+    Feature ef = entry.getFeature().get(0);
+    assertEquals("CDS", ef.getName());
+    assertEquals("complement(46..57)", ef.getLocation());
+    assertEquals(2, ef.getXref().size());
+    dbref = ef.getXref().get(0);
+    assertEquals("UniProtKB/Swiss-Prot", dbref.getDb());
+    assertEquals("B0BCM4", dbref.getId());
+    assertEquals("2.1", dbref.getSecondaryId());
+    dbref = ef.getXref().get(1);
+    assertEquals("UniProtKB/Swiss-Prot", dbref.getDb());
+    assertEquals("P0CE20", dbref.getId());
+    assertNull(dbref.getSecondaryId());
+    // CDS feature qualifiers
+    assertEquals(3, ef.getQualifier().size());
+    Qualifier q = ef.getQualifier().get(0);
+    assertEquals("note", q.getName());
+    assertEquals("ORF 8 (AA 1-330)", q.getValue());
+    q = ef.getQualifier().get(1);
+    assertEquals("protein_id", q.getName());
+    assertEquals("CAA30420.1", q.getValue());
+    q = ef.getQualifier().get(2);
+    assertEquals("translation", q.getName());
+    assertEquals("MLCF", q.getValue());
+  
+    /*
+     * second CDS
+     */
+    ef = entry.getFeature().get(1);
+    assertEquals("CDS", ef.getName());
+    assertEquals("4..15", ef.getLocation());
+    assertEquals(1, ef.getXref().size());
+    dbref = ef.getXref().get(0);
+    assertEquals("UniProtKB/Swiss-Prot", dbref.getDb());
+    assertEquals("B0BCM3", dbref.getId());
+    assertNull(dbref.getSecondaryId());
+    assertEquals(2, ef.getQualifier().size());
+    q = ef.getQualifier().get(0);
+    assertEquals("protein_id", q.getName());
+    assertEquals("CAA30421.1", q.getValue());
+    q = ef.getQualifier().get(1);
+    assertEquals("translation", q.getName());
+    assertEquals("MSSS", q.getValue());
+  
+    /*
+     * third CDS
+     */
+    ef = entry.getFeature().get(2);
+    assertEquals("CDS", ef.getName());
+    assertEquals("join(4..6,10..15)", ef.getLocation());
+    assertNotNull(ef.getXref());
+    assertTrue(ef.getXref().isEmpty());
+    assertEquals(2, ef.getQualifier().size());
+    q = ef.getQualifier().get(0);
+    assertEquals("protein_id", q.getName());
+    assertEquals("CAA12345.6", q.getValue());
+    q = ef.getQualifier().get(1);
+    assertEquals("translation", q.getName());
+    assertEquals("MSS", q.getValue());
+  
+    /*
+     * Sequence - raw data before removal of newlines
+     */
+    String seq = entry.getSequence();
+    assertEquals(
+            "GGTATGTCCTCTAGTACAAAC\n"
+                    + "ACCCCCAATATTGTGATATAATTAAAAACATAGCAT",
+            seq);
+  
+    /*
+     * getSequence() converts empty DBRefEntry.version to "0"
+     */
+    assertNull(entry.getXref().get(1).getSecondaryId());
+    assertNull(entry.getFeature().get(0).getXref().get(1).getSecondaryId());
+  }
+
+  static List<EntryType> getEmblEntries()
+  {
+    return new EmblSource()
+            .getEmblEntries(new ByteArrayInputStream(TESTDATA.getBytes()));
+  }
+}
index b914a45..f5cc640 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.ws.dbsources;
 
 import static org.testng.Assert.assertEquals;
index 2fa1871..355ef0c 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.ws.dbsources;
 
 import static org.testng.Assert.assertEquals;
index 90d4472..e04d195 100644 (file)
@@ -51,7 +51,7 @@ public class RemoteFormatTest
     Cache.applicationProperties.setProperty("ADD_SS_ANN",
             Boolean.TRUE.toString());
 
-    sf = new SequenceFetcher(false);
+    sf = new SequenceFetcher();
   }
 
   @DataProvider(name = "AccessionData")
@@ -92,7 +92,7 @@ public class RemoteFormatTest
   @Test(groups = { "Network" })
   public void testUniprotFreeTextSearch() throws Exception
   {
-    List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
+    List<FTSDataColumnI> wantedFields = new ArrayList<>();
     FTSRestClientI client = UniProtFTSRestClient.getInstance();
     wantedFields.add(client.getDataColumnByNameOrCode("id"));
     wantedFields.add(client.getDataColumnByNameOrCode("entry name"));
index cb60b14..2d1497f 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.ws.dbsources;
 
 import static org.testng.Assert.assertEquals;
index 5ca72c2..745ba2e 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.ws.dbsources;
 
 import static org.testng.Assert.assertEquals;
index f98ef85..e835724 100644 (file)
 package jalview.ws.dbsources;
 
 import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
 import static org.testng.AssertJUnit.assertNotNull;
 import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
 
-import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
-import jalview.datamodel.xdb.uniprot.UniprotEntry;
-import jalview.datamodel.xdb.uniprot.UniprotFeature;
 import jalview.gui.JvOptionPane;
+import jalview.xml.binding.uniprot.DbReferenceType;
+import jalview.xml.binding.uniprot.Entry;
+import jalview.xml.binding.uniprot.FeatureType;
+import jalview.xml.binding.uniprot.LocationType;
+import jalview.xml.binding.uniprot.PositionType;
 
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Vector;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.math.BigInteger;
+import java.util.List;
 
+import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -50,33 +55,41 @@ public class UniprotTest
 
   // adapted from http://www.uniprot.org/uniprot/A9CKP4.xml
   private static final String UNIPROT_XML = "<?xml version='1.0' encoding='UTF-8'?>"
-          + "<uniprot>"
+          + "<uniprot xmlns=\"http://uniprot.org/uniprot\">"
           + "<entry dataset=\"TrEMBL\" created=\"2008-01-15\" modified=\"2015-03-04\" version=\"38\">"
           + "<accession>A9CKP4</accession>"
           + "<accession>A9CKP5</accession>"
           + "<name>A9CKP4_AGRT5</name>"
           + "<name>A9CKP4_AGRT6</name>"
-          + "<protein><recommendedName><fullName>Mitogen-activated protein kinase 13</fullName><fullName>Henry</fullName></recommendedName></protein>"
+          + "<protein><recommendedName><fullName>Mitogen-activated protein kinase 13</fullName></recommendedName></protein>"
           + "<dbReference type=\"PDB\" id=\"2FSQ\"><property type=\"method\" value=\"X-ray\"/><property type=\"resolution\" value=\"1.40\"/></dbReference>"
           + "<dbReference type=\"PDBsum\" id=\"2FSR\"/>"
           + "<dbReference type=\"EMBL\" id=\"AE007869\"><property type=\"protein sequence ID\" value=\"AAK85932.1\"/><property type=\"molecule type\" value=\"Genomic_DNA\"/></dbReference>"
           + "<feature type=\"signal peptide\" evidence=\"7\"><location><begin position=\"1\"/><end position=\"18\"/></location></feature>"
           + "<feature type=\"propeptide\" description=\"Activation peptide\" id=\"PRO_0000027399\" evidence=\"9 16 17 18\"><location><begin position=\"19\"/><end position=\"20\"/></location></feature>"
           + "<feature type=\"chain\" description=\"Granzyme B\" id=\"PRO_0000027400\"><location><begin position=\"21\"/><end position=\"247\"/></location></feature>"
+          + "<feature type=\"sequence variant\"><original>M</original><variation>L</variation><location><position position=\"41\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Pathogenic\"><original>M</original><variation>L</variation><location><position position=\"41\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Pathogenic\"><original>M</original><location><position position=\"41\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Foo\"><variation>L</variation><variation>LMV</variation><original>M</original><location><position position=\"42\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Foo\"><variation>LL</variation><variation>LMV</variation><original>ML</original><location><begin position=\"42\"/><end position=\"43\"/></location></feature>"
+          + "<feature type=\"sequence variant\" description=\"Foo Too\"><variation>LL</variation><variation>LMVK</variation><original>MLML</original><location><begin position=\"42\"/><end position=\"45\"/></location></feature>"
           + "<sequence length=\"10\" mass=\"27410\" checksum=\"8CB760AACF88FE6C\" modified=\"2008-01-15\" version=\"1\">MHAPL VSKDL</sequence></entry>"
           + "</uniprot>";
 
   /**
    * Test the method that unmarshals XML to a Uniprot model
+   * 
+   * @throws UnsupportedEncodingException
    */
   @Test(groups = { "Functional" })
-  public void testGetUniprotEntries()
+  public void testGetUniprotEntries() throws UnsupportedEncodingException
   {
     Uniprot u = new Uniprot();
-    Reader reader = new StringReader(UNIPROT_XML);
-    Vector<UniprotEntry> entries = u.getUniprotEntries(reader);
+    InputStream is = new ByteArrayInputStream(UNIPROT_XML.getBytes());
+    List<Entry> entries = u.getUniprotEntries(is);
     assertEquals(1, entries.size());
-    UniprotEntry entry = entries.get(0);
+    Entry entry = entries.get(0);
     assertEquals(2, entry.getName().size());
     assertEquals("A9CKP4_AGRT5", entry.getName().get(0));
     assertEquals("A9CKP4_AGRT6", entry.getName().get(1));
@@ -84,70 +97,123 @@ public class UniprotTest
     assertEquals("A9CKP4", entry.getAccession().get(0));
     assertEquals("A9CKP5", entry.getAccession().get(1));
 
-    /*
-     * UniprotSequence drops any space characters
-     */
-    assertEquals("MHAPLVSKDL", entry.getUniprotSequence().getContent());
+    assertEquals("MHAPL VSKDL", entry.getSequence().getValue());
 
-    assertEquals(2, entry.getProtein().getName().size());
     assertEquals("Mitogen-activated protein kinase 13", entry.getProtein()
-            .getName().get(0));
-    assertEquals("Henry", entry.getProtein().getName().get(1));
+            .getRecommendedName().getFullName().getValue());
 
     /*
      * Check sequence features
      */
-    Vector<UniprotFeature> features = entry.getFeature();
-    assertEquals(3, features.size());
-    UniprotFeature sf = features.get(0);
+    List<FeatureType> features = entry.getFeature();
+    assertEquals(9, features.size());
+    FeatureType sf = features.get(0);
     assertEquals("signal peptide", sf.getType());
     assertNull(sf.getDescription());
     assertNull(sf.getStatus());
-    assertEquals(1, sf.getBegin());
-    assertEquals(18, sf.getEnd());
+    assertNull(sf.getLocation().getPosition());
+    assertEquals(1, sf.getLocation().getBegin().getPosition().intValue());
+    assertEquals(18, sf.getLocation().getEnd().getPosition().intValue());
     sf = features.get(1);
     assertEquals("propeptide", sf.getType());
     assertEquals("Activation peptide", sf.getDescription());
-    assertEquals(19, sf.getPosition());
-    assertEquals(19, sf.getBegin());
-    assertEquals(20, sf.getEnd());
+    assertNull(sf.getLocation().getPosition());
+    assertEquals(19, sf.getLocation().getBegin().getPosition().intValue());
+    assertEquals(20, sf.getLocation().getEnd().getPosition().intValue());
     sf = features.get(2);
     assertEquals("chain", sf.getType());
     assertEquals("Granzyme B", sf.getDescription());
-    assertEquals(21, sf.getPosition());
-    assertEquals(21, sf.getBegin());
-    assertEquals(247, sf.getEnd());
+    assertNull(sf.getLocation().getPosition());
+    assertEquals(21, sf.getLocation().getBegin().getPosition().intValue());
+    assertEquals(247, sf.getLocation().getEnd().getPosition().intValue());
+
+    sf = features.get(3);
+    assertEquals("sequence variant", sf.getType());
+    assertNull(sf.getDescription());
+    assertEquals(41,
+            sf.getLocation().getPosition().getPosition().intValue());
+    assertNull(sf.getLocation().getBegin());
+    assertNull(sf.getLocation().getEnd());
+
+    sf = features.get(4);
+    assertEquals("sequence variant", sf.getType());
+    assertEquals("Pathogenic", sf.getDescription());
+    assertEquals(41,
+            sf.getLocation().getPosition().getPosition().intValue());
+    assertNull(sf.getLocation().getBegin());
+    assertNull(sf.getLocation().getEnd());
+
+    sf = features.get(5);
+    assertEquals("sequence variant", sf.getType());
+    assertEquals("Pathogenic", sf.getDescription());
+    assertEquals(41,
+            sf.getLocation().getPosition().getPosition().intValue());
+    assertNull(sf.getLocation().getBegin());
+    assertNull(sf.getLocation().getEnd());
+
+    sf = features.get(6);
+    assertEquals("sequence variant", sf.getType());
+    assertEquals("Foo",
+            sf.getDescription());
+    assertEquals(42,
+            sf.getLocation().getPosition().getPosition().intValue());
+    assertNull(sf.getLocation().getBegin());
+    assertNull(sf.getLocation().getEnd());
+    Assert.assertEquals(Uniprot.getDescription(sf),
+            "<html>p.Met42Leu" + "<br/>&nbsp;&nbsp;"
+                    + "p.Met42LeuMetVal Foo</html>");
+
+    sf = features.get(7);
+    assertNull(sf.getLocation().getPosition());
+    assertEquals(42, sf.getLocation().getBegin().getPosition().intValue());
+    assertEquals(43, sf.getLocation().getEnd().getPosition().intValue());
+    Assert.assertEquals(Uniprot.getDescription(sf),
+            "<html>p.MetLeu42LeuLeu" + "<br/>&nbsp;&nbsp;"
+                    + "p.MetLeu42LeuMetVal Foo</html>");
+
+    sf = features.get(8);
+    assertNull(sf.getLocation().getPosition());
+    assertEquals(42, sf.getLocation().getBegin().getPosition().intValue());
+    assertEquals(45, sf.getLocation().getEnd().getPosition().intValue());
+    Assert.assertEquals(Uniprot.getDescription(sf),
+            "<html>p.MLML42LeuLeu" + "<br/>&nbsp;&nbsp;"
+                    + "p.MLML42LMVK Foo Too</html>");
 
     /*
      * Check cross-references
      */
-    Vector<PDBEntry> xrefs = entry.getDbReference();
+    List<DbReferenceType> xrefs = entry.getDbReference();
     assertEquals(3, xrefs.size());
 
-    PDBEntry xref = xrefs.get(0);
+    DbReferenceType xref = xrefs.get(0);
     assertEquals("2FSQ", xref.getId());
     assertEquals("PDB", xref.getType());
-    assertEquals("X-ray", xref.getProperty("method"));
-    assertEquals("1.40", xref.getProperty("resolution"));
+    assertEquals("X-ray",
+            Uniprot.getProperty(xref.getProperty(), "method"));
+    assertEquals("1.40",
+            Uniprot.getProperty(xref.getProperty(), "resolution"));
 
     xref = xrefs.get(1);
     assertEquals("2FSR", xref.getId());
     assertEquals("PDBsum", xref.getType());
-    assertFalse(xref.getProperties().hasMoreElements());
+    assertTrue(xref.getProperty().isEmpty());
 
     xref = xrefs.get(2);
     assertEquals("AE007869", xref.getId());
     assertEquals("EMBL", xref.getType());
-    assertEquals("AAK85932.1", xref.getProperty("protein sequence ID"));
-    assertEquals("Genomic_DNA", xref.getProperty("molecule type"));
+    assertEquals("AAK85932.1",
+            Uniprot.getProperty(xref.getProperty(), "protein sequence ID"));
+    assertEquals("Genomic_DNA",
+            Uniprot.getProperty(xref.getProperty(), "molecule type"));
   }
 
   @Test(groups = { "Functional" })
-  public void testGetUniprotSequence()
+  public void testGetUniprotSequence() throws UnsupportedEncodingException
   {
-    UniprotEntry entry = new Uniprot().getUniprotEntries(
-            new StringReader(UNIPROT_XML)).get(0);
-    SequenceI seq = new Uniprot().uniprotEntryToSequenceI(entry);
+    InputStream is = new ByteArrayInputStream(UNIPROT_XML.getBytes());
+    Entry entry = new Uniprot().getUniprotEntries(
+            is).get(0);
+    SequenceI seq = new Uniprot().uniprotEntryToSequence(entry);
     assertNotNull(seq);
     assertEquals(6, seq.getDBRefs().length); // 2*Uniprot, PDB, PDBsum, 2*EMBL
 
@@ -155,12 +221,14 @@ public class UniprotTest
 
   /**
    * Test the method that formats the sequence id
+   * 
+   * @throws UnsupportedEncodingException
    */
   @Test(groups = { "Functional" })
-  public void testGetUniprotEntryId()
+  public void testGetUniprotEntryId() throws UnsupportedEncodingException
   {
-    UniprotEntry entry = new Uniprot().getUniprotEntries(
-            new StringReader(UNIPROT_XML)).get(0);
+    InputStream is = new ByteArrayInputStream(UNIPROT_XML.getBytes());
+    Entry entry = new Uniprot().getUniprotEntries(is).get(0);
 
     /*
      * name formatted with Uniprot Entry name
@@ -172,18 +240,66 @@ public class UniprotTest
 
   /**
    * Test the method that formats the sequence description
+   * 
+   * @throws UnsupportedEncodingException
    */
   @Test(groups = { "Functional" })
   public void testGetUniprotEntryDescription()
+          throws UnsupportedEncodingException
   {
-    UniprotEntry entry = new Uniprot().getUniprotEntries(
-            new StringReader(UNIPROT_XML)).get(0);
+    InputStream is = new ByteArrayInputStream(UNIPROT_XML.getBytes());
+    Entry entry = new Uniprot().getUniprotEntries(is).get(0);
+
+    assertEquals("Mitogen-activated protein kinase 13",
+            Uniprot.getUniprotEntryDescription(entry));
+  }
+
+  @Test(groups = { "Functional" })
+  public void testGetDescription()
+  {
+    FeatureType ft = new FeatureType();
+    assertEquals("", Uniprot.getDescription(ft));
+
+    ft.setDescription("Hello");
+    assertEquals("Hello", Uniprot.getDescription(ft));
+
+    ft.setLocation(new LocationType());
+    ft.getLocation().setPosition(new PositionType());
+    ft.getLocation().getPosition().setPosition(BigInteger.valueOf(23));
+    ft.setOriginal("K");
+    ft.getVariation().add("y");
+    assertEquals("p.Lys23Tyr Hello", Uniprot.getDescription(ft));
+
+    // multiple variants generate an html description over more than one line
+    ft.getVariation().add("W");
+    assertEquals("<html>p.Lys23Tyr<br/>&nbsp;&nbsp;p.Lys23Trp Hello</html>",
+            Uniprot.getDescription(ft));
 
     /*
-     * recommended names concatenated with space separator
+     * indel cases
+     * up to 3 bases (original or variant) are shown using 3 letter code
      */
-    String expectedDescription = "Mitogen-activated protein kinase 13 Henry";
-    assertEquals(expectedDescription,
-            Uniprot.getUniprotEntryDescription(entry));
+    ft.getVariation().clear();
+    ft.getVariation().add("KWE");
+    ft.setOriginal("KLS");
+    assertEquals("p.LysLeuSer23LysTrpGlu Hello",
+            Uniprot.getDescription(ft));
+
+    // adding a fourth original base switches to single letter code
+    ft.setOriginal("KLST");
+    assertEquals("p.KLST23LysTrpGlu Hello", Uniprot.getDescription(ft));
+
+    // adding a fourth variant switches to single letter code
+    ft.getVariation().clear();
+    ft.getVariation().add("KWES");
+    assertEquals("p.KLST23KWES Hello", Uniprot.getDescription(ft));
+
+    ft.getVariation().clear();
+    ft.getVariation().add("z"); // unknown variant - fails gracefully
+    ft.setOriginal("K");
+    assertEquals("p.Lys23z Hello", Uniprot.getDescription(ft));
+
+    ft.getVariation().clear(); // variant missing - is ignored
+    assertEquals("Hello", Uniprot.getDescription(ft));
   }
 }
diff --git a/test/jalview/ws/seqfetcher/DasSequenceFetcher.java b/test/jalview/ws/seqfetcher/DasSequenceFetcher.java
deleted file mode 100644 (file)
index f1dafcb..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws.seqfetcher;
-
-import static org.testng.Assert.assertTrue;
-
-import jalview.bin.Cache;
-import jalview.gui.JvOptionPane;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class DasSequenceFetcher
-{
-
-  @BeforeClass(alwaysRun = true)
-  public void setUpJvOptionPane()
-  {
-    JvOptionPane.setInteractiveMode(false);
-    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
-  }
-
-  @Test(groups = { "Network" })
-  public void testDasRegistryContact()
-  {
-    Cache.getDasSourceRegistry().refreshSources();
-    assertTrue(Cache.getDasSourceRegistry().getSources().isEmpty(),
-            "Expected to find no DAS sources at the registry. Check config.");
-  }
-
-}
index a649cb4..c69d554 100755 (executable)
@@ -200,7 +200,7 @@ Can be separated by colons (Mac OS/Unix) or semicolons (Windows)]]></string>
                                                        <method name="addElement">
                                                                <object class="com.zerog.ia.installer.util.LAXPropertyData" objectID="97fa91cfa6f7">
                                                                        <property name="propertyValue">
-                                                                               <string><![CDATA[268400000]]></string>
+                                                                               <string><![CDATA[1060000000]]></string>
                                                                        </property>
                                                                        <property name="propertyName">
                                                                                <string><![CDATA[lax.nl.java.option.java.heap.size.max]]></string>
@@ -254,7 +254,7 @@ it will search for ones in this list]]></string>
                                                        <method name="addElement">
                                                                <object class="com.zerog.ia.installer.util.LAXPropertyData" objectID="97f991ffa6f7">
                                                                        <property name="propertyValue">
-                                                                               <string><![CDATA[33554432]]></string>
+                                                                               <string><![CDATA[1000000000]]></string>
                                                                        </property>
                                                                        <property name="propertyName">
                                                                                <string><![CDATA[lax.nl.java.option.java.heap.size.initial]]></string>
@@ -314,13 +314,13 @@ and any path to a file to save to the file]]></string>
                                                                <string><![CDATA[logo.gif]]></string>
                                                        </property>
                                                        <property name="smallIconPath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/resources/images/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/resources/images/]]></string>
                                                        </property>
                                                        <property name="largeIconPath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/resources/images/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/resources/images/]]></string>
                                                        </property>
                                                        <property name="macOSXIconPath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
                                                        </property>
                                                        <property name="macOSXIconName">
                                                                <string><![CDATA[mac_logo.icns]]></string>
@@ -367,7 +367,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/dist/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/dist/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -419,7 +419,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -471,7 +471,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -523,7 +523,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -575,7 +575,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -627,7 +627,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -679,7 +679,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -731,7 +731,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -783,7 +783,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -835,7 +835,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -887,7 +887,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -939,7 +939,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -991,7 +991,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1043,7 +1043,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1095,7 +1095,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1147,7 +1147,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1199,7 +1199,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1251,7 +1251,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1303,7 +1303,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1355,7 +1355,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1407,7 +1407,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1459,7 +1459,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1511,7 +1511,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1563,7 +1563,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1615,7 +1615,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1667,7 +1667,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1719,7 +1719,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1771,7 +1771,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1823,7 +1823,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1875,7 +1875,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1927,7 +1927,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -1979,7 +1979,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2031,7 +2031,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2083,7 +2083,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2135,7 +2135,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2187,7 +2187,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2239,7 +2239,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2291,7 +2291,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2320,6 +2320,58 @@ and any path to a file to save to the file]]></string>
                                                </object>
                                        </method>
                                        <method name="addElement">
+            <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="9a1f46efeef911a">
+              <property name="belongsToUninstallPhase">
+                <boolean>false</boolean>
+              </property>
+              <property name="rollbackEnabledCancel">
+                <boolean>true</boolean>
+              </property>
+              <property name="rollbackEnabledError">
+                <boolean>true</boolean>
+              </property>
+              <property name="ruleExpression">
+                <string><![CDATA[]]></string>
+              </property>
+              <property name="unixPermissions">
+                <string><![CDATA[664]]></string>
+              </property>
+              <property name="sourceName">
+                <string><![CDATA[VAqua5-patch.jar]]></string>
+              </property>
+              <property name="overrideUnixPermissions">
+                <boolean>false</boolean>
+              </property>
+              <property name="sourcePath">
+                <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
+              </property>
+              <property name="shouldUninstall">
+                <boolean>true</boolean>
+              </property>
+              <property name="rollbackEnabledCancel">
+                <boolean>true</boolean>
+              </property>
+              <property name="rollbackEnabledError">
+                <boolean>true</boolean>
+              </property>
+              <property name="destinationName">
+                <string><![CDATA[VAqua5-patch.jar]]></string>
+              </property>
+              <property name="fileSize">
+                <long>1370564</long>
+              </property>
+              <property name="macBinary">
+                <boolean>false</boolean>
+              </property>
+              <property name="targetCheckKind">
+                <int>0</int>
+              </property>
+              <property name="ruleExpression">
+                <string><![CDATA[]]></string>
+              </property>
+            </object>
+          </method>
+          <method name="addElement">
                                                <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="1936efeefab93">
                                                        <property name="belongsToUninstallPhase">
                                                                <boolean>false</boolean>
@@ -2343,7 +2395,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2395,7 +2447,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2447,7 +2499,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2499,7 +2551,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2551,7 +2603,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2603,7 +2655,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2655,7 +2707,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2707,7 +2759,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2759,7 +2811,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2811,7 +2863,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2863,7 +2915,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2915,7 +2967,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>false</boolean>
                                                        </property>
                                                        <property name="sourcePath">
-                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib/]]></string>
                                                        </property>
                                                        <property name="shouldUninstall">
                                                                <boolean>true</boolean>
@@ -2949,7 +3001,7 @@ and any path to a file to save to the file]]></string>
                                <string><![CDATA[The installer cannot run on your configuration. It will now quit.]]></string>
                        </property>
                        <property name="userSplashPath">
-                               <string><![CDATA[/home/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
+                               <string><![CDATA[/homes/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
                        </property>
                        <property name="userSplashName">
                                <string><![CDATA[jalview.gif]]></string>
@@ -4242,7 +4294,7 @@ Press "Done" to quit the installer.]]></string>
                                                                <boolean>true</boolean>
                                                        </property>
                                                        <property name="buildOutputLocation">
-                                                               <string><![CDATA[/opt/homes/cruisecontrol/live/cruisecontrol/checkout/next-release-jalview/utils/InstallAnywhere/Jalview_Build_Output]]></string>
+                                                               <string><![CDATA[/homes/cruisecontrol/jalview/utils/InstallAnywhere/Jalview_Build_Output]]></string>
                                                        </property>
                                                        <property name="relatedProjectSettings">
                                                                <object class="com.zerog.ia.installer.RelatedProjectSettings" objectID="97f2363da6ac">
@@ -5406,7 +5458,7 @@ Press "Done" to quit the installer.]]></string>
                                                <boolean>true</boolean>
                                        </property>
                                        <property name="backgroundImagePath">
-                                               <string><![CDATA[/home/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
+                                               <string><![CDATA[/homes/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
                                        </property>
                                        <property name="backgroundImageName">
                                                <string><![CDATA[align.gif]]></string>
@@ -7230,6 +7282,7 @@ and any path to a file to read from that file]]></string>
                                                                                <object refID="24485f8ca673"/>
                                                                                <object refID="24485f8ba674"/>
                                                                                <object refID="24485f8ca674"/>
+                                                                               <object refID="9a1f46efeef911a"/>
                                                                                <object class="com.zerog.ia.installer.actions.CreateShortcut" objectID="3cd8e2ffa672">
                                                                                        <property name="belongsToUninstallPhase">
                                                                                                <boolean>false</boolean>
@@ -7291,7 +7344,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7332,7 +7385,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7373,7 +7426,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/doc/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/doc/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7445,7 +7498,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7486,7 +7539,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7527,7 +7580,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7568,7 +7621,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7609,7 +7662,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7659,7 +7712,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7700,7 +7753,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7741,7 +7794,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7782,7 +7835,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7823,7 +7876,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7864,7 +7917,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7905,7 +7958,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7946,7 +7999,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/lib]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -7981,6 +8034,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <object refID="24485f8ca673"/>
                                                                                                <object refID="24485f8ba674"/>
                                                                                                <object refID="24485f8ca674"/>
+                                                                                               <object refID="9a1f46efeef911a"/>
                                                                                                <object refID="b1a16838a449"/>
                                                                                                <object refID="b1a16839a449"/>
                                                                                                <object refID="495aeddb8b3d"/>
@@ -8036,7 +8090,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples/groovy]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples/groovy]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -8077,7 +8131,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/home/cruisecontrol/jalview/examples]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/examples]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>false</boolean>
@@ -8133,7 +8187,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/opt/homes/cruisecontrol/live/cruisecontrol/checkout/next-release-jalview/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -8174,7 +8228,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="sourcePath">
-                                                                                               <string><![CDATA[/opt/homes/cruisecontrol/live/cruisecontrol/checkout/next-release-jalview/]]></string>
+                                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/]]></string>
                                                                                        </property>
                                                                                        <property name="shouldUninstall">
                                                                                                <boolean>true</boolean>
@@ -8359,7 +8413,7 @@ and any path to a file to read from that file]]></string>
                                                                                <string><![CDATA[]]></string>
                                                                        </property>
                                                                        <property name="imagePath">
-                                                                               <string><![CDATA[/home/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
+                                                                               <string><![CDATA[/homes/cruisecontrol/jalview/utils/InstallAnywhere/]]></string>
                                                                        </property>
                                                                        <property name="imageName">
                                                                                <string><![CDATA[bartonGroup.gif]]></string>
index e9e5176..82062f9 100755 (executable)
@@ -6,18 +6,26 @@ Jalview Readme
 
 To run application:
 
-java -Djava.ext.dirs=JALVIEW_HOME/lib -jar JALVIEW_HOME/jalview.jar [-help ... ]
+java -classpath "JALVIEW_HOME/lib/*" -jar JALVIEW_HOME/jalview.jar [-help ... ]
 
 Replace JALVIEW_HOME with the full path to Jalview Installation Directory.
 Use -help to see the available command line arguments.
 
 For best results use a Sun java run time environment (not the gcj gnu java, sorry!). 
 
-If you want to the java runtime bundled with Jalview, then launch jalview like this:
+If you want to use the java runtime bundled with Jalview, then launch jalview like this:
 
-JAVA_HOME=JALVIEW_HOME/jre JALVIEW_HOME/jre/bin/java -Djava.ext.dirs=JALVIEW_HOME/lib -jar JALVIEW_HOME/jalview.jar 
+in Windows:
+JAVA_HOME=JALVIEW_HOME/jre JALVIEW_HOME/jre/bin/java -classpath "JALVIEW_HOME/lib/*;JALVIEW_HOME/jalview.jar" jalview.bin.Jalview
+
+in Linux:
+JAVA_HOME=JALVIEW_HOME/jre JALVIEW_HOME/jre/bin/java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview
+
+in macOS:
+JAVA_HOME=JALVIEW_HOME/jre/Contents/Home JALVIEW_HOME/jre/Contents/Home/bin/java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview
+
+Note: ensure the -classpath argument is quoted and only use a terminating wildcard (e.g. 'DIR/*') to refer to all jar files in a directory, don't use e.g. 'DIR/*.jar'
 
-Please Note: the -jar jalview.jar option launches the jalview.bin.Jalview class in the jalview.jar
 ##################
 
 
index 6310934..6f0115e 100644 (file)
@@ -20,7 +20,7 @@
 <project name="jalviewInstallAnywhere" default="build" basedir=".">
   <property name="IA_LOCATION" value="/home/cruisecontrol/InstallAnywhere 2013/"/>
   <property name="IA_PROJECT" location="Jalview.iap_xml"/>
-  <property name="ABS_PATH" value="/home/cruisecontrol/jalview"/> <!-- \/utils\/InstallAnywhere"/> --> <!--/home/cruisecontrol/jalview"/> -->
+  <property name="ABS_PATH" value="/homes/cruisecontrol/jalview"/> <!-- \/utils\/InstallAnywhere"/> --> <!--/home/cruisecontrol/jalview"/> -->
   <!-- location of top level of jalview distribution directory -->
   <property name="CUR_PATH" location="../../." />
   <property name="USER_HOME" location="~" />
diff --git a/utils/classgraph-4.1.6.jar b/utils/classgraph-4.1.6.jar
new file mode 100644 (file)
index 0000000..a0788bc
Binary files /dev/null and b/utils/classgraph-4.1.6.jar differ