Merge branch 'JAL-972-dasobert-to-jdas' into JAL-972-jdas
authorjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 30 Mar 2012 12:29:04 +0000 (13:29 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 30 Mar 2012 12:29:04 +0000 (13:29 +0100)
Conflicts:
.classpath
src/jalview/ws/dbsources/DasSequenceSource.java
src/jalview/ws/dbsources/das/DasSequenceSourceListener.java

merged jdas switchover into v2.8 development branch

796 files changed:
.classpath
.externalToolBuilders/Jalview Release indices [Builder].launch
FEATURETODO [new file with mode: 0644]
build.xml
doc/AddingGroovySupport.html
doc/JalviewRNASupport.html [new file with mode: 0644]
doc/building.html
doc/developing.html
doc/index.html
doc/newdmobj.html
examples/RF00031_folded.stk [new file with mode: 0644]
examples/appletParameters.html
examples/applets.html
help/help.jhm
help/helpTOC.xml
help/html/calculations/consensus.html
help/html/calculations/conservation.html
help/html/calculations/pairwise.html
help/html/calculations/pca.html
help/html/calculations/quality.html
help/html/calculations/recoverInputdata.html
help/html/calculations/redundancy.html
help/html/calculations/sorting.html
help/html/calculations/structureconsensus.html [new file with mode: 0755]
help/html/calculations/tree.html
help/html/calculations/treeviewer.html
help/html/colourSchemes/abovePID.html
help/html/colourSchemes/annotationColouring.html
help/html/colourSchemes/blosum.html
help/html/colourSchemes/buried.html
help/html/colourSchemes/clustal.html
help/html/colourSchemes/conservation.html
help/html/colourSchemes/helix.html
help/html/colourSchemes/hydrophobic.html
help/html/colourSchemes/index.html
help/html/colourSchemes/nucleotide.html
help/html/colourSchemes/pid.html
help/html/colourSchemes/purinepyrimidine.html [new file with mode: 0644]
help/html/colourSchemes/rnahelicesColouring.html [new file with mode: 0644]
help/html/colourSchemes/rnahelicescoloring.png [new file with mode: 0644]
help/html/colourSchemes/strand.html
help/html/colourSchemes/taylor.html
help/html/colourSchemes/textcolour.html
help/html/colourSchemes/turn.html
help/html/colourSchemes/user.html
help/html/colourSchemes/zappo.html
help/html/editing/index.html
help/html/features/annotation.html
help/html/features/annotationsFormat.html
help/html/features/clarguments.html
help/html/features/codingfeatures.html
help/html/features/commandline.html
help/html/features/creatinFeatures.html
help/html/features/cursorMode.html
help/html/features/dasfeatures.html
help/html/features/dassettings.html
help/html/features/editingFeatures.html
help/html/features/featuresFormat.html
help/html/features/featureschemes.html
help/html/features/featuresettings.html
help/html/features/groovy.html
help/html/features/hiddenRegions.html
help/html/features/jalarchive.html
help/html/features/jmol.html
help/html/features/multipleViews.html
help/html/features/newkeystrokes.html
help/html/features/overview.html
help/html/features/pdbviewer.html
help/html/features/preferences.html
help/html/features/search.html
help/html/features/seqfeatures.html
help/html/features/seqfetch.html
help/html/features/seqmappings.html
help/html/features/varna.html [new file with mode: 0644]
help/html/features/viewingpdbs.html
help/html/features/wrap.html
help/html/index.html
help/html/io/export.html
help/html/io/fileformats.html
help/html/io/index.html
help/html/io/modellerpir.html
help/html/jalviewjnlp.html
help/html/keys.html
help/html/memory.html
help/html/menus/alignmentMenu.html
help/html/menus/alwannotations.html
help/html/menus/alwcalculate.html
help/html/menus/alwcolour.html
help/html/menus/alwedit.html
help/html/menus/alwfile.html
help/html/menus/alwformat.html
help/html/menus/alwselect.html
help/html/menus/alwview.html
help/html/menus/desktopMenu.html
help/html/menus/index.html
help/html/menus/popupMenu.html
help/html/menus/wsmenu.html
help/html/misc/aaproperties.html
help/html/misc/aminoAcids.html
help/html/misc/geneticCode.html
help/html/na/index.html [new file with mode: 0644]
help/html/privacy.html
help/html/releases.html
help/html/vamsas/index.html
help/html/webServices/JABAWS.html
help/html/webServices/dbreffetcher.html
help/html/webServices/index.html
help/html/webServices/jnet.html
help/html/webServices/msaclient.html
help/html/webServices/shmr.html
help/html/webServices/urllinks.html
help/html/webServices/webServicesParams.html
help/html/webServices/webServicesPrefs.html
help/html/whatsNew.html
jalview-jalopy.xml
lib/VARNAv3-9-dev.jar [new file with mode: 0644]
lib/min-jaba-client-2.0.jar [new file with mode: 0644]
lib/min-jaba-client.jar [deleted file]
nbbuild.xml
nbproject/project.properties
nbproject/project.xml
resources/authors.props [new file with mode: 0644]
resources/embl_mapping.xml
resources/uniprot_mapping.xml
schemas/JalviewUserColours.xsd
schemas/JalviewWsParamSet.xsd
schemas/castor-mapping.xsd
schemas/jalview.xsd
schemas/jalviewJvV1.xsd
schemas/vamsas.xsd
schemas/vamsasJvV1.xsd
src/MCview/AppletPDBCanvas.java
src/MCview/AppletPDBViewer.java
src/MCview/Atom.java
src/MCview/Bond.java
src/MCview/MCMatrix.java
src/MCview/PDBCanvas.java
src/MCview/PDBChain.java
src/MCview/PDBViewer.java
src/MCview/PDBfile.java
src/MCview/Residue.java
src/MCview/Zsort.java
src/ext/vamsas/IRegistry.java
src/ext/vamsas/IRegistryService.java
src/ext/vamsas/IRegistryServiceLocator.java
src/ext/vamsas/Jpred.java
src/ext/vamsas/JpredService.java
src/ext/vamsas/JpredServiceLocator.java
src/ext/vamsas/JpredSoapBindingStub.java
src/ext/vamsas/MuscleWS.java
src/ext/vamsas/MuscleWSService.java
src/ext/vamsas/MuscleWSServiceLocator.java
src/ext/vamsas/MuscleWSSoapBindingStub.java
src/ext/vamsas/RegistryServiceSoapBindingStub.java
src/ext/vamsas/SeqSearchI.java
src/ext/vamsas/SeqSearchServiceLocator.java
src/ext/vamsas/SeqSearchServiceService.java
src/ext/vamsas/SeqSearchServiceSoapBindingStub.java
src/ext/vamsas/ServiceHandle.java
src/ext/vamsas/ServiceHandles.java
src/jalview/analysis/AAFrequency.java
src/jalview/analysis/AlignSeq.java
src/jalview/analysis/AlignmentSorter.java
src/jalview/analysis/Conservation.java
src/jalview/analysis/CrossRef.java
src/jalview/analysis/Dna.java
src/jalview/analysis/Finder.java
src/jalview/analysis/Grouping.java
src/jalview/analysis/NJTree.java
src/jalview/analysis/PCA.java
src/jalview/analysis/ParseProperties.java
src/jalview/analysis/Rna.java [new file with mode: 0644]
src/jalview/analysis/SeqsetUtils.java
src/jalview/analysis/SequenceIdMatcher.java
src/jalview/analysis/StructureFrequency.java [new file with mode: 0644]
src/jalview/analysis/WUSSParseException.java [new file with mode: 0644]
src/jalview/api/AlignCalcManagerI.java [new file with mode: 0644]
src/jalview/api/AlignCalcWorkerI.java [new file with mode: 0644]
src/jalview/api/AlignViewportI.java [new file with mode: 0644]
src/jalview/api/AlignmentViewPanel.java
src/jalview/api/FeatureRenderer.java
src/jalview/api/OOMHandlerI.java [new file with mode: 0644]
src/jalview/api/SequenceRenderer.java
src/jalview/api/SequenceStructureBinding.java
src/jalview/api/StructureSelectionManagerProvider.java
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/AlignViewport.java
src/jalview/appletgui/AlignmentPanel.java
src/jalview/appletgui/AnnotationColourChooser.java
src/jalview/appletgui/AnnotationLabels.java
src/jalview/appletgui/AnnotationPanel.java
src/jalview/appletgui/AppletJmol.java
src/jalview/appletgui/AppletJmolBinding.java
src/jalview/appletgui/CutAndPasteTransfer.java
src/jalview/appletgui/EditNameDialog.java
src/jalview/appletgui/EmbmenuFrame.java
src/jalview/appletgui/ExtJmol.java
src/jalview/appletgui/FeatureColourChooser.java
src/jalview/appletgui/FeatureRenderer.java
src/jalview/appletgui/FeatureSettings.java
src/jalview/appletgui/Finder.java
src/jalview/appletgui/FontChooser.java
src/jalview/appletgui/IdCanvas.java
src/jalview/appletgui/IdPanel.java
src/jalview/appletgui/IdwidthAdjuster.java
src/jalview/appletgui/JVDialog.java
src/jalview/appletgui/OverviewPanel.java
src/jalview/appletgui/PCAPanel.java
src/jalview/appletgui/PaintRefresher.java
src/jalview/appletgui/PairwiseAlignPanel.java
src/jalview/appletgui/RedundancyPanel.java
src/jalview/appletgui/RotatableCanvas.java
src/jalview/appletgui/ScalePanel.java
src/jalview/appletgui/SeqCanvas.java
src/jalview/appletgui/SeqPanel.java
src/jalview/appletgui/SequenceRenderer.java
src/jalview/appletgui/SliderPanel.java
src/jalview/appletgui/Tooltip.java
src/jalview/appletgui/TreeCanvas.java
src/jalview/appletgui/TreePanel.java
src/jalview/appletgui/UserDefinedColours.java
src/jalview/bin/Cache.java
src/jalview/bin/Jalview.java
src/jalview/bin/JalviewLite.java
src/jalview/bin/JalviewLiteURLRetrieve.java
src/jalview/binding/Alignment.java
src/jalview/binding/Annotation.java
src/jalview/binding/AnnotationElement.java
src/jalview/binding/Colour.java
src/jalview/binding/Feature.java
src/jalview/binding/FeatureSettings.java
src/jalview/binding/Features.java
src/jalview/binding/JGroup.java
src/jalview/binding/JSeq.java
src/jalview/binding/JalviewModel.java
src/jalview/binding/JalviewModelSequence.java
src/jalview/binding/JalviewUserColours.java
src/jalview/binding/Pdbentry.java
src/jalview/binding/PdbentryItem.java
src/jalview/binding/Pdbids.java
src/jalview/binding/Property.java
src/jalview/binding/Sequence.java
src/jalview/binding/SequenceSet.java
src/jalview/binding/SequenceType.java
src/jalview/binding/Setting.java
src/jalview/binding/Tree.java
src/jalview/binding/UserColourScheme.java
src/jalview/binding/UserColours.java
src/jalview/binding/VAMSAS.java
src/jalview/binding/VamsasModel.java
src/jalview/binding/Viewport.java
src/jalview/commands/ChangeCaseCommand.java
src/jalview/commands/CommandI.java
src/jalview/commands/EditCommand.java
src/jalview/commands/OrderCommand.java
src/jalview/commands/RemoveGapColCommand.java
src/jalview/commands/RemoveGapsCommand.java
src/jalview/commands/SlideSequencesCommand.java
src/jalview/commands/TrimRegionCommand.java
src/jalview/datamodel/AlignedCodonFrame.java
src/jalview/datamodel/Alignment.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/datamodel/AlignmentI.java
src/jalview/datamodel/AlignmentOrder.java
src/jalview/datamodel/AlignmentView.java
src/jalview/datamodel/Annotation.java
src/jalview/datamodel/BinaryNode.java
src/jalview/datamodel/BinarySequence.java
src/jalview/datamodel/CigarArray.java
src/jalview/datamodel/CigarBase.java
src/jalview/datamodel/CigarCigar.java
src/jalview/datamodel/CigarSimple.java
src/jalview/datamodel/ColumnSelection.java
src/jalview/datamodel/DBRefEntry.java
src/jalview/datamodel/DBRefSource.java
src/jalview/datamodel/FeatureProperties.java
src/jalview/datamodel/GraphLine.java
src/jalview/datamodel/HiddenSequences.java
src/jalview/datamodel/Mapping.java
src/jalview/datamodel/NodeTransformI.java
src/jalview/datamodel/PDBEntry.java
src/jalview/datamodel/Provenance.java
src/jalview/datamodel/ProvenanceEntry.java
src/jalview/datamodel/SearchResults.java
src/jalview/datamodel/SeqCigar.java
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceFeature.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/datamodel/SequenceI.java
src/jalview/datamodel/SequenceNode.java
src/jalview/datamodel/SequencePoint.java
src/jalview/datamodel/UniprotEntry.java
src/jalview/datamodel/UniprotFile.java
src/jalview/datamodel/UniprotProteinName.java
src/jalview/datamodel/UniprotSequence.java
src/jalview/datamodel/xdb/embl/BasePosition.java
src/jalview/datamodel/xdb/embl/EmblEntry.java
src/jalview/datamodel/xdb/embl/EmblError.java
src/jalview/datamodel/xdb/embl/EmblFeature.java
src/jalview/datamodel/xdb/embl/EmblFeatureLocElement.java
src/jalview/datamodel/xdb/embl/EmblFeatureLocations.java
src/jalview/datamodel/xdb/embl/EmblFile.java
src/jalview/datamodel/xdb/embl/EmblSequence.java
src/jalview/datamodel/xdb/embl/Qualifier.java
src/jalview/ext/jmol/JalviewJmolBinding.java
src/jalview/ext/jmol/JmolCommands.java
src/jalview/ext/varna/JalviewVarnaBinding.java [new file with mode: 0644]
src/jalview/ext/varna/VarnaCommands.java [new file with mode: 0644]
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/AnnotationExporter.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/AppJmol.java
src/jalview/gui/AppJmolBinding.java
src/jalview/gui/AppVarna.java [new file with mode: 0644]
src/jalview/gui/AppVarnaBinding.java [new file with mode: 0644]
src/jalview/gui/AssociatePdbFileWithSeq.java
src/jalview/gui/BlogReader.java
src/jalview/gui/ConservationThread.java [deleted file]
src/jalview/gui/Console.java
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/gui/DasSourceBrowser.java
src/jalview/gui/Desktop.java
src/jalview/gui/EPSOptions.java
src/jalview/gui/EditNameDialog.java
src/jalview/gui/FeatureColourChooser.java
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/Finder.java
src/jalview/gui/FontChooser.java
src/jalview/gui/IProgressIndicator.java
src/jalview/gui/IProgressIndicatorHandler.java
src/jalview/gui/IdCanvas.java
src/jalview/gui/IdPanel.java
src/jalview/gui/IdwidthAdjuster.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/JalviewAppender.java
src/jalview/gui/JalviewChangeSupport.java
src/jalview/gui/JalviewDialog.java
src/jalview/gui/JvSwingUtils.java
src/jalview/gui/OOMWarning.java
src/jalview/gui/OptsAndParamsPage.java
src/jalview/gui/OptsParametersContainerI.java
src/jalview/gui/OverviewPanel.java
src/jalview/gui/PCAPanel.java
src/jalview/gui/PaintRefresher.java
src/jalview/gui/PairwiseAlignPanel.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/Preferences.java
src/jalview/gui/PromptUserConfig.java
src/jalview/gui/RedundancyPanel.java
src/jalview/gui/RestInputParamEditDialog.java
src/jalview/gui/RestServiceEditorPane.java
src/jalview/gui/RotatableCanvas.java
src/jalview/gui/ScalePanel.java
src/jalview/gui/ScriptWindow.java
src/jalview/gui/SeqCanvas.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/SequenceFetcher.java
src/jalview/gui/SequenceRenderer.java
src/jalview/gui/SliderPanel.java
src/jalview/gui/SplashScreen.java
src/jalview/gui/TextColourChooser.java
src/jalview/gui/TreeCanvas.java
src/jalview/gui/TreePanel.java
src/jalview/gui/UserDefinedColours.java
src/jalview/gui/UserQuestionnaireCheck.java
src/jalview/gui/VamsasApplication.java
src/jalview/gui/ViewSelectionMenu.java
src/jalview/gui/WebserviceInfo.java
src/jalview/gui/WsJobParameters.java
src/jalview/gui/WsParamSetManager.java
src/jalview/gui/WsPreferences.java
src/jalview/io/AMSAFile.java
src/jalview/io/AlignFile.java
src/jalview/io/AlignmentProperties.java
src/jalview/io/AnnotationFile.java
src/jalview/io/AppletFormatAdapter.java
src/jalview/io/BLCFile.java
src/jalview/io/ClansFile.java
src/jalview/io/ClustalFile.java
src/jalview/io/DBRefFile.java
src/jalview/io/FastaFile.java
src/jalview/io/FeaturesFile.java
src/jalview/io/FileLoader.java
src/jalview/io/FileParse.java
src/jalview/io/FormatAdapter.java
src/jalview/io/HTMLOutput.java
src/jalview/io/IdentifyFile.java
src/jalview/io/JPredFile.java
src/jalview/io/JalviewFileChooser.java
src/jalview/io/JalviewFileFilter.java
src/jalview/io/JalviewFileView.java
src/jalview/io/JnetAnnotationMaker.java
src/jalview/io/MSFfile.java
src/jalview/io/MatrixFile.java
src/jalview/io/ModellerDescription.java
src/jalview/io/NewickFile.java
src/jalview/io/PIRFile.java
src/jalview/io/PfamFile.java
src/jalview/io/PileUpfile.java
src/jalview/io/SimpleBlastFile.java
src/jalview/io/StockholmFile.java
src/jalview/io/VamsasAppDatastore.java
src/jalview/io/WSWUBlastClient.java
src/jalview/io/packed/DataProvider.java
src/jalview/io/packed/JalviewDataset.java
src/jalview/io/packed/ParsePackedSet.java
src/jalview/io/packed/SimpleDataProvider.java
src/jalview/io/vamsas/Datasetsequence.java
src/jalview/io/vamsas/DatastoreItem.java
src/jalview/io/vamsas/DatastoreRegistry.java
src/jalview/io/vamsas/Dbref.java
src/jalview/io/vamsas/LocalDocSyncObject.java
src/jalview/io/vamsas/Rangetype.java
src/jalview/io/vamsas/Sequencefeature.java
src/jalview/io/vamsas/Sequencemapping.java
src/jalview/io/vamsas/Tree.java
src/jalview/javascript/JSFunctionExec.java
src/jalview/javascript/JalviewLiteJsApi.java
src/jalview/javascript/JsCallBack.java
src/jalview/javascript/JsSelectionSender.java
src/jalview/javascript/MouseOverListener.java
src/jalview/javascript/MouseOverStructureListener.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/jbgui/GAlignmentPanel.java
src/jalview/jbgui/GCutAndPasteTransfer.java
src/jalview/jbgui/GDasSourceBrowser.java
src/jalview/jbgui/GDesktop.java
src/jalview/jbgui/GFinder.java
src/jalview/jbgui/GFontChooser.java
src/jalview/jbgui/GPCAPanel.java
src/jalview/jbgui/GPairwiseAlignPanel.java
src/jalview/jbgui/GPreferences.java
src/jalview/jbgui/GRestInputParamEditDialog.java
src/jalview/jbgui/GRestServiceEditorPane.java
src/jalview/jbgui/GRnaStructureViewer.java [new file with mode: 0644]
src/jalview/jbgui/GSequenceLink.java
src/jalview/jbgui/GSliderPanel.java
src/jalview/jbgui/GStructureViewer.java
src/jalview/jbgui/GTreePanel.java
src/jalview/jbgui/GUserDefinedColours.java
src/jalview/jbgui/GWebserviceInfo.java
src/jalview/jbgui/GWsPreferences.java
src/jalview/math/Matrix.java
src/jalview/math/RotatableMatrix.java
src/jalview/renderer/AnnotationRenderer.java [new file with mode: 0644]
src/jalview/renderer/AwtRenderPanelI.java [new file with mode: 0644]
src/jalview/schemabinding/version2/AlcodMap.java
src/jalview/schemabinding/version2/Alcodon.java
src/jalview/schemabinding/version2/AlcodonFrame.java
src/jalview/schemabinding/version2/Annotation.java
src/jalview/schemabinding/version2/AnnotationColours.java
src/jalview/schemabinding/version2/AnnotationElement.java
src/jalview/schemabinding/version2/Colour.java
src/jalview/schemabinding/version2/DBRef.java
src/jalview/schemabinding/version2/Feature.java
src/jalview/schemabinding/version2/FeatureSettings.java
src/jalview/schemabinding/version2/Features.java
src/jalview/schemabinding/version2/Group.java
src/jalview/schemabinding/version2/HiddenColumns.java
src/jalview/schemabinding/version2/JGroup.java
src/jalview/schemabinding/version2/JSeq.java
src/jalview/schemabinding/version2/JalviewModel.java
src/jalview/schemabinding/version2/JalviewModelSequence.java
src/jalview/schemabinding/version2/JalviewUserColours.java
src/jalview/schemabinding/version2/MapListFrom.java
src/jalview/schemabinding/version2/MapListTo.java
src/jalview/schemabinding/version2/MapListType.java
src/jalview/schemabinding/version2/Mapping.java
src/jalview/schemabinding/version2/MappingChoice.java
src/jalview/schemabinding/version2/OtherData.java
src/jalview/schemabinding/version2/Pdbentry.java
src/jalview/schemabinding/version2/PdbentryItem.java
src/jalview/schemabinding/version2/Pdbids.java
src/jalview/schemabinding/version2/Property.java
src/jalview/schemabinding/version2/Sequence.java
src/jalview/schemabinding/version2/SequenceSet.java
src/jalview/schemabinding/version2/SequenceSetProperties.java
src/jalview/schemabinding/version2/SequenceType.java
src/jalview/schemabinding/version2/Setting.java
src/jalview/schemabinding/version2/StructureState.java
src/jalview/schemabinding/version2/ThresholdLine.java
src/jalview/schemabinding/version2/Tree.java
src/jalview/schemabinding/version2/UserColourScheme.java
src/jalview/schemabinding/version2/UserColours.java
src/jalview/schemabinding/version2/VAMSAS.java
src/jalview/schemabinding/version2/VamsasModel.java
src/jalview/schemabinding/version2/Viewport.java
src/jalview/schemabinding/version2/WebServiceParameterSet.java
src/jalview/schemabinding/version2/descriptors/AlcodMapDescriptor.java
src/jalview/schemabinding/version2/descriptors/AlcodonDescriptor.java
src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java
src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java
src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java
src/jalview/schemabinding/version2/descriptors/AnnotationElementDescriptor.java
src/jalview/schemabinding/version2/descriptors/ColourDescriptor.java
src/jalview/schemabinding/version2/descriptors/DBRefDescriptor.java
src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java
src/jalview/schemabinding/version2/descriptors/FeatureSettingsDescriptor.java
src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java
src/jalview/schemabinding/version2/descriptors/GroupDescriptor.java
src/jalview/schemabinding/version2/descriptors/HiddenColumnsDescriptor.java
src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java
src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java
src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java
src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java
src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java
src/jalview/schemabinding/version2/descriptors/MapListFromDescriptor.java
src/jalview/schemabinding/version2/descriptors/MapListToDescriptor.java
src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java
src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java
src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java
src/jalview/schemabinding/version2/descriptors/OtherDataDescriptor.java
src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java
src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java
src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java
src/jalview/schemabinding/version2/descriptors/PropertyDescriptor.java
src/jalview/schemabinding/version2/descriptors/SequenceDescriptor.java
src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java
src/jalview/schemabinding/version2/descriptors/SequenceSetPropertiesDescriptor.java
src/jalview/schemabinding/version2/descriptors/SequenceTypeDescriptor.java
src/jalview/schemabinding/version2/descriptors/SettingDescriptor.java
src/jalview/schemabinding/version2/descriptors/StructureStateDescriptor.java
src/jalview/schemabinding/version2/descriptors/ThresholdLineDescriptor.java
src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java
src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java
src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java
src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java
src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java
src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java
src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java
src/jalview/schemes/AnnotationColourGradient.java
src/jalview/schemes/Blosum62ColourScheme.java
src/jalview/schemes/BuriedColourScheme.java
src/jalview/schemes/ClustalxColourScheme.java
src/jalview/schemes/ColourSchemeI.java
src/jalview/schemes/ColourSchemeProperty.java
src/jalview/schemes/Consensus.java
src/jalview/schemes/CovariationColourScheme.java [new file with mode: 0644]
src/jalview/schemes/GraduatedColor.java
src/jalview/schemes/HelixColourScheme.java
src/jalview/schemes/HydrophobicColourScheme.java
src/jalview/schemes/NucleotideColourScheme.java
src/jalview/schemes/PIDColourScheme.java
src/jalview/schemes/PurinePyrimidineColourScheme.java [new file with mode: 0644]
src/jalview/schemes/RNAHelicesColour.java [new file with mode: 0644]
src/jalview/schemes/RNAHelicesColourChooser.java [new file with mode: 0644]
src/jalview/schemes/ResidueColourScheme.java
src/jalview/schemes/ResidueProperties.java
src/jalview/schemes/ScoreColourScheme.java
src/jalview/schemes/ScoreMatrix.java
src/jalview/schemes/StrandColourScheme.java
src/jalview/schemes/TaylorColourScheme.java
src/jalview/schemes/TurnColourScheme.java
src/jalview/schemes/UserColourScheme.java
src/jalview/schemes/ZappoColourScheme.java
src/jalview/structure/AlignmentViewPanelListener.java
src/jalview/structure/SecondaryStructureListener.java [new file with mode: 0644]
src/jalview/structure/SelectionListener.java
src/jalview/structure/SelectionSource.java
src/jalview/structure/SequenceListener.java
src/jalview/structure/StructureListener.java
src/jalview/structure/StructureMapping.java
src/jalview/structure/StructureMappingcommandSet.java
src/jalview/structure/StructureSelectionManager.java
src/jalview/structure/VamsasListener.java
src/jalview/structure/VamsasSource.java
src/jalview/util/AWTConsole.java
src/jalview/util/BrowserLauncher.java
src/jalview/util/ColorUtils.java [new file with mode: 0644]
src/jalview/util/Comparison.java
src/jalview/util/DBRefUtils.java
src/jalview/util/Format.java
src/jalview/util/GroupUrlLink.java
src/jalview/util/ImageMaker.java
src/jalview/util/MapList.java
src/jalview/util/ParseHtmlBodyAndLinks.java
src/jalview/util/Platform.java
src/jalview/util/QuickSort.java
src/jalview/util/ShiftList.java
src/jalview/util/TableSorter.java
src/jalview/util/UrlLink.java
src/jalview/util/jarInputStreamProvider.java
src/jalview/viewmodel/AlignmentViewport.java [new file with mode: 0644]
src/jalview/workers/AlignCalcManager.java [new file with mode: 0644]
src/jalview/workers/AlignCalcWorker.java [new file with mode: 0644]
src/jalview/workers/ConsensusThread.java [new file with mode: 0644]
src/jalview/workers/ConservationThread.java [new file with mode: 0644]
src/jalview/workers/StrucConsensusThread.java [new file with mode: 0644]
src/jalview/ws/AWSThread.java
src/jalview/ws/AWsJob.java
src/jalview/ws/DBRefFetcher.java
src/jalview/ws/DasSequenceFeatureFetcher.java
src/jalview/ws/EnfinEnvision2OneWay.java
src/jalview/ws/JobStateSummary.java
src/jalview/ws/SequenceFetcher.java
src/jalview/ws/WSClient.java
src/jalview/ws/WSClientI.java
src/jalview/ws/WSMenuEntryProviderI.java
src/jalview/ws/dbsources/EbiFileRetrievedProxy.java
src/jalview/ws/dbsources/EmblCdsSouce.java
src/jalview/ws/dbsources/EmblSource.java
src/jalview/ws/dbsources/EmblXmlSource.java
src/jalview/ws/dbsources/GeneDbSource.java
src/jalview/ws/dbsources/Pdb.java
src/jalview/ws/dbsources/Pfam.java
src/jalview/ws/dbsources/PfamFull.java
src/jalview/ws/dbsources/PfamSeed.java
src/jalview/ws/dbsources/Rfam.java [new file with mode: 0644]
src/jalview/ws/dbsources/RfamFull.java [new file with mode: 0644]
src/jalview/ws/dbsources/RfamSeed.java [new file with mode: 0644]
src/jalview/ws/dbsources/Uniprot.java
src/jalview/ws/dbsources/UnprotName.java
src/jalview/ws/dbsources/Xfam.java [new file with mode: 0644]
src/jalview/ws/ebi/EBIFetchClient.java
src/jalview/ws/io/mime/HttpContentHandler.java
src/jalview/ws/io/mime/JalviewMimeContentHandler.java
src/jalview/ws/io/mime/MimeTypes.java
src/jalview/ws/jws1/Discoverer.java
src/jalview/ws/jws1/JPredClient.java
src/jalview/ws/jws1/JPredThread.java
src/jalview/ws/jws1/JWS1Thread.java
src/jalview/ws/jws1/MsaWSClient.java
src/jalview/ws/jws1/MsaWSThread.java
src/jalview/ws/jws1/SeqSearchWSClient.java
src/jalview/ws/jws1/SeqSearchWSThread.java
src/jalview/ws/jws1/WS1Client.java
src/jalview/ws/jws1/WSJob.java
src/jalview/ws/jws2/AAConsClient.java [new file with mode: 0644]
src/jalview/ws/jws2/AADisorderClient.java [new file with mode: 0644]
src/jalview/ws/jws2/AWS2Thread.java
src/jalview/ws/jws2/JWs2Job.java
src/jalview/ws/jws2/JabaParamStore.java
src/jalview/ws/jws2/JabaPreset.java
src/jalview/ws/jws2/JabaWsServerQuery.java
src/jalview/ws/jws2/JabawsAlignCalcWorker.java [new file with mode: 0644]
src/jalview/ws/jws2/Jws2Client.java
src/jalview/ws/jws2/Jws2Discoverer.java
src/jalview/ws/jws2/MsaWSClient.java
src/jalview/ws/jws2/MsaWSThread.java
src/jalview/ws/jws2/ParameterUtils.java
src/jalview/ws/jws2/SequenceAnnotationWSClient.java [new file with mode: 0644]
src/jalview/ws/jws2/dm/JabaOption.java
src/jalview/ws/jws2/dm/JabaParameter.java
src/jalview/ws/jws2/dm/JabaValueConstrain.java
src/jalview/ws/jws2/dm/JabaWsParamSet.java
src/jalview/ws/jws2/jabaws2/Jws2Instance.java [new file with mode: 0644]
src/jalview/ws/params/ArgumentI.java
src/jalview/ws/params/InvalidArgumentException.java
src/jalview/ws/params/OptionI.java
src/jalview/ws/params/ParamDatastoreI.java
src/jalview/ws/params/ParamManager.java
src/jalview/ws/params/ParameterI.java
src/jalview/ws/params/ValueConstrainI.java
src/jalview/ws/params/WsParamSetI.java
src/jalview/ws/params/simple/BooleanOption.java
src/jalview/ws/params/simple/IntegerParameter.java
src/jalview/ws/params/simple/Option.java
src/jalview/ws/params/simple/Parameter.java
src/jalview/ws/params/simple/StringChoiceParameter.java
src/jalview/ws/rest/AlignmentProcessor.java
src/jalview/ws/rest/HttpResultSet.java
src/jalview/ws/rest/InputType.java
src/jalview/ws/rest/NoValidInputDataException.java
src/jalview/ws/rest/RestClient.java
src/jalview/ws/rest/RestJob.java
src/jalview/ws/rest/RestJobThread.java
src/jalview/ws/rest/RestServiceDescription.java
src/jalview/ws/rest/params/Alignment.java
src/jalview/ws/rest/params/AnnotationFile.java
src/jalview/ws/rest/params/JobConstant.java
src/jalview/ws/rest/params/SeqGroupIndexVector.java
src/jalview/ws/rest/params/SeqIdVector.java
src/jalview/ws/rest/params/SeqVector.java
src/jalview/ws/rest/params/Tree.java
src/jalview/ws/seqfetcher/ASequenceFetcher.java
src/jalview/ws/seqfetcher/DbSourceProxy.java
src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
src/uk/ac/ebi/picr/model/CrossReference.java
src/uk/ac/ebi/picr/model/CrossReference_Helper.java
src/uk/ac/ebi/picr/model/UPEntry.java
src/uk/ac/ebi/picr/model/UPEntry_Helper.java
src/uk/ac/ebi/www/Data.java
src/uk/ac/ebi/www/InputParams.java
src/uk/ac/ebi/www/WSFile.java
src/uk/ac/ebi/www/WSWUBlast.java
src/uk/ac/ebi/www/WSWUBlastService.java
src/uk/ac/ebi/www/WSWUBlastServiceLocator.java
src/uk/ac/ebi/www/WSWUBlastSoapBindingStub.java
src/uk/ac/ebi/www/picr/AccessionMappingService/AccessionMapperBindingStub.java
src/uk/ac/ebi/www/picr/AccessionMappingService/AccessionMapperInterface.java
src/uk/ac/ebi/www/picr/AccessionMappingService/AccessionMapperService.java
src/uk/ac/ebi/www/picr/AccessionMappingService/AccessionMapperServiceLocator.java
src/vamsas/IMsaWS.java
src/vamsas/objects/simple/Alignment.java
src/vamsas/objects/simple/Alignment_Helper.java
src/vamsas/objects/simple/JpredResult.java
src/vamsas/objects/simple/JpredResult_Helper.java
src/vamsas/objects/simple/MsaResult.java
src/vamsas/objects/simple/MsaResult_Helper.java
src/vamsas/objects/simple/Msfalignment.java
src/vamsas/objects/simple/Msfalignment_Helper.java
src/vamsas/objects/simple/Object.java
src/vamsas/objects/simple/Object_Helper.java
src/vamsas/objects/simple/Result.java
src/vamsas/objects/simple/Result_Helper.java
src/vamsas/objects/simple/Secstructpred.java
src/vamsas/objects/simple/Secstructpred_Helper.java
src/vamsas/objects/simple/SeqSearchResult.java
src/vamsas/objects/simple/SeqSearchResult_Helper.java
src/vamsas/objects/simple/Sequence.java
src/vamsas/objects/simple/SequenceSet.java
src/vamsas/objects/simple/SequenceSet_Helper.java
src/vamsas/objects/simple/Sequence_Helper.java
src/vamsas/objects/simple/WsJobId.java
src/vamsas/objects/simple/WsJobId_Helper.java
utils/InstallAnywhere/Jalview.iap_xml
utils/InstallAnywhere/jalview_buildinstaller.xml
utils/eclipse/JalviewCodeStyle.xml
utils/getJavaVersion.java
utils/help2Website.java
utils/jalopy/docs/acknowledge.html
utils/jalopy/docs/bi01.html
utils/jalopy/docs/build.html
utils/jalopy/docs/comments.html
utils/jalopy/docs/contact.html
utils/jalopy/docs/contributors.html
utils/jalopy/docs/dedication.html
utils/jalopy/docs/dependencies.html
utils/jalopy/docs/docs.html
utils/jalopy/docs/download.html
utils/jalopy/docs/environment.html
utils/jalopy/docs/faq.html
utils/jalopy/docs/features.html
utils/jalopy/docs/footer.html
utils/jalopy/docs/header.html
utils/jalopy/docs/history.html
utils/jalopy/docs/imports.html
utils/jalopy/docs/indentation.html
utils/jalopy/docs/index.html
utils/jalopy/docs/inspector-naming.html
utils/jalopy/docs/inspector.html
utils/jalopy/docs/installation.html
utils/jalopy/docs/introduction.html
utils/jalopy/docs/ix01.html
utils/jalopy/docs/javadoc.html
utils/jalopy/docs/license-antlr.html
utils/jalopy/docs/license-apache.html
utils/jalopy/docs/license-common-public.html
utils/jalopy/docs/license-gnu-doc.html
utils/jalopy/docs/license-gnu.html
utils/jalopy/docs/license-sun-public.html
utils/jalopy/docs/links.html
utils/jalopy/docs/manual.html
utils/jalopy/docs/messages.html
utils/jalopy/docs/misc.html
utils/jalopy/docs/part-core.html
utils/jalopy/docs/part-plugins.html
utils/jalopy/docs/plugin-ant-config.html
utils/jalopy/docs/plugin-ant-license.html
utils/jalopy/docs/plugin-ant-usage.html
utils/jalopy/docs/plugin-ant.html
utils/jalopy/docs/plugin-console-license.html
utils/jalopy/docs/plugin-console-usage.html
utils/jalopy/docs/plugin-console.html
utils/jalopy/docs/plugin-eclipse-integration.html
utils/jalopy/docs/plugin-eclipse-license.html
utils/jalopy/docs/plugin-eclipse.html
utils/jalopy/docs/plugin-jbuilder-integration.html
utils/jalopy/docs/plugin-jbuilder-license.html
utils/jalopy/docs/plugin-jbuilder.html
utils/jalopy/docs/plugin-jdev-integration.html
utils/jalopy/docs/plugin-jdev-license.html
utils/jalopy/docs/plugin-jdev.html
utils/jalopy/docs/plugin-jedit-integration.html
utils/jalopy/docs/plugin-jedit-license.html
utils/jalopy/docs/plugin-jedit.html
utils/jalopy/docs/plugin-netbeans-integration.html
utils/jalopy/docs/plugin-netbeans-license.html
utils/jalopy/docs/plugin-netbeans.html
utils/jalopy/docs/plugins.html
utils/jalopy/docs/printer.html
utils/jalopy/docs/project.html
utils/jalopy/docs/separation.html
utils/jalopy/docs/settings.html
utils/jalopy/docs/sorting.html
utils/jalopy/docs/usage.html
utils/jalopy/docs/whitespace.html
utils/jalopy/docs/wrapping.html
utils/jalopy/readme.html

index 4a8ccc4..af48f6e 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="utils"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="lib" path="lib/activation.jar"/>
        <classpathentry kind="lib" path="lib/axis.jar" sourcepath="D:/axis-1_2RC2-src/axis-1_2RC2"/>
        </classpathentry>
        <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/min-jaba-client.jar"/>
        <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
+       <classpathentry kind="lib" path="lib/min-jaba-client-2.0.jar" sourcepath="/clustengine2"/>
        <classpathentry kind="lib" path="lib/Jmol-12.2.4.jar"/>
        <classpathentry kind="lib" path="appletlib/JmolApplet-12.2.4.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="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
-       <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.java"/>
+       <classpathentry kind="lib" path="/Users/jimp/git/jalview_clean/lib/VARNAv3-9-dev.jar"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>
index 57994d7..4c0c7dd 100644 (file)
@@ -15,6 +15,7 @@
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jalview"/>
 <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="buildindices,"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${build_project}/build.xml"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
diff --git a/FEATURETODO b/FEATURETODO
new file mode 100644 (file)
index 0000000..636cb53
--- /dev/null
@@ -0,0 +1,7 @@
+Normalised logo feature todo
+
+* add gui switches in applet for normalised logo display
+* add flags for normalised logo display to AnnotationFile and Jalview Project
+* add preference for application
+* consider rationalising flag model for N types of consensus/logo calculation methods
+
index beccd07..6e3a2f2 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5dfa54f..ff9af07 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/doc/JalviewRNASupport.html b/doc/JalviewRNASupport.html
new file mode 100644 (file)
index 0000000..0104d96
--- /dev/null
@@ -0,0 +1,83 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+-->
+<title>Jalview RNA Support</title>
+<body>
+<h1>
+Jalview RNA Support
+</h1>
+<p>
+Jalview RNA support was first added during a 
+<a href="http://socghop.appspot.com/gsoc/program/home/google/gsoc2010">2010 Google Summer of Code Project</a> by  
+Lauren Lui (see her <a href="https://www.nescent.org/wg_phyloinformatics/PhyloSoC:Extending_Jalview_to_Support_RNA_Alignment_Annotation_and_Secondary_Structure_Visualization">
+NESCent wiki page</a> and the project <a href="http://jalview-rnasupport.blogspot.com/">blog</a>).  
+</p>
+<h2>What was added</h2>
+<p>
+<ul>
+<li>Recognition of ".stk" and ".sto" extensions for Stockholm file format.</li>
+<li>Purine/Pyrimidine colour scheme.</li>
+<li>Colouring by RNA helices. Helices are determined from the secondary structure line written in WUSS format in Stockholm files.</li>
+<li>Ability to fetch sequences from RFAM.</li>
+<li>Visualization of RNA secondary structure in WUSS format (from input file) and RNA helices in the 
+annotation panel.</li>
+</ul>
+</p>
+<p>In 2011, Jan Engelhardt was supported by <a href="http://socghop.appspot.com/gsoc/program/home/google/gsoc2011">GSOC</a> to extend Lauren's work, with <a href="https://www.nescent.org/wg_phyloinformatics/PhyloSoC:_Extending_Jalview_support_for_handling_RNA">support for viewing secondary structure in VARNA and visualizing base pair contact conservation</a>.
+</p>
+<h2>What Jan added</h2>
+<p>
+<ul>
+<li>Enable RNA secondary structure annotation to be imported/exported through Jalview annotation files</li>
+<li>Incorporated <a href="varna.lri.fr">VARNA</a> into the desktop application</li>
+<li>Added a new base pair consensus histogram and sequence logo annotation row</li> 
+</ul>  
+</p>
+<h2>TODO</h2>
+<h3>Secondary Structure Visualization/Annotation</h3>
+<ul>
+<li>Detection of pseudoknots and tetraloops </li>
+<li>Update colouring of RNA helices in annotation panel when "By RNA helices" colouring is selected</li>
+<li>Editing of secondary structure line</li>
+<li>Update helix colouring when secondary structure changes.</li>
+<li>Support per sequence in RNA secondary structure annotation</li>
+</ul>
+
+<h3>Colour schemes</h3>
+<ul>
+<li>Coloring scheme for pseudoknots</li>
+<li>Covariation colour scheme similar to RFAM's</li>
+<li>Coloring schemes from other MSA viewers, like 4Sale and Assemble</li>
+<li>Highlight positions in alignments that break base pairing specified in the secondary structure line</li>
+</ul>
+<h3>Embed VARNA, An RNA Secondary Structure Viewer</h3>
+<ul>
+<li>The homepage for VARNA can be found <a href="http://varna.lri.fr/">here</a>.</li>
+<li>Hook VARNA into Jalview</li>
+<li>Ability to port RNA secondary structure (e.g. from Stockholm files) into VARNA</li>
+<li>Mouse over and selections get highlighted in the linked views</li>
+</ul>
+<h3>Miscellaneous</h3>
+<ul>
+<li>Add changes done to the main gui to the applet gui</li>
+<li>Add export of Stockholm file format</li>
+</ul>
+</p> 
+</body>
+</html>
+
index dfb21a2..e628f0f 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
 <p>
 You will need the following (hopefully):<br>
 <ul>
-<li>Java development kit (we used JDK1.5SE but JDK1.6 will work too,
-and maybe even jikes).</li>
+<li>Java development kit (JDK1.6 is the recommended platform for developing with Jalview, although JDK1.7 seems to work too!).</li>
 <li>Ant (we think 1.5.4 is quite sufficient to use the simple build
-file supplied).</li>
+file supplied, and it seems to work with later versions e.g. 1.7).</li>
 </ul>
 With any luck, after setting your paths and JAVA_HOME correctly, you
 just need to change to the Jalview directory and run ant (this works
index a5fc4a3..025643c 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 4b43977..d694c67 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 5521d00..c03b21d 100644 (file)
@@ -1,7 +1,7 @@
 <html>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
diff --git a/examples/RF00031_folded.stk b/examples/RF00031_folded.stk
new file mode 100644 (file)
index 0000000..e7a76fb
--- /dev/null
@@ -0,0 +1,227 @@
+# STOCKHOLM 1.0
+
+#=GF ID SECIS_1
+#=GF AC RF00031
+#=GF DE Selenocysteine insertion sequence 1
+#=GF AU Griffiths-Jones SR
+#=GF GA 20.0
+#=GF NC 0.0
+#=GF TC 22.6
+#=GF PI SECIS
+#=GF SE Gautheret D, PMID:12458087
+#=GF SS Published; PMID:12458087
+#=GF TP Cis-reg;
+#=GF BM cmbuild  -F CM SEED; cmcalibrate --mpi -s 1 CM
+#=GF BM cmsearch  -Z 169604 -E 1000  --toponly  CM SEQDB
+#=GF DR SO:1001274 SO:SECIS_element
+#=GF DR GO:0001514 GO:selenocysteine incorporation
+#=GF RN [1]
+#=GF RM 8634917
+#=GF RT A novel RNA structural motif in the selenocysteine insertion element
+#=GF RT of eukaryotic selenoprotein mRNAs.
+#=GF RA Walczak R, Westhof E, Carbon P, Krol A;
+#=GF RL RNA 1996;2:367-379.
+#=GF RN [2]
+#=GF RM 12458087
+#=GF RT A survey of metazoan selenocysteine insertion sequences.
+#=GF RA Lambert A, Lescure A, Gautheret D;
+#=GF RL Biochimie 2002;84:953-959.
+#=GF CC The incorporation of selenocysteine into a protein sequence
+#=GF CC is directed by an in-frame UGA codon (usually a stop codon)
+#=GF CC within the coding region of the mRNA.  Selenoprotein mRNAs
+#=GF CC contain a conserved secondary structure in the 3' UTR that
+#=GF CC is required for the distinction of UGA stop from UGA 
+#=GF CC selenocysteine.  The selenocysteine insertion sequence 
+#=GF CC (SECIS) is around 60 nt in length and adopts a hairpin 
+#=GF CC structure which is sufficiently well-defined and conserved
+#=GF CC to act as a computational screen for selenoprotein genes [2].
+#=GF WK http://en.wikipedia.org/wiki/SECIS_element
+#=GF SQ 61
+
+#=GS D.melanogaster.1 AC AY119185.1/838-902
+#=GS D.melanogaster.2 AC AC092237.1/57223-57161
+#=GS D.melanogaster.3 AC AY060611.1/560-627
+#=GS O.niloticus.1    AC Y11109.1/1272-1330
+#=GS O.niloticus.2    AC Y11109.1/927-987
+#=GS O.niloticus.3    AC Y11111.1/1260-1324
+#=GS D.rerio.1        AC AF322071.1/1577-1642
+#=GS X.laevis.1       AC L28111.1/1299-1365
+#=GS G.gallus.1       AC AF125575.1/5781-5843
+#=GS G.gallus.2       AC Y11110.1/1218-1277
+#=GS G.gallus.3       AC Y11273.1/1139-1211
+#=GS M.musculus.1     AC AF195142.1/461-524
+#=GS M.musculus.2     AC AF021345.1/10097-10160
+#=GS M.musculus.3     AC X03920.1/1172-1235
+#=GS M.musculus.4     AC AF096875.1/5504-5568
+#=GS M.musculus.5     AC AF241527.2/359-424
+#=GS M.musculus.6     AC AF136399.1/1808-1868
+#=GS M.musculus.7     AC X84742.1/5239-5302
+#=GS M.musculus.8     AC AF288740.1/1291-1357
+#=GS M.musculus.9     AC AF274027.1/835-900
+#=GS M.musculus.10    AC AB030643.1/4176-4241
+#=GS M.musculus.11    AC AL645723.11/192421-192359
+#=GS M.musculus.12    AC AC002327.1/156204-156268
+#=GS M.musculus.13    AC AF333036.1/2190-2249
+#=GS M.musculus.14    AC U43285.1/2009-2075
+#=GS R.norvegicus.1   AC X57999.1/1526-1586
+#=GS R.norvegicus.2   AC M63574.1/1465-1528
+#=GS R.norvegicus.3   AC AF390544.1/1076-1142
+#=GS R.norvegicus.4   AC AF072865.1/1887-1947
+#=GS R.norvegicus.5   AC X12367.1/703-764
+#=GS R.norvegicus.6   AC U25264.1/366-432
+#=GS R.norvegicus.7   AC L24896.1/600-665
+#=GS H.sapiens.1      AC AF201385.1/3055-3117
+#=GS H.sapiens.2      AC AL049837.4/130674-130738
+#=GS H.sapiens.3      AC U67171.1/375-442
+#=GS H.sapiens.4      AC AF195141.1/689-759
+#=GS H.sapiens.5      AC X53463.1/847-903
+#=GS H.sapiens.6      AC AF093774.1/5851-5916
+#=GS H.sapiens.7      AC X58295.1/1384-1453
+#=GS H.sapiens.8      AC AL833145.1/1479-1545
+#=GS H.sapiens.9      AC S48220.1/1731-1788
+#=GS H.sapiens.10     AC X71973.1/730-791
+#=GS H.sapiens.11     AC AF166127.1/1919-1981
+#=GS H.sapiens.12     AC U43286.1/2054-2120
+#=GS H.sapiens.13     AC BC003127.1/865-928
+#=GS H.sapiens.14     AC S79854.1/1605-1666
+#=GS H.sapiens.15     AC X13710.1/946-1008
+#=GS B.taurus.1       AC D88033.3/5711-5774
+#=GS B.taurus.2       AC D25220.1/1493-1556
+#=GS B.taurus.3       AC AB017534.1/661-726
+#=GS B.taurus.4       AC AB032826.1/1401-1464
+#=GS B.taurus.5       AC AB022283.1/1669-1729
+#=GS B.taurus.6       AC AF053984.1/1951-2017
+#=GS B.taurus.7       AC X13684.1/700-760
+#=GS O.aries.1        AC U67853.1/375-442
+#=GS S.scrofa.1       AC AF380118.1/366-433
+#=GS S.scrofa.2       AC L12743.1/694-758
+#=GS S.scrofa.3       AC AF532927.1/678-740
+#=GS S.scrofa.4       AC X76008.1/2709-2772
+#=GS C.elegans.1      AC U61947.2/4246-4309
+#=GS S.mansoni.1      AC L37762.1/2940-3006
+
+D.melanogaster.1          G.AGCC.CU...AUGAUCGAUGAUUGG.CAAA.UCCUCUC..GAGG..A.......ACCGAUC.G.U.UGAGAA..CCCCU.....UUGCCUU
+#=GR D.melanogaster.1 SS  ................(((((((((((......((((......)))..)........)))))).).).)))......................
+D.melanogaster.2          C.AUUCAACU.UAUGAGGAUUAUUUCU.UAAA.GGCCUCU...GGC..U.......CGGAAAU.A.G.UCUGAA...CCU........UAUUG
+#=GR D.melanogaster.2 SS  ................(((((((((((......((((......)))..)........)))))).).).)))......................
+D.melanogaster.3          G.UGGCGCU..UAUGACGCAGUUGUCU.UAAA.CUCGAAC..UCGA.GC........GGGCAA.U.U.GCUGAU...UACG...AUUAACCAC
+#=GR D.melanogaster.3 SS  (.(((...(....((((((((((((((......((((......))).).........)))))).).).)).).)...)).....)....))))
+O.niloticus.1             G.UUUCUCA...GUGAAGGCUACAGAU.UAAA..CCUCU....GGC...........CUCUGG.A.G.CCAGAU..GCAUU.......GAAAC
+#=GR O.niloticus.1 SS     ......(((...(((..(((((.((..........)).)....)))...........)((((.......))))....)))).......))...
+O.niloticus.2             U.GUUUAUU..AAUGACGGCUACAGAU.UAAA..CCUUU....AGC...........CUCUGG.A.G.CCAGAU..GCAUU......CAAACA
+#=GR O.niloticus.2 SS     ..((((.....((((..(((((.((..........)).)....)))...........)((((.......))))....)))).......)))).
+O.niloticus.3             G.UGUCUCU...GUGAAGUUCGGUUUU.UAAA.AGGGUCA...UCC..A.......GAAAACC.G.ACACUGAU..GUUUC......CGACAC
+#=GR O.niloticus.3 SS     (.((((..........(((((((((((.(......((.......))..........))))))).).).))).................)))))
+D.rerio.1                 A.UGUGGUCUUUAUGAAGGCAGGUGCA.GAAA.CUAUGCA...CUA.GU........GGUGUC.U.G.UCUGAU..GUUUG.......GCCAU
+#=GR D.rerio.1 SS         ...((((((.......(((((((..(.....(.(((........)).)).........)..)).).).))).........).......)))))
+X.laevis.1                G.UGUUUGCA.AAUGACGACCGAUUUU.GAAA.UGGUCUCACGGCC..A.......AAAACUC.GUG.UCCGAC...AUC........AACCC
+#=GR X.laevis.1 SS        .................((((((.(((......(((((....))))..)........))).)).).).)).......................
+G.gallus.1                G.UGUGUUU...AUGAAGAGCACUAAC.AAAA.GAGUAAU.UGACU..C.......AGUUGGU.G.U.UCAGAU..GCU.........CUCAC
+#=GR G.gallus.1 SS        (.((.(..(...((...((((((((((......((((......)))..)........)))))).).).))..))..)...........).)))
+G.gallus.2                U.AUUUGUC...AUGACAGUCACAGCA.UAAA..GCGCA....GAC...........GGCUGU.G.A.CCUGAU..UUUAG......AAAAUA
+#=GR G.gallus.2 SS        ................((((((((((................................))))).).)..))).....................
+G.gallus.3                U.AUUUCUU..UGUGAUGACCGAUUUU.GAAA.UGGGUUU...CUC..UAAUGCCAGGAAAUC.GUG.UCUGAU...GUUG.....UCAAGUA
+#=GR G.gallus.3 SS        ......(((...(..((((((((((((......((((((..........))).))).)))))).).).)).......)).......).)))..
+M.musculus.1              G.UCACCGA...AUGAUCUGCUCUGGU.CAAA.UCCUUCU...AUG..C......CAGCCAGG.G.U.GGUGAU..GACCC.......GUGAC
+#=GR M.musculus.1 SS      (.((((.(....((.(((.((((((((..............................)))))).).).))).)).....)........)))))
+M.musculus.2              G.UUACAUU..AAUGAGAACAGAAACA.UAAA..CUAUGA.CCUAG.G.........GGUUUC.U.G.UUGGAU..AGCUU.......GUAAU
+#=GR M.musculus.2 SS      (.(((((..........(((((((((........(((......)))............))))).).).))..........).......)))))
+M.musculus.3              G.GUUCUUC..CAUGAUGGUGUUUCCUCUAAA..UUUGC....ACG...........GAGAAA.C.A.CCUGAU.UUCCAG.....GAAAAUC
+#=GR M.musculus.3 SS      (.(((.(((..(..((.((((((((.(((................)...........)))))).).).))......))..).....)))))))
+M.musculus.4              G.UGUGCGA...AUGAUAACUACUGAC.GAAA.GAGCUGU.CUGCU..C.......AGUCUGU.G.G.UUGGAU...GUAG......UCACAC
+#=GR M.musculus.4 SS      (.(((((.........(((((((.(((......((((......)))..)........))).)).).).))).........).......)))))
+M.musculus.5              G.CCGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUUA...GAC..C.....UGUGGUCUU.U.C.CUCGAU..GUUCC......UGCGGC
+#=GR M.musculus.5 SS      (.((((..(...((...((((((((((.(.....(((......)))..........))))))).).).))..))..)...........)))))
+M.musculus.6              G.UCAGAUG...AUGAUGGCCUGGGCA.GAAA.CCCCAUG..UGGG..C........CGCCCA.G.G.UUUGAA...CCC........CUGGC
+#=GR M.musculus.6 SS      (.((((...........(((((((((..(.....(((......)))..).........))))).).).))..................)))))
+M.musculus.7              G.UGUCUCU...AUGAAGGAGGGGCCC.GAAG.CCCUUGU...GGG..C........GGGCCU.C.C.CCUGAG...CCCG....UCUGUGGU
+#=GR M.musculus.7 SS      ................(((.(((((((....(.(((.......)))..)........)))))).)...)))..(...(((........).)))
+M.musculus.8              U.UUGCAUU..AAUGAGGAUUACACAG.AAAA.CCUUUGU..UAAG.GA.......CUUGUGU.AGA.UCUGAU..AAUUG.......GCAAA
+#=GR M.musculus.8 SS      ..((((......((.(((.((((((((......((((......))).).........)))))).))..))).))..............)))).
+M.musculus.9              C.CGGCACU..CAUGAAGGUCUGCUUG.AAAA.CCAGCCU..GCUG.GU........GGGGCA.G.U.CCUGAG.GACCUG.......GCGUG
+#=GR M.musculus.9 SS      (.(((..((..((....((.((((((.....(.((((......))).)).........))))).)...))))))...)).).......)....
+M.musculus.10             C.CGGCACU..CAUGAAGGUCUGCCUG.AAAA.CCAGCCU..GCUG.GU........GGGGCA.G.U.CCUGAG.GACCUG.......GCGUG
+#=GR M.musculus.10 SS     (.(((..((..((....((.((((((.....(.((((......))).)).........))))).)...))))))...)).).......)....
+M.musculus.11             U.AUUUGUG..UAUGAUGGUCACAGUG.UAAA..GUUCC....CAC...........AGCUGU.G.A.CUUGAU..UUUUA....AAAAUGUC
+#=GR M.musculus.11 SS     (.((((...........((((((((((.(...............))...........).)))).).).))................)))))..
+M.musculus.12             C.UCAGCAG..GAUGAUGAGAAGGGCU.GAAA.UGCUGCC..AAAC..C.......AGGUCCU.U.U.UCUGAU..GGUGG.......CUGGG
+#=GR M.musculus.12 SS     (.(((((..........((((((((((......((....)..)..............)))))).).).))..........).......)))))
+M.musculus.13             C.AUGCGUC..CAUGAAGUCACUGGCC.UCAA.GCCCAA....GUG.GU........GGGCAG.U.G.ACAGAA...GA.........GCUGC
+#=GR M.musculus.13 SS     (.(((......))))..(((((((.((......(((.........).))........)).))).).).)).......................
+M.musculus.14             C.UCUGAUA...AUGAUGUCUCUCCCU.CUAA.CUCCCAGUAAGGA..C........UGGGAG.A.G.GCUGAACAAACCU.......CAGAG
+#=GR M.musculus.14 SS     (.(((((.........(((.((..(((.(.....(((((((....)..)........)))))).).).)..)))))....).......)))))
+R.norvegicus.1            A.UAUUUGUU.UAUGAUGGUCACAGUG.UAAA..GUUCA....CAC...........AGCUGU.G.A.CUUGAU..UUUUA.......AAAAU
+#=GR R.norvegicus.1 SS    ....((((.........((((((((((.(...............))...........).)))).).).)).........)).......))...
+R.norvegicus.2            G.UUACAUU..GAUGAGAACAGAAACA.UAAA..CUAUGA.CCUAG.G.........GGUUUC.U.G.UUGGAU..AGCUC.......GUAAU
+#=GR R.norvegicus.2 SS    ............((((((((((((((........(((......)))............))))).).).))........))).......))...
+R.norvegicus.3            U.UUGCAUU..AAUGAGGAUUACACAG.AAAA.CCUUUGU..UAAGGGU........UUGUGUCG.A.UCUGCU..AAUUG.......GCAAA
+#=GR R.norvegicus.3 SS    ..((((..........(((((((((((.(....((((......)))).)........)))))).).).))).................)))).
+R.norvegicus.4            G.UCAGAUG...AUGACGGCCUGUGCA.GAAA.CCCCCAC.GUGGG..C........UGC.CA.G.G.UUUGAA...CCC........CUGGC
+#=GR R.norvegicus.4 SS    (.(((........)))).(((..((...(.......)..).)..))..).........((.((.(.(............)........)))))
+R.norvegicus.5            G.UUUUUCC...AUGACGGUGUUUCCUCUAAA..UUUAC....AUG...........GAGAAA.C.A.CCUGAU.UUCCAG......AAAAAU
+#=GR R.norvegicus.5 SS    (.((((((......(((((((((((.((((..............))...........)))))).).).)).).).)....)......))))))
+R.norvegicus.6            G.CCGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUCA.AAGAC..C.....UGUGGUCUU.U.C.UUCGAU..GUUCU.......GCGGC
+#=GR R.norvegicus.6 SS    (.((((..(...((((..(((((((((.(.....(((......)))..........))))))).).).))).))..)...........)))))
+R.norvegicus.7            C.CGGCACU..CAUGACGGUCUGCCUG.AAAA.CCAGCCC..GCUG.GU........GGGGCA.G.U.CCCGAG.GACCUG.......GCGUG
+#=GR R.norvegicus.7 SS    (.(((..((..(.....((.((((((.....(.((((......))).)).........))))).)...)).)))...)).).......)....
+H.sapiens.1               G.CCAGAUG...AUGACGACCUGGGUG.GAAA.CCUACCC.UGUGG..G........CACCCA.U.G.UCCGAG...CCCC.......CUGGC
+#=GR H.sapiens.1 SS       (.((((...........(((.((((((......(((((....))))..)........))))))...).))..................)))))
+H.sapiens.2               G.UGUGCGG...AUGAUAACUACUGAC.GAAA.GAGUCAU.CGACU..C.......AGUUAGU.G.G.UUGGAU...GUAG......UCACAU
+#=GR H.sapiens.2 SS       (.(((((.........(((((((((((......(((((....))))..)........)))))).).).))).........).......)))))
+H.sapiens.3               G.ACGCUUC...AUGAUAGGAAGGACU.GAAA.AGUCUUG.UGGAC..A.....CCUGGUCUU.U.C.CCUGAU..GUUCU......CGUGGC
+#=GR H.sapiens.3 SS       ..(((...(...((.(..(((((((((.......(((......)))...........)))))).).).).).))..)..........)))...
+H.sapiens.4               G.ACUGACAU.UAUGAAGGCCUGUACU.GAAG.ACAGCAA..GCUG..U.......UAGUACA.G.A.CCAGAU..GCUUU..CUUGGCAGGC
+#=GR H.sapiens.4 SS       ...(((.((.....(((((((((((((....(.((((......)))..).......))))))).)...........)))))..).)).)))..
+H.sapiens.5               U.UCACAGA...AUGAUGGCACCUUCC.UAA...ACCCU....CAU...........GGGUGG.U.G.UCUGAG..AGGC........GUGAA
+#=GR H.sapiens.5 SS       ..((((...........((((((...........((((...................)))))).).).))..................)))).
+H.sapiens.6               G.UGUGCGG...AUGAUAACUACUGAC.GAAAGAGUCAUC...GAC..C.....UCAGUUAGU.G.G.UUGGAU...GUAG......UCACAU
+#=GR H.sapiens.6 SS       (.(((((.........(((((((((((....((.(((......)))..).....)..)))))).).).))).........).......)))))
+H.sapiens.7               U.GGCGUCUU.CAUGAGGGAGGGGCCC..AAA.GCCCUUG..UGGG..C........GGACCU.C.C.CCUGAG...CCUGUCUGAGGGGCCA
+#=GR H.sapiens.7 SS       ..(((.((((.((...((((((((.........((((......)))..)...............).).)))......)))...))))))))).
+H.sapiens.8               U.UUGCUUU..AAUGAGAAUAGAAACG.UAAA..CUAUGA.CCUAG.G.........GGUUUC.U.G.UUGGAU.AAUUAG.....CAGUUUA
+#=GR H.sapiens.8 SS       ..(((((..........(((((((((........(((......)))............))))).).).)).........)).....)))....
+H.sapiens.9               U.AUUUGUU..UAUGAUGGCCACAGCC.UAAA..GUACA....CAC...........GGCUGU.G.A.CUUGAU...UCA........AAAGA
+#=GR H.sapiens.9 SS       .............(((.((.(((((((..............................)))))).)...)).......))).............
+H.sapiens.10              C.CGGCACU..CAUGACGGCCUGCCUG.CAAA..CCUGC....UGG..U........GGGGCA.G.A.CCCGAA.AAUCCA.......GCGUG
+#=GR H.sapiens.10 SS      ...((((....(......)..))))............((....(((..(........(((........))))......))).......))...
+H.sapiens.11              G.CCGGAUG...AUGACGACCUGGGUG.GAAA.CCUACCC.UGUGG..G........CACCCA.U.G.UCCGAG...CCCC.......CUGGC
+#=GR H.sapiens.11 SS      (.((((...........(((.((((((......(((((....))))..)........))))))...).))..................)))))
+H.sapiens.12              C.UCUGUUA...AUGACGUCUCUCCCUCUAAA.CCCCAUU.AAGGA..C........UGGGAG.A.G.GCAGAGCAAGCCU.......CAGAG
+#=GR H.sapiens.12 SS      (.((((.......((..(((((((((.......((........)).............))))).).).))....))............)))))
+H.sapiens.13              G.UCACUGC...AUGAUCCGCUCUGGU.CAAA.CCCUUCC...AGG..C......CAGCCAGA.G.U.GGGGAU..GGUCU.......GUGAC
+#=GR H.sapiens.13 SS      (.((((.((.......(((((((((((......((.........))...........)))))).).).)))......)).........)))))
+H.sapiens.14              C.ACUGCUG...AUGACGAACUAUCUC.UAAC.UGGUCUU..GACC..A.......CGAGCUA.G.U.UCUGAA...UU.G.......CAGGG
+#=GR H.sapiens.14 SS      ...((((.(...((...((((((.(((......((((......)))..)........))).)).).).))...)...)).).......)))..
+H.sapiens.15              U.UUUCAUC..UAUGAGGGUGUUUCCUCUAAA..CCUACG...AGG...........GAGGAA.C.A.CCUGAU...CUUA.....CAGAAAA
+#=GR H.sapiens.15 SS      .......((..(.((((((((((.(((((................)...........)))))).).).)).......))))......)))...
+B.taurus.1                C.UUGCGUU..AAUGAGAACAGAAACG.UAAA..CUAUAA.CCUAG.G.........GGUUUC.U.G.UUGGAU..GGUUG.......GCAAC
+#=GR B.taurus.1 SS        ......(((..(((.(.(((((((((........(((......)))............))))).).).))...)...)))).......))...
+B.taurus.2                C.UUGCGUU..AAUGAGAACAGAAACG.AAAA..CUAUAA.CCUAG.G.........GGUUUC.U.G.UUGGAU..GGUUG.......GCAAC
+#=GR B.taurus.2 SS        ......(((..(((.(.(((((((((........(((......)))............))))).).).))...)...)))).......))...
+B.taurus.3                C.CCGGUGCC.UAUGACGGUCUGUCUG.AAAA.CCAGCCC...CUG.GU........GGGGCA.G.A.CCUGAG.AACCUG.......GCGUG
+#=GR B.taurus.3 SS        (.(.(((..(.(.....(((((((((.....(.((((......))).)).........))))).).).))..))..))).).......)....
+B.taurus.4                ACUUGCGUU..AAUGAGAACAGAAACG.UAAA..CUAUAA.CCUAG.G.........GGUUUC.U.G.UUGGAU..GGUUG.......GCAA.
+#=GR B.taurus.4 SS        ......(((..(((.(.(((((((((........(((......)))............))))).).).))...)...)))).......))...
+B.taurus.5                G.CCAGAUG...AUGAGGACCUGUGCG.GAAA.CCCCCCG..CGGG..C........UGCCCA.U.G.UCUGAG...CCC........CUGGC
+#=GR B.taurus.5 SS        (.((((((....(((.((.((((((.(.(.......))))..)))).............)))).).).)))).)...)...............
+B.taurus.6                G.AUGCGUC..CAUGAAGUCACCAGCC.CCAA.GCCCCUC...GUG.GU........GGGUGG.U.G.AUGGAA.CCGUCA.....AAGCAGU
+#=GR B.taurus.6 SS        (.(((..((..((.....((((((.((.(((.............)).).........)).))).).).)))))...)))).............
+B.taurus.7                U.UUUGCCC...AUGAAGGUGUUCCCUCUAAA..CCUAC....GUG...........GAGGAA.U.G.CCUGAU.GUCCAG.......GAAAA
+#=GR B.taurus.7 SS        (.((((..(...((..(((((((((.((((..............))...........)))))).).).))).)).)..))).......))...
+O.aries.1                 G.ACGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUCU.UGGAC.GC......CUGGUCCU.U.C.CUUGAU..GUUCU......CACGGC
+#=GR O.aries.1 SS         (.(.((.((...(....((((((((((.(....((((......))).)........))))))).).).)))))...))..)......).....
+S.scrofa.1                G.ACGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUUG.UGGAC.GC......CUGGUCCU.U.C.CCUGAU..GUUCU......CAUGGC
+#=GR S.scrofa.1 SS        .......((...(((((((((((((((.(....((((......))).)........))))))).)...))))........)......))))).
+S.scrofa.2                C.UGGCACC..CAUGACAGUCUGCCUA.AAAA.CCAGCCC...CUG.GU........GGGGCA.G.A.CUCGAG.AACCUG.......GCGUG
+#=GR S.scrofa.2 SS        .....((((..((.(.((((((((((.....(.((((......))).)).........))))).).).)).).....).)).......).)))
+S.scrofa.3                A.UUUUAUC..CAUGAAAGUGUUUCCUCUAAA..CCUAU....GUG...........GAGGAA.C.A.CCUGAU.GUCCAG......GAAAAU
+#=GR S.scrofa.3 SS        ...........(((....))).((((((((..............))...........)))))).....((((......)))......).....
+S.scrofa.4                C.UGGCACC..CAUGACAGUCUGCCUA.AAAA.CCAGCC....CUG.GU........GGGGCA.G.A.CUCGAG.AACCUG.......GCGUG
+#=GR S.scrofa.4 SS        .....((((..((.(.((((((((((.....(.(((........)).)).........))))).).).)).).....).)).......).)))
+C.elegans.1               G.AGGCAGCUUUGUGACGACCUUUGGC.UAAA.CUCCAUC..GUGA.GC........GCCUCU.G.G.UCUGAU...GC.........GCCUC
+#=GR C.elegans.1 SS       (.((((.((...((.(.((((...(((......(((........)).).........)))....).).))).))...)).........)))))
+S.mansoni.1               C.UCGCUAU...AUGACGAUGGCAAUC.UCAA..AUGUU....CAU..U........GGUUGC.C.A.UUUGAU..GAAAUCAGUUUUGUGUG
+#=GR S.mansoni.1 SS       ...(((.((...(.(((((((((((((..............................)))))).).).)).............))).))))))
+#=GC SS_cons              <-<<<<-----------<<<<<<<<<<-------<<<______>>>----------->>>>>>->->->>------------------>>>>>
+#=GC RF                   g.ucucauu..uAUGAuGgccucuccc.uAAA.ucccuuu...ggg..c........gggaga.g.g.cCuGAU..gcuug.......gagac
+//
index 3cc5403..261bfa3 100644 (file)
@@ -19,7 +19,7 @@
             button by setting the embed parameter to true;<br>
             &lt;param name=&quot;embedded&quot;
           value=&quot;true&quot;&gt; </li>
-        </ul>\r        <p><strong><font size="2">** NEW FEATURES ** in Jalview 2.7.1</font></strong></p>\r        <ul><li><font size="2">Jmol compatibility updated to Jmol 12.2.x series - <a href="JmolApplet-12.2.4.jar">download the JmolApplet here</a></font></li>\r<li>To use Jmol as the structure viewer for Jalview, you must include \r            the jar file in the applet archive argument thus:<br>\r            <pre>archive=&quot;jalviewApplet.jar,Jmol-12.2.4.jar&quot;</pre></font>\r          </li>\r          <li>Jmol 12.2.x requires at least Java 1.6 to run in the clients web browser. If the client does not have \r            Java 1.6, or if the Jmol-12.2.jar is not added to the archive, the \r            original Jalview structure viewer will still be available. <br>\r          </li>\r          \r        </ul>\r        <p><strong><font size="2">**NEW FEATURES** in Jalview 2.7</font></strong></p>\r        <ul>\r        <li><font size="2">Javascript callbacks capabilities<ul><li>oninit parameter and methods for registering javascript handlers for selections, mouseovers and linking to Jmol applets on the page.</li>\r        <li>To use javascript callbacks, ensure the applet tag includes the '<a href="http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html">mayscript</a>' attribute - either as a parameter (&lt;param name="mayscript" value="true"/;gt;) or as a bare attribute in the applet html tag).</li></ul></font>\r        </li>\r        <li><font size="2">New <a href="jalviewLiteJs.html">jalviewLite java api</a> methods for selecting, highlighting, scrolling and reordering sequences in an alignment view.\r        </font></li></ul>\r        <p><strong><font size="2">**NEW FEATURES** in Jalview 2.6</font></strong></p>\r        <ul>\r        <li><font size="2">Jmol compatibility updated to Jmol 12.1.x series</font></li>\r          <li>Jalview 2.6 works only with Jmol version 12.1.13 or later. You can use the JmolApplet.jar from \r          the Jmol binary distribution available at the Jmol Sourceforge site, \r          or <a href="JmolApplet-12.1.13.jar">download the Jmol applet from here</a></li>\r          <li><font size="2">Minimum recommended version of Java runtime for the applet is now 1.5 (JalviewLite v2.6 without the Jmol viewer may work ok on earlier Java environments but compatibility can no-longer be guaranteed).</font></li>\r          </ul>
+        </ul>\r        <p><strong><font size="2">**NEW FEATURES** in Jalview 2.8</font></strong></p>\r        <ul>\r        <li><font size="2">Normalised sequence logo display\r        </font></li>\r        <li><font size="2">RNA secondary structure annotation row\r        </font></li>\r        </ul>\r        <p><strong><font size="2">**NEW FEATURES** in Jalview 2.7.1</font></strong></p>\r        <ul>\r<li><font size="2">Jmol compatibility updated to Jmol 12.2.x series - <a href="JmolApplet-12.2.4.jar">download the JmolApplet here</a></font></li>\r<li>To use Jmol as the structure viewer for Jalview, you must include \r            the jar file in the applet archive argument thus:<br>\r            <pre>archive=&quot;jalviewApplet.jar,Jmol-12.2.4.jar&quot;</pre></font>\r          </li>\r          <li>Jmol 12.2.x requires at least Java 1.6 to run in the clients web browser. If the client does not have \r            Java 1.6, or if the Jmol-12.2.jar is not added to the archive, the \r            original Jalview structure viewer will still be available. <br>\r          </li>\r          \r        </ul>\r        <p><strong><font size="2">**NEW FEATURES** in Jalview 2.7</font></strong></p>\r        <ul>\r        <li><font size="2">Javascript callbacks capabilities<ul><li>oninit parameter and methods for registering javascript handlers for selections, mouseovers and linking to Jmol applets on the page.</li>\r        <li>To use javascript callbacks, ensure the applet tag includes the '<a href="http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html">mayscript</a>' attribute - either as a parameter (&lt;param name="mayscript" value="true"/;gt;) or as a bare attribute in the applet html tag).</li></ul></font>\r        </li>\r        <li><font size="2">New <a href="jalviewLiteJs.html">jalviewLite java api</a> methods for selecting, highlighting, scrolling and reordering sequences in an alignment view.\r        </font></li></ul>\r        <p><strong><font size="2">**NEW FEATURES** in Jalview 2.6</font></strong></p>\r        <ul>\r        <li><font size="2">Jmol compatibility updated to Jmol 12.1.x series</font></li>\r          <li>Jalview 2.6 works only with Jmol version 12.1.13 or later. You can use the JmolApplet.jar from \r          the Jmol binary distribution available at the Jmol Sourceforge site, \r          or <a href="JmolApplet-12.1.13.jar">download the Jmol applet from here</a></li>\r          <li><font size="2">Minimum recommended version of Java runtime for the applet is now 1.5 (JalviewLite v2.6 without the Jmol viewer may work ok on earlier Java environments but compatibility can no-longer be guaranteed).</font></li>\r          </ul>
         <br><strong><font size="2">**NEW FEATURES** in Jalview 2.5</font></strong></p>\r        <ul>\r        <li><font size="2">New parameters to control display of tree annotation, width of alignment columns, and to disable the jalview button and check for Jmol on startup.</font></li>\r         </ul>        \r        <br><strong><font size="2">**NEW FEATURES** in Jalview 2.4</font></strong></p>
         <ul>
         <li><font size="2">New applet API methods for feature display control, views, and obtaining current selection via javascript.</font></li>
           <td>true</td>
           <td>Show the jalview button on the page. When false, JalviewLite will open immediately.</td>
           </tr>\r          </tr>\r                 <tr><td>sortByTree</td>\r                <td>true or false (default is false)</td>\r              <td>automatically sort the associated alignment view by the tree when a new tree is opened.</td>\r               </tr>\r                  <tr>\r            <td>showTreeBootstraps</td><td>true or false (default is true)</td><td>show or hide branch bootstraps</td>\r                  </tr>\r  <tr><td>showTreeDistances</td><td>true or false (default is true)</td><td>show or hide branch lengths</td></tr>\r        <tr><td>showUnlinkedTreeNodes</td><td>true or false (default is false)</td><td>indicate if unassociated nodes should be highlighted in the tree view</td>\r      </tr>\r          <tr><td>heightScale</td>\r          <td>1.0 or greater</td>\r          <td>Adjust the height of each cell in the alignment grid relative to the height of a character in the alignment font. (<em>since 2.5.1</em>)</td>\r          </tr>
-          <tr><td>widthScale</td>\r          <td>1.0 or greater</td>\r          <td>Adjust the width of each cell in the alignment grid relative to the width of a character in the alignment font. (<em>since 2.5.1</em>)</td>\r          </tr>\r          <tr><td>centrecolumnlabels</td>\r          <td>true of false (default is false)</td>\r          <td>When true, text labels associated with a column in the alignment will be shown centered with respect to the column. (<em>since 2.4</em>)</td>\r          <tr><td>showUnconserved</td>\r          <td>true of false (default is false)</td>\r          <td>When true, only gaps and symbols different to the consensus sequence for a column will be shown. Useful for visualizing alignments exhibiting low sequence variation, where it is important to highlight mutations. (<em>since 2.5</em>)</td>\r          </tr>\r          <tr><td>upperCase</td>\r          <td><em>bold</em> or other value</td>\r          <td>Indicate a text style to apply to uppercase sequence symbols. Currently, only <strong>bold</strong> is supported.</td>\r          </tr>\r          <tr><td>automaticScrolling</td>\r          <td>true of false (default is true)</td>\r          <td>When true, alignment panels will automatically scroll to show any regions of the alignment highlighted due to javascript events or when mousing over a position in an associated structure. (<em>since 2.6</em>)</td>\r          </tr>\r          \r          <tr><td>showGroupConsensus</td>\r          <td>true of false (default is false)</td>\r          <td>When true, shows consensus annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r          </tr>\r          \r          <tr><td>showGroupConservation</td>\r          <td>true of false (default is false)</td>\r          <td>When true, shows amino-acid property conservation annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>showConsensusHistogram</td>\r          <td>true of false (default is true)</td>\r          <td>When true, shows the percentage occurence of the consensus symbol for each column as a histogram above the consensus sequence row. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>showSequenceLogo</td>\r          <td>true of false (default is false)</td>\r          <td>When true, shows a sequence logo above the consensus sequence (overlaid above the Consensus Histogram, if visible, with symbols coloured using the alignment's default colourscheme). (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>oninit</td>\r          <td><em>after_init()</em></td>\r          <td>name of javascript function that will be called after the jalviewLite instance has completed its initialisation. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>relaxedidmatch</td>\r          <td><em>true or false (default is false)</em></td>\r          <td>When true, use stem based matching to identify sequences that match features imported from a GFF or Jalview sequence features file, and for associating PDB data (passed on PDBfile parguments) with sequences (based on a given destination sequence ID). (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>alignpdbfiles</td>\r          <td><em>true or false (default is false)</em></td>\r          <td>When true, and jalviewLite is able to use jmol as a structure viewer, attempt to show a superposition of all structures loaded onto the alignment, superimposed using the aligned regions of corresponding sequences. [experimental] (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>externalstructureviewer</td>\r          <td><em>true or false (default is false)</em></td>\r          <td>re-route jmol colouring commands, selection and mouseover events to an external viewer using javascript callbacks. [experimental] (<em>since 2.7</em>)</td>\r          \r          </tr>\r          <tr><td>annotationcolour_max</td>\r          <td>colour name or RGB hex triplet (default is red)</td>\r          <td>Default colour used for maximum value when shading by annotation. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>annotationcolour_min</td>\r          <td>colour name or RGB hex triplet (default is orange)</td>\r          <td>Default colour used for minimum value when shading by annotation. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>jalviewhelpurl</td>\r          <td>absolute or relative url or javascript function prefixed by <em>javascript:</em> (default is http://www.jalview.org/help.html)</td>\r          <td>Optional parameter allowing modification of the default Jalview Help URL normally opened when JalviewLite's 'Help' menu item is selected. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>resolvetocodebase</td>\r          <td>True or False (False)</td>\r          <td>Set to true to re-instate pre-JalviewLite 2.7 behaviour where relative URLs were prepended with the applet 'codebase' rather than the current document base URL before resolution. (<em>since 2.7</em>)</td>\r          </tr>\r          \r                  </table>
+          <tr><td>widthScale</td>\r          <td>1.0 or greater</td>\r          <td>Adjust the width of each cell in the alignment grid relative to the width of a character in the alignment font. (<em>since 2.5.1</em>)</td>\r          </tr>\r          <tr><td>centrecolumnlabels</td>\r          <td>true of false (default is false)</td>\r          <td>When true, text labels associated with a column in the alignment will be shown centered with respect to the column. (<em>since 2.4</em>)</td>\r          <tr><td>showUnconserved</td>\r          <td>true of false (default is false)</td>\r          <td>When true, only gaps and symbols different to the consensus sequence for a column will be shown. Useful for visualizing alignments exhibiting low sequence variation, where it is important to highlight mutations. (<em>since 2.5</em>)</td>\r          </tr>\r          <tr><td>upperCase</td>\r          <td><em>bold</em> or other value</td>\r          <td>Indicate a text style to apply to uppercase sequence symbols. Currently, only <strong>bold</strong> is supported.</td>\r          </tr>\r          <tr><td>automaticScrolling</td>\r          <td>true of false (default is true)</td>\r          <td>When true, alignment panels will automatically scroll to show any regions of the alignment highlighted due to javascript events or when mousing over a position in an associated structure. (<em>since 2.6</em>)</td>\r          </tr>\r          \r          <tr><td>showGroupConsensus</td>\r          <td>true of false (default is false)</td>\r          <td>When true, shows consensus annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r          </tr>\r          \r          <tr><td>showGroupConservation</td>\r          <td>true of false (default is false)</td>\r          <td>When true, shows amino-acid property conservation annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>showConsensusHistogram</td>\r          <td>true of false (default is true)</td>\r          <td>When true, shows the percentage occurence of the consensus symbol for each column as a histogram above the consensus sequence row. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>showSequenceLogo</td>\r          <td>true of false (default is false)</td>\r          <td>When true, shows a sequence logo above the consensus sequence (overlaid above the Consensus Histogram, if visible, with symbols coloured using the alignment's default colourscheme). (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>normaliseLogo</td>\r          <td>true of false (default is false)</td>\r          <td>When true, all sequence logos will be normalised (all symbol stacks add up to full height of annotation row), rather than being scaled according to the fraction of symbols identical to the consensus. (<em>since 2.7.1</em>)</td>\r          </tr>\r          <tr><td>oninit</td>\r          <td><em>after_init()</em></td>\r          <td>name of javascript function that will be called after the jalviewLite instance has completed its initialisation. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>relaxedidmatch</td>\r          <td><em>true or false (default is false)</em></td>\r          <td>When true, use stem based matching to identify sequences that match features imported from a GFF or Jalview sequence features file, and for associating PDB data (passed on PDBfile parguments) with sequences (based on a given destination sequence ID). (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>alignpdbfiles</td>\r          <td><em>true or false (default is false)</em></td>\r          <td>When true, and jalviewLite is able to use jmol as a structure viewer, attempt to show a superposition of all structures loaded onto the alignment, superimposed using the aligned regions of corresponding sequences. [experimental] (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>externalstructureviewer</td>\r          <td><em>true or false (default is false)</em></td>\r          <td>re-route jmol colouring commands, selection and mouseover events to an external viewer using javascript callbacks. [experimental] (<em>since 2.7</em>)</td>\r          \r          </tr>\r          <tr><td>annotationcolour_max</td>\r          <td>colour name or RGB hex triplet (default is red)</td>\r          <td>Default colour used for maximum value when shading by annotation. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>annotationcolour_min</td>\r          <td>colour name or RGB hex triplet (default is orange)</td>\r          <td>Default colour used for minimum value when shading by annotation. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>jalviewhelpurl</td>\r          <td>absolute or relative url or javascript function prefixed by <em>javascript:</em> (default is http://www.jalview.org/help.html)</td>\r          <td>Optional parameter allowing modification of the default Jalview Help URL normally opened when JalviewLite's 'Help' menu item is selected. (<em>since 2.7</em>)</td>\r          </tr>\r          <tr><td>resolvetocodebase</td>\r          <td>True or False (False)</td>\r          <td>Set to true to re-instate pre-JalviewLite 2.7 behaviour where relative URLs were prepended with the applet 'codebase' rather than the current document base URL before resolution. (<em>since 2.7</em>)</td>\r          </tr>\r          \r                  </table>
         <p align="center">&nbsp;</p>
         <!-- InstanceEndEditable --></td>\r    </tr>\r  </table>\r</div>\r</body>\r<!-- InstanceEnd --></html>\r
\ No newline at end of file
index e3c71ba..1086416 100755 (executable)
                 </table></td>
             </tr>
           </table>
-          <p>&nbsp;</p>
-          <table width="300" border="1" cellspacing="0" cellpadding="0">
-            <tr>
-              <td><table width="300" border="0" cellspacing="0" cellpadding="0">
-                  <tr>
-                    <td width="100"> <applet code="jalview.bin.JalviewLite"
-                               width="140" height="35"
-                               archive="jalviewApplet.jar">
-                        <param name="file" value="jpred_msa.fasta">
-                        <param name="jnetfile" value="jpred_msa.seq.concise">
-                        <param name="defaultColour" value="Clustal">
-                        <param name="showAnnotation" value="true">
-                        <param name="windowHeight" value="515">
-                        <param name="windowWidth" value="650">
-                        <param name="showConservation" value="false">
-                        <param name="showQuality" value="false">
-                        <param name="showConsensus" value="false">
-                        <param name="showFullId" value="false">
-                        <param name="RGB"  value="F2F2FF">
-                        <param name="linkLabel_1" value="SRS">
-                        <param name="linkUrl_1" value="http://srs.ebi.ac.uk/srs7bin/cgi-bin/wgetz?-e+[uniprot-all:$SEQUENCE_ID$]+-vn+2">
-                        <param name="linkLabel_2" value="Uniprot">
-                        <param name="linkUrl_2" value="http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$">
-                        <param name="APPLICATION_URL" value="http://www.jalview.org/services/launchApp">
-                      </applet> </td>
-                    <td width="165">Displays a Multiple Sequence Alignment Based
-                      JNet Prediction for a Sequence</td>
-                  </tr>
-                </table></td>
-            </tr>
-          </table>\r        </div>\r        <p>&nbsp;</p>\r          <p>For more JalviewLite examples, follow the links below.\r          <ul>\r          <li><a href="embedded.html">JalviewLite embedded in the web page</a></li>\r          <li><a href="formComplete.html">use Javascript to control and get data from JalviewLite</a></li>\r          <li><a href="linkedapplets_ng.html">use Javascript to make two jalviewLite instances talk to each other</a></li>\r          <li><a href="embeddedWJmol.html">configure JalviewLite to talk to a Jmol applet on the page.</a></li>\r          </ul>
+          <p>&nbsp;</p>\r                                               <table width="300" border="1" cellspacing="0" cellpadding="0">\r                                                 <tr>\r                                                           <td><table width="300" border="0" cellspacing="0"\r                                                                              cellpadding="0">\r                                                                               <tr>\r                                                                                   <td width="100"><applet code="jalview.bin.JalviewLite"\r                                                                                                 width="140" height="35" archive="jalviewApplet.jar">\r                                                                                                   <param name="file" value="jpred_msa.fasta">\r                                                                                                    <param name="jnetfile" value="jpred_msa.seq.concise">\r                                                                                                  <param name="defaultColour" value="Clustal">\r                                                                                                   <param name="showAnnotation" value="true">\r                                                                                                     <param name="windowHeight" value="515">\r                                                                                                        <param name="windowWidth" value="650">\r                                                                                                 <param name="showConservation" value="false">\r                                                                                                  <param name="showQuality" value="false">\r                                                                                                       <param name="showConsensus" value="false">\r                                                                                                     <param name="showFullId" value="false">\r                                                                                                        <param name="RGB" value="F2F2FF">\r                                                                                                      <param name="linkLabel_1" value="SRS">\r                                                                                                 <param name="linkUrl_1"\r                                                                                                                value="http://srs.ebi.ac.uk/srs7bin/cgi-bin/wgetz?-e+[uniprot-all:$SEQUENCE_ID$]+-vn+2">\r                                                                                                       <param name="linkLabel_2" value="Uniprot">\r                                                                                                     <param name="linkUrl_2"\r                                                                                                                value="http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$">\r                                                                                                        <param name="APPLICATION_URL"\r                                                                                                          value="http://www.jalview.org/services/launchApp">\r                                                                                             </applet></td>\r                                                                                 <td width="165">Displays a Multiple Sequence Alignment\r                                                                                         Based JNet Prediction for a Sequence</td>\r                                                                              </tr>\r                                                                  </table></td>\r                                                  </tr>\r                                          </table>\r                                               <p>&nbsp;</p>\r                                          <table width="300" border="1" cellspacing="0" cellpadding="0">\r            <tr>\r              <td><table width="300" border="0" cellspacing="0" cellpadding="0">\r                  <tr>\r                    <td width="100"> <applet code="jalview.bin.JalviewLite"\r                            width="140" height="35"\r                                archive="jalviewApplet.jar">\r                        <param name="file" value="RF00031_folded.stk">\r                        <param name="defaultColour" value="Purine/Pyrimidine">\r                        <param name="showAnnotation" value="true">\r                        <param name="windowHeight" value="515">\r                        <param name="windowWidth" value="650">\r                        <param name="showConservation" value="false">\r                        <param name="showQuality" value="false">\r                        <param name="showConsensus" value="true">\r                        <param name="showFullId" value="false">\r                        <param name="RGB"  value="F2F2FF">\r                        <param name="APPLICATION_URL" value="http://www.jalview.org/services/launchApp">\r                      </applet> </td>\r                    <td width="165">Displays an RFAM RNA fold family with secondary structure annotation</td>\r                  </tr>\r                </table></td>\r            </tr>\r          </table>\r        </div>\r        <p>&nbsp;</p>\r          <p>For more JalviewLite examples, follow the links below.\r          <ul>\r          <li><a href="embedded.html">JalviewLite embedded in the web page</a></li>\r          <li><a href="formComplete.html">use Javascript to control and get data from JalviewLite</a></li>\r          <li><a href="linkedapplets_ng.html">use Javascript to make two jalviewLite instances talk to each other</a></li>\r          <li><a href="embeddedWJmol.html">configure JalviewLite to talk to a Jmol applet on the page.</a></li>\r          </ul>
         <!-- InstanceEndEditable --></td>\r    </tr>\r  </table>\r</div>\r</body>\r<!-- InstanceEnd --></html>\r
\ No newline at end of file
index 261d6d0..91ef827 100755 (executable)
@@ -29,6 +29,7 @@
    <mapID target="viewingpdbs" url="html/features/viewingpdbs.html"/>
    <mapID target="pdbmcviewer" url="html/features/pdbviewer.html"/>
    <mapID target="pdbjmol" url="html/features/jmol.html"/>
+   <mapID target="varna" url="html/features/varna.html"/>
    <mapID target="preferences" url="html/features/preferences.html"/>     
    <mapID target="commandline" url="html/features/commandline.html"/>
    <mapID target="clarguments" url="html/features/clarguments.html"/>
    <mapID target="colours.abovepid" url="html/colourSchemes/abovePID.html"/>
    <mapID target="colours.conservation" url="html/colourSchemes/conservation.html"/>
    <mapID target="colours.annotation" url="html/colourSchemes/annotationColouring.html"/>
+   <mapID target="colours.purinepyrimidine" url="html/colourSchemes/purinepyrimidine.html"/>
+   <mapID target="colours.rnahelices" url="html/colourSchemes/rnahelicesColouring.html"/>
    
    <mapID target="calcs.alquality" url="html/calculations/quality.html"/>   
    <mapID target="calcs.alconserv" url="html/calculations/conservation.html"/>
+   <mapID target="calcs.alstrconsensus" url="html/calculations/structureconsensus.html"/>  
    <mapID target="calcs.consensus" url="html/calculations/consensus.html"/>
    
+   <mapID target="nucleicAcids" url="html/na/index.html"/>
+   
    <mapID target="menus" url="html/menus/index.html"/>
    <mapID target="desktopMenu" url="html/menus/desktopMenu.html"/>
    <mapID target="alMenu" url="html/menus/alignmentMenu.html"/>
index 926a710..9406292 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"  ?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
 <toc version="1.0">
 <tocitem text="Jalview Documentation" target="home" expand="true" >
        <tocitem text="What's new" target="new" expand="true">
-      <tocitem text="Enhanced Jmol/Jalview interaction" target="pdbjmol"/>
-          <tocitem text="Multi-Harmony Alignment Analysis" target="shmrws"/>
-          <tocitem text="Jalview News Reader" target="newsreader"/>
-          <tocitem text="Sort alignments associated with tree" target="treeviewer"/>
-      <tocitem text="Default Annotation preferences" target="colours.annotation"/>
-      <tocitem text="Jaba Web Services" target="jabaws"/>
+               <tocitem text="Viewing RNA structure" target="varna" />
+               <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
+               <tocitem text="RNA Helices coloring" target="colours.rnahelices"/>
        </tocitem>
     <tocitem text="Editing Alignments" target ="edit"/>        
     <tocitem text="Cursor Mode" target="cursor"/>
        <tocitem text="Multiple Views" target="multipleviews"/>
        <tocitem text="Viewing Trees" target="treeviewer" expand="false"/>
        <tocitem text="Fetching Sequences" target="seqfetch"/>
+       <tocitem text="Nucleic Acid Support" target="nucleicAcids" expand="false">
+               <tocitem text="Viewing RNA structure" target="varna" />
+               <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
+               <tocitem text="RNA Helices coloring" target="colours.rnahelices"/>
+       </tocitem>
        <tocitem text="Sequence Features" target="seqfeatures" expand="false">
           <tocitem text="Sequence Feature Settings" target="seqfeatures.settings"/>
           <tocitem text="Sequence Features File" target="features.fileformat"/>
                <tocitem text="Turn propensity" target="colours.turn"/>
                <tocitem text="Buried index" target="colours.buried"/>
                <tocitem text="Nucleotide colours" target="colours.nucleotide"/>
+               <tocitem text="Purine/Pyrimidine colours" target="colours.purinepyrimidine"/>
                <tocitem text="Blosum62" target="colours.blosum"/>
                <tocitem text="by Percentage Identity" target="colours.pid"/>   
                <tocitem text="User Defined" target="colours.user"/>
                <tocitem text="Above Percentage Identity" target="colours.abovepid"/>
                <tocitem text="By conservation" target="colours.conservation"/>
                <tocitem text="By Annotation" target="colours.annotation"/>
+               <tocitem text="By RNA Helices" target="colours.rnahelices"/>
        </tocitem>
        <tocitem text="Calculations" target="calculations" expand="false">
                <tocitem text="Sorting alignments" target="sorting"/>
                <tocitem text="Remove Redundancy" target="redundancy"/>
        </tocitem>
        <tocitem text="Alignment Annotations" target ="alannotation" expand="false">
-          <tocitem text="Conservation" target="calcs.alconserv"/>
+          <tocitem text="Conservation" target="calcs.alconserv"/>          
           <tocitem text="Quality" target="calcs.alquality"/>
           <tocitem text="Consensus" target="calcs.consensus"/>
+          <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
           <tocitem text="Annotations File Format" target="annotations.fileformat"/>
         </tocitem>
        <tocitem text="Viewing PDB Files" target="viewingpdbs" expand="false">
          <tocitem text="Jmol Viewer" target="pdbjmol"/>
          <tocitem text="Simple PDB Viewer" target="pdbmcviewer"/>
        </tocitem>
+       <tocitem text="Viewing RNA structures" target="varna" expand="false">   </tocitem>
        <tocitem text="VAMSAS Data Exchange" target="vamsas">
                <!-- what can Jalview share with other apps -->
                <!-- what other apps exist -->
index 5a962a4..71bd90f 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
 <p>Select the <strong>&quot;Copy Consensus Sequence&quot;</strong> entry from 
 the consensus annotation label to copy the alignment's consensus sequence to the 
 clipboard. 
+
+<p><strong>Sequence logo</strong></p> 
+By clicking on the label you can also activate the sequence logo. It
+indicates the relative amount of residues per column which can be
+estimated by it's size in the logo. The tooltip of a column gives the
+exact numbers for all occuring residues.
 </p>
 </body>
 </html>
index ebba3ab..7c5953f 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 795450b..7fdaedf 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9ae9e50..b042dd8 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4846acc..e83a124 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c09acbc..87fb24b 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4ded83c..403535b 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d7cb9d1..262b2b0 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/help/html/calculations/structureconsensus.html b/help/html/calculations/structureconsensus.html
new file mode 100755 (executable)
index 0000000..d945919
--- /dev/null
@@ -0,0 +1,44 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+-->
+<head><title>Alignment RNA Structure Consensus Annotation</title></head>
+<body><p><strong>Alignment RNA Structure Consensus Annotation</strong></p>
+
+<p>The RNA structure consensus displayed below the alignment is the
+percentage of valid base pairs per column. It is calculated in
+relation to a secondary structure and just paired columns are
+calculated. The canonical Watson-Crick base pairings (A-T/U, G-C) and
+the wobble base pair (G-T/U) are regarded as valid pairings.<br>  
+The amount of valid base pairs is indicated by the profile in the
+Alignment Annotation row.<br>  
+By default this calculation includes gaps in columns. You can choose
+to ignore gaps in the calculation by right clicking on the label
+&quot;StrConsensus&quot; to the left of the structure consensus bar
+chart.<br>
+
+<p><strong>Structure logo</strong></p>
+By clicking on the label you can also activate the structure logo. It is very
+similar to a sequence logo but counts the numbers of base pairs. There
+are two residues per column, the actual column and the interacting
+base. The opening bracket is always the one on the left side.<br>
+Like sequence logos the relative amount of a specific base pair can be
+estimated by it's size in the logo. The tool tip of a column gives the
+exact numbers for all occurring valid base pairs.
+</p>
+</body>
+</html>
index 1579043..9460378 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fe6dbbc..638ed3c 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 406fdde..d39772b 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6f2f59d..9b8c95c 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index bad9d30..b03840c 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1367245..576fa9f 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9f3e04c..1657ab1 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4d53a57..11bac41 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2d2804a..7321951 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 09cf5d3..f55a33f 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 70d74ee..a0ae963 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -49,6 +49,7 @@ background, and the intensity threshold for transition between them.</p>
 <p>The default colour schemes are summarised in the table below:
 <div align="center">
 <p>&nbsp;</p>
+<p><strong>Protein Colour Schemes</strong></p>
 <table border="1">
        <tr>
                <td>
@@ -291,6 +292,81 @@ background, and the intensity threshold for transition between them.</p>
                </td>
        </tr>
 </table>
+<p>&nbsp;</p>
+<p><strong>Nucleotide Colour Schemes</strong></p>
+<table border="1">
+       <tr>
+               <td>
+               <table border="1">
+                       <tr>
+                               <td nowrap></td>
+                               <td>A</td> <!--Adenine-->
+                           <td>C</td> <!--Cytosine-->
+                       <td>G</td> <!--Guanine-->
+                       <td>T</td> <!--Thymine-->
+                       <td>U</td> <!--Uracil-->
+                       <td>I</td> <!--Inosine-->
+                       <td>X</td> <!--Xanthine-->
+                       <td>R</td> <!--Unknown Purine-->
+                       <td>Y</td> <!--Unknown Pyrimidine-->
+                       <td>N</td> <!--Unknown-->
+                       <td>W</td> <!--Weak nucleotide (A or T)-->
+                       <td>S</td> <!--Strong nucleotide (G or C)-->
+                       <td>M</td> <!--Amino (A or C)-->
+                       <td>K</td> <!--Keto (G or T)-->
+                       <td>B</td> <!--Not A (G or C or T)-->
+                       <td>H</td> <!--Not G (A or C or T)-->
+                       <td>D</td> <!--Not C (A or G or T)-->
+                       <td>V</td> <!--Not T (A or G or C-->
+                       </tr>
+                       <tr>
+                               <td height="24">Nucleotide</td>
+                               <td bgcolor="#64F73F"></td>
+                               <td bgcolor="#FFB340"></td>
+                       <td bgcolor="#EB413C"></td>
+                       <td bgcolor="#3C88EE"></td>
+                       <td bgcolor="#3C88EE"></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       </tr>
+                       <tr>
+                               <td height="24">Purine/Pyrimidine</td>
+                               <td bgcolor="#FF83FA"></td>
+                               <td bgcolor="#40E0D0"></td>
+                       <td bgcolor="#FF83FA"></td>
+                       <td bgcolor="#40E0D0"></td>
+                       <td bgcolor="#40E0D0"></td>
+                       <td></td>
+                       <td></td>
+                       <td bgcolor="#FF83FA"></td>
+                       <td bgcolor="#40E0D0"></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       <td></td>
+                       </tr>
+               </table>
+               </td>
+       </tr>
+</table>
+
+
 </div>
 <p align="center">&nbsp;</p>
 </body>
index a0d4c8c..1e5eb67 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -35,6 +35,7 @@ td {
       <td bgcolor="#FFB340">C</td>
       <td bgcolor="#EB413C">G</td>
       <td bgcolor="#3C88EE">T</td>
+      <td bgcolor="#3C88EE">U</td>
     </tr>
   </table>
 </div>
index 58e8489..2aa9138 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/help/html/colourSchemes/purinepyrimidine.html b/help/html/colourSchemes/purinepyrimidine.html
new file mode 100644 (file)
index 0000000..0f10577
--- /dev/null
@@ -0,0 +1,40 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+-->
+<head><title>Purine/Pyrimidine Colour Scheme</title>
+<style type="text/css">
+<!--
+td {
+       text-align: center;
+}
+-->
+</style>
+</head>
+
+<body>
+<p><em>Purine/Pyrimidine Colours</em></p>
+<div align="center">
+  <table width="200" border="1">
+    <tr>
+      <td bgcolor="#FF83FA">Purines <BR> A, G, R</td>
+      <td bgcolor="#40E0D0">Pyrimidines <BR> C, U, T, Y</td>
+    </tr>
+  </table>
+</div>
+</body>
+</html>
diff --git a/help/html/colourSchemes/rnahelicesColouring.html b/help/html/colourSchemes/rnahelicesColouring.html
new file mode 100644 (file)
index 0000000..f31bb78
--- /dev/null
@@ -0,0 +1,50 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+-->
+<head><title>RNA Helices Colouring</title></head>
+
+<body>
+<p><strong> RNA Helices Colouring </strong></p>
+<p>An RNA alignment loaded from a Stockholm file can be coloured 
+   based on its helices.  The helices are determined from the 
+   secondary structure line in the Stockholm file (#GC SS_cons) 
+   written in WUSS notation
+   that specifies base pairing. See <a href="http://en.wikipedia.org/wiki/Stockholm_format">
+   Wikipedia</a> or <a href="http://jalview-rnasupport.blogspot.com/2010/06/parsing-wuss-notation-of-rna-secondary.html">
+   Jalview RNA Support Blog</a> for more information about Stockholm files and WUSS notation.</p>
+Select &quot;Colour&quot; <strong>&#8594;</strong> &quot; 
+  By RNA Helices&quot; to colour the alignment by RNA helices. <br>
+  <br>
+<p><em>Features</em></p>
+<ul>
+<li>Colours are generated randomly for the number of helices present.  
+Reselect the "By RNA Helices" option to generate another set of random colors. </li>
+<li>Sequence logo is in <a href="purinepyrimidine.html">
+Purine/Pyrimidine colour scheme</a>. </li>
+<li>Line above the "Secondary Structure" line in annotation panel is WUSS notation present
+in the input file.</li>
+</ul>
+  
+  
+  
+  <div align="center">
+  <img src="rnahelicescoloring.png" width="600" height="140"> </div> 
+
+</body>
+</html>
diff --git a/help/html/colourSchemes/rnahelicescoloring.png b/help/html/colourSchemes/rnahelicescoloring.png
new file mode 100644 (file)
index 0000000..05e9230
Binary files /dev/null and b/help/html/colourSchemes/rnahelicescoloring.png differ
index 33f1d34..e35bc52 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 41edf24..5b667de 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index de18633..f2fd8c8 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 928c5ee..9605118 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1f48afa..71345f6 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 327c9b1..dc55f2e 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1a1bc31..3bef965 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4e4ea73..01353aa 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3705569..2604430 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9a50c86..f278516 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5977ae5..9e6739c 100644 (file)
@@ -1,7 +1,7 @@
 <html>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 0d6cd2f..368698b 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c820e45..e41bf4d 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b43e79e..1c61b81 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9bd70ff..b29262b 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b9fe144..5927ddb 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5439609..ef410cb 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8693756..897640c 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e5b30ae..215e283 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c1d08a9..c0fbf32 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 77888dd..f630639 100644 (file)
@@ -1,7 +1,7 @@
 <html>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 3bfa293..606083c 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3694d07..060059e 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 93146a5..a10b14e 100644 (file)
@@ -1,7 +1,7 @@
 <html>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -23,7 +23,7 @@
 <p><strong>The Jmol PDB Viewer</strong></p>\r
 <p>Since Jalview 2.3, <a href="http://jmol.sourceforge.net/">Jmol</a>\r
 has been integrated into Jalview for interactively viewing structures\r
-opened by selecting the <strong>&quot;Sequence&#8594;View PDB\r
+opened by selecting the <strong>&quot;Structure&#8594;View PDB\r
 entry:&quot;</strong> option in the <a href="../menus/popupMenu.html">sequence\r
 id pop-up menu</a> (if you can't see this, then you need to <a\r
        href="viewingpdbs.html">associate a PDB structure</a> with the\r
index 1e4852a..06841df 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4f93219..b6e1127 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c5dc93d..67af998 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 743f2a9..5c08e55 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7bc2a61..089d1a5 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0c733e4..87e4a96 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e77ec85..68741f7 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cca5c66..a956d6d 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
 </head>
 <body>
 <p><strong>Sequence Fetcher</strong></p>
-<p>Jalview can retrieve sequences from certain databases using
-either the WSDBFetch service provided by the European Bioinformatics
-Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em>
-command (configured in <a href="dassettings.html">DAS settings</a>).</p>
-<img src="seqfetcher.gif" align="center"
-       alt="The Jalview Sequence Fetcher Dialog Box">
-<p>The Sequence Fetcher dialog box 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. Please note, there
-will 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.</strong></p>
-<p>First, select the database you want to retrieve sequences from.
-Then, enter one or more accession ids (as a semi-colon separated list),
-or press the &quot;Example&quot; button to paste the example accession
-for the currently selected database into the retrieval box. Finally,
-press &quot;OK&quot; to initiate the retrieval.</p>
-<p><em>Fetching Individual PDB Chains</em><br>
-If you are retrieving sequences from the PDB, you can retrieve specific
-chains by appending a colon and the chain id to the PDB id. For example
-:<br>
-<pre> 1GAQ:A</pre>
-</p>
-<p><em>Retrieving parts of large sequence records</em><br>
-When retrieving from DAS sequence sources, coordinate range arguments
-can be passed to the server using the standard DAS sequence command
-format:<pre>
-  &lt;AccessionId&gt;:&lt;start&gt;,&lt;end&gt;</pre> If you know a source
-understands this type of query format, then you should untick the
-checkbox for 'replace commas with semi-colons' so the range query can be
-passed to the server; otherwise, the query will be split into two (e.g
-'Mito:1' and '85779' rather than 'Mito:1,85779'). In most cases,
-however, a source that supports range queries will include a range
-qualification in its example query, and Jalview will then automatically
-disable the 'replace commas with semi-colons' option.<br>
-<em>The option to disable the comma to semi-colon translation was
-added in Jalview 2.6</em></p>
-<p>If you use the WSDBFetch sequence fetcher services (EMBL,
-Uniprot, PDB and PFAM) in work for publication, please cite:</p>
-<p>Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S.,
-Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez
-R. <br>
-SOAP-based services provided by the European Bioinformatics Institute.<br>
-Nucleic Acids Res. 33(1):W25-W28 (2005) <br>
-<br>
+<p>Jalview can retrieve sequences from certain databases using either the
+WSDBFetch service provided by the European Bioinformatics Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em> command (configured in <a href="dassettings.html">DAS settings</a>).</p>
+<img src="seqfetcher.gif" align="center" alt="The Jalview Sequence Fetcher Dialog Box">
+<p>The Sequence Fetcher dialog box 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. Please note, there will 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.</strong>
 </p>
+<p>First, select the database you want to retrieve sequences from. Then, enter
+  one or more accession ids (as a semi-colon separated list), or press the 
+  &quot;Example&quot; button to paste the example accession for the currently selected database into the retrieval box.
+   Finally, press &quot;OK&quot; to initiate the retrieval.</p>
+<p>
+  If you are retrieving sequences from the PDB, you can retrieve
+  specific chains by appending a colon and the chain id to the PDB
+  id. For example :<br><pre> 1GAQ:A</pre><br>When retrieving from DAS sequence sources,
+  coordinate range arguments can be passed to the server using the standard DAS 
+  sequence command format (<strong>:&lt;start&gt;,&lt;end&gt;</strong>)</p>
+<p>If you use the WSDBFetch sequence fetcher services (EMBL, Uniprot, PDB, PFAM, and RFAM)
+   in work for publication, please cite:</p>
+<p>Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar 
+  S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R. <br>
+  SOAP-based services provided by the European Bioinformatics Institute.<br>
+  Nucleic Acids Res. 33(1):W25-W28 (2005) <br>
+  <br>
+  </p>
 </body>
 </html>
index bb93c97..f90f882 100644 (file)
@@ -1,7 +1,7 @@
 <html>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
diff --git a/help/html/features/varna.html b/help/html/features/varna.html
new file mode 100644 (file)
index 0000000..507b26f
--- /dev/null
@@ -0,0 +1,74 @@
+<html>\r
+<!--\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ * \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
+-->\r
+<head>\r
+<title>The VARNA RNA Viewer</title>\r
+</head>\r
+<body>\r
+<p><strong>The VARNA RNA Viewer</strong></p>\r
+<p>Since Jalview\r
+2.7.1, <a href="http://varna.lri.fr/index.html">VARNA</a> has been\r
+integrated into Jalview for interactively viewing structures opened by\r
+selecting the <strong>&quot;Structure&#8594;View\r
+Structure:&quot;</strong> option in\r
+the <a href="../menus/popupMenu.html">sequence id pop-up menu</a> (if\r
+you can't see this, then no RNA structure is associated with your\r
+sequence or alignment. In the pop-up menu all structures that\r
+are associated with this sequence and all sequences that are\r
+associated with the alignment are available.\r
+\r
+<p><strong>Different structures</strong></p>\r
+<ul>\r
+  <li>\r
+    <b>Alignment structures</b>:\r
+    Structures associated with the alignment are marked by having &quot;consensus&quot; attached to their name. VARNA contains two different entries for consensus structures.\r
+    <ul>\r
+      <li>Consensus structure: the individual sequence folded into the consensus structure</li>\r
+      <li>Trimmed consensus structure: the individual sequence\r
+       folded into the the gap-free consensus structure. That means all\r
+       columns that contained gaps in the individual sequence were\r
+       removed. If this breaks a base-pair the pairing is removed also.\r
+       This can be considered as an approximation for the individual structure.\r
+    </ul>\r
+  </li>\r
+  <li>\r
+    <b>Individual structures</b>:\r
+    this is a structure associated with the individual sequence and therefore not related to the alignment    \r
+  </li>\r
+\r
+<p><strong>Controls</strong><br>\r
+<ul>\r
+<li>Rotate view - Left Click and drag</li>\r
+<li>Zoom in - Press '+'</li>\r
+<li>Zoom out - Press '-'</li>\r
+<li>Choose a different structure - Left click on structure in the left hand panel</li>\r
+<li>Highlighting bases - Move mouse over columns in the Jalview alignment panel</li>\r
+</ul>\r
+\r
+<p><strong>Functionality provided by VARNA</strong></p>\r
+<p>VARNA's own functions are accessed by right-clicking in the\r
+structure display area. That will open the VARNA pop-up menu,\r
+which provides access to a number of features like different draw algorithm, color highlighting or annotations. \r
+</p>\r
+<p><strong>More Information</strong></p>\r
+<p>VARNA is a very powerful RNA viewer on its own. Only the\r
+essentials have been described here - the interested reader is\r
+referred to <a href="http://varna.lri.fr/usermanual.html">VARNA's own\r
+comprehensive online documentation</a>.</p>\r
+</body>\r
+</html>\r
index fc12b3b..1460e8a 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 689d516..a4ff930 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0957962..cfa8cb3 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b5a86da..ed24f59 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9172b28..7cbfbf5 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -63,6 +63,11 @@ THISISASEQENCE<br></td>
 </tr><tr><td width="17%">PFAM</td>
 <td width="60%">SequenceName THISISASEQENCE</td>
 <td width="23%">.pfam</td>
+</tr><tr>
+<td width="17%">Stockholm</td>
+<td width="60%"># STOCKHOLM VersionNumber<br>
+<em>...</em><br>//</td>
+<td width="23%">.stk, .sto</td>
 </tr>
 </table>
 <p>The file extensions are used to associate jalview alignment icons
index be803bb..f413786 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7d12827..b7809a5 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6f31a7a..dfebd8e 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ee526e8..f154572 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 366c073..4e52b84 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ff74139..4a1a200 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -28,8 +28,8 @@
                <li><strong>File</strong>
                        <ul>
                                <li><strong>Fetch Sequence</strong><br> <em>Shows a
-                                               dialog window in which you can select known ids from Uniprot,
-                                               EMBL, EMBLCDS or PDB database using Web Services provided by the
+                                               dialog window in which you can retrieve known ids from Uniprot,
+                                               EMBL, EMBLCDS, PFAM, Rfam, or PDB database using Web Services provided by the
                                                European Bioinformatics Institute. See <a
                                                href="../features/seqfetch.html">Sequence Fetcher</a> </em>.</li>
                                <li><strong>Add Sequences</strong><em><br> Add
 
                                        </ul></li>
                        </ul>
+       </li>
+
+               </ul>
                </li>
 
                <li><strong>Colour</strong>
                                <li>Colour Scheme options: <strong>None, ClustalX,
                                                Blosum62 Score, Percentage Identity, Zappo, Taylor,
                                                Hydrophobicity, Helix Propensity, Strand Propensity, Turn
-                                               Propensity, Buried Index, Nucleotide, User Defined<br> </strong> <em>See
+                                               Propensity, Buried Index, Nucleotide, Purine/Pyrimidine, User Defined<br> </strong> <em>See
                                                <a href="../colourSchemes/index.html">colours</a> for a
                                                description of all colour schemes.</em><br></li>
                                <li><strong>By Conservation<br> </strong><em>See <a
                                                the alignment on a per-column value from a specified annotation.
                                                See <a href="../colourSchemes/annotationColouring.html">Annotation
                                                        Colouring</a>.</em><br></li>
+               <li><strong>By RNA Helices</strong><br>
+               <em>Colours the helices of an RNA alignment loaded from a Stockholm file. See 
+               <a href="../colourSchemes/rnahelicesColouring.html">RNA Helices
+               Colouring</a>.</em><br>
+               </li>
                        </ul></li>
                <li><strong>Calculate</strong>
                        <ul>
index bd1eda6..9508b24 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 444dfe3..28ff3d6 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3093edd..4e4978c 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -31,7 +31,7 @@
       </em></li>
     <li>Colour Scheme options: <strong>None, ClustalX, Blosum62 Score, Percentage 
       Identity, Zappo, Taylor, Hydrophobicity, Helix Propensity, Strand Propensity, 
-      Turn Propensity, Buried Index, Nucleotide, User Defined<br>
+      Turn Propensity, Buried Index, Nucleotide, Purine/Pyrimidine, User Defined<br>
       </strong> <em>See <a href="../colourSchemes/index.html">colours</a> for 
       a description of all colour schemes.</em><br>
     </li>
       <em>Colours the alignment on a per-column value from a specified annotation. 
       See <a href="../colourSchemes/annotationColouring.html">Annotation Colouring</a>.</em><br>
     </li>
+    <li><strong>By RNA Helices</strong><br>
+               <em>Colours the helices of an RNA alignment loaded from a Stockholm file. See 
+               <a href="../colourSchemes/rnahelicesColouring.html">RNA Helices
+               Colouring</a>.</em><br>
+               </li>
   </ul>
 </body>
 </html>
index 488e2f0..4ab514f 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index af3e105..39db7ae 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -25,7 +25,7 @@
 <ul>
        <li><strong>Fetch Sequence</strong><br>
        <em>Shows a dialog window in which you can select known ids from
-       Uniprot, EMBL, EMBLCDS or PDB database using Web Services provided by
+       Uniprot, EMBL, EMBLCDS, PDB, PFAM, or RFAM databases using Web Services provided by
        the European Bioinformatics Institute. See <a
                href="../features/seqfetch.html">Sequence Fetcher</a></em>.</li>
        <li><strong>Add Sequences</strong><em><br>
index 62fdf93..ab5fd74 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6cbaad3..dd8a343 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b533452..2cf52db 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4098c67..d8c5c46 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 436dc35..b1c115d 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f875672..19dd51a 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fb16551..46b8605 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3c5221e..d6c8264 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 494db99..e985312 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a57bc0a..95164d9 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/help/html/na/index.html b/help/html/na/index.html
new file mode 100644 (file)
index 0000000..bad0c92
--- /dev/null
@@ -0,0 +1,58 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+-->
+<head>
+<title>Nucleic Acid Support</title>
+<style type="text/css">
+<!--
+td {
+       font-family: "Courier New", Courier, mono;
+       font-style: normal;
+       font-size: medium;
+}
+-->
+</style>
+</head>
+<body>
+<p><strong>Nucleic Acid Support</strong></p>
+<p><em>Colour Schemes</em></p>
+<p>Jalview has color schemes for nucleic acid based sequences, ability to 
+fetch sequences from RFAM and RNA secondary structure coloring</p>
+<p>Information on the <a href="../colourSchemes/nucleotide.html">Nucleotide 
+colour scheme</a> and <a href="../colourSchemes/purinepyrimidine.html">
+Purine/Pyrimidine colour scheme</a> are available
+under the Colour Menu.  See <a href="../colourSchemes/index.html">Colour 
+Schemes</a>.</p>
+<p><em>RNA Support</em></p>
+<p>Sequences can be <a href="../features/seqfetch.html">fetched</a> from the 
+RFAM database by accession number or ID.</p>
+<p>If an RNA alignment is loaded from a Stockholm file with secondary
+structure information in WUSS notation, the alignment can be coloured by 
+the helices in the secondary structure. Helices are determined by the base-pairing
+in the secondary structure line. See <a href="../colourSchemes/rnahelicesColouring.html">
+RNA Helices Colouring</a>. Below is an example of this type of coloring</p>
+<p>Annotation panel shows the presence of RNA helices and WUSS notation from
+input file specifying secondary structure.<p>
+<div align="center">
+  <img src="../colourschemes/rnahelicescoloring.png" width="600" height="140"> </div> 
+
+</div>
+<p align="center">&nbsp;</p>
+</body>
+</html>
index b1e12c2..567cc58 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 88bd1dc..fc054dc 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 20c0897..ef23489 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 58950b9..3a95ab3 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f62012c..39c499f 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 21bceca..b41e643 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3009823..297d8ea 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5736258..ecca088 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 80f8a28..2dcaa4d 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index dc01f71..e8ddabf 100644 (file)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fd0acf6..6eb8ee7 100644 (file)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1187204..9fc29db 100644 (file)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cf96d47..20c80df 100755 (executable)
@@ -1,7 +1,7 @@
 <html>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
                <strong>What's new ?</strong>
        </p>
        <p>
-               The Jalview 2.7 release features new web services, and important
-               improvements to the way in which Jalview handles alignments and
-               associated PDB structures, as well as numerous minor improvements and
-               bug fixes. Version 2.7 of the JalviewLite applet also features a
-               significantly enhanced Javascript API enabling it to be more easily
-               integrated with javascript based web applications. <br /> For full
-               details see the <a href="releases.html#Jalview2.7">Jalview 2.7
+               The Jalview 2.7.1 release features (tbc)
+               <br /> For full
+               details see the <a href="releases.html#Jalview2.7.1">Jalview 2.7.1
                        release history</a>.
        </p>
        <p>
-               <strong>Highlights in Jalview Desktop Version 2.7</strong>
+               <strong>Highlights in Jalview Desktop Version 2.7.1</strong>
        </p>
        <ul>
-               <li>New <a href="features/viewingpdbs.html">structure viewer
-                               options</a>:
-                       <ul>
-                               <li>Colour and superimpose 3D structures of complexes and
-                                       multi-domain chains using several different alignments</li>
-                               <li>Drag and drop to associate PDB files with sequences that
-                                       have the same name</li>
-                               <li>Open and superimpose all associated structures for the
-                                       current selection</li>
-                       </ul>
-               <li>New web services for <a href="webServices/shmr.html">alignment
-                               analysis</a></li>
-               <li>Improved graphical user interface for <a
-                       href="http://www.compbio.dundee.ac.uk/jabaws">JABAWS</a>services.
-               </li>
-               <li>Sort associated alignment views option in tree viewer</li>
-               <li>Default colours for <a
-                       href="colourSchemes/annotationColouring.html">shading alignment
-                               by quantitative annotation</a>.
-               </li>
-               <li><a href="webServices/newsreader.html">Jalview Desktop RSS
-                               reader</a> - following important updates at <a
-                       href="http://www.jalview.org/feeds/desktop/rss">http://www.jalview.org/feeds/desktop/rss</a>
+
+       <li>New Purine/Pyrimidine colour scheme</li>
+       <li>Colouring of RNA secondary structure by helices.  See <a href="na/index.html">Nucleic Acid Support</a></li>
+       <li>Embedded <a href="http://www.varna.fr/">VARNA</a> RNA secondary structure viewer.
        </ul>
 
        <p>
                <strong>Issues Resolved (a select list - see the <a
-                       href="releases.html#Jalview2.7">release history</a> for full details)
+                       href="releases.html#Jalview2.7.1">release history</a> for full details)
                </strong>
        </p>
        <p>
                <strong>Issues in the Jalview Desktop</strong>
        <ul>
-               <li>Problems viewing associated structures for sequences
-                       retrieved from UNIPROT</li>
-               <li>Problems viewing Jalview projects from older versions in
-                       version 2.6</li>
-               <li>Preservation of hidden annotation rows and tree bootstrap
-                       values in projects</li>
-               <li>Newly added JABAWS servers not always visible in web services
-                       menu</li>
        </ul>
        <strong>Issues specific to the JalviewLite Applet</strong>
        <ul>
-               <li>Layout problems when lots of annotation rows are displayed</li>
-               <li>&lt;= shown as = in annotation row tooltip</li>
-               <li>export features raises exception when no features exist</li>
-               <li>relative URLs not handled properly when used in parameters
-                       and annotation files</li>
        </ul>
        <strong>Issues affecting both applet and application</strong>
        <ul>
-               <li>sequence numbering not preserved in MSF alignment output</li>
-               <li>sequence associated secondary structure not correctly parsed
-                       in interleaved stockholm</li>
-               <li>sequences containing lowercase letters are not properly
-                       associated with their pdb files</li>
-               <li>Jalview PDB file reader does not extract sequence from deoxy
-                       nucleotide chains correctly</li>
-               <li>Sequence length given in alignment properties window is off
-                       by 1</li>
        </ul>
 </body>
 </html>
index 014f741..1708b7d 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/lib/VARNAv3-9-dev.jar b/lib/VARNAv3-9-dev.jar
new file mode 100644 (file)
index 0000000..6ae57bf
Binary files /dev/null and b/lib/VARNAv3-9-dev.jar differ
diff --git a/lib/min-jaba-client-2.0.jar b/lib/min-jaba-client-2.0.jar
new file mode 100644 (file)
index 0000000..4ba3f33
Binary files /dev/null and b/lib/min-jaba-client-2.0.jar differ
diff --git a/lib/min-jaba-client.jar b/lib/min-jaba-client.jar
deleted file mode 100644 (file)
index b626144..0000000
Binary files a/lib/min-jaba-client.jar and /dev/null differ
index 830f355..3b03197 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?><!--
     Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
-    Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
    
     This file is part of Jalview.
    
index 878d309..14cb70b 100644 (file)
@@ -63,7 +63,7 @@ file.reference.Jmol-12.2.4.jar=lib/Jmol-12.2.4.jar
 file.reference.JmolApplet-12.2.4.jar=appletlib/JmolApplet-12.2.4.jar
 file.reference.log4j-1.2.8.jar=lib/log4j-1.2.8.jar
 file.reference.mail.jar=lib/mail.jar
-file.reference.min-jaba-client.jar=lib/min-jaba-client.jar
+file.reference.min-jaba-client.jar=lib/min-jaba-client-2.0.jar
 file.reference.regex.jar=lib/regex.jar
 file.reference.saaj.jar=lib/saaj.jar
 file.reference.vamsas-client.jar=lib/vamsas-client.jar
@@ -71,6 +71,7 @@ file.reference.wsdl4j.jar=lib/wsdl4j.jar
 file.reference.xercesImpl.jar=lib/xercesImpl.jar
 file.reference.xml-apis.jar=lib/xml-apis.jar
 file.reference.miglayout-4.0-swing.jar=lib/miglayout-4.0-swing.jar
+file.reference.varna-3.9-dev.jar=lib/VARNAv3.9-dev.jar
 includes=**
 jar.compress=false
 javac.classpath=\
@@ -100,7 +101,8 @@ javac.classpath=\
     ${file.reference.xml-apis.jar}:\
     ${file.reference.xercesImpl.jar}:\
     ${file.reference.wsdl4j.jar}:\
-    ${file.reference.JmolApplet-12.2.4.jar}
+    ${file.reference.JmolApplet-12.2.4.jar} \
+    ${file.reference.varna-3.9-dev.jar}
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.deprecation=false
index f3db653..99ac32c 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?><!--
     Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
-    Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
    
     This file is part of Jalview.
    
diff --git a/resources/authors.props b/resources/authors.props
new file mode 100644 (file)
index 0000000..69c89a6
--- /dev/null
@@ -0,0 +1,4 @@
+YEAR=2011
+AUTHORS=J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+AUTHORFNAMES=Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
\ No newline at end of file
index d3af6c7..7a1f585 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index bf971af..337ec44 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1142745..7268b0e 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7238f18..506c9f2 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3d37852..63d02b7 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 431fad5..cc8b1e9 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7c562fb..a453b97 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index f061b42..0843deb 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f8bfed0..7742e6a 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <!--\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 181d85f..cadbc77 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ae255e1..cebd6a9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9ab7e09..1502f4e 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9d22b6a..2979cd1 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 298fcc4..500e203 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fd1b764..987dcd1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0004308..aeb4800 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a5f050d..c3ab9d7 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3f9bc9d..18b83ae 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cb3d221..041277d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fd2c210..a5d7905 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e952e53..7ea16ce 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 866fe88..e582b59 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d015f63..885c62d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 06483a6..d8ed0e4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 216f411..3e539d5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b878c18..5f1f636 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 03a2383..724a7d9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 249c163..f6cc6a5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 752f622..0c9bd24 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c669d23..538be42 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e582192..f148589 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ca961e2..fecd11c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3af0cf0..e366cbb 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index bd70635..e424865 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index f476ec2..48f99cb 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 118c893..979a855 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 3a96d70..b649c99 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 64687a1..eefbac5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index aadd8f0..d56fb01 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -321,14 +321,16 @@ public class AAFrequency
     }
     ;
     jalview.util.QuickSort.sort(vl, ca);
-    rtnval[0] = 1;
+    rtnval[0] = 2;
+    rtnval[1]=0;
     for (int c = ca.length - 1; profile[0][((char[]) ca[c])[0]] > 0; c--)
     {
       if (((char[]) ca[c])[0] != '-')
       {
         rtnval[rtnval[0]++] = ((char[]) ca[c])[0];
-        rtnval[rtnval[0]++] = (int) (((float) profile[0][((char[]) ca[c])[0]]) * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+        rtnval[rtnval[0]] = (int) (((float) profile[0][((char[]) ca[c])[0]]) * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
                 : 0]);
+        rtnval[1]+=rtnval[rtnval[0]++];
       }
     }
     return rtnval;
index 3db4435..2ce08fc 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d78b5b3..25717d0 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2a065f6..6957b5c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -85,9 +85,8 @@ public class Conservation
    *          end residue position
    */
   public Conservation(String name, Hashtable propHash, int threshold,
-          Vector sequences, int start, int end)
+          List<SequenceI> sequences, int start, int end)
   {
-
     this.name = name;
     this.propHash = propHash;
     this.threshold = threshold;
@@ -103,7 +102,7 @@ public class Conservation
     try {
     for (s = 0; s < sSize; s++)
     {
-      sarray[s] = (SequenceI) sequences.elementAt(s);
+      sarray[s] = (SequenceI) sequences.get(s);
       if (sarray[s].getLength() > maxLength)
       {
         maxLength = sarray[s].getLength();
@@ -695,4 +694,42 @@ public class Conservation
       }
     }
   }
+
+  /**
+   * construct and call the calculation methods on a new Conservation object
+   * @param name - name of conservation
+   * @param consHash - hash table of properties for each amino acid (normally ResidueProperties.propHash)
+   * @param threshold - minimum number of conserved residues needed to indicate conservation (typically 3)
+   * @param seqs
+   * @param start first column in calculation window
+   * @param end last column in calculation window
+   * @param posOrNeg positive (true) or negative (false) conservation 
+   * @param consPercGaps percentage of gaps tolerated in column
+   * @param calcQuality flag indicating if alignment quality should be calculated  
+   * @return Conservation object ready for use in visualization
+   */
+  public static Conservation calculateConservation(String name,
+          Hashtable consHash, int threshold, List<SequenceI> seqs, int start, int end, boolean posOrNeg, int consPercGaps, boolean calcQuality)
+  {
+    Conservation cons = new Conservation(name, consHash, threshold, seqs, start,end);
+    return calculateConservation(cons, posOrNeg, consPercGaps, calcQuality);
+  }
+  /**
+  * @param b positive (true) or negative (false) conservation 
+  * @param consPercGaps percentage of gaps tolerated in column
+  * @param calcQuality flag indicating if alignment quality should be calculated  
+  * @return Conservation object ready for use in visualization
+  */
+ public static Conservation calculateConservation(Conservation cons, boolean b, int consPercGaps, boolean calcQuality)
+ {
+   cons.calculate();
+    cons.verdict(b, consPercGaps); 
+
+    if (calcQuality)
+    {
+      cons.findQuality();
+    }
+
+    return cons;
+  }
 }
index 1420c9a..6298505 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 49c37df..9f3a8d0 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 2dd6a74..41478d6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 57f1dcf..95323e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e9e1cd7..67ce460 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ff4ed38..47f2d0d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3649a29..f188bef 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java
new file mode 100644 (file)
index 0000000..ba18732
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+
+/* Author: Lauren Michelle Lui 
+ * Methods are based on RALEE methods http://personalpages.manchester.ac.uk/staff/sam.griffiths-jones/software/ralee/
+ * */
+
+package jalview.analysis;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Stack;
+import java.util.Vector;
+
+import jalview.datamodel.SequenceFeature;
+
+public class Rna
+{
+       static Hashtable<Integer, Integer> pairHash = new Hashtable();
+  /**
+   * Based off of RALEE code ralee-get-base-pairs. Keeps track of open bracket
+   * positions in "stack" vector. When a close bracket is reached, pair this
+   * with the last element in the "stack" vector and store in "pairs" vector.
+   * Remove last element in the "stack" vector. Continue in this manner until
+   * the whole string is processed.
+   * 
+   * @param line
+   *          Secondary structure line of an RNA Stockholm file
+   * @return Array of SequenceFeature; type = RNA helix, begin is open base
+   *         pair, end is close base pair
+   */
+  public static SequenceFeature[] GetBasePairs(CharSequence line) throws WUSSParseException
+  {
+    Stack stack = new Stack();
+    Vector pairs = new Vector();
+
+    int i = 0;
+    while (i < line.length())
+    {
+      char base = line.charAt(i);
+
+      if ((base == '<') || (base == '(') || (base == '{') || (base == '['))
+      {
+        stack.push(i);
+      }
+      else if ((base == '>') || (base == ')') || (base == '}')
+              || (base == ']'))
+      {
+
+        if (stack.isEmpty())
+        {
+          // error whilst parsing i'th position. pass back
+          throw new WUSSParseException("Mismatched closing bracket", i);
+        }
+        Object temp = stack.pop();
+        pairs.addElement(temp);
+        pairs.addElement(i);        
+      }
+
+      i++;
+    }
+
+    int numpairs = pairs.size() / 2;
+    SequenceFeature[] outPairs = new SequenceFeature[numpairs];
+
+    // Convert pairs to array
+    for (int p = 0; p < pairs.size(); p += 2)
+    {
+      int begin = Integer.parseInt(pairs.elementAt(p).toString());
+      int end = Integer.parseInt(pairs.elementAt(p + 1).toString());
+      
+       outPairs[p / 2] = new SequenceFeature("RNA helix", "", "", begin,
+              end, "");
+       //pairHash.put(begin, end);
+
+    }
+
+    return outPairs;
+  }
+  
+  
+  /**
+   * Function to get the end position corresponding to a given start position
+   * @param indice - start position of a base pair
+   * @return - end position of a base pair
+   */
+  /*makes no sense at the moment :(
+  public int findEnd(int indice){
+         //TODO: Probably extend this to find the start to a given end?
+         //could be done by putting everything twice to the hash
+         ArrayList<Integer> pair = new ArrayList<Integer>();
+         return pairHash.get(indice);
+  }*/
+  
+
+  /**
+   * Figures out which helix each position belongs to and stores the helix
+   * number in the 'featureGroup' member of a SequenceFeature Based off of RALEE
+   * code ralee-helix-map.
+   * 
+   * @param pairs
+   *          Array of SequenceFeature (output from Rna.GetBasePairs)
+   */
+  public static void HelixMap(SequenceFeature[] pairs)
+  {
+
+    int helix = 0; // Number of helices/current helix
+    int lastopen = 0; // Position of last open bracket reviewed
+    int lastclose = 9999999; // Position of last close bracket reviewed
+    int i = pairs.length; // Number of pairs
+
+    int open; // Position of an open bracket under review
+    int close; // Position of a close bracket under review
+    int j; // Counter
+
+    Hashtable helices = new Hashtable(); // Keep track of helix number for each
+                                         // position
+
+    // Go through each base pair and assign positions a helix
+    for (i = 0; i < pairs.length; i++)
+    {
+
+      open = pairs[i].getBegin();
+      close = pairs[i].getEnd();
+
+      // System.out.println("open " + open + " close " + close);
+      // System.out.println("lastclose " + lastclose + " lastopen " + lastopen);
+
+      // we're moving from right to left based on closing pair
+      /*
+       * catch things like <<..>>..<<..>> |
+       */
+      if (open > lastclose)
+      {
+        helix++;
+      }
+
+      /*
+       * catch things like <<..<<..>>..<<..>>>> |
+       */
+      j = pairs.length - 1;
+      while (j >= 0)
+      {
+        int popen = pairs[j].getBegin();
+
+        // System.out.println("j " + j + " popen " + popen + " lastopen "
+        // +lastopen + " open " + open);
+        if ((popen < lastopen) && (popen > open))
+        {
+          if (helices.containsValue(popen)
+                  && (((Integer) helices.get(popen)) == helix))
+          {
+            continue;
+          }
+          else
+          {
+            helix++;
+            break;
+          }
+        }
+
+        j -= 1;
+      }
+
+      // Put positions and helix information into the hashtable
+      helices.put(open, helix);
+      helices.put(close, helix);
+
+      // Record helix as featuregroup
+      pairs[i].setFeatureGroup(Integer.toString(helix));
+
+      lastopen = open;
+      lastclose = close;
+
+    }
+  }
+}
+
index f28fa05..21dea57 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a8ce33d..4b1900c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java
new file mode 100644 (file)
index 0000000..0c9f830
--- /dev/null
@@ -0,0 +1,468 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+
+package jalview.analysis;
+
+import java.util.*;
+
+import jalview.datamodel.*;
+
+/**
+ * Takes in a vector or array of sequences and column start and column end and
+ * returns a new Hashtable[] of size maxSeqLength, if Hashtable not supplied.
+ * This class is used extensively in calculating alignment colourschemes that
+ * depend on the amount of conservation in each alignment column.
+ * 
+ * @author $author$
+ * @version $Revision$
+ */
+public class StructureFrequency
+{
+  // No need to store 1000s of strings which are not
+  // visible to the user.
+  public static final String MAXCOUNT = "C";
+
+  public static final String MAXRESIDUE = "R";
+
+  public static final String PID_GAPS = "G";
+
+  public static final String PID_NOGAPS = "N";
+
+  public static final String PROFILE = "P";
+
+  public static final String PAIRPROFILE = "B";
+
+  /**
+   * Returns the 3' position of a base pair
+   * 
+   * @param pairs
+   *          Secondary structure annotation
+   * @param indice
+   *          5' position of a base pair
+   * @return 3' position of a base pair
+   */
+  public static int findPair(SequenceFeature[] pairs, int indice)
+  {
+    for (int i = 0; i < pairs.length; i++)
+    {
+      if (pairs[i].getBegin() == indice)
+      {
+        return pairs[i].getEnd();
+      }
+    }
+    return -1;
+  }
+
+  /**
+   * Method to calculate a 'base pair consensus row', very similar to nucleotide
+   * consensus but takes into account a given structure
+   * 
+   * @param sequences
+   * @param start
+   * @param end
+   * @param result
+   * @param profile
+   * @param rnaStruc
+   */
+  public static final void calculate(SequenceI[] sequences, int start,
+          int end, Hashtable[] result, boolean profile,
+          AlignmentAnnotation rnaStruc)
+  {
+    Hashtable residueHash;
+    String maxResidue;
+    char[] seq, struc = rnaStruc.getRNAStruc().toCharArray();
+    SequenceFeature[] rna = rnaStruc._rnasecstr;
+    char c, s, cEnd;
+    int count, nonGap = 0, i, bpEnd = -1, j, jSize = sequences.length;
+    int[] values;
+    int[][] pairs;
+    float percentage;
+
+    for (i = start; i < end; i++) // foreach column
+    {
+      residueHash = new Hashtable();
+      maxResidue = "-";
+      values = new int[255];
+      pairs = new int[255][255];
+      bpEnd = -1;
+      if (i < struc.length)
+      {
+        s = struc[i];
+      }
+      else
+      {
+        s = '-';
+      }
+      if (s == '.' || s == ' ')
+      {
+        s = '-';
+      }
+
+      if (s != '(')
+      {
+        if (s == '-')
+        {
+          values['-']++;
+        }
+      }
+      else
+      {
+        bpEnd = findPair(rna, i);
+        if (bpEnd>-1)
+        {
+        for (j = 0; j < jSize; j++) // foreach row
+        {
+          if (sequences[j] == null)
+          {
+            System.err
+                    .println("WARNING: Consensus skipping null sequence - possible race condition.");
+            continue;
+          }
+          c = sequences[j].getCharAt(i);
+          {
+
+            // standard representation for gaps in sequence and structure
+            if (c == '.' || c == ' ')
+            {
+              c = '-';
+            }
+
+            if (c == '-')
+            {
+              values['-']++;
+              continue;
+            }
+            cEnd = sequences[j].getCharAt(bpEnd);
+            if (checkBpType(c, cEnd))
+            {
+              values['(']++; // H means it's a helix (structured)
+            }
+            pairs[c][cEnd]++;
+
+            maxResidue = "(";
+          }
+        }
+        }
+        // nonGap++;
+      }
+      // UPDATE this for new values
+      if (profile)
+      {
+        residueHash.put(PROFILE, new int[][]
+        { values, new int[]
+        { jSize, (jSize - values['-']) } });
+
+        residueHash.put(PAIRPROFILE, pairs);
+      }
+
+      count = values['('];
+
+      residueHash.put(MAXCOUNT, new Integer(count));
+      residueHash.put(MAXRESIDUE, maxResidue);
+
+      percentage = ((float) count * 100) / (float) jSize;
+      residueHash.put(PID_GAPS, new Float(percentage));
+
+      // percentage = ((float) count * 100) / (float) nongap;
+      // residueHash.put(PID_NOGAPS, new Float(percentage));
+      if (result[i] == null)
+      {
+        result[i] = residueHash;
+      }
+      if (bpEnd > 0)
+      {
+        values[')'] = values['('];
+        values['('] = 0;
+
+        residueHash = new Hashtable();
+        maxResidue = ")";
+
+        if (profile)
+        {
+          residueHash.put(PROFILE, new int[][]
+          { values, new int[]
+          { jSize, (jSize - values['-']) } });
+
+          residueHash.put(PAIRPROFILE, pairs);
+        }
+
+        residueHash.put(MAXCOUNT, new Integer(count));
+        residueHash.put(MAXRESIDUE, maxResidue);
+
+        percentage = ((float) count * 100) / (float) jSize;
+        residueHash.put(PID_GAPS, new Float(percentage));
+
+        result[bpEnd] = residueHash;
+      }
+    }
+  }
+
+  /**
+   * Method to check if a base-pair is a canonical or a wobble bp
+   * 
+   * @param up
+   *          5' base
+   * @param down
+   *          3' base
+   * @return True if it is a canonical/wobble bp
+   */
+  public static boolean checkBpType(char up, char down)
+  {
+    if (up > 'Z')
+    {
+      up -= 32;
+    }
+    if (down > 'Z')
+    {
+      down -= 32;
+    }
+
+    switch (up)
+    {
+    case 'A':
+      switch (down)
+      {
+      case 'T':
+        return true;
+      case 'U':
+        return true;
+      }
+      break;
+    case 'C':
+      switch (down)
+      {
+      case 'G':
+        return true;
+      }
+      break;
+    case 'T':
+      switch (down)
+      {
+      case 'A':
+        return true;
+      case 'G':
+        return true;
+      }
+      break;
+    case 'G':
+      switch (down)
+      {
+      case 'C':
+        return true;
+      case 'T':
+        return true;
+      case 'U':
+        return true;
+      }
+      break;
+    case 'U':
+      switch (down)
+      {
+      case 'A':
+        return true;
+      case 'G':
+        return true;
+      }
+      break;
+    }
+    return false;
+  }
+
+  /**
+   * Compute all or part of the annotation row from the given consensus
+   * hashtable
+   * 
+   * @param consensus
+   *          - pre-allocated annotation row
+   * @param hconsensus
+   * @param iStart
+   * @param width
+   * @param ignoreGapsInConsensusCalculation
+   * @param includeAllConsSymbols
+   */
+  public static void completeConsensus(AlignmentAnnotation consensus,
+          Hashtable[] hconsensus, int iStart, int width,
+          boolean ignoreGapsInConsensusCalculation,
+          boolean includeAllConsSymbols)
+  {
+    float tval, value;
+    if (consensus == null || consensus.annotations == null
+            || consensus.annotations.length < width)
+    {
+      // called with a bad alignment annotation row - wait for it to be
+      // initialised properly
+      return;
+    }
+    for (int i = iStart; i < width; i++)
+    {
+      if (i >= hconsensus.length)
+      {
+        // happens if sequences calculated over were shorter than alignment
+        // width
+        consensus.annotations[i] = null;
+        continue;
+      }
+      value = 0;
+      if (ignoreGapsInConsensusCalculation)
+      {
+        value = ((Float) hconsensus[i].get(StructureFrequency.PID_NOGAPS))
+                .floatValue();
+      }
+      else
+      {
+        value = ((Float) hconsensus[i].get(StructureFrequency.PID_GAPS))
+                .floatValue();
+      }
+
+      String maxRes = hconsensus[i].get(StructureFrequency.MAXRESIDUE)
+              .toString();
+      String mouseOver = hconsensus[i].get(StructureFrequency.MAXRESIDUE)
+              + " ";
+      if (maxRes.length() > 1)
+      {
+        mouseOver = "[" + maxRes + "] ";
+        maxRes = "+";
+      }
+      int[][] profile = (int[][]) hconsensus[i]
+              .get(StructureFrequency.PROFILE);
+      int[][] pairs = (int[][]) hconsensus[i]
+              .get(StructureFrequency.PAIRPROFILE);
+
+      if (pairs != null && includeAllConsSymbols) // Just responsible for the
+      // tooltip
+      // TODO Update tooltips for Structure row
+      {
+        mouseOver = "";
+
+        /* TODO It's not sure what is the purpose of the alphabet and wheter it is useful for structure?
+         * 
+         * if (alphabet != null) { for (int c = 0; c < alphabet.length; c++) {
+         * tval = ((float) profile[0][alphabet[c]]) 100f / (float)
+         * profile[1][ignoreGapsInConsensusCalculation ? 1 : 0]; mouseOver +=
+         * ((c == 0) ? "" : "; ") + alphabet[c] + " " + ((int) tval) + "%"; } }
+         * else {
+         */
+        Object[] ca = new Object[625];
+        float[] vl = new float[625];
+        int x = 0;
+        for (int c = 65; c < 90; c++)
+        {
+          for (int d = 65; d < 90; d++)
+          {
+            ca[x] = new int[]
+            { c, d };
+            vl[x] = (float) pairs[c][d];
+            x++;
+          }
+        }
+        jalview.util.QuickSort.sort(vl, ca);
+        int p = 0;
+
+        for (int c = 624; c > 0; c--)
+        {
+          if (vl[c] > 0)
+          {
+            tval = ((float) vl[c] * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+                    : 0]);
+            mouseOver += ((p == 0) ? "" : "; ") + (char) ((int[]) ca[c])[0]
+                    + (char) ((int[]) ca[c])[1] + " " + ((int) tval) + "%";
+            p++;
+
+          }
+        }
+
+        // }
+      }
+      else
+      {
+        mouseOver += ((int) value + "%");
+      }
+      consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ',
+              value);
+    }
+  }
+
+  /**
+   * get the sorted base-pair profile for the given position of the consensus
+   * 
+   * @param hconsensus
+   * @return profile of the given column
+   */
+  public static int[] extractProfile(Hashtable hconsensus,
+          boolean ignoreGapsInConsensusCalculation)
+  {
+    int[] rtnval = new int[52]; // 2*(5*5)+2
+    int[][] profile = (int[][]) hconsensus.get(StructureFrequency.PROFILE);
+    int[][] pairs = (int[][]) hconsensus
+            .get(StructureFrequency.PAIRPROFILE);
+
+    if (profile == null)
+      return null;
+
+    // TODO fix the object length, also do it in completeConsensus
+    Object[] ca = new Object[625];
+    float[] vl = new float[625];
+    int x = 0;
+    for (int c = 65; c < 90; c++)
+    {
+      for (int d = 65; d < 90; d++)
+      {
+        ca[x] = new int[]
+        { c, d };
+        vl[x] = (float) pairs[c][d];
+        x++;
+      }
+    }
+    jalview.util.QuickSort.sort(vl, ca);
+
+    rtnval[0] = 2;
+    rtnval[1] = 0;
+    for (int c = 624; c > 0; c--)
+    {
+      if (vl[c] > 0)
+      {
+        rtnval[rtnval[0]++] = ((int[]) ca[c])[0];
+        rtnval[rtnval[0]++] = ((int[]) ca[c])[1];
+        rtnval[rtnval[0]] = (int) ((float) vl[c] * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+                : 0]);
+        rtnval[1]+=rtnval[rtnval[0]++];
+      }
+    }
+
+    return rtnval;
+  }
+
+  public static void main(String args[])
+  {
+    // Short test to see if checkBpType works
+    ArrayList<String> test = new ArrayList<String>();
+    test.add("A");
+    test.add("c");
+    test.add("g");
+    test.add("T");
+    test.add("U");
+    for (String i : test)
+    {
+      for (String j : test)
+      {
+        System.out.println(i + "-" + j + ": "
+                + StructureFrequency.checkBpType(i.charAt(0), j.charAt(0)));
+      }
+    }
+  }
+}
diff --git a/src/jalview/analysis/WUSSParseException.java b/src/jalview/analysis/WUSSParseException.java
new file mode 100644 (file)
index 0000000..c8ade0c
--- /dev/null
@@ -0,0 +1,19 @@
+package jalview.analysis;
+
+public class WUSSParseException extends Exception {
+  private long problemPos;
+  public WUSSParseException(long problemPos)
+  {
+    this("Invalid WUSS Notation", problemPos);
+  }
+  public WUSSParseException(String message, long problemPos)
+  {
+    super(message+" at or near position "+problemPos);
+    this.problemPos=problemPos;
+  }
+  public long getProblemPos()
+  {
+    return problemPos;
+  }
+  
+}
\ No newline at end of file
diff --git a/src/jalview/api/AlignCalcManagerI.java b/src/jalview/api/AlignCalcManagerI.java
new file mode 100644 (file)
index 0000000..e9b625b
--- /dev/null
@@ -0,0 +1,108 @@
+package jalview.api;
+
+import java.util.List;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+public interface AlignCalcManagerI
+{
+
+  
+  /**
+   * tell manager that a worker is initialised and has started to run
+   * @param worker
+   */
+  void notifyStart(AlignCalcWorkerI worker);
+
+  /**
+   * check if a calculation of this type is already active
+   * @param worker
+   * @return
+   */
+  boolean alreadyDoing(AlignCalcWorkerI worker);
+
+  /**
+   * tell manager that worker is now processing data
+   * @param worker
+   */
+  boolean notifyWorking(AlignCalcWorkerI worker);
+
+
+  /**
+   * notify manager that the worker has completed, and results may be ready to collect
+   * @param worker
+   */
+  void workerComplete(AlignCalcWorkerI worker);
+
+  /**
+   * indicate that a worker like this cannot run on the platform and shouldn't be started again
+   * @param worker
+   */
+  void workerCannotRun(AlignCalcWorkerI worker);
+
+  /**
+   * indicate that a worker like this may be run on the platform.  
+   * @param worker of class to be removed from the execution blacklist
+   */
+  void workerMayRun(AlignCalcWorkerI worker);
+  /**
+   * launch a new worker
+   * @param worker
+   */
+  void startWorker(AlignCalcWorkerI worker);
+
+  /**
+   * 
+   * @param worker
+   * @return
+   */
+  boolean isWorking(AlignCalcWorkerI worker);
+
+  /**
+   * if any worker thread is operational, return true!
+   * @return
+   */
+  boolean isWorking();
+
+  
+  /**
+   * register a restartable worker
+   * @param worker
+   */
+  void registerWorker(AlignCalcWorkerI worker);
+
+  /**
+   * restart any registered workers 
+   */
+  void restartWorkers();
+
+  /**
+   * 
+   * @param alignmentAnnotation
+   * @return true if a currently registered and working worker indicates its involvement with the given alignmentAnnotation
+   */
+  boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
+
+  /**
+   * kick any known instances of the given worker class to update their annotation 
+   * @param workerClass
+   */
+  void updateAnnotationFor(Class workerClass);
+
+  /**
+   * return any registered workers of the given class 
+   * @param workerClass
+   * @return null or one or more workers of the given class
+   */
+  List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
+          Class workerClass);
+
+  /**
+   * start any workers of the given class
+   * @param workerClass
+   * @return false if no workers of given class were registered
+   * (note - blacklisted classes cannot be restarted, so this method will return true for blacklisted workers)
+   */
+  boolean startRegisteredWorkersOfClass(Class workerClass);
+
+}
diff --git a/src/jalview/api/AlignCalcWorkerI.java b/src/jalview/api/AlignCalcWorkerI.java
new file mode 100644 (file)
index 0000000..00f967a
--- /dev/null
@@ -0,0 +1,11 @@
+package jalview.api;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+public interface AlignCalcWorkerI extends Runnable
+{
+
+  public boolean involves(AlignmentAnnotation annot);
+
+  public void updateAnnotation();
+}
diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java
new file mode 100644 (file)
index 0000000..6688e27
--- /dev/null
@@ -0,0 +1,103 @@
+/**
+ * 
+ */
+package jalview.api;
+
+import java.util.Hashtable;
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.RNAHelicesColour;
+
+/**
+ * @author jimp
+ *
+ */
+public interface AlignViewportI
+{
+
+  int getCharWidth();
+
+  int getEndRes();
+
+  int getCharHeight();
+
+  boolean hasHiddenColumns();
+
+  boolean isValidCharWidth();
+
+  boolean isShowConsensusHistogram();
+
+  boolean isShowSequenceLogo();
+
+  boolean isNormaliseSequenceLogo();
+
+  ColourSchemeI getGlobalColourScheme();
+
+  AlignmentI getAlignment();
+
+  ColumnSelection getColumnSelection();
+
+  Hashtable[] getSequenceConsensusHash();
+
+  Hashtable[] getRnaStructureConsensusHash();
+
+  boolean getIgnoreGapsConsensus();
+
+  boolean getCentreColumnLabels();
+
+  boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
+
+  AlignmentAnnotation getAlignmentQualityAnnot();
+
+  AlignmentAnnotation getAlignmentConservationAnnotation();
+  /**
+   * get the container for alignment consensus annotation
+   * @return
+   */
+  AlignmentAnnotation getAlignmentConsensusAnnotation();
+
+  /**
+   * Test to see if viewport is still open and active
+   * @return true indicates that all references to viewport should be dropped 
+   */
+  boolean isClosed();
+  /**
+   * get the associated calculation thread manager for the view
+   * @return
+   */
+  AlignCalcManagerI getCalcManager();
+  
+  /**
+   * get the percentage gaps allowed in a conservation calculation
+   * 
+   */
+  public int getConsPercGaps();
+
+  /**
+   * set the consensus result object for the viewport
+   * @param hconsensus
+   */
+  void setSequenceConsensusHash(Hashtable[] hconsensus);
+
+  /**
+   * 
+   * @return the alignment annotatino row for the structure consensus calculation
+   */
+  AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
+
+  /**
+   * set the Rna structure consensus result object for the viewport
+   * @param hStrucConsensus 
+   */
+  void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
+
+  /**
+   * set global colourscheme
+   * @param rhc
+   */
+  void setGlobalColourScheme(ColourSchemeI rhc);
+
+}
index a7acc66..70bb3d6 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
@@ -26,9 +26,20 @@ import jalview.structure.StructureSelectionManager;
  * @author JimP
  *
  */
-public interface AlignmentViewPanel
+public interface AlignmentViewPanel extends OOMHandlerI
 {
 
   AlignmentI getAlignment();
   StructureSelectionManager getStructureSelectionManager();
+  /**
+   * repaint the alignment view after a datamodel update.
+   * @param updateOverview - if true, the overview panel will also be updated and repainted 
+   */
+  
+  void paintAlignment(boolean updateOverview);
+  /**
+   * automatically adjust annotation panel height for new annotation
+   * whilst ensuring the alignment is still visible.
+   */
+  void adjustAnnotationHeight();
 }
index fe3786d..5e237ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/api/OOMHandlerI.java b/src/jalview/api/OOMHandlerI.java
new file mode 100644 (file)
index 0000000..c14b4f7
--- /dev/null
@@ -0,0 +1,8 @@
+package jalview.api;
+
+public interface OOMHandlerI
+{
+
+  void raiseOOMWarning(String string, OutOfMemoryError error);
+
+}
index a4ec373..dcc50d5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b5938bb..89cebe5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e89aeb5..efe63be 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 0727b0c..b45fa6b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -157,7 +157,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
       showColourText.setState(sg.getColourText());
       showBoxes.setState(sg.getDisplayBoxes());
       displayNonconserved.setState(sg.getShowNonconserved());
-      if (!ap.av.alignment.getGroups().contains(sg))
+      if (!ap.av.getAlignment().getGroups().contains(sg))
       {
         groupMenu.remove(unGroupMenuItem);
       }
@@ -300,12 +300,12 @@ public class APopupMenu extends java.awt.PopupMenu implements
       remove(seqMenu);
     }
 
-    if (!ap.av.hasHiddenRows)
+    if (!ap.av.hasHiddenRows())
     {
       remove(revealAll);
       remove(revealSeq);
     } else {
-      final int index = ap.av.alignment.findIndex(seq);
+      final int index = ap.av.getAlignment().findIndex(seq);
 
       if (ap.av.adjustForHiddenSeqs(index)
               - ap.av.adjustForHiddenSeqs(index - 1) > 1)
@@ -513,8 +513,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
           EditCommand editCommand = new EditCommand("Edit Sequences",
                   EditCommand.REPLACE, dialog.getName().replace(' ',
                           ap.av.getGapCharacter()),
-                  sg.getSequencesAsArray(ap.av.hiddenRepSequences),
-                  sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
+                  sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
+                  sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
 
           ap.alignFrame.addHistoryItem(editCommand);
 
@@ -529,44 +529,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
       Vector regions = new Vector();
       if (sg != null)
       {
-        int start = sg.getStartRes();
-        int end = sg.getEndRes() + 1;
-
-        do
-        {
-          if (ap.av.hasHiddenColumns)
-          {
-            if (start == 0)
-            {
-              start = ap.av.colSel.adjustForHiddenColumns(start);
-            }
-
-            end = ap.av.colSel.getHiddenBoundaryRight(start);
-            if (start == end)
-            {
-              end = sg.getEndRes() + 1;
-            }
-            if (end > sg.getEndRes())
-            {
-              end = sg.getEndRes() + 1;
-            }
-          }
-
-          regions.addElement(new int[]
-          { start, end });
-
-          if (ap.av.hasHiddenColumns)
-          {
-            start = ap.av.colSel.adjustForHiddenColumns(end);
-            start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1;
-          }
-        } while (end < sg.getEndRes());
-
-        int[][] startEnd = new int[regions.size()][2];
-        for (int i = 0; i < regions.size(); i++)
-        {
-          startEnd[i] = (int[]) regions.elementAt(i);
-        }
+        int[][] startEnd = ap.av.getVisibleRegionBoundaries(sg.getStartRes(),
+                sg.getEndRes() + 1);
 
         String description;
         int caseChange;
@@ -588,7 +552,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
         }
 
         ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
-                sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
+                sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), startEnd,
                 caseChange);
 
         ap.alignFrame.addHistoryItem(caseCommand);
@@ -652,6 +616,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
     frame.add(cap);
     jalview.bin.JalviewLite.addFrame(frame,
             "Selection output - " + e.getActionCommand(), 600, 500);
+    // JBPNote: getSelectionAsNewSequence behaviour has changed - this method now returns a full copy of sequence data
+    // TODO consider using getSequenceSelection instead here
 
     cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(
             e.getActionCommand(),
@@ -833,8 +799,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
   {
     SequenceGroup sg = getGroup();
     sg.cs = new ClustalxColourScheme(
-            sg.getSequences(ap.av.hiddenRepSequences),
-            ap.av.alignment.getWidth());
+            sg.getSequences(ap.av.getHiddenRepSequences()),
+            ap.av.getAlignment().getWidth());
     refresh();
   }
 
@@ -897,8 +863,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
     if (abovePIDColour.getState())
     {
       sg.cs.setConsensus(AAFrequency.calculate(
-              sg.getSequences(ap.av.hiddenRepSequences), 0,
-              ap.av.alignment.getWidth()));
+              sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+              ap.av.getAlignment().getWidth()));
       int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
               .getName());
 
@@ -927,8 +893,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
     SequenceGroup sg = getGroup();
     sg.cs = new PIDColourScheme();
     sg.cs.setConsensus(AAFrequency.calculate(
-            sg.getSequences(ap.av.hiddenRepSequences), 0,
-            ap.av.alignment.getWidth()));
+            sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+            ap.av.getAlignment().getWidth()));
     refresh();
   }
 
@@ -939,8 +905,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
     sg.cs = new Blosum62ColourScheme();
 
     sg.cs.setConsensus(AAFrequency.calculate(
-            sg.getSequences(ap.av.hiddenRepSequences), 0,
-            ap.av.alignment.getWidth()));
+            sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+            ap.av.getAlignment().getWidth()));
 
     refresh();
   }
@@ -962,16 +928,11 @@ public class APopupMenu extends java.awt.PopupMenu implements
     if (conservationMenuItem.getState())
     {
 
-      Conservation c = new Conservation("Group",
+      sg.cs.setConservation(Conservation.calculateConservation("Group",
               ResidueProperties.propHash, 3,
-              sg.getSequences(ap.av.hiddenRepSequences), 0,
-              ap.av.alignment.getWidth());
-
-      c.calculate();
-      c.verdict(false, ap.av.ConsPercGaps);
-
-      sg.cs.setConservation(c);
-
+              sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+              ap.av.getAlignment().getWidth(),
+              false, ap.av.getConsPercGaps(),false));
       SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
       SliderPanel.showConservationSlider();
     }
@@ -991,7 +952,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
     // this method won't add a new group if it already exists
     if (sg != null)
     {
-      ap.av.alignment.addGroup(sg);
+      ap.av.getAlignment().addGroup(sg);
     }
 
     return sg;
@@ -1000,7 +961,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
   void unGroupMenuItem_actionPerformed()
   {
     SequenceGroup sg = ap.av.getSelectionGroup();
-    ap.av.alignment.deleteGroup(sg);
+    ap.av.getAlignment().deleteGroup(sg);
     ap.av.setSelectionGroup(null);
     ap.paintAlignment(true);
   }
index 5790bc3..ea5ead8 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -69,12 +69,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     viewport.updateConsensus(alignPanel);\r
 \r
     annotationPanelMenuItem.setState(viewport.showAnnotation);\r
-    displayNonconservedMenuItem.setState(viewport.getShowunconserved());\r
+    displayNonconservedMenuItem.setState(viewport.getShowUnconserved());\r
     followMouseOverFlag.setState(viewport.getFollowHighlight());\r
-    showGroupConsensus.setState(viewport.showGroupConsensus);\r
-    showGroupConservation.setState(viewport.showGroupConservation);\r
-    showConsensusHistogram.setState(viewport.showConsensusHistogram);\r
-    showSequenceLogo.setState(viewport.showSequenceLogo);\r
+    showGroupConsensus.setState(viewport.isShowGroupConsensus());\r
+    showGroupConservation.setState(viewport.isShowGroupConservation());\r
+    showConsensusHistogram.setState(viewport.isShowConsensusHistogram());\r
+    showSequenceLogo.setState(viewport.isShowSequenceLogo());\r
 \r
     seqLimits.setState(viewport.showJVSuffix);\r
 \r
@@ -131,7 +131,20 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       }\r
 \r
     }\r
-\r
+    if (viewport.getAlignment().isNucleotide())\r
+    {\r
+      viewport.updateStrucConsensus(alignPanel);\r
+      if (viewport.getAlignment().hasRNAStructure())\r
+      {\r
+        RNAHelixColour.setEnabled(true);\r
+      }\r
+      else {\r
+        RNAHelixColour.setEnabled(false);\r
+      }\r
+    } else {\r
+      RNAHelixColour.setEnabled(false);\r
+      purinePyrimidineColour.setEnabled(false);\r
+    }\r
     // Some JVMS send keyevents to Top frame or lowest panel,\r
     // Havent worked out why yet. So add to both this frame and seqCanvas for\r
     // now\r
@@ -186,7 +199,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     try\r
     {\r
       featuresFile = new jalview.io.FeaturesFile(file, type)\r
-              .parse(viewport.alignment,\r
+              .parse(viewport.getAlignment(),\r
                       alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,\r
                       featureLinks, true, viewport.applet.getDefaultParameter("relaxedidmatch", false));\r
     } catch (Exception ex)\r
@@ -488,7 +501,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       // Hide everything by the current selection - this is a hack - we do the\r
       // invert and then hide\r
       // first check that there will be visible columns after the invert.\r
-      if ((viewport.colSel != null && viewport.colSel.getSelected() != null && viewport.colSel\r
+      if ((viewport.getColumnSelection() != null && viewport.getColumnSelection().getSelected() != null && viewport.getColumnSelection()\r
               .getSelected().size() > 0)\r
               || (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg\r
                       .getEndRes()))\r
@@ -512,12 +525,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     if (toggleSeqs)\r
     {\r
-      if (sg != null && sg.getSize() != viewport.alignment.getHeight())\r
+      if (sg != null && sg.getSize() != viewport.getAlignment().getHeight())\r
       {\r
         hide = true;\r
         viewport.hideAllSelectedSeqs();\r
       }\r
-      else if (!(toggleCols && viewport.colSel.getSelected().size() > 0))\r
+      else if (!(toggleCols && viewport.getColumnSelection().getSelected().size() > 0))\r
       {\r
         viewport.showAllHiddenSeqs();\r
       }\r
@@ -525,12 +538,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     if (toggleCols)\r
     {\r
-      if (viewport.colSel.getSelected().size() > 0)\r
+      if (viewport.getColumnSelection().getSelected().size() > 0)\r
       {\r
         viewport.hideSelectedColumns();\r
         if (!toggleSeqs)\r
         {\r
-          viewport.selectionGroup = sg;\r
+          viewport.setSelectionGroup(sg);\r
         }\r
       }\r
       else if (!hide)\r
@@ -614,7 +627,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     }\r
     else if (evt.getSource() == autoCalculate)\r
     {\r
-      viewport.autocalculateConsensus = autoCalculate.getState();\r
+      viewport.autoCalculateConsensus = autoCalculate.getState();\r
     }\r
     else if (evt.getSource() == sortByTree)\r
     {\r
@@ -864,7 +877,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     else if (source == alProperties)\r
     {\r
       StringBuffer contents = new jalview.io.AlignmentProperties(\r
-              viewport.alignment).formatAsString();\r
+              viewport.getAlignment()).formatAsString();\r
       CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this);\r
       cap.setText(contents.toString());\r
       Frame frame = new Frame();\r
@@ -884,8 +897,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {\r
       abovePIDThreshold.setState(false);\r
       changeColour(new ClustalxColourScheme(\r
-              viewport.alignment.getSequences(),\r
-              viewport.alignment.getWidth()));\r
+              viewport.getAlignment().getSequences(),\r
+              viewport.getAlignment().getWidth()));\r
     }\r
     else if (source == zappoColour)\r
     {\r
@@ -919,6 +932,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {\r
       changeColour(new NucleotideColourScheme());\r
     }\r
+    else if (source == purinePyrimidineColour)\r
+    {\r
+      changeColour(new PurinePyrimidineColourScheme());\r
+    }\r
+    else if (source == RNAHelixColour)\r
+    {\r
+      new RNAHelicesColourChooser(viewport, alignPanel);\r
+    }\r
     else if (source == modifyPID)\r
     {\r
       modifyPID_actionPerformed();\r
@@ -1032,10 +1053,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   public String outputAnnotations(boolean displayTextbox)\r
   {\r
     String annotation = new AnnotationFile().printAnnotations(\r
-            viewport.showAnnotation ? viewport.alignment\r
-                    .getAlignmentAnnotation() : null, viewport.alignment\r
+            viewport.showAnnotation ? viewport.getAlignment()\r
+                    .getAlignmentAnnotation() : null, viewport.getAlignment()\r
                     .getGroups(),\r
-            ((Alignment) viewport.alignment).alignmentProperties);\r
+            ((Alignment) viewport.getAlignment()).alignmentProperties);\r
 \r
     if (displayTextbox)\r
     {\r
@@ -1072,13 +1093,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     if (format.equalsIgnoreCase("Jalview"))\r
     {\r
       features = new FeaturesFile().printJalviewFormat(\r
-              viewport.alignment.getSequencesArray(),\r
+              viewport.getAlignment().getSequencesArray(),\r
               getDisplayedFeatureCols());\r
     }\r
     else\r
     {\r
       features = new FeaturesFile().printGFFFormat(\r
-              viewport.alignment.getSequencesArray(),\r
+              viewport.getAlignment().getSequencesArray(),\r
               getDisplayedFeatureCols());\r
     }\r
 \r
@@ -1254,7 +1275,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       viewport.historyList.push(command);\r
       viewport.redoList.removeAllElements();\r
       updateEditMenuBar();\r
-      viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+      viewport.updateHiddenColumns();\r
     }\r
   }\r
 \r
@@ -1276,11 +1297,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     command.undoCommand(null);\r
 \r
     AlignViewport originalSource = getOriginatingSource(command);\r
-\r
-    originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+    // JBPNote Test\r
+    if (originalSource!=viewport) {\r
+      System.err.println("Warning: Viewport object mismatch whilst undoing");\r
+    }\r
+    originalSource.updateHiddenColumns(); //    originalSource.hasHiddenColumns = viewport.getColumnSelection().getHiddenColumns() != null;\r
     updateEditMenuBar();\r
     originalSource.firePropertyChange("alignment", null,\r
-            originalSource.alignment.getSequences());\r
+            originalSource.getAlignment().getSequences());\r
   }\r
 \r
   /**\r
@@ -1301,11 +1325,15 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     command.doCommand(null);\r
 \r
     AlignViewport originalSource = getOriginatingSource(command);\r
-    originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+    // JBPNote Test\r
+    if (originalSource!=viewport) {\r
+      System.err.println("Warning: Viewport object mismatch whilst re-doing");\r
+    }\r
+    originalSource.updateHiddenColumns(); //sethasHiddenColumns(); = viewport.getColumnSelection().getHiddenColumns() != null;\r
 \r
     updateEditMenuBar();\r
     originalSource.firePropertyChange("alignment", null,\r
-            originalSource.alignment.getSequences());\r
+            originalSource.getAlignment().getSequences());\r
   }\r
 \r
   AlignViewport getOriginatingSource(CommandI command)\r
@@ -1325,7 +1353,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       {\r
         if (comps.elementAt(i) instanceof AlignmentPanel)\r
         {\r
-          if (al == ((AlignmentPanel) comps.elementAt(i)).av.alignment)\r
+          if (al == ((AlignmentPanel) comps.elementAt(i)).av.getAlignment())\r
           {\r
             originalSource = ((AlignmentPanel) comps.elementAt(i)).av;\r
             break;\r
@@ -1340,7 +1368,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       // the current view against the closed view first\r
       if (al != null)\r
       {\r
-        PaintRefresher.validateSequences(al, viewport.alignment);\r
+        PaintRefresher.validateSequences(al, viewport.getAlignment());\r
       }\r
 \r
       originalSource = viewport;\r
@@ -1359,42 +1387,42 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     if (up)\r
     {\r
-      for (int i = 1; i < viewport.alignment.getHeight(); i++)\r
+      for (int i = 1; i < viewport.getAlignment().getHeight(); i++)\r
       {\r
-        SequenceI seq = viewport.alignment.getSequenceAt(i);\r
+        SequenceI seq = viewport.getAlignment().getSequenceAt(i);\r
         if (!sg.getSequences(null).contains(seq))\r
         {\r
           continue;\r
         }\r
 \r
-        SequenceI temp = viewport.alignment.getSequenceAt(i - 1);\r
+        SequenceI temp = viewport.getAlignment().getSequenceAt(i - 1);\r
         if (sg.getSequences(null).contains(temp))\r
         {\r
           continue;\r
         }\r
 \r
-        viewport.alignment.getSequences().setElementAt(temp, i);\r
-        viewport.alignment.getSequences().setElementAt(seq, i - 1);\r
+        viewport.getAlignment().getSequences().setElementAt(temp, i);\r
+        viewport.getAlignment().getSequences().setElementAt(seq, i - 1);\r
       }\r
     }\r
     else\r
     {\r
-      for (int i = viewport.alignment.getHeight() - 2; i > -1; i--)\r
+      for (int i = viewport.getAlignment().getHeight() - 2; i > -1; i--)\r
       {\r
-        SequenceI seq = viewport.alignment.getSequenceAt(i);\r
-        if (!sg.getSequences(viewport.hiddenRepSequences).contains(seq))\r
+        SequenceI seq = viewport.getAlignment().getSequenceAt(i);\r
+        if (!sg.getSequences(viewport.getHiddenRepSequences()).contains(seq))\r
         {\r
           continue;\r
         }\r
 \r
-        SequenceI temp = viewport.alignment.getSequenceAt(i + 1);\r
-        if (sg.getSequences(viewport.hiddenRepSequences).contains(temp))\r
+        SequenceI temp = viewport.getAlignment().getSequenceAt(i + 1);\r
+        if (sg.getSequences(viewport.getHiddenRepSequences()).contains(temp))\r
         {\r
           continue;\r
         }\r
 \r
-        viewport.alignment.getSequences().setElementAt(temp, i);\r
-        viewport.alignment.getSequences().setElementAt(seq, i + 1);\r
+        viewport.getAlignment().getSequences().setElementAt(temp, i);\r
+        viewport.getAlignment().getSequences().setElementAt(seq, i + 1);\r
       }\r
     }\r
 \r
@@ -1406,15 +1434,15 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     Vector sg = new Vector();\r
     if (viewport.cursorMode)\r
     {\r
-      sg.addElement(viewport.alignment\r
+      sg.addElement(viewport.getAlignment()\r
               .getSequenceAt(alignPanel.seqPanel.seqCanvas.cursorY));\r
     }\r
     else if (viewport.getSelectionGroup() != null\r
-            && viewport.getSelectionGroup().getSize() != viewport.alignment\r
+            && viewport.getSelectionGroup().getSize() != viewport.getAlignment()\r
                     .getHeight())\r
     {\r
       sg = viewport.getSelectionGroup().getSequences(\r
-              viewport.hiddenRepSequences);\r
+              viewport.getHiddenRepSequences());\r
     }\r
 \r
     if (sg.size() < 1)\r
@@ -1424,10 +1452,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     Vector invertGroup = new Vector();\r
 \r
-    for (int i = 0; i < viewport.alignment.getHeight(); i++)\r
+    for (int i = 0; i < viewport.getAlignment().getHeight(); i++)\r
     {\r
-      if (!sg.contains(viewport.alignment.getSequenceAt(i)))\r
-        invertGroup.addElement(viewport.alignment.getSequenceAt(i));\r
+      if (!sg.contains(viewport.getAlignment().getSequenceAt(i)))\r
+        invertGroup.addElement(viewport.getAlignment().getSequenceAt(i));\r
     }\r
 \r
     SequenceI[] seqs1 = new SequenceI[sg.size()];\r
@@ -1502,14 +1530,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     for (int i = 0; i < sg.getSize(); i++)\r
     {\r
       SequenceI seq = sg.getSequenceAt(i);\r
-      int index = viewport.alignment.findIndex(seq);\r
+      int index = viewport.getAlignment().findIndex(seq);\r
       orderedSeqs.put(index + "", seq);\r
     }\r
 \r
     int index = 0, startRes, endRes;\r
     char ch;\r
 \r
-    if (viewport.hasHiddenColumns && viewport.getSelectionGroup() != null)\r
+    if (viewport.hasHiddenColumns() && viewport.getSelectionGroup() != null)\r
     {\r
       copiedHiddenColumns = new Vector();\r
       int hiddenOffset = viewport.getSelectionGroup().getStartRes();\r
@@ -1656,17 +1684,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   {\r
     for (int i = 0; i < seqs.length; i++)\r
     {\r
-      viewport.alignment.addSequence(seqs[i]);\r
+      viewport.getAlignment().addSequence(seqs[i]);\r
     }\r
 \r
     // !newAlignment\r
     addHistoryItem(new EditCommand("Add sequences", EditCommand.PASTE,\r
-            seqs, 0, viewport.alignment.getWidth(), viewport.alignment));\r
+            seqs, 0, viewport.getAlignment().getWidth(), viewport.getAlignment()));\r
 \r
-    viewport.setEndSeq(viewport.alignment.getHeight());\r
-    viewport.alignment.getWidth();\r
+    viewport.setEndSeq(viewport.getAlignment().getHeight());\r
+    viewport.getAlignment().getWidth();\r
     viewport.firePropertyChange("alignment", null,\r
-            viewport.alignment.getSequences());\r
+            viewport.getAlignment().getSequences());\r
 \r
   }\r
 \r
@@ -1694,7 +1722,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     }\r
 \r
     // If the cut affects all sequences, remove highlighted columns\r
-    if (sg.getSize() == viewport.alignment.getHeight())\r
+    if (sg.getSize() == viewport.getAlignment().getHeight())\r
     {\r
       viewport.getColumnSelection().removeElements(sg.getStartRes(),\r
               sg.getEndRes() + 1);\r
@@ -1711,10 +1739,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
      */\r
     addHistoryItem(new EditCommand("Cut Sequences", EditCommand.CUT, cut,\r
             sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,\r
-            viewport.alignment));\r
+            viewport.getAlignment()));\r
 \r
     viewport.setSelectionGroup(null);\r
-    viewport.alignment.deleteGroup(sg);\r
+    viewport.getAlignment().deleteGroup(sg);\r
 \r
     viewport.firePropertyChange("alignment", null, viewport.getAlignment()\r
             .getSequences());\r
@@ -1784,8 +1812,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
               viewport.getSequenceSelection(),\r
               viewport.getAlignmentView(true).getSequenceStrings(\r
                       viewport.getGapCharacter()),\r
-              viewport.alignment.getGroups());\r
-      viewport.alignment.deleteAllGroups();\r
+              viewport.getAlignment().getGroups());\r
+      viewport.getAlignment().deleteAllGroups();\r
       viewport.sequenceColours = null;\r
       viewport.setSelectionGroup(null);\r
       // set view properties for each group\r
@@ -1793,7 +1821,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       {\r
         // gps[g].setShowunconserved(viewport.getShowUnconserved());\r
         gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());\r
-        viewport.alignment.addGroup(gps[g]);\r
+        viewport.getAlignment().addGroup(gps[g]);\r
         Color col = new Color((int) (Math.random() * 255),\r
                 (int) (Math.random() * 255), (int) (Math.random() * 255));\r
         col = col.brighter();\r
@@ -1810,7 +1838,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
   protected void deleteGroups_actionPerformed()\r
   {\r
-    viewport.alignment.deleteAllGroups();\r
+    viewport.getAlignment().deleteAllGroups();\r
     viewport.sequenceColours = null;\r
     viewport.setSelectionGroup(null);\r
 \r
@@ -1824,7 +1852,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {\r
       sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);\r
     }\r
-    sg.setEndRes(viewport.alignment.getWidth() - 1);\r
+    sg.setEndRes(viewport.getAlignment().getWidth() - 1);\r
     viewport.setSelectionGroup(sg);\r
     alignPanel.paintAlignment(true);\r
     PaintRefresher.Refresh(alignPanel, viewport.getSequenceSetId());\r
@@ -1888,11 +1916,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       if (viewport.getSelectionGroup() != null)\r
       {\r
         seqs = viewport.getSelectionGroup().getSequencesAsArray(\r
-                viewport.hiddenRepSequences);\r
+                viewport.getHiddenRepSequences());\r
       }\r
       else\r
       {\r
-        seqs = viewport.alignment.getSequencesArray();\r
+        seqs = viewport.getAlignment().getSequencesArray();\r
       }\r
 \r
       TrimRegionCommand trimRegion;\r
@@ -1900,23 +1928,23 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       {\r
         trimRegion = new TrimRegionCommand("Remove Left",\r
                 TrimRegionCommand.TRIM_LEFT, seqs, column,\r
-                viewport.alignment, viewport.colSel,\r
-                viewport.selectionGroup);\r
+                viewport.getAlignment(), viewport.getColumnSelection(),\r
+                viewport.getSelectionGroup());\r
         viewport.setStartRes(0);\r
       }\r
       else\r
       {\r
         trimRegion = new TrimRegionCommand("Remove Right",\r
                 TrimRegionCommand.TRIM_RIGHT, seqs, column,\r
-                viewport.alignment, viewport.colSel,\r
-                viewport.selectionGroup);\r
+                viewport.getAlignment(), viewport.getColumnSelection(),\r
+                viewport.getSelectionGroup());\r
       }\r
 \r
       statusBar.setText("Removed " + trimRegion.getSize() + " columns.");\r
 \r
       addHistoryItem(trimRegion);\r
 \r
-      Vector groups = viewport.alignment.getGroups();\r
+      Vector groups = viewport.getAlignment().getGroups();\r
 \r
       for (int i = 0; i < groups.size(); i++)\r
       {\r
@@ -1925,7 +1953,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         if ((trimLeft && !sg.adjustForRemoveLeft(column))\r
                 || (!trimLeft && !sg.adjustForRemoveRight(column)))\r
         {\r
-          viewport.alignment.deleteGroup(sg);\r
+          viewport.getAlignment().deleteGroup(sg);\r
         }\r
       }\r
 \r
@@ -1936,23 +1964,23 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
   public void removeGappedColumnMenuItem_actionPerformed()\r
   {\r
-    int start = 0, end = viewport.alignment.getWidth() - 1;\r
+    int start = 0, end = viewport.getAlignment().getWidth() - 1;\r
 \r
     SequenceI[] seqs;\r
     if (viewport.getSelectionGroup() != null)\r
     {\r
       seqs = viewport.getSelectionGroup().getSequencesAsArray(\r
-              viewport.hiddenRepSequences);\r
+              viewport.getHiddenRepSequences());\r
       start = viewport.getSelectionGroup().getStartRes();\r
       end = viewport.getSelectionGroup().getEndRes();\r
     }\r
     else\r
     {\r
-      seqs = viewport.alignment.getSequencesArray();\r
+      seqs = viewport.getAlignment().getSequencesArray();\r
     }\r
 \r
     RemoveGapColCommand removeGapCols = new RemoveGapColCommand(\r
-            "Remove Gapped Columns", seqs, start, end, viewport.alignment);\r
+            "Remove Gapped Columns", seqs, start, end, viewport.getAlignment());\r
 \r
     addHistoryItem(removeGapCols);\r
 \r
@@ -1961,7 +1989,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     // This is to maintain viewport position on first residue\r
     // of first sequence\r
-    SequenceI seq = viewport.alignment.getSequenceAt(0);\r
+    SequenceI seq = viewport.getAlignment().getSequenceAt(0);\r
     int startRes = seq.findPosition(viewport.startRes);\r
     // ShiftList shifts;\r
     // viewport.getAlignment().removeGaps(shifts=new ShiftList());\r
@@ -1976,28 +2004,28 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
   public void removeAllGapsMenuItem_actionPerformed()\r
   {\r
-    int start = 0, end = viewport.alignment.getWidth() - 1;\r
+    int start = 0, end = viewport.getAlignment().getWidth() - 1;\r
 \r
     SequenceI[] seqs;\r
     if (viewport.getSelectionGroup() != null)\r
     {\r
       seqs = viewport.getSelectionGroup().getSequencesAsArray(\r
-              viewport.hiddenRepSequences);\r
+              viewport.getHiddenRepSequences());\r
       start = viewport.getSelectionGroup().getStartRes();\r
       end = viewport.getSelectionGroup().getEndRes();\r
     }\r
     else\r
     {\r
-      seqs = viewport.alignment.getSequencesArray();\r
+      seqs = viewport.getAlignment().getSequencesArray();\r
     }\r
 \r
     // This is to maintain viewport position on first residue\r
     // of first sequence\r
-    SequenceI seq = viewport.alignment.getSequenceAt(0);\r
+    SequenceI seq = viewport.getAlignment().getSequenceAt(0);\r
     int startRes = seq.findPosition(viewport.startRes);\r
 \r
     addHistoryItem(new RemoveGapsCommand("Remove Gaps", seqs, start, end,\r
-            viewport.alignment));\r
+            viewport.getAlignment()));\r
 \r
     viewport.setStartRes(seq.findIndex(startRes) - 1);\r
 \r
@@ -2020,30 +2048,30 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   public AlignFrame newView(String viewtitle)\r
   {\r
     AlignmentI newal;\r
-    if (viewport.hasHiddenRows)\r
+    if (viewport.hasHiddenRows())\r
     {\r
       newal = new Alignment(viewport.getAlignment().getHiddenSequences()\r
               .getFullAlignment().getSequencesArray());\r
     }\r
     else\r
     {\r
-      newal = new Alignment(viewport.alignment.getSequencesArray());\r
+      newal = new Alignment(viewport.getAlignment().getSequencesArray());\r
     }\r
 \r
-    if (viewport.alignment.getAlignmentAnnotation() != null)\r
+    if (viewport.getAlignment().getAlignmentAnnotation() != null)\r
     {\r
-      for (int i = 0; i < viewport.alignment.getAlignmentAnnotation().length; i++)\r
+      for (int i = 0; i < viewport.getAlignment().getAlignmentAnnotation().length; i++)\r
       {\r
-        if (!viewport.alignment.getAlignmentAnnotation()[i].autoCalculated)\r
+        if (!viewport.getAlignment().getAlignmentAnnotation()[i].autoCalculated)\r
         {\r
-          newal.addAnnotation(viewport.alignment.getAlignmentAnnotation()[i]);\r
+          newal.addAnnotation(viewport.getAlignment().getAlignmentAnnotation()[i]);\r
         }\r
       }\r
     }\r
 \r
     AlignFrame newaf = new AlignFrame(newal, viewport.applet, "", false);\r
 \r
-    newaf.viewport.sequenceSetID = alignPanel.av.getSequenceSetId();\r
+    newaf.viewport.setSequenceSetId(alignPanel.av.getSequenceSetId());\r
     PaintRefresher.Register(alignPanel, alignPanel.av.getSequenceSetId());\r
     PaintRefresher.Register(newaf.alignPanel,\r
             newaf.alignPanel.av.getSequenceSetId());\r
@@ -2223,13 +2251,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       if (viewport.getConservationSelected())\r
       {\r
 \r
-        Alignment al = (Alignment) viewport.alignment;\r
+        Alignment al = (Alignment) viewport.getAlignment();\r
         Conservation c = new Conservation("All",\r
                 ResidueProperties.propHash, 3, al.getSequences(), 0,\r
                 al.getWidth() - 1);\r
 \r
         c.calculate();\r
-        c.verdict(false, viewport.ConsPercGaps);\r
+        c.verdict(false, viewport.getConsPercGaps());\r
 \r
         cs.setConservation(c);\r
 \r
@@ -2242,14 +2270,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         cs.setConservation(null);\r
       }\r
 \r
-      cs.setConsensus(viewport.hconsensus);\r
+      cs.setConsensus(viewport.getSequenceConsensusHash());\r
 \r
     }\r
     viewport.setGlobalColourScheme(cs);\r
 \r
     if (viewport.getColourAppliesToAllGroups())\r
     {\r
-      Vector groups = viewport.alignment.getGroups();\r
+      Vector groups = viewport.getAlignment().getGroups();\r
       for (int i = 0; i < groups.size(); i++)\r
       {\r
         SequenceGroup sg = (SequenceGroup) groups.elementAt(i);\r
@@ -2262,7 +2290,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         if (cs instanceof ClustalxColourScheme)\r
         {\r
           sg.cs = new ClustalxColourScheme(\r
-                  sg.getSequences(viewport.hiddenRepSequences),\r
+                  sg.getSequences(viewport.getHiddenRepSequences()),\r
                   sg.getWidth());\r
         }\r
         else\r
@@ -2283,7 +2311,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         {\r
           sg.cs.setThreshold(threshold, viewport.getIgnoreGapsConsensus());\r
           sg.cs.setConsensus(AAFrequency.calculate(\r
-                  sg.getSequences(viewport.hiddenRepSequences), 0,\r
+                  sg.getSequences(viewport.getHiddenRepSequences()), 0,\r
                   sg.getWidth()));\r
         }\r
         else\r
@@ -2295,10 +2323,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         {\r
           Conservation c = new Conservation("Group",\r
                   ResidueProperties.propHash, 3,\r
-                  sg.getSequences(viewport.hiddenRepSequences), 0,\r
-                  viewport.alignment.getWidth() - 1);\r
+                  sg.getSequences(viewport.getHiddenRepSequences()), 0,\r
+                  viewport.getAlignment().getWidth() - 1);\r
           c.calculate();\r
-          c.verdict(false, viewport.ConsPercGaps);\r
+          c.verdict(false, viewport.getConsPercGaps());\r
           sg.cs.setConservation(c);\r
         }\r
         else\r
@@ -2325,7 +2353,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   protected void modifyPID_actionPerformed()\r
   {\r
     if (viewport.getAbovePIDThreshold()\r
-            && viewport.globalColourScheme != null)\r
+            && viewport.getGlobalColourScheme() != null)\r
     {\r
       SliderPanel.setPIDSliderSource(alignPanel,\r
               viewport.getGlobalColourScheme(), "Background");\r
@@ -2336,10 +2364,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   protected void modifyConservation_actionPerformed()\r
   {\r
     if (viewport.getConservationSelected()\r
-            && viewport.globalColourScheme != null)\r
+            && viewport.getGlobalColourScheme() != null)\r
     {\r
       SliderPanel.setConservationSlider(alignPanel,\r
-              viewport.globalColourScheme, "Background");\r
+              viewport.getGlobalColourScheme(), "Background");\r
       SliderPanel.showConservationSlider();\r
     }\r
   }\r
@@ -2375,7 +2403,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
             .getAlignment().getSequenceAt(0), null);\r
 \r
     addHistoryItem(new OrderCommand("Pairwise Sort", oldOrder,\r
-            viewport.alignment));\r
+            viewport.getAlignment()));\r
     alignPanel.paintAlignment(true);\r
   }\r
 \r
@@ -2383,7 +2411,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   {\r
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();\r
     AlignmentSorter.sortByID(viewport.getAlignment());\r
-    addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.alignment));\r
+    addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.getAlignment()));\r
     alignPanel.paintAlignment(true);\r
   }\r
 \r
@@ -2392,7 +2420,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();\r
     AlignmentSorter.sortByLength(viewport.getAlignment());\r
     addHistoryItem(new OrderCommand("Length Sort", oldOrder,\r
-            viewport.alignment));\r
+            viewport.getAlignment()));\r
     alignPanel.paintAlignment(true);\r
   }\r
 \r
@@ -2401,7 +2429,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();\r
     AlignmentSorter.sortByGroup(viewport.getAlignment());\r
     addHistoryItem(new OrderCommand("Group Sort", oldOrder,\r
-            viewport.alignment));\r
+            viewport.getAlignment()));\r
     alignPanel.paintAlignment(true);\r
 \r
   }\r
@@ -2426,7 +2454,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   public void PCAMenuItem_actionPerformed()\r
   {\r
     // are the sequences aligned?\r
-    if (!viewport.alignment.isAligned(false))\r
+    if (!viewport.getAlignment().isAligned(false))\r
     {\r
       SequenceI current;\r
       int Width = viewport.getAlignment().getWidth();\r
@@ -2483,7 +2511,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   void NewTreePanel(String type, String pwType, String title)\r
   {\r
     // are the sequences aligned?\r
-    if (!viewport.alignment.isAligned(false))\r
+    if (!viewport.getAlignment().isAligned(false))\r
     {\r
       SequenceI current;\r
       int Width = viewport.getAlignment().getWidth();\r
@@ -2503,7 +2531,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     if ((viewport.getSelectionGroup() != null && viewport\r
             .getSelectionGroup().getSize() > 1)\r
-            || (viewport.getSelectionGroup() == null && viewport.alignment\r
+            || (viewport.getSelectionGroup() == null && viewport.getAlignment()\r
                     .getHeight() > 1))\r
     {\r
       final TreePanel tp = new TreePanel(alignPanel, type, pwType);\r
@@ -2547,7 +2575,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     // addHistoryItem(new HistoryItem("Sort", viewport.alignment,\r
     // HistoryItem.SORT));\r
     addHistoryItem(new OrderCommand("Order by " + title, oldOrder,\r
-            viewport.alignment));\r
+            viewport.getAlignment()));\r
     alignPanel.paintAlignment(true);\r
   }\r
 \r
@@ -2599,7 +2627,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     AlignmentSorter.sortBy(viewport.getAlignment(), alorder);\r
     if (undoname!=null)\r
     {\r
-      addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.alignment));\r
+      addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.getAlignment()));\r
     }\r
     alignPanel.paintAlignment(true);\r
     return true;\r
@@ -2767,6 +2795,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
   MenuItem buriedColour = new MenuItem();\r
 \r
+  MenuItem purinePyrimidineColour = new MenuItem();\r
+  MenuItem RNAHelixColour = new MenuItem();\r
+  \r
   MenuItem userDefinedColour = new MenuItem();\r
 \r
   MenuItem PIDColour = new MenuItem();\r
@@ -2955,6 +2986,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     turnColour.addActionListener(this);\r
     buriedColour.setLabel("Buried Index");\r
     buriedColour.addActionListener(this);\r
+    purinePyrimidineColour.setLabel("Purine/Pyrimidine");\r
+    purinePyrimidineColour.addActionListener(this);\r
+    RNAHelixColour.setLabel("by RNA Helices");\r
+    RNAHelixColour.addActionListener(this);\r
     userDefinedColour.setLabel("User Defined...");\r
     userDefinedColour.addActionListener(this);\r
     PIDColour.setLabel("Percentage Identity");\r
@@ -3168,6 +3203,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     colourMenu.add(turnColour);\r
     colourMenu.add(buriedColour);\r
     colourMenu.add(nucleotideColour);\r
+    colourMenu.add(purinePyrimidineColour);\r
     colourMenu.add(userDefinedColour);\r
     colourMenu.addSeparator();\r
     colourMenu.add(conservationMenuItem);\r
@@ -3175,6 +3211,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     colourMenu.add(abovePIDThreshold);\r
     colourMenu.add(modifyPID);\r
     colourMenu.add(annotationColour);\r
+    colourMenu.add(RNAHelixColour);\r
     calculateMenu.add(sort);\r
     calculateMenu.add(calculate);\r
     calculateMenu.addSeparator();\r
index ff8f7df..e094d7d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -22,14 +22,18 @@ import java.util.*;
 import java.awt.*;
 
 import jalview.analysis.*;
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignViewportI;
 import jalview.bin.*;
 import jalview.datamodel.*;
 import jalview.schemes.*;
 import jalview.structure.SelectionSource;
-import jalview.structure.StructureSelectionManager;
 import jalview.structure.VamsasSource;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.workers.ConservationThread;
+import jalview.workers.ConsensusThread;
 
-public class AlignViewport implements SelectionSource, VamsasSource
+public class AlignViewport extends AlignmentViewport implements AlignViewportI, SelectionSource, VamsasSource 
 {
   int startRes;
 
@@ -57,24 +61,14 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   boolean showAnnotation = true;
 
-  boolean showConservation = true;
-
-  boolean showQuality = true;
-
-  boolean showConsensus = true;
-
   boolean upperCasebold = false;
 
   boolean colourAppliesToAllGroups = true;
 
-  ColourSchemeI globalColourScheme = null;
-
   boolean conservationColourSelected = false;
 
   boolean abovePIDThreshold = false;
 
-  SequenceGroup selectionGroup;
-
   int charHeight;
 
   int charWidth;
@@ -85,10 +79,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   boolean validCharWidth = true;
 
-  AlignmentI alignment;
-
-  ColumnSelection colSel = new ColumnSelection();
-
   int threshold;
 
   int increment;
@@ -105,33 +95,9 @@ public class AlignViewport implements SelectionSource, VamsasSource
   // currently visible, in the correct order or rendering
   public Hashtable featuresDisplayed;
 
-  boolean hasHiddenColumns = false;
-
-  boolean hasHiddenRows = false;
 
   boolean showHiddenMarkers = true;
 
-  public Hashtable[] hconsensus;
-
-  AlignmentAnnotation consensus;
-
-  AlignmentAnnotation conservation;
-
-  AlignmentAnnotation quality;
-
-  AlignmentAnnotation[] groupConsensus;
-
-  AlignmentAnnotation[] groupConservation;
-
-  boolean autocalculateConsensus = true;
-
-  public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
-
-  private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
-          this);
-
-  boolean ignoreGapsInConsensusCalculation = false;
-
   public jalview.bin.JalviewLite applet;
 
   Hashtable sequenceColours;
@@ -141,11 +107,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
   Stack historyList = new Stack();
 
   Stack redoList = new Stack();
-
-  String sequenceSetID;
-
-  Hashtable hiddenRepSequences;
-  
+    
   public void finalize() {
     applet=null;
     quality=null;
@@ -155,8 +117,11 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   public AlignViewport(AlignmentI al, JalviewLite applet)
   {
+    calculator = new jalview.workers.AlignCalcManager();
     this.applet = applet;
     setAlignment(al);
+    // we always pad gaps
+    this.setPadGaps(true);
     this.startRes = 0;
     this.endRes = al.getWidth() - 1;
     this.startSeq = 0;
@@ -243,7 +208,9 @@ public class AlignViewport implements SelectionSource, VamsasSource
       followSelection = followHighlight;
 
       showSequenceLogo = applet.getDefaultParameter("showSequenceLogo", showSequenceLogo);
-      
+
+      normaliseSequenceLogo = applet.getDefaultParameter("normaliseSequenceLogo", normaliseSequenceLogo);
+
       showGroupConsensus = applet.getDefaultParameter("showGroupConsensus", showGroupConsensus);
       
       showGroupConservation = applet.getDefaultParameter("showGroupConservation", showGroupConservation);
@@ -281,44 +248,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
                 .getParameter("userDefinedColour"));
       }
     }
-    if (hconsensus == null)
-    {
-      if (!alignment.isNucleotide())
-      {
-        conservation = new AlignmentAnnotation("Conservation",
-                "Conservation of total alignment less than " + ConsPercGaps
-                        + "% gaps", new Annotation[1], 0f, 11f,
-                AlignmentAnnotation.BAR_GRAPH);
-        conservation.hasText = true;
-        conservation.autoCalculated = true;
-
-        if (showConservation)
-        {
-          alignment.addAnnotation(conservation);
-        }
-
-        if (showQuality)
-        {
-          quality = new AlignmentAnnotation("Quality",
-                  "Alignment Quality based on Blosum62 scores",
-                  new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
-          quality.hasText = true;
-          quality.autoCalculated = true;
-
-          alignment.addAnnotation(quality);
-        }
-      }
-
-      consensus = new AlignmentAnnotation("Consensus", "PID",
-              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
-
-      if (showConsensus)
-      {
-        alignment.addAnnotation(consensus);
-      }
-    }
+    initAutoAnnotation();
 
   }
 
@@ -332,282 +262,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return showSequenceFeatures;
   }
 
-  class ConservationThread extends Thread
-  {
-    AlignmentPanel ap;
-
-    public ConservationThread(AlignmentPanel ap)
-    {
-      this.ap = ap;
-    }
-
-    public void run()
-    {
-      try
-      {
-        updatingConservation = true;
-
-        while (UPDATING_CONSERVATION)
-        {
-          try
-          {
-            if (ap != null)
-            {
-              ap.paintAlignment(false);
-            }
-            Thread.sleep(200);
-          } catch (Exception ex)
-          {
-            ex.printStackTrace();
-          }
-        }
-
-        UPDATING_CONSERVATION = true;
-
-        int alWidth = (alignment==null) ? -1 : alignment.getWidth();
-        if (alWidth < 0)
-        {
-          updatingConservation = false;
-          UPDATING_CONSERVATION = false;
-          return;
-        }
-
-        Conservation cons = new jalview.analysis.Conservation("All",
-                jalview.schemes.ResidueProperties.propHash, 3,
-                alignment.getSequences(), 0, alWidth - 1);
-
-        cons.calculate();
-        cons.verdict(false, ConsPercGaps);
-
-        if (quality != null)
-        {
-          cons.findQuality();
-        }
-
-        char[] sequence = cons.getConsSequence().getSequence();
-        float minR;
-        float minG;
-        float minB;
-        float maxR;
-        float maxG;
-        float maxB;
-        minR = 0.3f;
-        minG = 0.0f;
-        minB = 0f;
-        maxR = 1.0f - minR;
-        maxG = 0.9f - minG;
-        maxB = 0f - minB; // scalable range for colouring both Conservation and
-        // Quality
-
-        float min = 0f;
-        float max = 11f;
-        float qmin = 0f;
-        float qmax = 0f;
-
-        char c;
-
-        conservation.annotations = new Annotation[alWidth];
-
-        if (quality != null)
-        {
-          quality.graphMax = cons.qualityRange[1].floatValue();
-          quality.annotations = new Annotation[alWidth];
-          qmin = cons.qualityRange[0].floatValue();
-          qmax = cons.qualityRange[1].floatValue();
-        }
-
-        for (int i = 0; i < alWidth; i++)
-        {
-          float value = 0;
-
-          c = sequence[i];
-
-          if (Character.isDigit(c))
-          {
-            value = (int) (c - '0');
-          }
-          else if (c == '*')
-          {
-            value = 11;
-          }
-          else if (c == '+')
-          {
-            value = 10;
-          }
-          // TODO - refactor to use a graduatedColorScheme to calculate the
-          // histogram colors.
-          float vprop = value - min;
-          vprop /= max;
-          conservation.annotations[i] = new Annotation(String.valueOf(c),
-                  String.valueOf(value), ' ', value, new Color(minR
-                          + (maxR * vprop), minG + (maxG * vprop), minB
-                          + (maxB * vprop)));
-
-          // Quality calc
-          if (quality != null)
-          {
-            value = ((Double) cons.quality.elementAt(i)).floatValue();
-            vprop = value - qmin;
-            vprop /= qmax;
-            quality.annotations[i] = new Annotation(" ",
-                    String.valueOf(value), ' ', value, new Color(minR
-                            + (maxR * vprop), minG + (maxG * vprop), minB
-                            + (maxB * vprop)));
-          }
-        }
-      } catch (OutOfMemoryError error)
-      {
-        System.out.println("Out of memory calculating conservation!!");
-        conservation = null;
-        quality = null;
-        System.gc();
-      }
-
-      UPDATING_CONSERVATION = false;
-      updatingConservation = false;
-
-      if (ap != null)
-      {
-        ap.paintAlignment(true);
-      }
-
-    }
-  }
-
-  ConservationThread conservationThread;
-
-  ConsensusThread consensusThread;
-
-  boolean consUpdateNeeded = false;
-
-  static boolean UPDATING_CONSENSUS = false;
-
-  static boolean UPDATING_CONSERVATION = false;
-
-  boolean updatingConsensus = false;
-
-  boolean updatingConservation = false;
-
-  /**
-   * DOCUMENT ME!
-   */
-  public void updateConservation(final AlignmentPanel ap)
-  {
-    if (alignment.isNucleotide() || conservation == null)
-    {
-      return;
-    }
-
-    conservationThread = new ConservationThread(ap);
-    conservationThread.start();
-  }
-
-  /**
-   * DOCUMENT ME!
-   */
-  public void updateConsensus(final AlignmentPanel ap)
-  {
-    consensusThread = new ConsensusThread(ap);
-    consensusThread.start();
-  }
-
-  class ConsensusThread extends Thread
-  {
-    AlignmentPanel ap;
-
-    public ConsensusThread(AlignmentPanel ap)
-    {
-      this.ap = ap;
-    }
-
-    public void run()
-    {
-      updatingConsensus = true;
-      while (UPDATING_CONSENSUS)
-      {
-        try
-        {
-          if (ap != null)
-          {
-            ap.paintAlignment(false);
-          }
-
-          Thread.sleep(200);
-        } catch (Exception ex)
-        {
-          ex.printStackTrace();
-        }
-      }
-
-      UPDATING_CONSENSUS = true;
-
-      try
-      {
-        int aWidth = alignment==null ? -1 : alignment.getWidth();
-        if (aWidth < 0)
-        {
-          UPDATING_CONSENSUS = false;
-          updatingConsensus = false;
-          return;
-        }
-
-        consensus.annotations = null;
-        consensus.annotations = new Annotation[aWidth];
-
-        hconsensus = new Hashtable[aWidth];
-        AAFrequency.calculate(alignment.getSequencesArray(), 0,
-                alignment.getWidth(), hconsensus, true); // always calculate the
-                                                         // full profile
-        updateAnnotation(true);
-        //AAFrequency.completeConsensus(consensus, hconsensus, 0, aWidth,
-        //        ignoreGapsInConsensusCalculation,
-        //        true);
-        
-        if (globalColourScheme != null)
-        {
-          globalColourScheme.setConsensus(hconsensus);
-        }
-
-      } catch (OutOfMemoryError error)
-      {
-        alignment.deleteAnnotation(consensus);
-
-        consensus = null;
-        hconsensus = null;
-        System.out.println("Out of memory calculating consensus!!");
-        System.gc();
-      }
-      UPDATING_CONSENSUS = false;
-      updatingConsensus = false;
-
-      if (ap != null)
-      {
-        ap.paintAlignment(true);
-      }
-    }
-
-    /**
-     * update the consensus annotation from the sequence profile data using
-     * current visualization settings.
-     */
-    public void updateAnnotation()
-    {
-      updateAnnotation(false);
-    }
-
-    protected void updateAnnotation(boolean immediate)
-    {
-      // TODO: make calls thread-safe, so if another thread calls this method,
-      // it will either return or wait until one calculation is finished.
-      if (immediate
-              || (!updatingConsensus && consensus != null && hconsensus != null))
-      {
-        AAFrequency.completeConsensus(consensus, hconsensus, 0,
-                hconsensus.length, ignoreGapsInConsensusCalculation,
-                showSequenceLogo);
-      }
-    }
-  }
 
   /**
    * get the consensus sequence as displayed under the PID consensus annotation
@@ -646,16 +300,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return sq;
   }
 
-  public SequenceGroup getSelectionGroup()
-  {
-    return selectionGroup;
-  }
-
-  public void setSelectionGroup(SequenceGroup sg)
-  {
-    selectionGroup = sg;
-  }
-
   public boolean getConservationSelected()
   {
     return conservationColourSelected;
@@ -691,16 +335,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return startSeq;
   }
 
-  public void setGlobalColourScheme(ColourSchemeI cs)
-  {
-    globalColourScheme = cs;
-  }
-
-  public ColourSchemeI getGlobalColourScheme()
-  {
-    return globalColourScheme;
-  }
-
   public void setStartRes(int res)
   {
     this.startRes = res;
@@ -889,20 +523,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return increment;
   }
 
-  public void setHiddenColumns(ColumnSelection colsel)
-  {
-    this.colSel = colsel;
-    if (colSel.getHiddenColumns() != null)
-    {
-      hasHiddenColumns = true;
-    }
-  }
-
-  public ColumnSelection getColumnSelection()
-  {
-    return colSel;
-  }
-
   public void resetSeqLimits(int height)
   {
     setEndSeq(height / getCharHeight());
@@ -990,390 +610,9 @@ public class AlignViewport implements SelectionSource, VamsasSource
     }
   }
 
-  /**
-   * Property change listener for changes in alignment
-   * 
-   * @param listener
-   *          DOCUMENT ME!
-   */
-  public void addPropertyChangeListener(
-          java.beans.PropertyChangeListener listener)
-  {
-    changeSupport.addPropertyChangeListener(listener);
-  }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param listener
-   *          DOCUMENT ME!
-   */
-  public void removePropertyChangeListener(
-          java.beans.PropertyChangeListener listener)
-  {
-    changeSupport.removePropertyChangeListener(listener);
-  }
 
-  /**
-   * Property change listener for changes in alignment
-   * 
-   * @param prop
-   *          DOCUMENT ME!
-   * @param oldvalue
-   *          DOCUMENT ME!
-   * @param newvalue
-   *          DOCUMENT ME!
-   */
-  public void firePropertyChange(String prop, Object oldvalue,
-          Object newvalue)
-  {
-    changeSupport.firePropertyChange(prop, oldvalue, newvalue);
-  }
-
-  public boolean getIgnoreGapsConsensus()
-  {
-    return ignoreGapsInConsensusCalculation;
-  }
-
-  public void hideSelectedColumns()
-  {
-    if (colSel.size() < 1)
-    {
-      return;
-    }
-
-    colSel.hideSelectedColumns();
-    setSelectionGroup(null);
-
-    hasHiddenColumns = true;
-  }
-
-  public void invertColumnSelection()
-  {
-    for (int i = 0; i < alignment.getWidth(); i++)
-    {
-      if (colSel.contains(i))
-      {
-        colSel.removeElement(i);
-      }
-      else
-      {
-        if (!hasHiddenColumns || colSel.isVisible(i))
-        {
-          colSel.addElement(i);
-        }
-      }
-    }
-  }
-
-  public void hideColumns(int start, int end)
-  {
-    if (start == end)
-    {
-      colSel.hideColumns(start);
-    }
-    else
-    {
-      colSel.hideColumns(start, end);
-    }
-
-    hasHiddenColumns = true;
-  }
-
-  public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
-  {
-    int sSize = sg.getSize();
-    if (sSize < 2)
-    {
-      return;
-    }
-
-    if (hiddenRepSequences == null)
-    {
-      hiddenRepSequences = new Hashtable();
-    }
-
-    hiddenRepSequences.put(repSequence, sg);
-
-    // Hide all sequences except the repSequence
-    SequenceI[] seqs = new SequenceI[sSize - 1];
-    int index = 0;
-    for (int i = 0; i < sSize; i++)
-    {
-      if (sg.getSequenceAt(i) != repSequence)
-      {
-        if (index == sSize - 1)
-        {
-          return;
-        }
-
-        seqs[index++] = sg.getSequenceAt(i);
-      }
-    }
-
-    hideSequence(seqs);
-
-  }
-
-  public void hideAllSelectedSeqs()
-  {
-    if (selectionGroup == null || selectionGroup.getSize() < 1)
-    {
-      return;
-    }
-
-    SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
-
-    hideSequence(seqs);
-
-    setSelectionGroup(null);
-  }
-
-  public void hideSequence(SequenceI[] seq)
-  {
-    if (seq != null)
-    {
-      for (int i = 0; i < seq.length; i++)
-      {
-        alignment.getHiddenSequences().hideSequence(seq[i]);
-      }
-
-      hasHiddenRows = true;
-      firePropertyChange("alignment", null, alignment.getSequences());
-    }
-  }
-  public void showSequence(int index)
-  {
-    Vector tmp = alignment.getHiddenSequences().showSequence(index,
-            hiddenRepSequences);
-    if (tmp.size() > 0)
-    {
-      if (selectionGroup == null)
-      {
-        selectionGroup = new SequenceGroup();
-        selectionGroup.setEndRes(alignment.getWidth() - 1);
-      }
-
-      for (int t = 0; t < tmp.size(); t++)
-      {
-        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
-      }
-      firePropertyChange("alignment", null, alignment.getSequences());
-      sendSelection();
-    }
-
-    if (alignment.getHiddenSequences().getSize() < 1)
-    {
-      hasHiddenRows = false;
-    }
-  }
-  public void showColumn(int col)
-  {
-    colSel.revealHiddenColumns(col);
-    if (colSel.getHiddenColumns() == null)
-    {
-      hasHiddenColumns = false;
-    }
-  }
-
-  public void showAllHiddenColumns()
-  {
-    colSel.revealAllHiddenColumns();
-    hasHiddenColumns = false;
-  }
-
-  public void showAllHiddenSeqs()
-  {
-    if (alignment.getHiddenSequences().getSize() > 0)
-    {
-      if (selectionGroup == null)
-      {
-        selectionGroup = new SequenceGroup();
-        selectionGroup.setEndRes(alignment.getWidth() - 1);
-      }
-      Vector tmp = alignment.getHiddenSequences().showAll(
-              hiddenRepSequences);
-      for (int t = 0; t < tmp.size(); t++)
-      {
-        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
-      }
-      firePropertyChange("alignment", null, alignment.getSequences());
-      hasHiddenRows = false;
-      hiddenRepSequences = null;
-      sendSelection();
-    }
-  }
-
-  public int adjustForHiddenSeqs(int alignmentIndex)
-  {
-    return alignment.getHiddenSequences().adjustForHiddenSeqs(
-            alignmentIndex);
-  }
-
-  /**
-   * This method returns the a new SequenceI [] with the selection sequence and
-   * start and end points adjusted
-   * 
-   * @return String[]
-   */
-  public SequenceI[] getSelectionAsNewSequence()
-  {
-    SequenceI[] sequences;
-
-    if (selectionGroup == null)
-    {
-      sequences = alignment.getSequencesArray();
-    }
-    else
-    {
-      sequences = selectionGroup.getSelectionAsNewSequences(alignment);
-    }
-
-    return sequences;
-  }
-
-  /**
-   * get the currently selected sequence objects or all the sequences in the
-   * alignment.
-   * 
-   * @return array of references to sequence objects
-   */
-  public SequenceI[] getSequenceSelection()
-  {
-    SequenceI[] sequences = null;
-    if (selectionGroup != null)
-    {
-      sequences = selectionGroup.getSequencesInOrder(alignment);
-    }
-    if (sequences == null)
-    {
-      sequences = alignment.getSequencesArray();
-    }
-    return sequences;
-  }
-
-  /**
-   * This method returns the visible alignment as text, as seen on the GUI, ie
-   * if columns are hidden they will not be returned in the result. Use this for
-   * calculating trees, PCA, redundancy etc on views which contain hidden
-   * columns.
-   * 
-   * @return String[]
-   */
-  public jalview.datamodel.CigarArray getViewAsCigars(
-          boolean selectedRegionOnly)
-  {
-    return new jalview.datamodel.CigarArray(alignment, (hasHiddenColumns ? colSel : null), (selectedRegionOnly ? selectionGroup : null));
-  }
-
-  /**
-   * return a compact representation of the current alignment selection to pass
-   * to an analysis function
-   * 
-   * @param selectedOnly
-   *          boolean true to just return the selected view
-   * @return AlignmentView
-   */
-  jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly)
-  {    
-    return getAlignmentView(selectedOnly, false);
-  }
-  
-  /**
-   * return a compact representation of the current alignment selection to pass
-   * to an analysis function
-   * 
-   * @param selectedOnly
-   *          boolean true to just return the selected view
-   * @param markGroups
-   *          boolean true to annotate the alignment view with groups on the alignment (and intersecting with selected region if selectedOnly is true) 
-   * @return AlignmentView
-   */
-  public jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups)
-  {
-    return new AlignmentView(alignment, colSel, selectionGroup, hasHiddenColumns, selectedOnly, markGroups);
-  }
-  /**
-   * This method returns the visible alignment as text, as seen on the GUI, ie
-   * if columns are hidden they will not be returned in the result. Use this for
-   * calculating trees, PCA, redundancy etc on views which contain hidden
-   * columns.
-   * 
-   * @return String[]
-   */
-  public String[] getViewAsString(boolean selectedRegionOnly)
-  {
-    String[] selection = null;
-    SequenceI[] seqs = null;
-    int i, iSize;
-    int start = 0, end = 0;
-    if (selectedRegionOnly && selectionGroup != null)
-    {
-      iSize = selectionGroup.getSize();
-      seqs = selectionGroup.getSequencesInOrder(alignment);
-      start = selectionGroup.getStartRes();
-      end = selectionGroup.getEndRes() + 1;
-    }
-    else
-    {
-      iSize = alignment.getHeight();
-      seqs = alignment.getSequencesArray();
-      end = alignment.getWidth();
-    }
-
-    selection = new String[iSize];
-
-    for (i = 0; i < iSize; i++)
-    {
-      if (hasHiddenColumns)
-      {
-        StringBuffer visibleSeq = new StringBuffer();
-        Vector regions = colSel.getHiddenColumns();
-
-        int blockStart = start, blockEnd = end;
-        int[] region;
-        int hideStart, hideEnd;
-
-        for (int j = 0; j < regions.size(); j++)
-        {
-          region = (int[]) regions.elementAt(j);
-          hideStart = region[0];
-          hideEnd = region[1];
-
-          if (hideStart < start)
-          {
-            continue;
-          }
-
-          blockStart = Math.min(blockStart, hideEnd + 1);
-          blockEnd = Math.min(blockEnd, hideStart);
-
-          if (blockStart > blockEnd)
-          {
-            break;
-          }
-
-          visibleSeq.append(seqs[i].getSequence(blockStart, blockEnd));
-
-          blockStart = hideEnd + 1;
-          blockEnd = end;
-        }
-
-        if (end > blockStart)
-        {
-          visibleSeq.append(seqs[i].getSequence(blockStart, end));
-        }
-
-        selection[i] = visibleSeq.toString();
-      }
-      else
-      {
-        selection[i] = seqs[i].getSequenceAsString(start, end);
-      }
-    }
-
-    return selection;
-  }
 
   public boolean getShowHiddenMarkers()
   {
@@ -1414,103 +653,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     }
   }
 
-  public String getSequenceSetId()
-  {
-    if (sequenceSetID == null)
-    {
-      sequenceSetID = alignment.hashCode() + "";
-    }
-
-    return sequenceSetID;
-  }
-  /**
-   * unique viewId for synchronizing state (e.g. with stored Jalview Project)
-   * 
-   */
-  private String viewId = null;
-
-  public String getViewId()
-  {
-    if (viewId == null)
-    {
-      viewId = this.getSequenceSetId() + "." + this.hashCode() + "";
-    }
-    return viewId;
-  }
-
-  public void alignmentChanged(AlignmentPanel ap)
-  {
-    alignment.padGaps();
-
-    if (hconsensus != null && autocalculateConsensus)
-    {
-      updateConsensus(ap);
-      updateConservation(ap);
-    }
-
-    // Reset endRes of groups if beyond alignment width
-    int alWidth = alignment.getWidth();
-    Vector groups = alignment.getGroups();
-    if (groups != null)
-    {
-      for (int i = 0; i < groups.size(); i++)
-      {
-        SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
-        if (sg.getEndRes() > alWidth)
-        {
-          sg.setEndRes(alWidth - 1);
-        }
-      }
-    }
-
-    if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
-    {
-      selectionGroup.setEndRes(alWidth - 1);
-    }
-
-    resetAllColourSchemes();
-
-    // AW alignment.adjustSequenceAnnotations();
-  }
-
-  void resetAllColourSchemes()
-  {
-    ColourSchemeI cs = globalColourScheme;
-    if (cs != null)
-    {
-      if (cs instanceof ClustalxColourScheme)
-      {
-        ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
-                alignment.getWidth());
-      }
-
-      cs.setConsensus(hconsensus);
-      if (cs.conservationApplied())
-      {
-        Alignment al = (Alignment) alignment;
-        Conservation c = new Conservation("All",
-                ResidueProperties.propHash, 3, al.getSequences(), 0,
-                al.getWidth() - 1);
-        c.calculate();
-        c.verdict(false, ConsPercGaps);
-
-        cs.setConservation(c);
-      }
-    }
-
-    int s, sSize = alignment.getGroups().size();
-    for (s = 0; s < sSize; s++)
-    {
-      SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
-      if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
-      {
-        ((ClustalxColourScheme) sg.cs).resetClustalX(
-                sg.getSequences(hiddenRepSequences), sg.getWidth());
-      }
-      sg.recalcConservation();
-    }
-  }
-
   boolean centreColumnLabels;
 
   public boolean getCentreColumnLabels()
@@ -1526,7 +668,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
       SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
       if (sg.idColour != null)
       {
-        Vector sqs = sg.getSequences(hiddenRepSequences);
+        Vector sqs = sg.getSequences(getHiddenRepSequences());
         for (int s = 0, sSize = sqs.size(); s < sSize; s++)
         {
           this.setSequenceColour((SequenceI) sqs.elementAt(s), sg.idColour);
@@ -1552,42 +694,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
   {
     return followSelection;
   }
-
-  private long sgrouphash = -1, colselhash = -1;
-
-  /**
-   * checks current SelectionGroup against record of last hash value, and
-   * updates record.
-   * 
-   * @return true if SelectionGroup changed since last call
-   */
-  boolean isSelectionGroupChanged()
-  {
-    int hc = (selectionGroup == null) ? -1 : selectionGroup.hashCode();
-    if (hc != sgrouphash)
-    {
-      sgrouphash = hc;
-      return true;
-    }
-    return false;
-  }
-
-  /**
-   * checks current colsel against record of last hash value, and updates
-   * record.
-   * 
-   * @return true if colsel changed since last call
-   */
-  boolean isColSelChanged()
-  {
-    int hc = (colSel == null) ? -1 : colSel.hashCode();
-    if (hc != colselhash)
-    {
-      colselhash = hc;
-      return true;
-    }
-    return false;
-  }
   public void sendSelection()
   {
     jalview.structure.StructureSelectionManager
@@ -1600,133 +706,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
 
   /**
-   * show non-conserved residues only
-   */
-  public boolean showUnconserved = false;
-
-  /**
-   * when set, alignment should be reordered according to a newly opened tree
-   */
-  public boolean sortByTree = false;
-
-  /**
-   * @return the showUnconserved
-   */
-  public boolean getShowunconserved()
-  {
-    return showUnconserved;
-  }
-
-  /**
-   * @param showNonconserved
-   *          the showUnconserved to set
-   */
-  public void setShowunconserved(boolean displayNonconserved)
-  {
-    this.showUnconserved = displayNonconserved;
-  }
-
-  /**
-   * should conservation rows be shown for groups
-   */
-  boolean showGroupConservation = false;
-
-  /**
-   * should consensus rows be shown for groups
-   */
-  boolean showGroupConsensus = false;
-
-  /**
-   * should consensus profile be rendered by default
-   */
-  public boolean showSequenceLogo = false;
-
-  /**
-   * should consensus histograms be rendered by default
-   */
-  public boolean showConsensusHistogram = true;
-
-  /**
-   * @return the showConsensusProfile
-   */
-  public boolean isShowSequenceLogo()
-  {
-    return showSequenceLogo;
-  }
-
-  /**
-   * @param showSequenceLogo
-   *          the new value
-   */
-  public void setShowSequenceLogo(boolean showSequenceLogo)
-  {
-    if (showSequenceLogo != this.showSequenceLogo)
-    {
-      // TODO: decouple settings setting from calculation when refactoring
-      // annotation update method from alignframe to viewport
-      this.showSequenceLogo = showSequenceLogo;
-      if (consensusThread != null)
-      {
-        consensusThread.updateAnnotation();
-      }
-    }
-    this.showSequenceLogo = showSequenceLogo;
-  }
-
-  /**
-   * @param showConsensusHistogram
-   *          the showConsensusHistogram to set
-   */
-  public void setShowConsensusHistogram(boolean showConsensusHistogram)
-  {
-    this.showConsensusHistogram = showConsensusHistogram;
-  }
-
-  /**
-   * @return the showGroupConservation
-   */
-  public boolean isShowGroupConservation()
-  {
-    return showGroupConservation;
-  }
-
-  /**
-   * @param showGroupConservation
-   *          the showGroupConservation to set
-   */
-  public void setShowGroupConservation(boolean showGroupConservation)
-  {
-    this.showGroupConservation = showGroupConservation;
-  }
-
-  /**
-   * @return the showGroupConsensus
-   */
-  public boolean isShowGroupConsensus()
-  {
-    return showGroupConsensus;
-  }
-
-  /**
-   * @param showGroupConsensus
-   *          the showGroupConsensus to set
-   */
-  public void setShowGroupConsensus(boolean showGroupConsensus)
-  {
-    this.showGroupConsensus = showGroupConsensus;
-  }
-
-  /**
-   * 
-   * @return flag to indicate if the consensus histogram should be rendered by
-   *         default
-   */
-  public boolean isShowConsensusHistogram()
-  {
-    return this.showConsensusHistogram;
-  }
-
-  /**
    * synthesize a column selection if none exists so it covers the given
    * selection group. if wholewidth is false, no column selection is made if the
    * selection group covers the whole alignment width.
@@ -1758,4 +737,30 @@ public class AlignViewport implements SelectionSource, VamsasSource
       }
     }
   }
+
+  @Override
+  public boolean hasHiddenColumns()
+  {
+    return hasHiddenColumns;
+  }
+  
+  public boolean isNormaliseSequenceLogo()
+  {
+    return normaliseSequenceLogo;
+  }
+
+  public void setNormaliseSequenceLogo(boolean state)
+  {
+    normaliseSequenceLogo = state;
+  }
+
+  /**
+   * 
+   * @return true if alignment characters should be displayed 
+   */
+  public boolean isValidCharWidth()
+  {
+    return validCharWidth;
+  }
+
 }
index 08d1f85..99084ba 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -286,13 +286,14 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
     // do we need to scroll the panel?
     if (results != null && results.getSize() > 0)
     {
-      int seqIndex = av.alignment.findIndex(results);
+      AlignmentI alignment=av.getAlignment();
+      int seqIndex = alignment.findIndex(results);
       if (seqIndex == -1)
       {
         return false;
       }
-      SequenceI seq = av.alignment.getSequenceAt(seqIndex);
-      int[] r = results.getResults(seq, 0,av.alignment.getWidth());
+      SequenceI seq = alignment.getSequenceAt(seqIndex);
+      int[] r = results.getResults(seq, 0,alignment.getWidth());
       if (r == null)
       {
         if (av.applet.debug) {// DEBUG
@@ -327,13 +328,13 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
            int startv, endv, starts, ends, width;
 
          int start=-1;
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       start = av.getColumnSelection().findColumnPosition(ostart);
       end = av.getColumnSelection().findColumnPosition(end);
       if (start == end)
       {
-        if (!scrollToNearest && !av.colSel.isVisible(ostart))
+        if (!scrollToNearest && !av.getColumnSelection().isVisible(ostart))
         {
           // don't scroll - position isn't visible
           return false;
@@ -373,18 +374,18 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
                 || (av.getEndRes() < start)
                 || ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
         {
-          if (start > av.alignment.getWidth() - hextent)
+          if (start > av.getAlignment().getWidth() - hextent)
           {
-            start = av.alignment.getWidth() - hextent;
+            start = av.getAlignment().getWidth() - hextent;
             if (start < 0)
             {
               start = 0;
             }
 
           }
-          if (seqIndex > av.alignment.getHeight() - vextent)
+          if (seqIndex > av.getAlignment().getHeight() - vextent)
           {
-            seqIndex = av.alignment.getHeight() - vextent;
+            seqIndex = av.getAlignment().getHeight() - vextent;
             if (seqIndex < 0)
             {
               seqIndex = 0;
@@ -588,10 +589,10 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
 
   public void setScrollValues(int x, int y)
   {
-    int width = av.alignment.getWidth();
-    int height = av.alignment.getHeight();
+    int width = av.getAlignment().getWidth();
+    int height = av.getAlignment().getHeight();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       width = av.getColumnSelection().findColumnPosition(width);
     }
@@ -636,9 +637,9 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
     av.setStartSeq(y);
 
     int endSeq = y + vextent;
-    if (endSeq > av.alignment.getHeight())
+    if (endSeq > av.getAlignment().getHeight())
     {
-      endSeq = av.alignment.getHeight();
+      endSeq = av.getAlignment().getHeight();
     }
 
     av.setEndSeq(endSeq);
@@ -768,9 +769,9 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
     
     if (av.getWrapAlignment())
     {
-      int maxwidth = av.alignment.getWidth();
+      int maxwidth = av.getAlignment().getWidth();
 
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
       }
@@ -918,10 +919,10 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
     // remove old automatic annotation
     // add any new annotation
 
-    Vector gr = av.alignment.getGroups(); // OrderedBy(av.alignment.getSequencesArray());
+    Vector gr = av.getAlignment().getGroups(); // OrderedBy(av.alignment.getSequencesArray());
     // intersect alignment annotation with alignment groups
 
-    AlignmentAnnotation[] aan = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aan = av.getAlignment().getAlignmentAnnotation();
     Hashtable oldrfs = new Hashtable();
     if (aan != null)
     {
@@ -930,7 +931,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
         if (aan[an].autoCalculated && aan[an].groupRef != null)
         {
           oldrfs.put(aan[an].groupRef, aan[an].groupRef);
-          av.alignment.deleteAnnotation(aan[an]);
+          av.getAlignment().deleteAnnotation(aan[an]);
           aan[an] = null;
         }
       }
@@ -951,12 +952,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
         if (conv)
         {
           updateCalcs = true;
-          av.alignment.addAnnotation(sg.getConservationRow(), 0);
+          av.getAlignment().addAnnotation(sg.getConservationRow(), 0);
         }
         if (cons)
         {
           updateCalcs = true;
-          av.alignment.addAnnotation(sg.getConsensus(), 0);
+          av.getAlignment().addAnnotation(sg.getConsensus(), 0);
         }
         // refresh the annotation rows
         if (updateCalcs)
@@ -972,12 +973,19 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, Alignme
   @Override
   public AlignmentI getAlignment()
   {
-    return av.alignment;
+    return av.getAlignment();
   }
   @Override
   public StructureSelectionManager getStructureSelectionManager()
   {
     return StructureSelectionManager.getStructureSelectionManager(av.applet);
   }
+  @Override
+  public void raiseOOMWarning(String string, OutOfMemoryError error)
+  {
+    // TODO: JAL-960
+    System.err.println("Out of memory whilst '"+string+"'");
+    error.printStackTrace();
+  }
 
 }
index 5463ed8..a3f9fa6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -55,10 +55,10 @@ public class AnnotationColourChooser extends Panel implements
     }
 
     oldcs = av.getGlobalColourScheme();
-    if (av.alignment.getGroups() != null)
+    if (av.getAlignment().getGroups() != null)
     {
       oldgroupColours = new Hashtable();
-      Vector allGroups = ap.av.alignment.getGroups();
+      Vector allGroups = ap.av.getAlignment().getGroups();
       SequenceGroup sg;
       for (int g = 0; g < allGroups.size(); g++)
       {
@@ -79,7 +79,7 @@ public class AnnotationColourChooser extends Panel implements
     slider.addAdjustmentListener(this);
     slider.addMouseListener(this);
 
-    if (av.alignment.getAlignmentAnnotation() == null)
+    if (av.getAlignment().getAlignmentAnnotation() == null)
     {
       return;
     }
@@ -100,9 +100,9 @@ public class AnnotationColourChooser extends Panel implements
 
     Vector list = new Vector();
     int index = 1;
-    for (int i = 0; i < av.alignment.getAlignmentAnnotation().length; i++)
+    for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
     {
-      String label = av.alignment.getAlignmentAnnotation()[i].label;
+      String label = av.getAlignment().getAlignmentAnnotation()[i].label;
       if (!list.contains(label))
         list.addElement(label);
       else
@@ -395,7 +395,7 @@ public class AnnotationColourChooser extends Panel implements
       return;
     }
 
-    currentAnnotation = av.alignment.getAlignmentAnnotation()[annotations
+    currentAnnotation = av.getAlignment().getAlignmentAnnotation()[annotations
             .getSelectedIndex()];
 
     int aboveThreshold = -1;
@@ -464,9 +464,9 @@ public class AnnotationColourChooser extends Panel implements
 
     av.setGlobalColourScheme(acg);
 
-    if (av.alignment.getGroups() != null)
+    if (av.getAlignment().getGroups() != null)
     {
-      Vector allGroups = ap.av.alignment.getGroups();
+      Vector allGroups = ap.av.getAlignment().getGroups();
       SequenceGroup sg;
       for (int g = 0; g < allGroups.size(); g++)
       {
@@ -499,9 +499,9 @@ public class AnnotationColourChooser extends Panel implements
   void reset()
   {
     av.setGlobalColourScheme(oldcs);
-    if (av.alignment.getGroups() != null)
+    if (av.getAlignment().getGroups() != null)
     {
-      Vector allGroups = ap.av.alignment.getGroups();
+      Vector allGroups = ap.av.getAlignment().getGroups();
       SequenceGroup sg;
       for (int g = 0; g < allGroups.size(); g++)
       {
index 5140024..635535c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -107,7 +107,7 @@ public class AnnotationLabels extends Panel implements ActionListener,
   int getSelectedRow(int y)
   {
     int row = -2;
-    AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
 
     if (aa == null)
     {
@@ -134,20 +134,20 @@ public class AnnotationLabels extends Panel implements ActionListener,
 
   public void actionPerformed(ActionEvent evt)
   {
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
 
     if (evt.getActionCommand().equals(ADDNEW))
     {
       AlignmentAnnotation newAnnotation = new AlignmentAnnotation("", null,
-              new Annotation[ap.av.alignment.getWidth()]);
+              new Annotation[ap.av.getAlignment().getWidth()]);
 
       if (!editLabelDescription(newAnnotation))
       {
         return;
       }
 
-      ap.av.alignment.addAnnotation(newAnnotation);
-      ap.av.alignment.setAnnotationIndex(newAnnotation, 0);
+      ap.av.getAlignment().addAnnotation(newAnnotation);
+      ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
     }
     else if (evt.getActionCommand().equals(EDITNAME))
     {
@@ -228,7 +228,7 @@ public class AnnotationLabels extends Panel implements ActionListener,
 
     if (row > -1)
     {
-      ParseHtmlBodyAndLinks phb = new ParseHtmlBodyAndLinks(av.alignment.getAlignmentAnnotation()[row].getDescription(true), true, "\n");
+      ParseHtmlBodyAndLinks phb = new ParseHtmlBodyAndLinks(av.getAlignment().getAlignmentAnnotation()[row].getDescription(true), true, "\n");
       if (tooltip == null)
       {
         tooltip = new Tooltip(phb.getNonHtmlContent(), this);
@@ -337,17 +337,17 @@ public class AnnotationLabels extends Panel implements ActionListener,
       if (start>-1 && start != end)
       {
         // Swap these annotations
-        AlignmentAnnotation startAA = ap.av.alignment
+        AlignmentAnnotation startAA = ap.av.getAlignment()
                 .getAlignmentAnnotation()[start];
         if (end == -1)
         {
-          end = ap.av.alignment.getAlignmentAnnotation().length - 1;
+          end = ap.av.getAlignment().getAlignmentAnnotation().length - 1;
         }
-        AlignmentAnnotation endAA = ap.av.alignment
+        AlignmentAnnotation endAA = ap.av.getAlignment()
                 .getAlignmentAnnotation()[end];
 
-        ap.av.alignment.getAlignmentAnnotation()[end] = startAA;
-        ap.av.alignment.getAlignmentAnnotation()[start] = endAA;
+        ap.av.getAlignment().getAlignmentAnnotation()[end] = startAA;
+        ap.av.getAlignment().getAlignmentAnnotation()[start] = endAA;
       }
     }
     resizePanel = false;
@@ -395,7 +395,7 @@ public class AnnotationLabels extends Panel implements ActionListener,
     // todo: move below to mouseClicked ?
     selectedRow = getSelectedRow(evt.getY() + scrollOffset);
 
-    AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
 
     // DETECT RIGHT MOUSE BUTTON IN AWT
     if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
@@ -622,7 +622,7 @@ public class AnnotationLabels extends Panel implements ActionListener,
     jalview.appletgui.AlignFrame.copiedSequences.append(sq.getName() + "\t"
             + sq.getStart() + "\t" + sq.getEnd() + "\t"
             + sq.getSequenceAsString() + "\n");
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       jalview.appletgui.AlignFrame.copiedHiddenColumns = new Vector();
       for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++)
@@ -665,7 +665,7 @@ public class AnnotationLabels extends Panel implements ActionListener,
     g.translate(0, -scrollOffset);
     g.setColor(Color.black);
 
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     int y = 0, fy = g.getFont().getSize();
     int x = 0, offset;
 
index 7d1333b..a941ef2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -26,9 +26,11 @@ import java.awt.geom.AffineTransform;
 
 import jalview.analysis.AAFrequency;
 import jalview.datamodel.*;
+import jalview.renderer.AnnotationRenderer;
+import jalview.renderer.AwtRenderPanelI;
 import jalview.schemes.ColourSchemeI;
 
-public class AnnotationPanel extends Panel implements AdjustmentListener,
+public class AnnotationPanel extends Panel implements AwtRenderPanelI, AdjustmentListener,
         ActionListener, MouseListener, MouseMotionListener
 {
   AlignViewport av;
@@ -39,19 +41,24 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
   Vector activeRes;
 
-  static String HELIX = "Helix";
+  final String HELIX = "Helix";
 
-  static String SHEET = "Sheet";
+  final String SHEET = "Sheet";
+  
+  /**
+   * For RNA secondary structure "stems" aka helices
+   */
+  final String STEM = "RNA Helix";
 
-  static String LABEL = "Label";
+  final String LABEL = "Label";
 
-  static String REMOVE = "Remove Annotation";
+  final String REMOVE = "Remove Annotation";
 
-  static String COLOUR = "Colour";
+  final String COLOUR = "Colour";
 
-  static Color HELIX_COLOUR = Color.red.darker();
+  final Color HELIX_COLOUR = Color.red.darker();
 
-  static Color SHEET_COLOUR = Color.green.darker().darker();
+  final Color SHEET_COLOUR = Color.green.darker().darker();
 
   Image image;
 
@@ -74,6 +81,8 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
   boolean MAC = false;
 
+  public final AnnotationRenderer renderer;
+
   public AnnotationPanel(AlignmentPanel ap)
   {
     MAC = new jalview.util.Platform().isAMac();
@@ -88,11 +97,13 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
     addMouseListener(this);
 
     // ap.annotationScroller.getVAdjustable().addAdjustmentListener( this );
+    renderer = new AnnotationRenderer();
   }
 
   public AnnotationPanel(AlignViewport av)
   {
     this.av = av;
+    renderer = new AnnotationRenderer();
   }
 
   public void adjustmentValueChanged(AdjustmentEvent evt)
@@ -107,7 +118,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
    */
   public void actionPerformed(ActionEvent evt)
   {
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     if (aa == null)
     {
       return;
@@ -123,8 +134,8 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
     }
 
     String label = "";
-    if (av.colSel != null && av.colSel.size() > 0
-            && anot[av.colSel.getMin()] != null)
+    if (av.getColumnSelection() != null && av.getColumnSelection().size() > 0
+            && anot[av.getColumnSelection().getMin()] != null)
       label = anot[av.getColumnSelection().getMin()].displayCharacter;
 
     if (evt.getActionCommand().equals(REMOVE))
@@ -152,7 +163,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       {
         int index = av.getColumnSelection().columnAt(i);
 
-        if (!av.colSel.isVisible(index))
+        if (!av.getColumnSelection().isVisible(index))
           continue;
 
         if (anot[index] == null)
@@ -174,7 +185,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       {
         int index = av.getColumnSelection().columnAt(i);
 
-        if (!av.colSel.isVisible(index))
+        if (!av.getColumnSelection().isVisible(index))
           continue;
 
         if (anot[index] == null)
@@ -201,6 +212,13 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
         symbol = "\u03B2";
       }
 
+      // Added by LML to color stems
+      else if (evt.getActionCommand().equals(STEM))
+      {
+        type = 'S';
+        symbol = "\u03C3";
+      }
+
       if (!aa[activeRow].hasIcons)
       {
         aa[activeRow].hasIcons = true;
@@ -222,7 +240,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       {
         int index = av.getColumnSelection().columnAt(i);
 
-        if (!av.colSel.isVisible(index))
+        if (!av.getColumnSelection().isVisible(index))
           continue;
 
         if (anot[index] == null)
@@ -235,6 +253,8 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       }
     }
 
+    aa[activeRow].validateRangeAndDisplay();
+
     adjustPanelHeight();
     repaint();
 
@@ -254,7 +274,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
   public void mousePressed(MouseEvent evt)
   {
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     if (aa == null)
     {
       return;
@@ -296,12 +316,23 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       }
 
       PopupMenu pop = new PopupMenu("Structure type");
-      MenuItem item = new MenuItem(HELIX);
-      item.addActionListener(this);
-      pop.add(item);
-      item = new MenuItem(SHEET);
-      item.addActionListener(this);
-      pop.add(item);
+      MenuItem item;
+      /*
+       * Just display the needed structure options
+       */
+      if (av.getAlignment().isNucleotide() == true)
+      {
+        item = new MenuItem(STEM);
+        item.addActionListener(this);
+        pop.add(item);
+      } else {
+        item = new MenuItem(HELIX);
+        item.addActionListener(this);
+        pop.add(item);
+        item = new MenuItem(SHEET);
+        item.addActionListener(this);
+        pop.add(item);
+      }
       item = new MenuItem(LABEL);
       item.addActionListener(this);
       pop.add(item);
@@ -348,11 +379,11 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
   {
     if (graphStretch > -1)
     {
-      av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
+      av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
               - evt.getY();
-      if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
+      if (av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight < 0)
       {
-        av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
+        av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0;
       }
       graphStretchY = evt.getY();
       calcPanelHeight();
@@ -367,7 +398,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
   public void mouseMoved(MouseEvent evt)
   {
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     if (aa == null)
     {
       return;
@@ -392,7 +423,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
     int res = evt.getX() / av.getCharWidth() + av.getStartRes();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
@@ -442,7 +473,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
   public int calcPanelHeight()
   {
     // setHeight of panels
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     int height = 0;
 
     if (aa != null)
@@ -492,7 +523,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
   {
     if (activeRow == -1)
     {
-      AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+      AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
       if (aa == null)
       {
         return;
@@ -557,8 +588,8 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
   public void fastPaint(int horizontal)
   {
-    if (horizontal == 0 || av.alignment.getAlignmentAnnotation() == null
-            || av.alignment.getAlignmentAnnotation().length < 1)
+    if (horizontal == 0 || av.getAlignment().getAlignmentAnnotation() == null
+            || av.getAlignment().getAlignmentAnnotation().length < 1)
     {
       repaint();
       return;
@@ -611,8 +642,8 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       fm = g.getFontMetrics();
     }
 
-    if ((av.alignment.getAlignmentAnnotation() == null)
-            || (av.alignment.getAlignmentAnnotation().length < 1))
+    if ((av.getAlignment().getAlignmentAnnotation() == null)
+            || (av.getAlignment().getAlignmentAnnotation().length < 1))
     {
       g.setColor(Color.white);
       g.fillRect(0, 0, getSize().width, getSize().height);
@@ -624,664 +655,34 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
       return;
     }
-
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
     g.translate(0, -scrollOffset);
-    int x = 0;
-    int y = 0;
-    int column = 0;
-    char lastSS;
-    int lastSSX;
-    int iconOffset = av.charHeight / 2;
-    boolean validRes = false;
-    boolean validEnd = false;
-    boolean labelAllCols = false;
-    boolean centreColLabels, centreColLabelsDef = av
-            .getCentreColumnLabels();
-    boolean scaleColLabel = false;
-    boolean[] graphGroupDrawn = new boolean[aa.length];
-    int charOffset = 0; // offset for a label
-    float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
-                                   // column.
-    // \u03B2 \u03B1
-    for (int i = 0; i < aa.length; i++)
-    {
-      AlignmentAnnotation row = aa[i];
-
-      if (!row.visible)
-      {
-        continue;
-      }
-      centreColLabels = row.centreColLabels || centreColLabelsDef;
-      labelAllCols = row.showAllColLabels;
-      scaleColLabel = row.scaleColLabel;
-      lastSS = ' ';
-      lastSSX = 0;
-
-      if (row.graph > 0)
-      {
-        if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
-        {
-          continue;
-        }
-
-        // this is so that we draw the characters below the graph
-        y += row.height;
-
-        if (row.hasText)
-        {
-          iconOffset = av.charHeight - fm.getDescent();
-          y -= av.charHeight;
-        }
-      }
-      // TODO: else is the logic used in application, applet had no 'else'
-      else if (row.hasText)
-      {
-        iconOffset = av.charHeight - fm.getDescent();
-
-      }
-      else
-      {
-        iconOffset = 0;
-      }
-
-      x = 0;
-      while (x < endRes - startRes)
-      {
-        if (av.hasHiddenColumns)
-        {
-          column = av.getColumnSelection().adjustForHiddenColumns(
-                  startRes + x);
-          if (column > row.annotations.length - 1)
-          {
-            break;
-          }
-        }
-        else
-        {
-          column = startRes + x;
-        }
-
-        if ((row.annotations.length <= column)
-                || (row.annotations[column] == null))
-        {
-          validRes = false;
-        }
-        else
-        {
-          validRes = true;
-        }
-
-        if (activeRow == i)
-        {
-          g.setColor(Color.red);
-
-          if (av.getColumnSelection() != null)
-          {
-            for (int n = 0; n < av.getColumnSelection().size(); n++)
-            {
-              int v = av.getColumnSelection().columnAt(n);
-
-              if (v == column)
-              {
-                g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
-              }
-            }
-          }
-        }
-
-        if (av.validCharWidth
-                && validRes
-                && (row.annotations[column].displayCharacter != null && row.annotations[column].displayCharacter
-                        .length() > 0))
-        {
-
-          if (centreColLabels || scaleColLabel)
-          {
-            fmWidth = (float) fm.charsWidth(
-                    row.annotations[column].displayCharacter.toCharArray(),
-                    0, row.annotations[column].displayCharacter.length());
-
-            if (scaleColLabel)
-            {
-              // justify the label and scale to fit in column
-              if (fmWidth > av.charWidth)
-              {
-                // scale only if the current font isn't already small enough
-                fmScaling = av.charWidth;
-                fmScaling /= fmWidth;
-                // not 1.1 // g.setFont(new
-                // Font(ofont,AffineTransform.getScaleInstance(fmScaling,
-                // 1.0)));
-                // and update the label's width to reflect the scaling.
-                fmWidth = av.charWidth;
-              }
-            }
-          }
-          else
-          {
-            fmWidth = (float) fm
-                    .charWidth(row.annotations[column].displayCharacter
-                            .charAt(0));
-          }
-          charOffset = (int) ((av.charWidth - fmWidth) / 2f);
-
-          if (row.annotations[column].colour == null)
-            g.setColor(Color.black);
-          else
-            g.setColor(row.annotations[column].colour);
-
-          if (column == 0 || row.graph > 0)
-          {
-            g.drawString(row.annotations[column].displayCharacter,
-                    (x * av.charWidth) + charOffset, y + iconOffset + 3); // +
-                                                                          // 3?
-          }
-          else if (row.annotations[column - 1] == null
-                  || (labelAllCols
-                          || !row.annotations[column].displayCharacter
-                                  .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
-                          .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
-          {
-            g.drawString(row.annotations[column].displayCharacter,
-                    (x * av.charWidth) + charOffset, y + iconOffset + 3); // +3?
-          }
-          g.setFont(ofont);
-        }
-
-        if (row.hasIcons)
-        {
-          if (!validRes
-                  || (row.annotations[column].secondaryStructure != lastSS))
-          {
-            switch (lastSS)
-            {
-            case 'H':
-              g.setColor(HELIX_COLOUR);
-              if (MAC)
-              {
-                // Off by 1 offset when drawing rects and ovals
-                // to offscreen image on the MAC
-                g.fillRoundRect(lastSSX, y + 4 + iconOffset,
-                        (x * av.charWidth) - lastSSX, 7, 8, 8);
-                break;
-              }
-
-              int sCol = (lastSSX / av.charWidth) + startRes;
-              int x1 = lastSSX;
-              int x2 = (x * av.charWidth);
-
-              if (sCol == 0
-                      || row.annotations[sCol - 1] == null
-                      || row.annotations[sCol - 1].secondaryStructure != 'H')
-              {
-                g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
-                        180);
-                x1 += av.charWidth / 2;
-              }
-
-              if (!validRes || row.annotations[column] == null
-                      || row.annotations[column].secondaryStructure != 'H')
-              {
-                g.fillArc((x * av.charWidth) - av.charWidth, y + 4
-                        + iconOffset, av.charWidth, 8, 270, 180);
-                x2 -= av.charWidth / 2;
-              }
-
-              g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
-              break;
-
-            case 'E':
-              g.setColor(SHEET_COLOUR);
-              g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
-                      - lastSSX - 4, 7);
-              g.fillPolygon(new int[]
-              { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
-                  (x * av.charWidth) }, new int[]
-              { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
-                      3);
-
-              break;
-
-            default:
-              g.setColor(Color.gray);
-              g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
-                      - lastSSX, 2);
-
-              break;
-            }
-
-            if (validRes)
-            {
-              lastSS = row.annotations[column].secondaryStructure;
-            }
-            else
-            {
-              lastSS = ' ';
-            }
-
-            lastSSX = (x * av.charWidth);
-          }
-        }
-
-        column++;
-        x++;
-      }
-
-      if (column >= row.annotations.length)
-      {
-        column = row.annotations.length - 1;
-        validEnd = false;
-      }
-      else
-      {
-        validEnd = true;
-      }
-
-      // x ++;
-
-      if (row.hasIcons)
-      {
-        switch (lastSS)
-        {
-        case 'H':
-          g.setColor(HELIX_COLOUR);
-          if (MAC)
-          {
-            // Off by 1 offset when drawing rects and ovals
-            // to offscreen image on the MAC
-            g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
-                    - lastSSX, 7, 8, 8);
-            break;
-          }
-
-          int sCol = (lastSSX / av.charWidth) + startRes;
-          int x1 = lastSSX;
-          int x2 = (x * av.charWidth);
-
-          if (sCol == 0 || row.annotations[sCol - 1] == null
-                  || row.annotations[sCol - 1].secondaryStructure != 'H')
-          {
-            g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
-            x1 += av.charWidth / 2;
-          }
-
-          if (row.annotations[column] == null
-                  || row.annotations[column].secondaryStructure != 'H')
-          {
-            g.fillArc((x * av.charWidth) - av.charWidth,
-                    y + 4 + iconOffset, av.charWidth, 8, 270, 180);
-            x2 -= av.charWidth / 2;
-          }
-
-          g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
-
-          break;
-
-        case 'E':
-          g.setColor(SHEET_COLOUR);
-
-          if (!validEnd || row.annotations[endRes] == null
-                  || row.annotations[endRes].secondaryStructure != 'E')
-          {
-            g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
-                    - lastSSX - 4, 7);
-            g.fillPolygon(new int[]
-            { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
-                (x * av.charWidth) }, new int[]
-            { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
-          }
-          else
-          {
-            g.fillRect(lastSSX, y + 4 + iconOffset, x * av.charWidth
-                    - lastSSX, 7);
-          }
-          break;
-
-        default:
-          g.setColor(Color.gray);
-          if (!av.wrapAlignment || endRes == av.endRes)
-          {
-            g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
-                    - lastSSX, 2);
-          }
-
-          break;
-        }
-      }
-
-      if (row.graph > 0 && row.graphHeight > 0)
-      {
-        if (row.graph == AlignmentAnnotation.LINE_GRAPH)
-        {
-          if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
-          {
-            float groupmax = -999999, groupmin = 9999999;
-            for (int gg = 0; gg < aa.length; gg++)
-            {
-              if (aa[gg].graphGroup != row.graphGroup)
-              {
-                continue;
-              }
-
-              if (aa[gg] != row)
-              {
-                aa[gg].visible = false;
-              }
-
-              if (aa[gg].graphMax > groupmax)
-              {
-                groupmax = aa[gg].graphMax;
-              }
-              if (aa[gg].graphMin < groupmin)
-              {
-                groupmin = aa[gg].graphMin;
-              }
-            }
-
-            for (int gg = 0; gg < aa.length; gg++)
-            {
-              if (aa[gg].graphGroup == row.graphGroup)
-              {
-                drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
-                        groupmax, row.graphHeight);
-              }
-            }
-
-            graphGroupDrawn[row.graphGroup] = true;
-          }
-          else
-          {
-            drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
-                    row.graphMax, row.graphHeight);
-          }
-        }
-        else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
-        {
-          drawBarGraph(g, row, startRes, endRes, row.graphMin,
-                  row.graphMax, y);
-        }
-      }
-
-      if (row.graph > 0 && row.hasText)
-      {
-        y += av.charHeight;
-      }
-
-      if (row.graph == 0)
-      {
-        y += aa[i].height;
-      }
-    }
+    renderer.drawComponent(this, av, g, activeRow, startRes, endRes);
     g.translate(0, +scrollOffset);
   }
+  
+  int scrollOffset = 0;
 
-  public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
-          int eRes, int y, float min, float max, int graphHeight)
-  {
-    if (sRes > aa.annotations.length)
-    {
-      return;
-    }
-
-    int x = 0;
-
-    // Adjustment for fastpaint to left
-    if (eRes < av.endRes)
-    {
-      eRes++;
-    }
-
-    eRes = Math.min(eRes, aa.annotations.length);
-
-    int y1 = y, y2 = y;
-    float range = max - min;
-
-    // //Draw origin
-    if (min < 0)
-    {
-      y2 = y - (int) ((0 - min / range) * graphHeight);
-    }
-
-    g.setColor(Color.gray);
-    g.drawLine(x - av.charWidth, y2, (eRes - sRes) * av.charWidth, y2);
-
-    eRes = Math.min(eRes, aa.annotations.length);
-
-    int column;
-    int aaMax = aa.annotations.length - 1;
-
-    while (x < eRes - sRes)
-    {
-      column = sRes + x;
-      if (av.hasHiddenColumns)
-      {
-        column = av.getColumnSelection().adjustForHiddenColumns(column);
-      }
-
-      if (column > aaMax)
-      {
-        break;
-      }
-
-      if (aa.annotations[column] == null) // || coaa.annotations[column - 1] ==
-      // null)
-      {
-        x++;
-        continue;
-      }
-
-      if (aa.annotations[column].colour == null)
-        g.setColor(Color.black);
-      else
-        g.setColor(aa.annotations[column].colour);
-      if (column == 0 || aa.annotations[column - 1] == null)
-      {
-        y1 = y
-                - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
-      }
-      else
-      {
-        y1 = y
-                - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
-      }
-      y2 = y
-              - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
-
-      g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
-              + av.charWidth / 2, y2);
-      x++;
-    }
-
-    if (aa.threshold != null)
-    {
-      g.setColor(aa.threshold.colour);
-
-      y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
-      g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
-    }
-  }
-
-  public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
-          int eRes, float min, float max, int y)
+  public void setScrollOffset(int value)
   {
-    ColourSchemeI profcolour = av.getGlobalColourScheme();
-    if (profcolour == null)
-    {
-      profcolour = new jalview.schemes.ZappoColourScheme();
-    }
-    if (sRes > aa.annotations.length)
-    {
-      return;
-    }
-    Font ofont = g.getFont();
-    eRes = Math.min(eRes, aa.annotations.length);
-
-    int x = 0, y1 = y, y2 = y;
-
-    float range = max - min;
-
-    if (min < 0)
-    {
-      y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
-    }
-
-    g.setColor(Color.gray);
-
-    g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
-
-    int column;
-    int aaMax = aa.annotations.length - 1;
-    boolean renderHistogram = true, renderProfile = false;
-    if (aa.autoCalculated && aa.label.startsWith("Consensus"))
-    { // TODO: generalise this to have render styles for consensus/profile data
-      if (aa.groupRef != null)
-      {
-        renderHistogram = aa.groupRef.isShowConsensusHistogram();
-        renderProfile = aa.groupRef.isShowSequenceLogo();
-      }
-      else
-      {
-        renderHistogram = av.isShowConsensusHistogram();
-        renderProfile = av.isShowSequenceLogo();
-      }
-    }
-
-    while (x < eRes - sRes)
-    {
-      column = sRes + x;
-      if (av.hasHiddenColumns)
-      {
-        column = av.getColumnSelection().adjustForHiddenColumns(column);
-      }
-
-      if (column > aaMax)
-      {
-        break;
-      }
-
-      if (aa.annotations[column] == null)
-      {
-        x++;
-        continue;
-      }
-
-      if (aa.annotations[column].colour == null)
-        g.setColor(Color.black);
-      else
-        g.setColor(aa.annotations[column].colour);
-
-      y1 = y
-              - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
-
-      if (renderHistogram)
-      {
-        if (y1 - y2 > 0)
-        {
-          g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
-        }
-        else
-        {
-          g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
-        }
-      }
-      // draw profile if available
-      if (aa.annotations[column].value != 0 && renderProfile)
-      {
-        int profl[] = getProfileFor(aa, column);
-        int ht = y1, htn = y2 - y1;// aa.graphHeight;
-        float wdth;
-        double ht2 = 0;
-        char[] dc = new char[1];
-        LineMetrics lm;
-        for (int c = 1; profl != null && c < profl[0];)
-        {
-          dc[0] = (char) profl[c++];
-          wdth = av.charWidth;
-          wdth /= (float) fm.charsWidth(dc, 0, 1);
-
-          if (c > 2)
-          {
-            ht += (int) ht2;
-          }
-          { // not java 1.1 compatible: Bug # 0060064
-            g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(
-                    wdth, (ht2 = (htn * ((double) profl[c++]) / 100.0))
-                            / av.charHeight)));
-            lm = g.getFontMetrics().getLineMetrics(dc, 0, 1, g);
-            g.setColor(profcolour.findColour(dc[0]));
-            g.drawChars(dc, 0, 1, x * av.charWidth,
-                    (int) (ht + lm.getHeight()));
-          }
-        }
-        g.setFont(ofont);
-      }
-
-      x++;
-
-    }
-    if (aa.threshold != null)
-    {
-      g.setColor(aa.threshold.colour);
-      y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
-      g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
-    }
+    scrollOffset = value;
+    repaint();
   }
 
-  private int[] getProfileFor(AlignmentAnnotation aa, int column)
+  @Override
+  public FontMetrics getFontMetrics()
   {
-    // if (aa.autoCalculated && aa.label.startsWith("Consensus")) {
-    if (aa.groupRef != null && aa.groupRef.consensusData != null)
-    {
-      // && aa.groupRef.isShowSequenceLogo()) {
-      return AAFrequency.extractProfile(aa.groupRef.consensusData[column],
-              aa.groupRef.getIgnoreGapsConsensus());
-    }
-    // TODO extend annotation row to enable dynamic and static profile data to
-    // be stored
-    if (aa.groupRef == null && aa.sequenceRef == null)
-    // && av.isShowSequenceLogo())
-    {
-      return AAFrequency.extractProfile(av.hconsensus[column],
-              av.getIgnoreGapsConsensus());
-    }
-    // }
-    return null;
+    return fm;
   }
 
-  // used by overview window
-  public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
-          int y, int sRes, int eRes)
+  @Override
+  public Image getFadedImage()
   {
-    eRes = Math.min(eRes, aa.annotations.length);
-    g.setColor(Color.white);
-    g.fillRect(0, 0, width, y);
-    g.setColor(new Color(0, 0, 180));
-
-    int x = 0, height;
-
-    for (int j = sRes; j < eRes; j++)
-    {
-      if (aa.annotations[j].colour == null)
-        g.setColor(Color.black);
-      else
-        g.setColor(aa.annotations[j].colour);
-
-      height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);
-      if (height > y)
-      {
-        height = y;
-      }
-      g.fillRect(x, y - height, av.charWidth, height);
-      x += av.charWidth;
-    }
+    return image;
   }
 
-  int scrollOffset = 0;
-
-  public void setScrollOffset(int value)
+  @Override
+  public int getFadedImageWidth()
   {
-    scrollOffset = value;
-    repaint();
+    return imgWidth;
   }
 }
index 7bf21a8..afaedb8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -71,6 +71,8 @@ public class AppletJmol extends EmbmenuFrame implements
   MenuItem turn = new MenuItem("Turn Propensity");
 
   MenuItem buried = new MenuItem("Buried Index");
+  
+  MenuItem purinepyrimidine = new MenuItem("Purine/Pyrimidine");
 
   MenuItem user = new MenuItem("User Defined Colours");
 
@@ -187,6 +189,7 @@ public class AppletJmol extends EmbmenuFrame implements
     strand.addActionListener(this);
     turn.addActionListener(this);
     buried.addActionListener(this);
+    purinepyrimidine.addActionListener(this);
     user.addActionListener(this);
     
     jmolHelp.addActionListener(this);
@@ -201,6 +204,7 @@ public class AppletJmol extends EmbmenuFrame implements
     coloursMenu.add(strand);
     coloursMenu.add(turn);
     coloursMenu.add(buried);
+    coloursMenu.add(purinepyrimidine);
     coloursMenu.add(user);
     coloursMenu.add(jmolColour);
     helpMenu.add(jmolHelp);
@@ -444,6 +448,10 @@ public class AppletJmol extends EmbmenuFrame implements
       setEnabled(buried);
       jmb.setJalviewColourScheme(new BuriedColourScheme());
     }
+    else if(evt.getSource() == purinepyrimidine)
+    {
+       jmb.setJalviewColourScheme(new PurinePyrimidineColourScheme());
+    }
     else if (evt.getSource() == user)
     {
       setEnabled(user);
index 808e30b..23aa311 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e5b5e43..b00a621 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -157,7 +157,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
     else if (annotationImport)
     {
       if (new AnnotationFile().readAnnotationFile(
-              alignFrame.viewport.alignment, textarea.getText(),
+              alignFrame.viewport.getAlignment(), textarea.getText(),
               jalview.io.AppletFormatAdapter.PASTE))
       {
         alignFrame.alignPanel.fontChanged();
index 162750a..99ffbf6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 005f4a3..cdaca2b 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index b3d1a3c..705b510 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a35cf49..4f67357 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 03f15d3..259030f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -786,10 +786,10 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     av.featuresDisplayed = new Hashtable();
     Vector allfeatures = new Vector();
     minmax = new Hashtable();
-
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    AlignmentI alignment=av.getAlignment();
+    for (int i = 0; i < alignment.getHeight(); i++)
     {
-      SequenceFeature[] features = av.alignment.getSequenceAt(i)
+      SequenceFeature[] features = alignment.getSequenceAt(i)
               .getSequenceFeatures();
 
       if (features == null)
@@ -1110,16 +1110,17 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     ArrayList allGroups = new ArrayList();
     SequenceFeature[] tmpfeatures;
     String group;
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    AlignmentI alignment=av.getAlignment();
+    for (int i = 0; i < alignment.getHeight(); i++)
     {
-      if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+      if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
       {
         continue;
       }
 
       alignmentHasFeatures = true;
 
-      tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+      tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
       int index = 0;
       while (index < tmpfeatures.length)
       {
@@ -1175,16 +1176,17 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     Vector allFeatures = new Vector();
     SequenceFeature[] tmpfeatures;
     String group;
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    AlignmentI alignment=av.getAlignment();
+    for (int i = 0; i < alignment.getHeight(); i++)
     {
-      if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+      if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
       {
         continue;
       }
 
       alignmentHasFeatures = true;
 
-      tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+      tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
       int index = 0;
       while (index < tmpfeatures.length)
       {
index ee0e23d..de9d231 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -291,15 +291,15 @@ public class FeatureSettings extends Panel implements ItemListener,
     SequenceFeature[] tmpfeatures;
     String group = null, type;
     Vector visibleChecks = new Vector();
-
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    AlignmentI alignment=av.getAlignment();
+    for (int i = 0; i < alignment.getHeight(); i++)
     {
-      if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+      if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
       {
         continue;
       }
 
-      tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+      tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
       int index = 0;
       while (index < tmpfeatures.length)
       {
index 5f697ea..583a5ad 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7a27df8..bdadc5d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 58a4af1..67bba32 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -80,7 +80,7 @@ public class IdCanvas extends Panel
             ((i - starty) * charHeight) + ypos + charHeight
                     - (charHeight / 5));
 
-    if (av.hasHiddenRows && av.showHiddenMarkers)
+    if (av.hasHiddenRows() && av.showHiddenMarkers)
     {
       drawMarker(i, starty, ypos);
     }
@@ -186,10 +186,10 @@ public class IdCanvas extends Panel
 
     if (av.getWrapAlignment())
     {
-      int maxwidth = av.alignment.getWidth();
-      int alheight = av.alignment.getHeight();
+      int maxwidth = av.getAlignment().getWidth();
+      int alheight = av.getAlignment().getHeight();
 
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
       }
@@ -221,9 +221,9 @@ public class IdCanvas extends Panel
         for (int i = starty; i < alheight; i++)
         {
 
-          SequenceI s = av.alignment.getSequenceAt(i);
+          SequenceI s = av.getAlignment().getSequenceAt(i);
           gg.setFont(italic);
-          if (av.hasHiddenRows)
+          if (av.hasHiddenRows())
           {
             setHiddenFont(s);
           }
@@ -246,14 +246,14 @@ public class IdCanvas extends Panel
       for (int i = starty; i < endy; i++)
       {
 
-        seq = av.alignment.getSequenceAt(i);
+        seq = av.getAlignment().getSequenceAt(i);
         if (seq == null)
         {
           continue;
         }
         gg.setFont(italic);
         // boolean isrep=false;
-        if (av.hasHiddenRows)
+        if (av.hasHiddenRows())
         {
           // isrep =
           setHiddenFont(seq);
@@ -288,7 +288,7 @@ public class IdCanvas extends Panel
                 (((i - starty) * av.charHeight) + av.charHeight)
                         - (av.charHeight / 5));
 
-        if (av.hasHiddenRows && av.showHiddenMarkers)
+        if (av.hasHiddenRows() && av.showHiddenMarkers)
         {
           drawMarker(i, starty, 0);
         }
@@ -304,7 +304,7 @@ public class IdCanvas extends Panel
 
   void drawMarker(int i, int starty, int yoffset)
   {
-    SequenceI[] hseqs = av.alignment.getHiddenSequences().hiddenSequences;
+    SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences;
     // Use this method here instead of calling hiddenSeq adjust
     // 3 times.
     int hSize = hseqs.length;
@@ -362,8 +362,8 @@ public class IdCanvas extends Panel
     Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
             .getSize());
 
-    if (av.hiddenRepSequences != null
-            && av.hiddenRepSequences.containsKey(seq))
+    if (av.getHiddenRepSequences() != null
+            && av.getHiddenRepSequences().containsKey(seq))
     {
       gg.setFont(bold);
       return true;
index 1497616..a6bff67 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -272,7 +272,7 @@ public class IdPanel extends Panel implements MouseListener,
     }
 
     if (mouseDragging && e.getY() >= getSize().height
-            && av.alignment.getHeight() > av.getEndSeq())
+            && av.getAlignment().getHeight() > av.getEndSeq())
     {
       scrollThread = new ScrollThread(false);
     }
@@ -331,7 +331,7 @@ public class IdPanel extends Panel implements MouseListener,
     {
       av.setSelectionGroup(new SequenceGroup());
       av.getSelectionGroup().setStartRes(0);
-      av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+      av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
     }
 
     if (e.isShiftDown() && lastid != -1)
@@ -409,7 +409,7 @@ public class IdPanel extends Panel implements MouseListener,
       return;
     }
 
-    int index = av.alignment.findIndex((SequenceI) found.elementAt(0));
+    int index = av.getAlignment().findIndex((SequenceI) found.elementAt(0));
 
     // do we need to scroll the panel?
     if (av.getStartSeq() > index || av.getEndSeq() < index)
@@ -454,7 +454,7 @@ public class IdPanel extends Panel implements MouseListener,
           {
             selectSeqs(lastid - 1, seq);
           }
-          else if (seq > lastid && seq < av.alignment.getHeight())
+          else if (seq > lastid && seq < av.getAlignment().getHeight())
           {
             selectSeqs(lastid + 1, seq);
           }
index 047d657..6495750 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index eaf8255..a722458 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 01b448c..4b646c3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -17,6 +17,8 @@
  */
 package jalview.appletgui;
 
+import jalview.datamodel.AlignmentI;
+
 import java.awt.*;
 import java.awt.event.*;
 
@@ -65,17 +67,17 @@ public class OverviewPanel extends Panel implements Runnable,
     sr.forOverview = true;
     fr = new FeatureRenderer(av);
     fr.overview = true;
-
+    
     // scale the initial size of overviewpanel to shape of alignment
-    float initialScale = (float) av.alignment.getWidth()
-            / (float) av.alignment.getHeight();
+    float initialScale = (float) av.getAlignment().getWidth()
+            / (float) av.getAlignment().getHeight();
 
-    if (av.hconsensus == null)
+    if (av.getSequenceConsensusHash() == null)
     {
       graphHeight = 0;
     }
 
-    if (av.alignment.getWidth() > av.alignment.getHeight())
+    if (av.getAlignment().getWidth() > av.getAlignment().getHeight())
     {
       // wider
       width = 400;
@@ -174,7 +176,7 @@ public class OverviewPanel extends Panel implements Runnable,
 
     if (boxX > (width - boxWidth))
     {
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         // Try smallest possible box
         boxWidth = (int) ((av.endRes - av.startRes + 1) * av.getCharWidth() * scalew);
@@ -185,7 +187,7 @@ public class OverviewPanel extends Panel implements Runnable,
     int col = (int) (boxX / scalew / av.getCharWidth());
     int row = (int) (boxY / scaleh / av.getCharHeight());
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       if (!av.getColumnSelection().isVisible(col))
       {
@@ -195,9 +197,9 @@ public class OverviewPanel extends Panel implements Runnable,
       col = av.getColumnSelection().findColumnPosition(col);
     }
 
-    if (av.hasHiddenRows)
+    if (av.hasHiddenRows())
     {
-      row = av.alignment.getHiddenSequences().findIndexWithoutHiddenSeqs(
+      row = av.getAlignment().getHiddenSequences().findIndexWithoutHiddenSeqs(
               row);
     }
 
@@ -243,8 +245,8 @@ public class OverviewPanel extends Panel implements Runnable,
   public void run()
   {
     miniMe = null;
-    int alwidth = av.alignment.getWidth();
-    int alheight = av.alignment.getHeight();
+    int alwidth = av.getAlignment().getWidth();
+    int alheight = av.getAlignment().getHeight();
 
     if (av.showSequenceFeatures)
     {
@@ -278,6 +280,7 @@ public class OverviewPanel extends Panel implements Runnable,
     int row, col, sameRow = 0, sameCol = 0;
     jalview.datamodel.SequenceI seq;
     boolean hiddenRow = false;
+    AlignmentI alignment=av.getAlignment();
     for (row = 0; row <= sequencesHeight; row++)
     {
       if ((int) (row * sampleRow) == lastrow)
@@ -287,15 +290,15 @@ public class OverviewPanel extends Panel implements Runnable,
       }
 
       hiddenRow = false;
-      if (av.hasHiddenRows)
+      if (av.hasHiddenRows())
       {
-        seq = av.alignment.getHiddenSequences().getHiddenSequence(lastrow);
+        seq = alignment.getHiddenSequences().getHiddenSequence(lastrow);
         if (seq == null)
         {
-          int index = av.alignment.getHiddenSequences()
+          int index = alignment.getHiddenSequences()
                   .findIndexWithoutHiddenSeqs(lastrow);
 
-          seq = av.alignment.getSequenceAt(index);
+          seq = alignment.getSequenceAt(index);
         }
         else
         {
@@ -304,7 +307,7 @@ public class OverviewPanel extends Panel implements Runnable,
       }
       else
       {
-        seq = av.alignment.getSequenceAt(lastrow);
+        seq = alignment.getSequenceAt(lastrow);
       }
 
       for (col = 0; col < width; col++)
@@ -333,7 +336,7 @@ public class OverviewPanel extends Panel implements Runnable,
         }
 
         if (hiddenRow
-                || (av.hasHiddenColumns && !av.getColumnSelection()
+                || (av.hasHiddenColumns() && !av.getColumnSelection()
                         .isVisible(lastcol)))
         {
           color = color.darker().darker();
@@ -357,14 +360,14 @@ public class OverviewPanel extends Panel implements Runnable,
       sameRow = 1;
     }
 
-    if (av.conservation != null)
+    if (av.getAlignmentConservationAnnotation()!= null)
     {
       for (col = 0; col < width; col++)
       {
         lastcol = (int) (col * sampleCol);
         {
           mg.translate(col, sequencesHeight);
-          ap.annotationPanel.drawGraph(mg, av.conservation,
+          ap.annotationPanel.renderer.drawGraph(mg, av.getAlignmentConservationAnnotation(),
                   (int) (sampleCol) + 1, graphHeight,
                   (int) (col * sampleCol), (int) (col * sampleCol) + 1);
           mg.translate(-col, -sequencesHeight);
@@ -386,14 +389,14 @@ public class OverviewPanel extends Panel implements Runnable,
 
   public void setBoxPosition()
   {
-    int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
-    int fullsizeHeight = (av.alignment.getHeight() + av.alignment
+    int fullsizeWidth = av.getAlignment().getWidth() * av.getCharWidth();
+    int fullsizeHeight = (av.getAlignment().getHeight() + av.getAlignment()
             .getHiddenSequences().getSize()) * av.getCharHeight();
 
     int startRes = av.getStartRes();
     int endRes = av.getEndRes();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       startRes = av.getColumnSelection().adjustForHiddenColumns(startRes);
       endRes = av.getColumnSelection().adjustForHiddenColumns(endRes);
@@ -402,12 +405,12 @@ public class OverviewPanel extends Panel implements Runnable,
     int startSeq = av.startSeq;
     int endSeq = av.endSeq;
 
-    if (av.hasHiddenRows)
+    if (av.hasHiddenRows())
     {
-      startSeq = av.alignment.getHiddenSequences().adjustForHiddenSeqs(
+      startSeq = av.getAlignment().getHiddenSequences().adjustForHiddenSeqs(
               startSeq);
 
-      endSeq = av.alignment.getHiddenSequences()
+      endSeq = av.getAlignment().getHiddenSequences()
               .adjustForHiddenSeqs(endSeq);
 
     }
@@ -418,7 +421,7 @@ public class OverviewPanel extends Panel implements Runnable,
     boxX = (int) (startRes * av.getCharWidth() * scalew);
     boxY = (int) (startSeq * av.getCharHeight() * scaleh);
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       boxWidth = (int) ((endRes - startRes + 1) * av.getCharWidth() * scalew);
     }
index 8a39ad9..6568b5b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -61,11 +61,11 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
     seqstrings = av.getAlignmentView(av.getSelectionGroup() != null);
     if (av.getSelectionGroup() == null)
     {
-      seqs = av.alignment.getSequencesArray();
+      seqs = av.getAlignment().getSequencesArray();
     }
     else
     {
-      seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+      seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
     }
     SeqCigar sq[] = seqstrings.getSequences();
     int length = sq[0].getWidth();
index 722dd32..25e529b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -122,8 +122,8 @@ public class PaintRefresher
       else if (validateSequences && comp instanceof AlignmentPanel
               && source instanceof AlignmentPanel)
       {
-        validateSequences(((AlignmentPanel) source).av.alignment,
-                ((AlignmentPanel) comp).av.alignment);
+        validateSequences(((AlignmentPanel) source).av.getAlignment(),
+                ((AlignmentPanel) comp).av.getAlignment());
       }
 
       if (comp instanceof AlignmentPanel && alignmentChanged)
index fe5e31d..a1fb5ea 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -48,17 +48,17 @@ public class PairwiseAlignPanel extends Panel implements ActionListener
 
     if (ap.av.getSelectionGroup() == null)
     {
-      seqs = ap.av.alignment.getSequencesArray();
+      seqs = ap.av.getAlignment().getSequencesArray();
     }
     else
     {
-      seqs = ap.av.getSelectionGroup().getSequencesInOrder(ap.av.alignment);
+      seqs = ap.av.getSelectionGroup().getSequencesInOrder(ap.av.getAlignment());
     }
 
     float scores[][] = new float[seqs.length][seqs.length];
     double totscore = 0;
     int count = ap.av.getSelectionGroup().getSize();
-    String type = (ap.av.alignment.isNucleotide()) ? AlignSeq.DNA
+    String type = (ap.av.getAlignment().isNucleotide()) ? AlignSeq.DNA
             : AlignSeq.PEP;
     Sequence seq;
 
index b3c6a01..0b4987c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -28,8 +28,6 @@ import jalview.datamodel.*;
 public class RedundancyPanel extends SliderPanel implements Runnable,
         WindowListener
 {
-  AlignmentPanel ap;
-
   Stack historyList = new Stack(); // simpler than synching with alignFrame.
 
   float[] redundancy;
@@ -109,15 +107,15 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
 
     if ((sg != null) && (sg.getSize() >= 1))
     {
-      originalSequences = sg.getSequencesInOrder(ap.av.alignment);
+      originalSequences = sg.getSequencesInOrder(ap.av.getAlignment());
       start = sg.getStartRes();
       end = sg.getEndRes();
     }
     else
     {
-      originalSequences = ap.av.alignment.getSequencesArray();
+      originalSequences = ap.av.getAlignment().getSequencesArray();
       start = 0;
-      end = ap.av.alignment.getWidth();
+      end = ap.av.getAlignment().getWidth();
     }
 
     height = originalSequences.length;
@@ -241,11 +239,11 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
       }
 
       EditCommand cut = new EditCommand("Remove Redundancy",
-              EditCommand.CUT, deleted, 0, width, ap.av.alignment);
-
+              EditCommand.CUT, deleted, 0, width, ap.av.getAlignment());
+      AlignmentI alignment=ap.av.getAlignment();
       for (int i = 0; i < del.size(); i++)
       {
-        ap.av.alignment.deleteSequence(deleted[i]);
+        alignment.deleteSequence(deleted[i]);
         PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true);
         if (sg != null)
         {
index fd63acf..ce03ef0 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -518,13 +518,13 @@ public class RotatableCanvas extends Panel implements MouseListener,
       if (av.getSelectionGroup() != null)
       {
         av.getSelectionGroup().addOrRemove(found, true);
-        av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+        av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
       }
       else
       {
         av.setSelectionGroup(new SequenceGroup());
         av.getSelectionGroup().addOrRemove(found, true);
-        av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+        av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
 
       }
       PaintRefresher.Refresh(this, av.getSequenceSetId());
index 1f256fe..8fe6e30 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -60,7 +60,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
     int x = (evt.getX() / av.getCharWidth()) + av.getStartRes();
     final int res;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(x);
     }
@@ -122,7 +122,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
           {
             av.hideColumns(res, res);
             if (av.getSelectionGroup() != null
-                    && av.getSelectionGroup().getSize() == av.alignment
+                    && av.getSelectionGroup().getSize() == av.getAlignment()
                             .getHeight())
             {
               av.setSelectionGroup(null);
@@ -150,9 +150,9 @@ public class ScalePanel extends Panel implements MouseMotionListener,
 
       av.getColumnSelection().addElement(res);
       SequenceGroup sg = new SequenceGroup();
-      for (int i = 0; i < av.alignment.getSequences().size(); i++)
+      for (int i = 0; i < av.getAlignment().getSequences().size(); i++)
       {
-        sg.addSequence(av.alignment.getSequenceAt(i), false);
+        sg.addSequence(av.getAlignment().getSequenceAt(i), false);
       }
 
       sg.setStartRes(res);
@@ -182,12 +182,12 @@ public class ScalePanel extends Panel implements MouseMotionListener,
 
     int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
 
-    if (res > av.alignment.getWidth())
+    if (res > av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
@@ -225,14 +225,14 @@ public class ScalePanel extends Panel implements MouseMotionListener,
       res = 0;
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
 
-    if (res > av.alignment.getWidth())
+    if (res > av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
 
     if (res < min)
@@ -307,7 +307,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
 
   public void mouseMoved(MouseEvent evt)
   {
-    if (!av.hasHiddenColumns)
+    if (!av.hasHiddenColumns())
     {
       return;
     }
@@ -360,7 +360,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
     for (int i = 0; i < cs.size(); i++)
     {
       int sel = cs.columnAt(i);
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         sel = av.getColumnSelection().findColumnPosition(sel);
       }
@@ -417,7 +417,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
       }
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       gg.setColor(Color.blue);
       int res;
index 26da08b..2296ab1 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -78,7 +78,7 @@ public class SeqCanvas extends Panel
     for (int i = scalestartx; i < endx; i += 10)
     {
       int value = i;
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         value = av.getColumnSelection().adjustForHiddenColumns(value);
       }
@@ -97,22 +97,22 @@ public class SeqCanvas extends Panel
   {
     FontMetrics fm = getFontMetrics(av.getFont());
     ypos += av.charHeight;
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       startx = av.getColumnSelection().adjustForHiddenColumns(startx);
       endx = av.getColumnSelection().adjustForHiddenColumns(endx);
     }
 
-    int maxwidth = av.alignment.getWidth();
-    if (av.hasHiddenColumns)
+    int maxwidth = av.getAlignment().getWidth();
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
 
     // WEST SCALE
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    for (int i = 0; i < av.getAlignment().getHeight(); i++)
     {
-      SequenceI seq = av.alignment.getSequenceAt(i);
+      SequenceI seq = av.getAlignment().getSequenceAt(i);
       int index = startx;
       int value = -1;
 
@@ -125,7 +125,7 @@ public class SeqCanvas extends Panel
           continue;
         }
 
-        value = av.alignment.getSequenceAt(i).findPosition(index);
+        value = av.getAlignment().getSequenceAt(i).findPosition(index);
 
         break;
       }
@@ -144,16 +144,16 @@ public class SeqCanvas extends Panel
   {
     ypos += av.charHeight;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       endx = av.getColumnSelection().adjustForHiddenColumns(endx);
     }
 
     SequenceI seq;
     // EAST SCALE
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    for (int i = 0; i < av.getAlignment().getHeight(); i++)
     {
-      seq = av.alignment.getSequenceAt(i);
+      seq = av.getAlignment().getSequenceAt(i);
       int index = endx;
       int value = -1;
 
@@ -348,9 +348,10 @@ public class SeqCanvas extends Panel
     String mask = "0";
     int maxWidth = 0;
     int tmp;
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    AlignmentI alignment=av.getAlignment();
+    for (int i = 0; i < alignment.getHeight(); i++)
     {
-      tmp = av.alignment.getSequenceAt(i).getEnd();
+      tmp = alignment.getSequenceAt(i).getEnd();
       if (tmp > maxWidth)
       {
         maxWidth = tmp;
@@ -397,9 +398,9 @@ public class SeqCanvas extends Panel
     int endx;
     int ypos = hgap;
 
-    int maxwidth = av.alignment.getWidth() - 1;
+    int maxwidth = av.getAlignment().getWidth() - 1;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
@@ -433,7 +434,7 @@ public class SeqCanvas extends Panel
       {
         drawNorthScale(g, startRes, endx, ypos);
       }
-      if (av.hasHiddenColumns && av.showHiddenMarkers)
+      if (av.hasHiddenColumns() && av.showHiddenMarkers)
       {
         g.setColor(Color.blue);
         int res;
@@ -506,7 +507,7 @@ public class SeqCanvas extends Panel
   void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
           int endSeq, int offset)
   {
-    if (!av.hasHiddenColumns)
+    if (!av.hasHiddenColumns())
     {
       draw(g1, startRes, endRes, startSeq, endSeq, offset);
     }
@@ -575,14 +576,14 @@ public class SeqCanvas extends Panel
     // ///////////////////////////
     for (int i = startSeq; i < endSeq; i++)
     {
-      nextSeq = av.alignment.getSequenceAt(i);
+      nextSeq = av.getAlignment().getSequenceAt(i);
 
       if (nextSeq == null)
       {
         continue;
       }
 
-      sr.drawSequence(nextSeq, av.alignment.findAllGroups(nextSeq),
+      sr.drawSequence(nextSeq, av.getAlignment().findAllGroups(nextSeq),
               startRes, endRes, offset + ((i - startSeq) * av.charHeight));
 
       if (av.showSequenceFeatures)
@@ -619,7 +620,7 @@ public class SeqCanvas extends Panel
     }
 
     if (av.getSelectionGroup() != null
-            || av.alignment.getGroups().size() > 0)
+            || av.getAlignment().getGroups().size() > 0)
     {
       drawGroupsBoundaries(g, startRes, endRes, startSeq, endSeq, offset);
     }
@@ -640,9 +641,9 @@ public class SeqCanvas extends Panel
     int ex = -1;
     int groupIndex = -1;
 
-    if ((group == null) && (av.alignment.getGroups().size() > 0))
+    if ((group == null) && (av.getAlignment().getGroups().size() > 0))
     {
-      group = (SequenceGroup) av.alignment.getGroups().elementAt(0);
+      group = (SequenceGroup) av.getAlignment().getGroups().elementAt(0);
       groupIndex = 0;
     }
 
@@ -655,7 +656,7 @@ public class SeqCanvas extends Panel
         boolean inGroup = false;
         int top = -1;
         int bottom = -1;
-        int alHeight = av.alignment.getHeight() - 1;
+        int alHeight = av.getAlignment().getHeight() - 1;
 
         for (i = startSeq; i < endSeq; i++)
         {
@@ -670,11 +671,11 @@ public class SeqCanvas extends Panel
 
           if ((sx <= (endRes - startRes) * av.charWidth)
                   && group.getSequences(null).contains(
-                          av.alignment.getSequenceAt(i)))
+                          av.getAlignment().getSequenceAt(i)))
           {
             if ((bottom == -1)
                     && (i >= alHeight || !group.getSequences(null)
-                            .contains(av.alignment.getSequenceAt(i + 1))))
+                            .contains(av.getAlignment().getSequenceAt(i + 1))))
             {
               bottom = sy + av.charHeight;
             }
@@ -683,7 +684,7 @@ public class SeqCanvas extends Panel
             {
               if (((top == -1) && (i == 0))
                       || !group.getSequences(null).contains(
-                              av.alignment.getSequenceAt(i - 1)))
+                              av.getAlignment().getSequenceAt(i - 1)))
               {
                 top = sy;
               }
@@ -793,14 +794,14 @@ public class SeqCanvas extends Panel
 
         groupIndex++;
 
-        if (groupIndex >= av.alignment.getGroups().size())
+        if (groupIndex >= av.getAlignment().getGroups().size())
         {
           break;
         }
 
-        group = (SequenceGroup) av.alignment.getGroups().elementAt(
+        group = (SequenceGroup) av.getAlignment().getGroups().elementAt(
                 groupIndex);
-      } while (groupIndex < av.alignment.getGroups().size());
+      } while (groupIndex < av.getAlignment().getGroups().size());
 
     }
   }
index f961212..f121d11 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -154,19 +154,19 @@ public class SeqPanel extends Panel implements MouseMotionListener,
   {
     seqCanvas.cursorX += dx;
     seqCanvas.cursorY += dy;
-    if (av.hasHiddenColumns && !av.colSel.isVisible(seqCanvas.cursorX))
+    if (av.hasHiddenColumns() && !av.getColumnSelection().isVisible(seqCanvas.cursorX))
     {
       int original = seqCanvas.cursorX - dx;
-      int maxWidth = av.alignment.getWidth();
+      int maxWidth = av.getAlignment().getWidth();
 
-      while (!av.colSel.isVisible(seqCanvas.cursorX)
+      while (!av.getColumnSelection().isVisible(seqCanvas.cursorX)
               && seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0)
       {
         seqCanvas.cursorX += dx;
       }
 
       if (seqCanvas.cursorX >= maxWidth
-              || !av.colSel.isVisible(seqCanvas.cursorX))
+              || !av.getColumnSelection().isVisible(seqCanvas.cursorX))
       {
         seqCanvas.cursorX = original;
       }
@@ -180,18 +180,18 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     {
       seqCanvas.cursorX = 0;
     }
-    else if (seqCanvas.cursorX > av.alignment.getWidth() - 1)
+    else if (seqCanvas.cursorX > av.getAlignment().getWidth() - 1)
     {
-      seqCanvas.cursorX = av.alignment.getWidth() - 1;
+      seqCanvas.cursorX = av.getAlignment().getWidth() - 1;
     }
 
     if (seqCanvas.cursorY < 0)
     {
       seqCanvas.cursorY = 0;
     }
-    else if (seqCanvas.cursorY > av.alignment.getHeight() - 1)
+    else if (seqCanvas.cursorY > av.getAlignment().getHeight() - 1)
     {
-      seqCanvas.cursorY = av.alignment.getHeight() - 1;
+      seqCanvas.cursorY = av.getAlignment().getHeight() - 1;
     }
 
     endEditing();
@@ -209,7 +209,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       {
         ap.scrollUp(false);
       }
-      while (seqCanvas.cursorX < av.colSel
+      while (seqCanvas.cursorX < av.getColumnSelection()
               .adjustForHiddenColumns(av.startRes))
       {
 
@@ -218,7 +218,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
           break;
         }
       }
-      while (seqCanvas.cursorX > av.colSel
+      while (seqCanvas.cursorX > av.getColumnSelection()
               .adjustForHiddenColumns(av.endRes))
       {
         if (!ap.scrollRight(true))
@@ -227,7 +227,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         }
       }
     }
-    setStatusMessage(av.alignment.getSequenceAt(seqCanvas.cursorY),
+    setStatusMessage(av.getAlignment().getSequenceAt(seqCanvas.cursorY),
             seqCanvas.cursorX, seqCanvas.cursorY);
 
     seqCanvas.repaint();
@@ -240,12 +240,12 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
     if (av.getSelectionGroup() != null)
     {
-      SequenceGroup sg = av.selectionGroup;
+      SequenceGroup sg = av.getSelectionGroup();
       // Find the top and bottom of this group
-      int min = av.alignment.getHeight(), max = 0;
+      int min = av.getAlignment().getHeight(), max = 0;
       for (int i = 0; i < sg.getSize(); i++)
       {
-        int index = av.alignment.findIndex(sg.getSequenceAt(i));
+        int index = av.getAlignment().findIndex(sg.getSequenceAt(i));
         if (index > max)
         {
           max = index;
@@ -290,7 +290,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         sg.getSequences(null).removeAllElements();
         for (int i = min; i < max; i++)
         {
-          sg.addSequence(av.alignment.getSequenceAt(i), false);
+          sg.addSequence(av.getAlignment().getSequenceAt(i), false);
         }
       }
     }
@@ -372,7 +372,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
             + sequence.getName());
 
     Object obj = null;
-    if (av.alignment.isNucleotide())
+    if (av.getAlignment().isNucleotide())
     {
       obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res)
               + "");
@@ -455,7 +455,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
   public void mouseClicked(MouseEvent evt)
   {
-    SequenceI sequence = av.alignment.getSequenceAt(findSeq(evt));
+    SequenceI sequence = av.getAlignment().getSequenceAt(findSeq(evt));
     if (evt.getClickCount() > 1)
     {
       if (av.getSelectionGroup()!=null && av.getSelectionGroup().getSize() == 1
@@ -543,7 +543,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       res = (x / av.getCharWidth()) + av.getStartRes();
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
@@ -582,7 +582,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       y -= hgap;
 
       seq = Math.min((y % cHeight) / av.getCharHeight(),
-              av.alignment.getHeight() - 1);
+              av.getAlignment().getHeight() - 1);
       if (seq < 0)
       {
         seq = -1;
@@ -591,7 +591,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     else
     {
       seq = Math.min((y / av.getCharHeight()) + av.getStartSeq(),
-              av.alignment.getHeight() - 1);
+              av.getAlignment().getHeight() - 1);
       if (seq < 0)
       {
         seq = -1;
@@ -688,7 +688,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
             + sequence.getName());
 
     Object obj = null;
-    if (av.alignment.isNucleotide())
+    if (av.getAlignment().isNucleotide())
     {
       obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res)
               + "");
@@ -717,7 +717,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     ap.alignFrame.statusBar.setText(text.toString());
 
     StringBuffer tooltipText = new StringBuffer();
-    SequenceGroup[] groups = av.alignment.findAllGroups(sequence);
+    SequenceGroup[] groups = av.getAlignment().findAllGroups(sequence);
     if (groups != null)
     {
       for (int g = 0; g < groups.length; g++)
@@ -916,14 +916,13 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     boolean fixedColumns = false;
     SequenceGroup sg = av.getSelectionGroup();
 
-    SequenceI seq = av.alignment.getSequenceAt(startseq);
+    SequenceI seq = av.getAlignment().getSequenceAt(startseq);
 
-    if (!groupEditing && av.hasHiddenRows)
+    if (!groupEditing && av.hasHiddenRows())
     {
-      if (av.hiddenRepSequences != null
-              && av.hiddenRepSequences.containsKey(seq))
+      if (av.isHiddenRepSequence(seq))
       {
-        sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+        sg = (SequenceGroup) av.getRepresentedSequences(seq);
         groupEditing = true;
       }
     }
@@ -965,7 +964,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
     // Are we editing within a selection group?
     if (groupEditing
-            || (sg != null && sg.getSequences(av.hiddenRepSequences)
+            || (sg != null && sg.getSequences(av.getHiddenRepSequences())
                     .contains(seq)))
     {
       fixedColumns = true;
@@ -974,14 +973,13 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       // but the sequence represents a group
       if (sg == null)
       {
-        if (av.hiddenRepSequences == null
-                || !av.hiddenRepSequences.containsKey(seq))
+        if (!av.isHiddenRepSequence(seq))
         {
           endEditing();
           return;
         }
 
-        sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+        sg = av.getRepresentedSequences(seq);
       }
 
       fixedLeft = sg.getStartRes();
@@ -1008,7 +1006,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       }
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       fixedColumns = true;
       int y1 = av.getColumnSelection().getHiddenBoundaryLeft(startres);
@@ -1038,7 +1036,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
     if (groupEditing)
     {
-      Vector vseqs = sg.getSequences(av.hiddenRepSequences);
+      Vector vseqs = sg.getSequences(av.getHiddenRepSequences());
       int g, groupSize = vseqs.size();
       SequenceI[] groupSeqs = new SequenceI[groupSize];
       for (g = 0; g < groupSeqs.length; g++)
@@ -1052,9 +1050,9 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         // If the user has selected the whole sequence, and is dragging to
         // the right, we can still extend the alignment and selectionGroup
         if (sg.getStartRes() == 0 && sg.getEndRes() == fixedRight
-                && sg.getEndRes() == av.alignment.getWidth() - 1)
+                && sg.getEndRes() == av.getAlignment().getWidth() - 1)
         {
-          sg.setEndRes(av.alignment.getWidth() + startres - lastres);
+          sg.setEndRes(av.getAlignment().getWidth() + startres - lastres);
           fixedRight = sg.getEndRes();
         }
 
@@ -1086,19 +1084,19 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
         if (!blank)
         {
-          if (sg.getSize() == av.alignment.getHeight())
+          if (sg.getSize() == av.getAlignment().getHeight())
           {
-            if ((av.hasHiddenColumns && startres < av.getColumnSelection()
+            if ((av.hasHiddenColumns() && startres < av.getColumnSelection()
                     .getHiddenBoundaryRight(startres)))
             {
               endEditing();
               return;
             }
 
-            int alWidth = av.alignment.getWidth();
-            if (av.hasHiddenRows)
+            int alWidth = av.getAlignment().getWidth();
+            if (av.hasHiddenRows())
             {
-              int hwidth = av.alignment.getHiddenSequences().getWidth();
+              int hwidth = av.getAlignment().getHiddenSequences().getWidth();
               if (hwidth > alWidth)
               {
                 alWidth = hwidth;
@@ -1155,7 +1153,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         else
         {
           editCommand.appendEdit(EditCommand.INSERT_GAP, groupSeqs,
-                  startres, startres - lastres, av.alignment, true);
+                  startres, startres - lastres, av.getAlignment(), true);
         }
       }
       else
@@ -1171,7 +1169,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         else
         {
           editCommand.appendEdit(EditCommand.DELETE_GAP, groupSeqs,
-                  startres, lastres - startres, av.alignment, true);
+                  startres, lastres - startres, av.getAlignment(), true);
         }
 
       }
@@ -1193,7 +1191,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         else
         {
           editCommand.appendEdit(EditCommand.INSERT_GAP, new SequenceI[]
-          { seq }, lastres, startres - lastres, av.alignment, true);
+          { seq }, lastres, startres - lastres, av.getAlignment(), true);
         }
       }
       else
@@ -1228,7 +1226,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
           if (max > 0)
           {
             editCommand.appendEdit(EditCommand.DELETE_GAP, new SequenceI[]
-            { seq }, startres, max, av.alignment, true);
+            { seq }, startres, max, av.getAlignment(), true);
           }
         }
       }
@@ -1264,9 +1262,9 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     }
 
     editCommand.appendEdit(EditCommand.DELETE_GAP, seq, blankColumn, 1,
-            av.alignment, true);
+            av.getAlignment(), true);
 
-    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.alignment,
+    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.getAlignment(),
             true);
 
   }
@@ -1274,11 +1272,11 @@ public class SeqPanel extends Panel implements MouseMotionListener,
   void deleteChar(int j, SequenceI[] seq, int fixedColumn)
   {
 
-    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.alignment,
+    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.getAlignment(),
             true);
 
     editCommand.appendEdit(EditCommand.INSERT_GAP, seq, fixedColumn, 1,
-            av.alignment, true);
+            av.getAlignment(), true);
   }
 
   // ////////////////////////////////////////
@@ -1313,7 +1311,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
     if (stretchGroup == null)
     {
-      stretchGroup = av.alignment.findGroup(sequence);
+      stretchGroup = av.getAlignment().findGroup(sequence);
       if (stretchGroup != null && res > stretchGroup.getStartRes()
               && res < stretchGroup.getEndRes())
       {
@@ -1331,7 +1329,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     {
       stretchGroup = null;
 
-      SequenceGroup[] allGroups = av.alignment.findAllGroups(sequence);
+      SequenceGroup[] allGroups = av.getAlignment().findAllGroups(sequence);
 
       if (allGroups != null)
       {
@@ -1424,7 +1422,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       if (stretchGroup.cs instanceof ClustalxColourScheme)
       {
         ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(
-                stretchGroup.getSequences(av.hiddenRepSequences),
+                stretchGroup.getSequences(av.getHiddenRepSequences()),
                 stretchGroup.getWidth());
       }
 
@@ -1473,14 +1471,14 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
     mouseDragging = true;
 
-    if (y > av.alignment.getHeight())
+    if (y > av.getAlignment().getHeight())
     {
-      y = av.alignment.getHeight() - 1;
+      y = av.getAlignment().getHeight() - 1;
     }
 
-    if (res >= av.alignment.getWidth())
+    if (res >= av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
 
     if (stretchGroup.getEndRes() == res)
@@ -1525,7 +1523,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       dragDirection = -1;
     }
 
-    while ((y != oldSeq) && (oldSeq > -1) && (y < av.alignment.getHeight()))
+    while ((y != oldSeq) && (oldSeq > -1) && (y < av.getAlignment().getHeight()))
     {
       // This routine ensures we don't skip any sequences, as the
       // selection is quite slow.
@@ -1662,7 +1660,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
           }
 
           if (mouseDragging && evt.getY() >= getSize().height
-                  && av.alignment.getHeight() > av.getEndSeq())
+                  && av.getAlignment().getHeight() > av.getEndSeq())
           {
             running = ap.scrollUp(false);
           }
@@ -1709,12 +1707,12 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     // rules are: colsel is copied if there is a real intersection between
     // sequence selection
     boolean repaint = false, copycolsel = true;
-    if (av.selectionGroup == null || !av.isSelectionGroupChanged())
+    if (av.getSelectionGroup() == null || !av.isSelectionGroupChanged(true))
     {
       SequenceGroup sgroup = null;
       if (seqsel != null && seqsel.getSize()>0)
       {
-        if (av.alignment == null)
+        if (av.getAlignment() == null)
         {
           System.out
                   .println("Selection message: alignviewport av SeqSetId="
@@ -1723,8 +1721,8 @@ public class SeqPanel extends Panel implements MouseMotionListener,
                           + " 's alignment is NULL! returning immediatly.");
           return;
         }
-        sgroup = seqsel.intersect(av.alignment,
-                (av.hasHiddenRows) ? av.hiddenRepSequences : null);
+        sgroup = seqsel.intersect(av.getAlignment(),
+                (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null);
         if ((sgroup == null || sgroup.getSize() == 0)
                 && (colsel == null || colsel.size() == 0))
         {
@@ -1740,35 +1738,35 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       {
         av.setSelectionGroup(null);
       }
-      repaint = av.isSelectionGroupChanged();
+      repaint = av.isSelectionGroupChanged(true);
     }
-    if (copycolsel && (av.colSel == null || !av.isColSelChanged()))
+    if (copycolsel && (av.getColumnSelection() == null || !av.isColSelChanged(true)))
     {
       // the current selection is unset or from a previous message
       // so import the new colsel.
       if (colsel == null || colsel.size() == 0)
       {
-        if (av.colSel != null)
+        if (av.getColumnSelection() != null)
         {
-          av.colSel.clear();
+          av.getColumnSelection().clear();
         }
       }
       else
       {
         // TODO: shift colSel according to the intersecting sequences
-        if (av.colSel == null)
+        if (av.getColumnSelection() == null)
         {
-          av.colSel = new ColumnSelection(colsel);
+          av.setColumnSelection(new ColumnSelection(colsel));
         }
         else
         {
-          av.colSel.setElementsFrom(colsel);
+          av.getColumnSelection().setElementsFrom(colsel);
         }
       }
-      repaint |= av.isColSelChanged();
+      repaint |= av.isColSelChanged(true);
     }
-    if (copycolsel && av.hasHiddenColumns
-            && (av.colSel == null || av.colSel.getHiddenColumns() == null))
+    if (copycolsel && av.hasHiddenColumns()
+            && (av.getColumnSelection() == null || av.getColumnSelection().getHiddenColumns() == null))
     {
       System.err.println("Bad things");
     }
index 857472b..afbc7e3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -61,7 +61,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
 
   public Color getResidueBoxColour(SequenceI seq, int i)
   {
-    allGroups = av.alignment.findAllGroups(seq);
+    allGroups = av.getAlignment().findAllGroups(seq);
 
     if (inCurrentSequenceGroup(i))
     {
@@ -72,7 +72,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     }
     else if (av.getShowBoxes())
     {
-      getBoxColour(av.globalColourScheme, seq, i);
+      getBoxColour(av.getGlobalColourScheme(), seq, i);
     }
 
     return resBoxColour;
@@ -98,7 +98,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
 
   public Color findSequenceColour(SequenceI seq, int i)
   {
-    allGroups = av.alignment.findAllGroups(seq);
+    allGroups = av.getAlignment().findAllGroups(seq);
     drawBoxes(seq, i, i, 0);
     return resBoxColour;
   }
@@ -223,7 +223,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
         {
           // cheat - use this if we have a consensus for each group: s =
           // getDisplayChar(currentSequenceGroup.getConsensus(), i, s, '.');
-          s = getDisplayChar(av.consensus, i, s, '.');
+          s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
         }
       }
       else
@@ -245,9 +245,9 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
             graphics.setColor(resBoxColour);
           }
         }
-        if (av.getShowunconserved())
+        if (av.getShowUnconserved())
         {
-          s = getDisplayChar(av.consensus, i, s, '.');
+          s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
 
         }
       }
index 4e6c2bf..f7522be 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -57,7 +57,7 @@ public class SliderPanel extends Panel implements ActionListener,
 
     conservationSlider.setTitle("Conservation Colour Increment  (" + source
             + ")");
-    if (ap.av.alignment.getGroups() != null)
+    if (ap.av.getAlignment().getGroups() != null)
     {
       sp.setAllGroupsCheckEnabled(true);
     }
@@ -112,7 +112,7 @@ public class SliderPanel extends Panel implements ActionListener,
     }
     PIDSlider.setTitle("Percentage Identity Threshold (" + source + ")");
 
-    if (ap.av.alignment.getGroups() != null)
+    if (ap.av.getAlignment().getGroups() != null)
     {
       pid.setAllGroupsCheckEnabled(true);
     }
@@ -200,7 +200,7 @@ public class SliderPanel extends Panel implements ActionListener,
 
     if (allGroupsCheck.getState())
     {
-      allGroups = ap.av.alignment.getGroups();
+      allGroups = ap.av.getAlignment().getGroups();
       groupIndex = allGroups.size() - 1;
     }
     else
index 11020fc..52b40e5 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 5d5b7ba..9a4c82c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -87,7 +87,7 @@ public class TreeCanvas extends Panel implements MouseListener,
       av.setSelectionGroup(selected);
     }
 
-    selected.setEndRes(av.alignment.getWidth() - 1);
+    selected.setEndRes(av.getAlignment().getWidth() - 1);
     selected.addOrRemove(sequence, true);
   }
 
@@ -570,7 +570,7 @@ public class TreeCanvas extends Panel implements MouseListener,
         setColor(tree.getTopNode(), Color.black);
 
         av.setSelectionGroup(null);
-        av.alignment.deleteAllGroups();
+        av.getAlignment().deleteAllGroups();
         av.sequenceColours = null;
 
         colourGroups();
@@ -619,7 +619,7 @@ public class TreeCanvas extends Panel implements MouseListener,
         }
         else
         {
-          cs = ColourSchemeProperty.getColour(sequences, av.alignment
+          cs = ColourSchemeProperty.getColour(sequences, av.getAlignment()
                   .getWidth(), ColourSchemeProperty.getColourName(av
                   .getGlobalColourScheme()));
         }
@@ -632,7 +632,7 @@ public class TreeCanvas extends Panel implements MouseListener,
       }
 
       SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true,
-              false, 0, av.alignment.getWidth() - 1);
+              false, 0, av.getAlignment().getWidth() - 1);
 
       sg.setName("JTreeGroup:" + sg.hashCode());
       sg.setIdColour(col);
@@ -644,14 +644,14 @@ public class TreeCanvas extends Panel implements MouseListener,
                 sg.getStartRes(), sg.getEndRes());
 
         c.calculate();
-        c.verdict(false, av.ConsPercGaps);
+        c.verdict(false, av.getConsPercGaps());
         cs.setConservation(c);
 
         sg.cs = cs;
 
       }
 
-      av.alignment.addGroup(sg);
+      av.getAlignment().addGroup(sg);
 
     }
     ap.updateAnnotation();
index 0351d14..aa57908 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -186,11 +186,11 @@ public class TreePanel extends EmbmenuFrame implements ActionListener,
       {
         if (odata == null)
         {
-          tree = new NJTree(av.alignment.getSequencesArray(), newtree);
+          tree = new NJTree(av.getAlignment().getSequencesArray(), newtree);
         }
         else
         {
-          tree = new NJTree(av.alignment.getSequencesArray(), odata,
+          tree = new NJTree(av.getAlignment().getSequencesArray(), odata,
                   newtree);
         }
 
@@ -204,14 +204,14 @@ public class TreePanel extends EmbmenuFrame implements ActionListener,
         if (av.getSelectionGroup() == null)
         {
           start = 0;
-          end = av.alignment.getWidth();
-          seqs = av.alignment.getSequencesArray();
+          end = av.getAlignment().getWidth();
+          seqs = av.getAlignment().getSequencesArray();
         }
         else
         {
           start = av.getSelectionGroup().getStartRes();
           end = av.getSelectionGroup().getEndRes() + 1;
-          seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+          seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
         }
 
         tree = new NJTree(seqs, seqStrings, type, pwtype, start, end);
index 7220321..77fd5ec 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d810ee7..b24304a 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -126,6 +126,8 @@ import org.apache.log4j.*;
  * histogram.</li>
  * <li>SHOW_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
  * logo.</li>
+ * <li>NORMALISE_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
+ * logo normalised to row height rather than histogram height.</li>
  * <li>FOLLOW_SELECTIONS (true) Controls whether a new alignment view should
  * respond to selections made in other alignments containing the same sequences.
  * </li>
@@ -282,6 +284,26 @@ public class Cache
       System.setProperty("http.proxyPort", getDefault("PROXY_PORT", null));
     }
 
+    // LOAD THE AUTHORS FROM THE authors.props file
+    try
+    {
+      String authorDetails = "jar:".concat(Cache.class.getProtectionDomain()
+              .getCodeSource().getLocation().toString()
+              .concat("!/authors.props"));
+
+      java.net.URL localJarFileURL = new java.net.URL(authorDetails);
+
+      InputStream in = localJarFileURL.openStream();
+      applicationProperties.load(in);
+      in.close();
+    } catch (Exception ex)
+    {
+      System.out.println("Error reading author details: " + ex);
+      applicationProperties.remove("AUTHORS");
+      applicationProperties.remove("AUTHORFNAMES");
+      applicationProperties.remove("YEAR");
+    }
+
     // FIND THE VERSION NUMBER AND BUILD DATE FROM jalview.jar
     // MUST FOLLOW READING OF LOCAL PROPERTIES FILE AS THE
     // VERSION MAY HAVE CHANGED SINCE LAST USING JALVIEW
index dd61e76..272250e 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0cba50e..311e48d 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -492,6 +492,8 @@ public class JalviewLite extends Applet implements
       boolean seqlimits = suffix.equalsIgnoreCase("true");\r
       if (alf.viewport.getSelectionGroup() != null)\r
       {\r
+        // JBPNote: getSelectionAsNewSequence behaviour has changed - this method now returns a full copy of sequence data\r
+        // TODO consider using getSequenceSelection instead here\r
         String reply = new AppletFormatAdapter().formatSequences(format,\r
                 new Alignment(alf.viewport.getSelectionAsNewSequence()),\r
                 seqlimits);\r
index a77186f..8ba113d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cc8f4dc..86d1ff3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 95447d3..61fa377 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 8b018c5..1648a24 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 38f7740..d8b2b3c 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 53beb10..34d5d7f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1a5a830..ec7001d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4b807c1..b2a47d7 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1186169..83d3b9a 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 407640a..bb48199 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 5c9be24..04fda30 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e4f6c5a..c88190d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 3248adf..b122fac 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 9e01bf4..e1fee09 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 316ace7..ea36590 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index c95c80a..9c8fc59 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f8eea6f..770985a 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1af7025..ff5d7b3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 3f34069..a459891 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 0acbe9f..5dbb9c8 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 80d22ee..aa35b20 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 846ed9d..aeeb3b4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index d57d24c..e36ec4b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 02cf07f..e6f469c 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4a04798..9ded3d4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 220dec2..bbd1f79 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4be6b86..097ba71 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index dc859f6..776d713 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cebbfff..388b0ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d18cb62..76ddbac 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -54,6 +54,8 @@ public class EditCommand implements CommandI
   public static final int PASTE = 3;
 
   public static final int REPLACE = 4;
+  
+  public static final int INSERT_NUC=5;
 
   Edit[] edits;
 
@@ -192,6 +194,10 @@ public class EditCommand implements CommandI
       case REPLACE:
         replace(edits[e]);
         break;
+        //TODO:add deleteNuc for UNDO
+//      case INSERT_NUC:
+//     insertNuc(edits[e]);
+//     break;
       }
     }
   }
@@ -223,7 +229,7 @@ public class EditCommand implements CommandI
       case REPLACE:
         replace(edits[e]);
         break;
-      }
+       }
     }
   }
 
@@ -234,10 +240,23 @@ public class EditCommand implements CommandI
     {
       command.seqs[s].insertCharAt(command.position, command.number,
               command.gapChar);
+//      System.out.println("pos: "+command.position+" number: "+command.number);
     }
 
     adjustAnnotations(command, true, false, null);
   }
+//  
+//  final void insertNuc(Edit command)
+//  {
+//
+//    for (int s = 0; s < command.seqs.length; s++)
+//    {
+//        System.out.println("pos: "+command.position+" number: "+command.number);
+//     command.seqs[s].insertCharAt(command.position, command.number,'A');
+//    }
+//
+//    adjustAnnotations(command, true, false, null);
+//  }
 
   final void deleteGap(Edit command)
   {
index e45aaa1..02c4fd9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 83197d7..1dd4373 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ef39ef0..575b4ca 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e7126ee..dc62666 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index de94dd4..edb9b3e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9c2bd83..335621f 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 707eee8..04977e8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -43,6 +43,8 @@ public class Alignment implements AlignmentI
   public static final int PROTEIN = 0;
 
   public static final int NUCLEOTIDE = 1;
+  
+  public boolean hasRNAStructure = false;
 
   /** DOCUMENT ME!! */
   public AlignmentAnnotation[] annotations;
@@ -732,6 +734,10 @@ public class Alignment implements AlignmentI
    */
   public void addAnnotation(AlignmentAnnotation aa, int pos)
   {
+    if(aa.getRNAStruc()!= null){
+      hasRNAStructure=true;
+    }
+    
     int aSize = 1;
     if (annotations != null)
     {
@@ -832,6 +838,11 @@ public class Alignment implements AlignmentI
       return false;
     }
   }
+  
+  public boolean hasRNAStructure(){
+    //TODO can it happen that structure is removed from alignment?
+    return hasRNAStructure;
+  }
 
   public void setDataset(Alignment data)
   {
index 1d624d4..9de07dd 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -17,6 +17,9 @@
  */
 package jalview.datamodel;
 
+import jalview.analysis.Rna;
+import jalview.analysis.WUSSParseException;
+
 import java.util.Enumeration;
 import java.util.Hashtable;
 
@@ -35,7 +38,7 @@ public class AlignmentAnnotation
   public boolean autoCalculated = false;
 
   public String annotationId;
-
+  
   public SequenceI sequenceRef;
 
   /** DOCUMENT ME!! */
@@ -47,6 +50,46 @@ public class AlignmentAnnotation
   /** DOCUMENT ME!! */
   public Annotation[] annotations;
 
+  /**
+   * RNA secondary structure contact positions
+   */
+  public SequenceFeature[] _rnasecstr = null;
+  /**
+   * position of annotation resulting in invalid WUSS parsing or -1
+   */
+  private long invalidrnastruc=-1;
+  /**
+   * Updates the _rnasecstr field Determines the positions that base pair and
+   * the positions of helices based on secondary structure from a Stockholm file
+   * 
+   * @param RNAannot
+   */
+  private void _updateRnaSecStr(CharSequence RNAannot)
+  {
+    try {
+    _rnasecstr = Rna.GetBasePairs(RNAannot);
+    invalidrnastruc=-1;
+    }
+    catch (WUSSParseException px)
+    {
+      invalidrnastruc=px.getProblemPos();
+    }
+    if (invalidrnastruc>-1)
+    {
+      return;
+    }
+    Rna.HelixMap(_rnasecstr);
+    // setRNAStruc(RNAannot);
+    
+    if (_rnasecstr != null && _rnasecstr.length > 0)
+    {
+      // show all the RNA secondary structure annotation symbols.
+      isrna=true;
+      showAllColLabels = true;
+      scaleColLabel = true;
+    }
+    // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+  }
   public java.util.Hashtable sequenceMapping;
 
   /** DOCUMENT ME!! */
@@ -117,6 +160,8 @@ public class AlignmentAnnotation
    */
   public boolean centreColLabels = false;
 
+  private boolean isrna;
+
   /*
    * (non-Javadoc)
    * 
@@ -167,9 +212,16 @@ public class AlignmentAnnotation
     validateRangeAndDisplay();
   }
 
+  /**
+   * Checks if annotation labels represent secondary structures
+   * 
+   */
   void areLabelsSecondaryStructure()
   {
     boolean nonSSLabel = false;
+    isrna = false;
+    StringBuffer rnastring = new StringBuffer();
+
     char firstChar = 0;
     for (int i = 0; i < annotations.length; i++)
     {
@@ -182,9 +234,22 @@ public class AlignmentAnnotation
       {
         hasIcons |= true;
       }
+      else
+      // Check for RNA secondary structure
+      {
+        if (annotations[i].secondaryStructure == 'S')
+        {
+          hasIcons |= true;
+          isrna |= true;
+        }
+      }
+
+      // System.out.println("displaychar " + annotations[i].displayCharacter);
 
-      if (annotations[i].displayCharacter == null)
+      if (annotations[i].displayCharacter == null
+              || annotations[i].displayCharacter.length() == 0)
       {
+        rnastring.append('.');
         continue;
       }
       if (annotations[i].displayCharacter.length() == 1)
@@ -205,6 +270,7 @@ public class AlignmentAnnotation
                 firstChar != ' '
                 && firstChar != 'H'
                 && firstChar != 'E'
+                && firstChar != 'S'
                 && firstChar != '-'
                 && firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
         {
@@ -219,6 +285,10 @@ public class AlignmentAnnotation
           }
         }
       }
+      else
+      {
+        rnastring.append(annotations[i].displayCharacter.charAt(1));
+      }
 
       if (annotations[i].displayCharacter.length() > 0)
       {
@@ -241,11 +311,83 @@ public class AlignmentAnnotation
 
       }
     }
+    else
+    {
+      if (isrna)
+      {
+        _updateRnaSecStr(new AnnotCharSequence());
+      }
+    }
 
     annotationId = this.hashCode() + "";
   }
-
   /**
+   * flyweight access to positions in the alignment annotation row for RNA processing
+   * @author jimp
+   *
+   */
+  private class AnnotCharSequence  implements CharSequence 
+  {
+    int offset=0;
+    int max=0;
+    
+    public AnnotCharSequence() {
+      this(0,annotations.length);
+    }
+    public AnnotCharSequence(int start, int end) {
+      offset=start;
+      max=end;
+    }
+    @Override
+    public CharSequence subSequence(int start, int end)
+    {
+      return new AnnotCharSequence(offset+start, offset+end);
+    }
+    
+    @Override
+    public int length()
+    {
+      return max-offset;
+    }
+    
+    @Override
+    public char charAt(int index)
+    {
+      String dc;
+      return ((index+offset<0) || (index+offset)>=max || annotations[index+offset]==null || (dc=annotations[index+offset].displayCharacter.trim()).length()<1)
+              ? '.' : dc.charAt(0);
+    }
+    public String toString()
+    {
+      char[] string=new char[max-offset];
+      int mx=annotations.length;
+        
+      for (int i=offset;i<mx;i++)
+      {
+        String dc;
+        string[i]=(annotations[i]==null || (dc=annotations[i].displayCharacter.trim()).length()<1 )? '.' : dc.charAt(0);
+      }
+      return new String(string);
+    }
+  };
+  
+  private long _lastrnaannot=-1;
+  public String getRNAStruc(){
+    if (isrna)
+    {
+      String rnastruc = new AnnotCharSequence().toString();
+      if (_lastrnaannot!=rnastruc.hashCode())
+      {
+        // ensure rna structure contacts are up to date
+        _lastrnaannot=rnastruc.hashCode();
+        _updateRnaSecStr(rnastruc);
+      }
+      return rnastruc;
+    }
+    return null;
+  }
+
+/**
    * Creates a new AlignmentAnnotation object.
    * 
    * @param label
@@ -280,7 +422,7 @@ public class AlignmentAnnotation
    * checks graphMin and graphMax, secondary structure symbols, sets graphType
    * appropriately, sets null labels to the empty string if appropriate.
    */
-  private void validateRangeAndDisplay()
+  public void validateRangeAndDisplay()
   {
 
     if (annotations == null)
@@ -823,4 +965,28 @@ public class AlignmentAnnotation
     }
     return description;
   }
+
+  public boolean isValidStruc()
+  {
+    return invalidrnastruc==-1;
+  }
+  public long getInvalidStrucPos()
+  {
+    return invalidrnastruc;
+  }
+
+  /**
+   * machine readable ID string indicating what generated this annotation
+   */
+  protected String calcId="";
+  public String getCalcId()
+  {
+    return calcId;
+  }
+
+  public void setCalcId(String calcId)
+  {
+    this.calcId = calcId;
+  }
+  
 }
index be1bff7..a193997 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -204,9 +204,9 @@ public interface AlignmentI
 
   /**
    * Deletes a specific AlignmentAnnotation from the alignment, and removes its
-   * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
-   * contained within the alignment's annotation vector. Otherwise, it will do
-   * nothing.
+   * reference from any SequenceI or SequenceGroup object's annotation if and
+   * only if aa is contained within the alignment's annotation vector.
+   * Otherwise, it will do nothing.
    * 
    * @param aa
    *          the annotation to delete
@@ -215,15 +215,17 @@ public interface AlignmentI
   public boolean deleteAnnotation(AlignmentAnnotation aa);
 
   /**
-   * Deletes a specific AlignmentAnnotation from the alignment, and optionally removes any
-   * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
-   * contained within the alignment's annotation vector. Otherwise, it will do
-   * nothing.
+   * Deletes a specific AlignmentAnnotation from the alignment, and optionally
+   * removes any reference from any SequenceI or SequenceGroup object's
+   * annotation if and only if aa is contained within the alignment's annotation
+   * vector. Otherwise, it will do nothing.
    * 
    * @param aa
    *          the annotation to delete
    * @param unhook
-   *          flag indicating if any references should be removed from annotation - use this if you intend to add the annotation back into the alignment
+   *          flag indicating if any references should be removed from
+   *          annotation - use this if you intend to add the annotation back
+   *          into the alignment
    * @return true if annotation was deleted from this alignment.
    */
   public boolean deleteAnnotation(AlignmentAnnotation aa, boolean unhook);
@@ -259,6 +261,13 @@ public interface AlignmentI
   public boolean isNucleotide();
 
   /**
+   * Test if alignment contains RNA structure
+   * 
+   * @return true if RNA structure AligmnentAnnotation was added to alignment
+   */
+  public boolean hasRNAStructure();
+
+  /**
    * Set alignment to be a nucleotide sequence
    * 
    */
index 528fbfc..9ba8586 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4bd1ace..8e596ce 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 609158d..6b22cad 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -34,7 +34,7 @@ public class Annotation
   public String description = ""; // currently used as mouse over
 
   /** DOCUMENT ME!! */
-  public char secondaryStructure = ' '; // recognises H and E
+  public char secondaryStructure = ' '; // recognises H, E and S(?)
 
   /** DOCUMENT ME!! */
   public float value;
index 451e7b5..6a1d2d2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9d6f5e8..04cfdc9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 78d34ed..dea0d72 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index df6f5f3..cd653cd 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index e31c818..b779498 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 6aa9988..9ea3a43 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 786101e..d0fc927 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 853255d..115ef88 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e1f5f41..fbd11ad 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -61,6 +61,11 @@ public class DBRefSource
    * PFAM ID\r
    */\r
   public static String PFAM = "PFAM";\r
+  \r
+  /**\r
+   * RFAM ID\r
+   */\r
+  public static String RFAM = "RFAM";\r
 \r
   /**\r
    * GeneDB ID\r
@@ -86,7 +91,7 @@ public class DBRefSource
   { PDB };\r
 \r
   public static final String[] DOMAINDBS =\r
-  { PFAM };\r
+  { PFAM, RFAM };\r
 \r
   /**\r
    * set of unique DBRefSource property constants. These could be used to\r
@@ -115,7 +120,7 @@ public class DBRefSource
   public static final Object DNACODINGSEQDB = "XONCODING";\r
 \r
   /**\r
-   * DB returns several sequences associated with a protein domain\r
+   * DB returns several sequences associated with a protein/nucleotide domain\r
    */\r
   public static final Object DOMAINDB = "DOMAIN";\r
 \r
index 8c238ef..eaf5874 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index deab08a..4af7ac4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 901cf35..9c3b8e0 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7116a2b..01c5151 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0e1c880..cea2fd9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d65293f..8c2473b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cb3bbf7..a05a6e9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d6711d7..55d6c8b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 89268f0..3efb713 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 182ad7b..46989bf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 52d9a72..b0969b5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6fed6ee..a0ba614 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -40,7 +40,7 @@ public class SequenceFeature
   public Hashtable otherDetails;
 
   public java.util.Vector links;
-
+  
   // Feature group can be set from a features file
   // as a group of features between STARTGROUP and ENDGROUP markers
   public String featureGroup;
@@ -95,7 +95,7 @@ public class SequenceFeature
       }
     }
   }
-
+  
   public SequenceFeature(String type, String desc, String status,
           int begin, int end, String featureGroup)
   {
index 01bf677..6bee416 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -91,6 +91,11 @@ public class SequenceGroup
    * consensus calculation property
    */
   private boolean showSequenceLogo = false;
+  /**
+   * flag indicating if logo should be rendered normalised
+   */
+  private boolean normaliseSequenceLogo;
+
 
   /**
    * @return the includeAllConsSymbols
@@ -1167,4 +1172,17 @@ public class SequenceGroup
   {
     return showConsensusHistogram;
   }
+
+  /**
+   * set flag indicating if logo should be normalised when rendered
+   * @param norm
+   */
+  public void setNormaliseSequenceLogo(boolean norm)
+  {
+    normaliseSequenceLogo=norm;
+  }
+  public boolean isNormaliseSequenceLogo()
+  {
+    return normaliseSequenceLogo;
+  }
 }
index d1e3853..3d91004 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 90a3681..0546065 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 921318f..2e6f175 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e93a262..adb9484 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e90c616..cf82757 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 18eeb74..578e60c 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index c239766..151e5b4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 31a1418..0922b36 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a949888..4011e0b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 612cf23..aab91ac 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 65ee51a..04b88ba 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 91a0133..16784cc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a20a9f7..43a6cef 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 277423d..111f816 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6c583cf..442147f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5e085fa..c0b0cf7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a625fd7..7f949c7 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 71faba3..b38979b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
diff --git a/src/jalview/ext/varna/JalviewVarnaBinding.java b/src/jalview/ext/varna/JalviewVarnaBinding.java
new file mode 100644 (file)
index 0000000..ced3c8d
--- /dev/null
@@ -0,0 +1,56 @@
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ * \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
+package jalview.ext.varna;\r
+\r
+import java.io.File;\r
+\r
+import java.net.URL;\r
+import java.util.*;\r
+import java.applet.Applet;\r
+import java.awt.*;\r
+import java.awt.event.*;\r
+\r
+import javax.swing.JPanel;\r
+\r
+import jalview.api.AlignmentViewPanel;\r
+import jalview.api.FeatureRenderer;\r
+import jalview.api.SequenceRenderer;\r
+import jalview.api.SequenceStructureBinding;\r
+import jalview.api.StructureSelectionManagerProvider;\r
+import jalview.datamodel.*;\r
+import jalview.structure.*;\r
+import jalview.io.*;\r
+\r
+import org.jmol.api.*;\r
+import org.jmol.adapter.smarter.SmarterJmolAdapter;\r
+\r
+import org.jmol.popup.*;\r
+import org.jmol.viewer.JmolConstants;\r
+import org.jmol.viewer.Viewer;\r
+\r
+import jalview.schemes.*;\r
+\r
+import fr.orsay.lri.varna.applications.*;\r
+\r
+\r
+public abstract class JalviewVarnaBinding implements StructureListener, SequenceStructureBinding,\r
+        ComponentListener, StructureSelectionManagerProvider\r
+\r
+{\r
+  \r
+}\r
diff --git a/src/jalview/ext/varna/VarnaCommands.java b/src/jalview/ext/varna/VarnaCommands.java
new file mode 100644 (file)
index 0000000..9d57969
--- /dev/null
@@ -0,0 +1,142 @@
+/**\r
+ * \r
+ */\r
+package jalview.ext.varna;\r
+\r
+import jalview.api.FeatureRenderer;\r
+import jalview.api.SequenceRenderer;\r
+import jalview.datamodel.AlignmentI;\r
+import jalview.datamodel.SequenceI;\r
+import jalview.structure.StructureMapping;\r
+import jalview.structure.StructureSelectionManager;\r
+import jalview.util.Comparison;\r
+\r
+import java.awt.Color;\r
+import java.util.ArrayList;\r
+\r
+/**\r
+ * Routines for generating Jmol commands for Jalview/Jmol binding\r
+ * another cruisecontrol test.\r
+ * \r
+ * @author JimP\r
+ *\r
+ */\r
+public class VarnaCommands\r
+{\r
+\r
+  /**\r
+   * Jmol utility which constructs the commands to colour chains by the given alignment\r
+   * \r
+   */\r
+  public static String[] getColourBySequenceCommand(StructureSelectionManager ssm, String[] files, SequenceI[][] sequence, SequenceRenderer sr, FeatureRenderer fr, AlignmentI alignment)\r
+  {\r
+    ArrayList<String> str = new ArrayList<String>();\r
+    StringBuffer command = new StringBuffer();\r
+  \r
+    for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)\r
+    {\r
+      StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]);\r
+  \r
+      if (mapping == null || mapping.length < 1)\r
+        continue;\r
+  \r
+      int lastPos = -1;\r
+      for (int s = 0; s < sequence[pdbfnum].length; s++)\r
+      {\r
+        for (int sp, m = 0; m < mapping.length; m++)\r
+        {\r
+          if (mapping[m].getSequence() == sequence[pdbfnum][s]\r
+                  && (sp = alignment.findIndex(sequence[pdbfnum][s])) > -1)\r
+          {\r
+            SequenceI asp = alignment.getSequenceAt(sp);\r
+            for (int r = 0; r < asp.getLength(); r++)\r
+            {\r
+              // no mapping to gaps in sequence\r
+              if (jalview.util.Comparison.isGap(asp.getCharAt(r)))\r
+              {\r
+                continue;\r
+              }\r
+              int pos = mapping[m].getPDBResNum(asp.findPosition(r));\r
+  \r
+              if (pos < 1 || pos == lastPos)\r
+                continue;\r
+  \r
+              lastPos = pos;\r
+  \r
+              Color col = sr.getResidueBoxColour(sequence[pdbfnum][s], r);\r
+  \r
+              if (fr != null)\r
+                col = fr.findFeatureColour(col, sequence[pdbfnum][s], r);\r
+              String newSelcom = (mapping[m].getChain() != " " ? ":"\r
+                      + mapping[m].getChain() : "")\r
+                      + "/"\r
+                      + (pdbfnum + 1)\r
+                      + ".1"\r
+                      + ";color["\r
+                      + col.getRed()\r
+                      + ","\r
+                      + col.getGreen()\r
+                      + ","\r
+                      + col.getBlue() + "]";\r
+              if (command.length()>newSelcom.length() && command.substring(command.length()-newSelcom.length()).equals(newSelcom))\r
+              {\r
+                command = VarnaCommands.condenseCommand(command, pos);\r
+                continue;\r
+              }\r
+              // TODO: deal with case when buffer is too large for Jmol to parse\r
+              // - execute command and flush\r
+  \r
+              command.append(";");\r
+              if (command.length()>51200)\r
+              {\r
+                // add another chunk\r
+                str.add(command.toString());\r
+                command.setLength(0);\r
+              }\r
+              command.append("select " + pos);\r
+              command.append(newSelcom);\r
+            }\r
+            break;\r
+          }\r
+        }\r
+      }\r
+    }\r
+    {\r
+      // add final chunk\r
+      str.add(command.toString());\r
+      command.setLength(0);\r
+    }\r
+    return str.toArray(new String[str.size()]);\r
+  }\r
+\r
+  public static StringBuffer condenseCommand(StringBuffer command, int pos)\r
+  {\r
+  \r
+    // work back to last 'select'\r
+    int p=command.length(),q=p;\r
+    do {\r
+      p-=6;\r
+      if (p<1) { p=0; };\r
+    } while ((q=command.indexOf("select",p))==-1 && p>0);\r
+    \r
+    StringBuffer sb = new StringBuffer(command.substring(0,q+7));\r
+  \r
+    command =  command.delete(0,q+7);\r
+  \r
+    String start;\r
+  \r
+    if (command.indexOf("-") > -1)\r
+    {\r
+      start = command.substring(0, command.indexOf("-"));\r
+    }\r
+    else\r
+    {\r
+      start = command.substring(0, command.indexOf(":"));\r
+    }\r
+  \r
+    sb.append(start + "-" + pos + command.substring(command.indexOf(":")));\r
+  \r
+    return sb;\r
+  }\r
+\r
+}\r
index 2ecd947..e1775d7 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -65,6 +65,8 @@ import jalview.schemes.HelixColourScheme;
 import jalview.schemes.HydrophobicColourScheme;
 import jalview.schemes.NucleotideColourScheme;
 import jalview.schemes.PIDColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.RNAHelicesColourChooser;
 import jalview.schemes.ResidueProperties;
 import jalview.schemes.StrandColourScheme;
 import jalview.schemes.TaylorColourScheme;
@@ -282,7 +284,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void init()
   {
-    if (viewport.conservation == null)
+    if (viewport.getAlignmentConservationAnnotation() == null)
     {
       BLOSUM62Colour.setEnabled(false);
       conservationMenuItem.setEnabled(false);
@@ -308,7 +310,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       this.setDropTarget(new java.awt.dnd.DropTarget(this, this));
       addServiceListeners();
-      setGUINucleotide(viewport.alignment.isNucleotide());
+      setGUINucleotide(viewport.getAlignment().isNucleotide());
     }
 
     setMenusFromViewport(viewport);
@@ -402,6 +404,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           }
           break;
 
+        // case KeyEvent.VK_A:
+        // if (viewport.cursorMode)
+        // {
+        // alignPanel.seqPanel.insertNucAtCursor(false,"A");
+        // //System.out.println("A");
+        // }
+        // break;
+        /*
+         * case KeyEvent.VK_CLOSE_BRACKET: if (viewport.cursorMode) {
+         * System.out.println("closing bracket"); } break;
+         */
         case KeyEvent.VK_DELETE:
         case KeyEvent.VK_BACK_SPACE:
           if (!viewport.cursorMode)
@@ -568,12 +581,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (newPanel)
     {
-      if (ap.av.padGaps)
+      if (ap.av.isPadGaps())
       {
-        ap.av.alignment.padGaps();
+        ap.av.getAlignment().padGaps();
       }
       ap.av.updateConservation(ap);
       ap.av.updateConsensus(ap);
+      ap.av.updateStrucConsensus(ap);
     }
   }
 
@@ -645,11 +659,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     conservationMenuItem.setEnabled(!nucleotide);
     modifyConservation.setEnabled(!nucleotide);
     showGroupConservation.setEnabled(!nucleotide);
+    rnahelicesColour.setEnabled(nucleotide);
+    purinePyrimidineColour.setEnabled(nucleotide);
     // Remember AlignFrame always starts as protein
-    if (!nucleotide)
-    {
-      calculateMenu.remove(calculateMenu.getItemCount() - 2);
-    }
+    // if (!nucleotide)
+    // {
+    // showTr
+    // calculateMenu.remove(calculateMenu.getItemCount() - 2);
+    // }
   }
 
   /**
@@ -671,7 +688,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void setMenusFromViewport(AlignViewport av)
   {
-    padGapsMenuitem.setSelected(av.padGaps);
+    padGapsMenuitem.setSelected(av.isPadGaps());
     colourTextMenuItem.setSelected(av.showColourText);
     abovePIDThreshold.setSelected(av.getAbovePIDThreshold());
     conservationMenuItem.setSelected(av.getConservationSelected());
@@ -686,11 +703,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     annotationPanelMenuItem.setState(av.showAnnotation);
     viewBoxesMenuItem.setSelected(av.showBoxes);
     viewTextMenuItem.setSelected(av.showText);
-    showNonconservedMenuItem.setSelected(av.showUnconserved);
-    showGroupConsensus.setSelected(av.showGroupConsensus);
-    showGroupConservation.setSelected(av.showGroupConservation);
-    showConsensusHistogram.setSelected(av.showConsensusHistogram);
-    showSequenceLogo.setSelected(av.showSequenceLogo);
+    showNonconservedMenuItem.setSelected(av.getShowUnconserved());
+    showGroupConsensus.setSelected(av.isShowGroupConsensus());
+    showGroupConservation.setSelected(av.isShowGroupConservation());
+    showConsensusHistogram.setSelected(av.isShowConsensusHistogram());
+    showSequenceLogo.setSelected(av.isShowSequenceLogo());
+    normaliseSequenceLogo.setSelected(av.isNormaliseSequenceLogo());
+
     setColourSelected(ColourSchemeProperty.getColourName(av
             .getGlobalColourScheme()));
 
@@ -702,7 +721,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     autoCalculate.setSelected(av.autoCalculateConsensus);
     sortByTree.setSelected(av.sortByTree);
     listenToViewSelections.setSelected(av.followSelection);
-    
+    rnahelicesColour.setEnabled(av.getAlignment().hasRNAStructure());
+    rnahelicesColour
+            .setSelected(av.getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
     setShowProductsEnabled();
 
     updateEditMenuBar();
@@ -995,7 +1016,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       String[] omitHidden = null;
 
-      if (viewport.hasHiddenColumns)
+      if (viewport.hasHiddenColumns())
       {
         int reply = JOptionPane
                 .showInternalConfirmDialog(
@@ -1012,10 +1033,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         }
       }
       FormatAdapter f = new FormatAdapter();
-      String output = f.formatSequences(format,
-              (Alignment) viewport.alignment, // class cast exceptions will
+      String output = f.formatSequences(
+              format,
+              (Alignment) viewport.getAlignment(), // class cast exceptions will
               // occur in the distant future
-              omitHidden, f.getCacheSuffixDefault(format), viewport.colSel);
+              omitHidden, f.getCacheSuffixDefault(format),
+              viewport.getColumnSelection());
 
       if (output == null)
       {
@@ -1075,7 +1098,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     String[] omitHidden = null;
 
-    if (viewport.hasHiddenColumns)
+    if (viewport.hasHiddenColumns())
     {
       int reply = JOptionPane
               .showInternalConfirmDialog(
@@ -1098,7 +1121,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     try
     {
       cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
-              viewport.alignment, omitHidden, viewport.colSel));
+              viewport.getAlignment(), omitHidden,
+              viewport.getColumnSelection()));
       Desktop.addInternalFrame(cap,
               "Alignment output - " + e.getActionCommand(), 600, 500);
     } catch (OutOfMemoryError oom)
@@ -1175,12 +1199,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
   public void exportAnnotations_actionPerformed(ActionEvent e)
   {
-    new AnnotationExporter().exportAnnotations(
-            alignPanel,
-            viewport.showAnnotation ? viewport.alignment
-                    .getAlignmentAnnotation() : null, viewport.alignment
-                    .getGroups(),
-            ((Alignment) viewport.alignment).alignmentProperties);
+    new AnnotationExporter().exportAnnotations(alignPanel,
+            viewport.showAnnotation ? viewport.getAlignment()
+                    .getAlignmentAnnotation() : null, viewport
+                    .getAlignment().getGroups(), ((Alignment) viewport
+                    .getAlignment()).alignmentProperties);
   }
 
   public void associatedData_actionPerformed(ActionEvent e)
@@ -1318,9 +1341,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       viewport.historyList.push(command);
       viewport.redoList.clear();
       updateEditMenuBar();
-      viewport.hasHiddenColumns = (viewport.colSel != null
-              && viewport.colSel.getHiddenColumns() != null && viewport.colSel
-              .getHiddenColumns().size() > 0);
+      viewport.updateHiddenColumns();
+      // viewport.hasHiddenColumns = (viewport.getColumnSelection() != null
+      // && viewport.getColumnSelection().getHiddenColumns() != null &&
+      // viewport.getColumnSelection()
+      // .getHiddenColumns().size() > 0);
     }
   }
 
@@ -1343,7 +1368,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (viewport != null)
     {
       return new AlignmentI[]
-      { viewport.alignment };
+      { viewport.getAlignment() };
     }
     return null;
   }
@@ -1367,11 +1392,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (originalSource != null)
     {
-      originalSource.hasHiddenColumns = (viewport.colSel != null
-              && viewport.colSel.getHiddenColumns() != null && viewport.colSel
-              .getHiddenColumns().size() > 0);
-      originalSource.firePropertyChange("alignment", null,
-              originalSource.alignment.getSequences());
+      if (originalSource != viewport)
+      {
+        Cache.log
+                .warn("Implementation worry: mismatch of viewport origin for undo");
+      }
+      originalSource.updateHiddenColumns();
+      // originalSource.hasHiddenColumns = (viewport.getColumnSelection() !=
+      // null
+      // && viewport.getColumnSelection().getHiddenColumns() != null &&
+      // viewport.getColumnSelection()
+      // .getHiddenColumns().size() > 0);
+      originalSource.firePropertyChange("alignment", null, originalSource
+              .getAlignment().getSequences());
     }
   }
 
@@ -1397,11 +1430,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (originalSource != null)
     {
-      originalSource.hasHiddenColumns = (viewport.colSel != null
-              && viewport.colSel.getHiddenColumns() != null && viewport.colSel
-              .getHiddenColumns().size() > 0);
-      originalSource.firePropertyChange("alignment", null,
-              originalSource.alignment.getSequences());
+
+      if (originalSource != viewport)
+      {
+        Cache.log
+                .warn("Implementation worry: mismatch of viewport origin for redo");
+      }
+      originalSource.updateHiddenColumns();
+      // originalSource.hasHiddenColumns = (viewport.getColumnSelection() !=
+      // null
+      // && viewport.getColumnSelection().getHiddenColumns() != null &&
+      // viewport.getColumnSelection()
+      // .getHiddenColumns().size() > 0);
+      originalSource.firePropertyChange("alignment", null, originalSource
+              .getAlignment().getSequences());
     }
   }
 
@@ -1423,7 +1465,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       {
         if (comps.elementAt(i) instanceof AlignmentPanel)
         {
-          if (al == ((AlignmentPanel) comps.elementAt(i)).av.alignment)
+          if (al == ((AlignmentPanel) comps.elementAt(i)).av.getAlignment())
           {
             originalSource = ((AlignmentPanel) comps.elementAt(i)).av;
             break;
@@ -1438,7 +1480,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       // the current view against the closed view first
       if (al != null)
       {
-        PaintRefresher.validateSequences(al, viewport.alignment);
+        PaintRefresher.validateSequences(al, viewport.getAlignment());
       }
 
       originalSource = viewport;
@@ -1464,46 +1506,46 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (up)
     {
-      for (int i = 1; i < viewport.alignment.getHeight(); i++)
+      for (int i = 1; i < viewport.getAlignment().getHeight(); i++)
       {
-        SequenceI seq = viewport.alignment.getSequenceAt(i);
+        SequenceI seq = viewport.getAlignment().getSequenceAt(i);
 
         if (!sg.getSequences(null).contains(seq))
         {
           continue;
         }
 
-        SequenceI temp = viewport.alignment.getSequenceAt(i - 1);
+        SequenceI temp = viewport.getAlignment().getSequenceAt(i - 1);
 
         if (sg.getSequences(null).contains(temp))
         {
           continue;
         }
 
-        viewport.alignment.getSequences().setElementAt(temp, i);
-        viewport.alignment.getSequences().setElementAt(seq, i - 1);
+        viewport.getAlignment().getSequences().setElementAt(temp, i);
+        viewport.getAlignment().getSequences().setElementAt(seq, i - 1);
       }
     }
     else
     {
-      for (int i = viewport.alignment.getHeight() - 2; i > -1; i--)
+      for (int i = viewport.getAlignment().getHeight() - 2; i > -1; i--)
       {
-        SequenceI seq = viewport.alignment.getSequenceAt(i);
+        SequenceI seq = viewport.getAlignment().getSequenceAt(i);
 
         if (!sg.getSequences(null).contains(seq))
         {
           continue;
         }
 
-        SequenceI temp = viewport.alignment.getSequenceAt(i + 1);
+        SequenceI temp = viewport.getAlignment().getSequenceAt(i + 1);
 
         if (sg.getSequences(null).contains(temp))
         {
           continue;
         }
 
-        viewport.alignment.getSequences().setElementAt(temp, i);
-        viewport.alignment.getSequences().setElementAt(seq, i + 1);
+        viewport.getAlignment().getSequences().setElementAt(temp, i);
+        viewport.getAlignment().getSequences().setElementAt(seq, i + 1);
       }
     }
 
@@ -1515,15 +1557,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     Vector sg = new Vector();
     if (viewport.cursorMode)
     {
-      sg.addElement(viewport.alignment
-              .getSequenceAt(alignPanel.seqPanel.seqCanvas.cursorY));
+      sg.addElement(viewport.getAlignment().getSequenceAt(
+              alignPanel.seqPanel.seqCanvas.cursorY));
     }
     else if (viewport.getSelectionGroup() != null
-            && viewport.getSelectionGroup().getSize() != viewport.alignment
-                    .getHeight())
+            && viewport.getSelectionGroup().getSize() != viewport
+                    .getAlignment().getHeight())
     {
       sg = viewport.getSelectionGroup().getSequences(
-              viewport.hiddenRepSequences);
+              viewport.getHiddenRepSequences());
     }
 
     if (sg.size() < 1)
@@ -1533,10 +1575,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     Vector invertGroup = new Vector();
 
-    for (int i = 0; i < viewport.alignment.getHeight(); i++)
+    for (int i = 0; i < viewport.getAlignment().getHeight(); i++)
     {
-      if (!sg.contains(viewport.alignment.getSequenceAt(i)))
-        invertGroup.add(viewport.alignment.getSequenceAt(i));
+      if (!sg.contains(viewport.getAlignment().getSequenceAt(i)))
+        invertGroup.add(viewport.getAlignment().getSequenceAt(i));
     }
 
     SequenceI[] seqs1 = new SequenceI[sg.size()];
@@ -1612,7 +1654,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     SequenceI[] seqs = viewport.getSelectionAsNewSequence();
     String[] omitHidden = null;
 
-    if (viewport.hasHiddenColumns)
+    if (viewport.hasHiddenColumns())
     {
       omitHidden = viewport.getViewAsString(true);
     }
@@ -1639,7 +1681,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     Vector hiddenColumns = null;
-    if (viewport.hasHiddenColumns)
+    if (viewport.hasHiddenColumns())
     {
       hiddenColumns = new Vector();
       int hiddenOffset = viewport.getSelectionGroup().getStartRes(), hiddenCutoff = viewport
@@ -1658,7 +1700,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     Desktop.jalviewClipboard = new Object[]
-    { seqs, viewport.alignment.getDataset(), hiddenColumns };
+    { seqs, viewport.getAlignment().getDataset(), hiddenColumns };
     statusBar.setText("Copied " + seqs.length + " sequences to clipboard.");
   }
 
@@ -1989,7 +2031,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     // If the cut affects all sequences, remove highlighted columns
-    if (sg.getSize() == viewport.alignment.getHeight())
+    if (sg.getSize() == viewport.getAlignment().getHeight())
     {
       viewport.getColumnSelection().removeElements(sg.getStartRes(),
               sg.getEndRes() + 1);
@@ -2006,11 +2048,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
      */
     addHistoryItem(new EditCommand("Cut Sequences", EditCommand.CUT, cut,
             sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
-            viewport.alignment));
+            viewport.getAlignment()));
 
     viewport.setSelectionGroup(null);
     viewport.sendSelection();
-    viewport.alignment.deleteGroup(sg);
+    viewport.getAlignment().deleteGroup(sg);
 
     viewport.firePropertyChange("alignment", null, viewport.getAlignment()
             .getSequences());
@@ -2033,7 +2075,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   protected void deleteGroups_actionPerformed(ActionEvent e)
   {
-    viewport.alignment.deleteAllGroups();
+    viewport.getAlignment().deleteAllGroups();
     viewport.sequenceColours = null;
     viewport.setSelectionGroup(null);
     PaintRefresher.Refresh(this, viewport.getSequenceSetId());
@@ -2056,7 +2098,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);
     }
 
-    sg.setEndRes(viewport.alignment.getWidth() - 1);
+    sg.setEndRes(viewport.getAlignment().getWidth() - 1);
     viewport.setSelectionGroup(sg);
     viewport.sendSelection();
     alignPanel.paintAlignment(true);
@@ -2162,11 +2204,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       if (viewport.getSelectionGroup() != null)
       {
         seqs = viewport.getSelectionGroup().getSequencesAsArray(
-                viewport.hiddenRepSequences);
+                viewport.getHiddenRepSequences());
       }
       else
       {
-        seqs = viewport.alignment.getSequencesArray();
+        seqs = viewport.getAlignment().getSequencesArray();
       }
 
       TrimRegionCommand trimRegion;
@@ -2174,23 +2216,23 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       {
         trimRegion = new TrimRegionCommand("Remove Left",
                 TrimRegionCommand.TRIM_LEFT, seqs, column,
-                viewport.alignment, viewport.colSel,
-                viewport.selectionGroup);
+                viewport.getAlignment(), viewport.getColumnSelection(),
+                viewport.getSelectionGroup());
         viewport.setStartRes(0);
       }
       else
       {
         trimRegion = new TrimRegionCommand("Remove Right",
                 TrimRegionCommand.TRIM_RIGHT, seqs, column,
-                viewport.alignment, viewport.colSel,
-                viewport.selectionGroup);
+                viewport.getAlignment(), viewport.getColumnSelection(),
+                viewport.getSelectionGroup());
       }
 
       statusBar.setText("Removed " + trimRegion.getSize() + " columns.");
 
       addHistoryItem(trimRegion);
 
-      Vector groups = viewport.alignment.getGroups();
+      Vector groups = viewport.getAlignment().getGroups();
 
       for (int i = 0; i < groups.size(); i++)
       {
@@ -2199,7 +2241,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         if ((trimLeft && !sg.adjustForRemoveLeft(column))
                 || (!trimLeft && !sg.adjustForRemoveRight(column)))
         {
-          viewport.alignment.deleteGroup(sg);
+          viewport.getAlignment().deleteGroup(sg);
         }
       }
 
@@ -2216,23 +2258,24 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
   {
-    int start = 0, end = viewport.alignment.getWidth() - 1;
+    int start = 0, end = viewport.getAlignment().getWidth() - 1;
 
     SequenceI[] seqs;
     if (viewport.getSelectionGroup() != null)
     {
       seqs = viewport.getSelectionGroup().getSequencesAsArray(
-              viewport.hiddenRepSequences);
+              viewport.getHiddenRepSequences());
       start = viewport.getSelectionGroup().getStartRes();
       end = viewport.getSelectionGroup().getEndRes();
     }
     else
     {
-      seqs = viewport.alignment.getSequencesArray();
+      seqs = viewport.getAlignment().getSequencesArray();
     }
 
     RemoveGapColCommand removeGapCols = new RemoveGapColCommand(
-            "Remove Gapped Columns", seqs, start, end, viewport.alignment);
+            "Remove Gapped Columns", seqs, start, end,
+            viewport.getAlignment());
 
     addHistoryItem(removeGapCols);
 
@@ -2241,7 +2284,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     // This is to maintain viewport position on first residue
     // of first sequence
-    SequenceI seq = viewport.alignment.getSequenceAt(0);
+    SequenceI seq = viewport.getAlignment().getSequenceAt(0);
     int startRes = seq.findPosition(viewport.startRes);
     // ShiftList shifts;
     // viewport.getAlignment().removeGaps(shifts=new ShiftList());
@@ -2262,28 +2305,28 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
   {
-    int start = 0, end = viewport.alignment.getWidth() - 1;
+    int start = 0, end = viewport.getAlignment().getWidth() - 1;
 
     SequenceI[] seqs;
     if (viewport.getSelectionGroup() != null)
     {
       seqs = viewport.getSelectionGroup().getSequencesAsArray(
-              viewport.hiddenRepSequences);
+              viewport.getHiddenRepSequences());
       start = viewport.getSelectionGroup().getStartRes();
       end = viewport.getSelectionGroup().getEndRes();
     }
     else
     {
-      seqs = viewport.alignment.getSequencesArray();
+      seqs = viewport.getAlignment().getSequencesArray();
     }
 
     // This is to maintain viewport position on first residue
     // of first sequence
-    SequenceI seq = viewport.alignment.getSequenceAt(0);
+    SequenceI seq = viewport.getAlignment().getSequenceAt(0);
     int startRes = seq.findPosition(viewport.startRes);
 
     addHistoryItem(new RemoveGapsCommand("Remove Gaps", seqs, start, end,
-            viewport.alignment));
+            viewport.getAlignment()));
 
     viewport.setStartRes(seq.findIndex(startRes) - 1);
 
@@ -2300,7 +2343,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public void padGapsMenuitem_actionPerformed(ActionEvent e)
   {
-    viewport.padGaps = padGapsMenuitem.isSelected();
+    viewport.setPadGaps(padGapsMenuitem.isSelected());
     viewport.firePropertyChange("alignment", null, viewport.getAlignment()
             .getSequences());
   }
@@ -2368,13 +2411,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (!copyAnnotation)
     {
       // just remove all the current annotation except for the automatic stuff
-      newap.av.alignment.deleteAllGroups();
-      for (AlignmentAnnotation alan : newap.av.alignment
+      newap.av.getAlignment().deleteAllGroups();
+      for (AlignmentAnnotation alan : newap.av.getAlignment()
               .getAlignmentAnnotation())
       {
         if (!alan.autoCalculated)
         {
-          newap.av.alignment.deleteAnnotation(alan);
+          newap.av.getAlignment().deleteAnnotation(alan);
         }
         ;
       }
@@ -2558,8 +2601,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       // Hide everything by the current selection - this is a hack - we do the
       // invert and then hide
       // first check that there will be visible columns after the invert.
-      if ((viewport.colSel != null && viewport.colSel.getSelected() != null && viewport.colSel
-              .getSelected().size() > 0)
+      if ((viewport.getColumnSelection() != null
+              && viewport.getColumnSelection().getSelected() != null && viewport
+              .getColumnSelection().getSelected().size() > 0)
               || (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg
                       .getEndRes()))
       {
@@ -2582,12 +2626,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (toggleSeqs)
     {
-      if (sg != null && sg.getSize() != viewport.alignment.getHeight())
+      if (sg != null && sg.getSize() != viewport.getAlignment().getHeight())
       {
         hideSelSequences_actionPerformed(null);
         hide = true;
       }
-      else if (!(toggleCols && viewport.colSel.getSelected().size() > 0))
+      else if (!(toggleCols && viewport.getColumnSelection().getSelected()
+              .size() > 0))
       {
         showAllSeqs_actionPerformed(null);
       }
@@ -2595,12 +2640,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (toggleCols)
     {
-      if (viewport.colSel.getSelected().size() > 0)
+      if (viewport.getColumnSelection().getSelected().size() > 0)
       {
         hideSelColumns_actionPerformed(null);
         if (!toggleSeqs)
         {
-          viewport.selectionGroup = sg;
+          viewport.setSelectionGroup(sg);
         }
       }
       else if (!hide)
@@ -2809,7 +2854,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     JEditorPane editPane = new JEditorPane("text/html", "");
     editPane.setEditable(false);
-    StringBuffer contents = new AlignmentProperties(viewport.alignment)
+    StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
             .formatAsHtml();
     editPane.setText("<html>" + contents.toString() + "</html>");
     JInternalFrame frame = new JInternalFrame();
@@ -2875,9 +2920,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public void clustalColour_actionPerformed(ActionEvent e)
   {
-    changeColour(new ClustalxColourScheme(
-            viewport.alignment.getSequences(),
-            viewport.alignment.getWidth()));
+    changeColour(new ClustalxColourScheme(viewport.getAlignment()
+            .getSequences(), viewport.getAlignment().getWidth()));
   }
 
   /**
@@ -2968,11 +3012,27 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     changeColour(new NucleotideColourScheme());
   }
 
+  public void purinePyrimidineColour_actionPerformed(ActionEvent e)
+  {
+    changeColour(new PurinePyrimidineColourScheme());
+  }
+
+  /*
+   * public void covariationColour_actionPerformed(ActionEvent e) {
+   * changeColour(new
+   * CovariationColourScheme(viewport.getAlignment().getAlignmentAnnotation
+   * ()[0])); }
+   */
   public void annotationColour_actionPerformed(ActionEvent e)
   {
     new AnnotationColourChooser(viewport, alignPanel);
   }
 
+  public void rnahelicesColour_actionPerformed(ActionEvent e)
+  {
+    new RNAHelicesColourChooser(viewport, alignPanel);
+  }
+
   /**
    * DOCUMENT ME!
    * 
@@ -3013,13 +3073,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       if (viewport.getConservationSelected())
       {
 
-        Alignment al = (Alignment) viewport.alignment;
+        Alignment al = (Alignment) viewport.getAlignment();
         Conservation c = new Conservation("All",
                 ResidueProperties.propHash, 3, al.getSequences(), 0,
                 al.getWidth() - 1);
 
         c.calculate();
-        c.verdict(false, viewport.ConsPercGaps);
+        c.verdict(false, viewport.getConsPercGaps());
 
         cs.setConservation(c);
 
@@ -3031,14 +3091,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         cs.setConservation(null);
       }
 
-      cs.setConsensus(viewport.hconsensus);
+      cs.setConsensus(viewport.getSequenceConsensusHash());
     }
 
     viewport.setGlobalColourScheme(cs);
 
     if (viewport.getColourAppliesToAllGroups())
     {
-      Vector groups = viewport.alignment.getGroups();
+      Vector groups = viewport.getAlignment().getGroups();
 
       for (int i = 0; i < groups.size(); i++)
       {
@@ -3052,9 +3112,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
         if (cs instanceof ClustalxColourScheme)
         {
-          sg.cs = new ClustalxColourScheme(
-                  sg.getSequences(viewport.hiddenRepSequences),
-                  sg.getWidth());
+          sg.cs = new ClustalxColourScheme(sg.getSequences(viewport
+                  .getHiddenRepSequences()), sg.getWidth());
         }
         else if (cs instanceof UserColourScheme)
         {
@@ -3077,7 +3136,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           sg.cs.setThreshold(threshold, viewport.getIgnoreGapsConsensus());
 
           sg.cs.setConsensus(AAFrequency.calculate(
-                  sg.getSequences(viewport.hiddenRepSequences),
+                  sg.getSequences(viewport.getHiddenRepSequences()),
                   sg.getStartRes(), sg.getEndRes() + 1));
         }
         else
@@ -3088,11 +3147,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         if (viewport.getConservationSelected())
         {
           Conservation c = new Conservation("Group",
-                  ResidueProperties.propHash, 3,
-                  sg.getSequences(viewport.hiddenRepSequences),
-                  sg.getStartRes(), sg.getEndRes() + 1);
+                  ResidueProperties.propHash, 3, sg.getSequences(viewport
+                          .getHiddenRepSequences()), sg.getStartRes(),
+                  sg.getEndRes() + 1);
           c.calculate();
-          c.verdict(false, viewport.ConsPercGaps);
+          c.verdict(false, viewport.getConsPercGaps());
           sg.cs.setConservation(c);
         }
         else
@@ -3119,7 +3178,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   protected void modifyPID_actionPerformed(ActionEvent e)
   {
     if (viewport.getAbovePIDThreshold()
-            && viewport.globalColourScheme != null)
+            && viewport.getGlobalColourScheme() != null)
     {
       SliderPanel.setPIDSliderSource(alignPanel,
               viewport.getGlobalColourScheme(), "Background");
@@ -3136,10 +3195,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   protected void modifyConservation_actionPerformed(ActionEvent e)
   {
     if (viewport.getConservationSelected()
-            && viewport.globalColourScheme != null)
+            && viewport.getGlobalColourScheme() != null)
     {
       SliderPanel.setConservationSlider(alignPanel,
-              viewport.globalColourScheme, "Background");
+              viewport.getGlobalColourScheme(), "Background");
       SliderPanel.showConservationSlider();
     }
   }
@@ -3306,7 +3365,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     AlignmentSorter.sortByPID(viewport.getAlignment(), viewport
             .getAlignment().getSequenceAt(0), null);
     addHistoryItem(new OrderCommand("Pairwise Sort", oldOrder,
-            viewport.alignment));
+            viewport.getAlignment()));
     alignPanel.paintAlignment(true);
   }
 
@@ -3320,7 +3379,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
     AlignmentSorter.sortByID(viewport.getAlignment());
-    addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.alignment));
+    addHistoryItem(new OrderCommand("ID Sort", oldOrder,
+            viewport.getAlignment()));
     alignPanel.paintAlignment(true);
   }
 
@@ -3335,7 +3395,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
     AlignmentSorter.sortByLength(viewport.getAlignment());
     addHistoryItem(new OrderCommand("Length Sort", oldOrder,
-            viewport.alignment));
+            viewport.getAlignment()));
     alignPanel.paintAlignment(true);
   }
 
@@ -3350,7 +3410,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
     AlignmentSorter.sortByGroup(viewport.getAlignment());
     addHistoryItem(new OrderCommand("Group Sort", oldOrder,
-            viewport.alignment));
+            viewport.getAlignment()));
 
     alignPanel.paintAlignment(true);
   }
@@ -3423,6 +3483,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               .getAlignment().getSequences());
     }
   }
+
   public void sortByTreeOption_actionPerformed(ActionEvent e)
   {
     viewport.sortByTree = sortByTree.isSelected();
@@ -3433,6 +3494,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     viewport.followSelection = listenToViewSelections.isSelected();
   }
+
   /**
    * DOCUMENT ME!
    * 
@@ -3531,7 +3593,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     else
     {
       // are the visible sequences aligned?
-      if (!viewport.alignment.isAligned(false))
+      if (!viewport.getAlignment().isAligned(false))
       {
         JOptionPane
                 .showMessageDialog(
@@ -3545,7 +3607,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         return;
       }
 
-      if (viewport.alignment.getHeight() < 2)
+      if (viewport.getAlignment().getHeight() < 2)
       {
         return;
       }
@@ -3588,8 +3650,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         // pointers
         AlignmentSorter.sortBy(viewport.getAlignment(), order);
 
-        addHistoryItem(new OrderCommand(order.getName(), oldOrder,
-                viewport.alignment));
+        addHistoryItem(new OrderCommand(order.getName(), oldOrder, viewport
+                .getAlignment()));
 
         alignPanel.paintAlignment(true);
       }
@@ -3618,7 +3680,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         AlignmentSorter.sortByAnnotationScore(scoreLabel,
                 viewport.getAlignment());// ,viewport.getSelectionGroup());
         addHistoryItem(new OrderCommand("Sort by " + scoreLabel, oldOrder,
-                viewport.alignment));
+                viewport.getAlignment()));
         alignPanel.paintAlignment(true);
       }
     });
@@ -3638,18 +3700,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public void buildSortByAnnotationScoresMenu()
   {
-    if (viewport.alignment.getAlignmentAnnotation() == null)
+    if (viewport.getAlignment().getAlignmentAnnotation() == null)
     {
       return;
     }
 
-    if (viewport.alignment.getAlignmentAnnotation().hashCode() != _annotationScoreVectorHash)
+    if (viewport.getAlignment().getAlignmentAnnotation().hashCode() != _annotationScoreVectorHash)
     {
       sortByAnnotScore.removeAll();
       // almost certainly a quicker way to do this - but we keep it simple
       Hashtable scoreSorts = new Hashtable();
       AlignmentAnnotation aann[];
-      Enumeration sq = viewport.alignment.getSequences().elements();
+      Enumeration sq = viewport.getAlignment().getSequences().elements();
       while (sq.hasMoreElements())
       {
         aann = ((SequenceI) sq.nextElement()).getAnnotation();
@@ -3670,7 +3732,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       sortByAnnotScore.setVisible(scoreSorts.size() > 0);
       scoreSorts.clear();
 
-      _annotationScoreVectorHash = viewport.alignment
+      _annotationScoreVectorHash = viewport.getAlignment()
               .getAlignmentAnnotation().hashCode();
     }
   }
@@ -3724,7 +3786,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         {
           tp.sortByTree_actionPerformed(null);
           addHistoryItem(tp.sortAlignmentIn(alignPanel));
-          
+
         }
       });
 
@@ -3739,7 +3801,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (undoname != null)
     {
       addHistoryItem(new OrderCommand(undoname, oldOrder,
-              viewport.alignment));
+              viewport.getAlignment()));
     }
     alignPanel.paintAlignment(true);
     return true;
@@ -3806,9 +3868,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
     // limit sequences - JBPNote in future - could spawn multiple prediction
     // jobs
-    // TODO: viewport.alignment.isAligned is a global state - the local
+    // TODO: viewport.getAlignment().isAligned is a global state - the local
     // selection may well be aligned - we preserve 2.0.8 behaviour for moment.
-    if (!viewport.alignment.isAligned(false))
+    if (!viewport.getAlignment().isAligned(false))
     {
       seqs.setSequences(new SeqCigar[]
       { seqs.getSequences()[0] });
@@ -3966,20 +4028,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           // TODO: group services by location as well as function and/or
           // introduce
           // object broker mechanism.
-          final Vector wsmenu = new Vector();
+          final Vector<JMenu> wsmenu = new Vector<JMenu>();
           final IProgressIndicator af = me;
           final JMenu msawsmenu = new JMenu("Alignment");
           final JMenu secstrmenu = new JMenu(
                   "Secondary Structure Prediction");
-          final JMenu seqsrchmenu = new JMenu(
-                  "Sequence Database Search");
-          final JMenu analymenu = new JMenu(
-                  "Analysis");
-          // JAL-940 - only show secondary structure prediction services from the legacy server
+          final JMenu seqsrchmenu = new JMenu("Sequence Database Search");
+          final JMenu analymenu = new JMenu("Analysis");
+          final JMenu dismenu = new JMenu("Disorder");
+          // JAL-940 - only show secondary structure prediction services from
+          // the legacy server
           if (// Cache.getDefault("SHOW_JWS1_SERVICES", true)
-                  // && 
-                  Discoverer.services != null
-                  && (Discoverer.services.size() > 0))
+              // &&
+          Discoverer.services != null && (Discoverer.services.size() > 0))
           {
             // TODO: refactor to allow list of AbstractName/Handler bindings to
             // be
@@ -3987,7 +4048,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             Vector msaws = null; // (Vector) Discoverer.services.get("MsaWS");
             Vector secstrpr = (Vector) Discoverer.services
                     .get("SecStrPred");
-            Vector seqsrch = null; // (Vector) Discoverer.services.get("SeqSearch");
+            Vector seqsrch = null; // (Vector)
+                                   // Discoverer.services.get("SeqSearch");
             // TODO: move GUI generation code onto service implementation - so a
             // client instance attaches itself to the GUI with method call like
             // jalview.ws.MsaWSClient.bind(servicehandle, Desktop.instance,
@@ -4031,22 +4093,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             }
           }
 
-          // TODO: move into separate menu builder class.
-          if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
-          {
-            Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
-            if (jws2servs != null)
-            {
-              if (jws2servs.hasServices())
-              {
-                jws2servs.attachWSMenuEntry(msawsmenu, me);
-              }
-            }
-          }
-          // Add all submenus in the order they should appear on the web services menu
+          // Add all submenus in the order they should appear on the web
+          // services menu
           wsmenu.add(msawsmenu);
           wsmenu.add(secstrmenu);
+          wsmenu.add(dismenu);
           wsmenu.add(analymenu);
+//          final ArrayList<JMenu> submens=new ArrayList<JMenu>();
+//          submens.add(msawsmenu);
+ //         submens.add(secstrmenu);
+ //         submens.add(dismenu);
+  //        submens.add(analymenu);
+          
           // No search services yet
           // wsmenu.add(seqsrchmenu);
 
@@ -4069,8 +4127,39 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 {
                   webService.add(me.webServiceNoServices);
                 }
+                // TODO: move into separate menu builder class.
+                if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
+                {
+                  Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
+                  if (jws2servs != null)
+                  {
+                    if (jws2servs.hasServices())
+                    {
+                      jws2servs.attachWSMenuEntry(webService, me);
+                    }
+                    if (jws2servs.isRunning())
+                    {
+                      JMenuItem tm = new JMenuItem(
+                              "Still discovering JABA Services");
+                      tm.setEnabled(false);
+                      webService.add(tm);
+                    }
+                  }
+                }
+
                 build_urlServiceMenu(me.webService);
                 build_fetchdbmenu(webService);
+                for (JMenu item : wsmenu)
+                {
+                  if (item.getItemCount() == 0)
+                  {
+                    item.setEnabled(false);
+                  }
+                  else
+                  {
+                    item.setEnabled(true);
+                  }
+                }
               } catch (Exception e)
               {
               }
@@ -4088,7 +4177,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
   }
 
-
   /**
    * construct any groupURL type service menu entries.
    * 
@@ -4103,8 +4191,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
      * AlignFrame af = this; testAlView.addActionListener(new ActionListener() {
      * 
      * @Override public void actionPerformed(ActionEvent e) {
-     * jalview.datamodel.AlignmentView.testSelectionViews(af.viewport.alignment,
-     * af.viewport.colSel, af.viewport.selectionGroup); }
+     * jalview.datamodel.AlignmentView
+     * .testSelectionViews(af.viewport.getAlignment(),
+     * af.viewport.getColumnSelection(), af.viewport.selectionGroup); }
      * 
      * }); webService.add(testAlView);
      */
@@ -4112,9 +4201,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     // rest-style services with other types of analysis/calculation service
     // SHmmr test client - still being implemented.
     // DEBUG - alignmentView
-    
-    for (jalview.ws.rest.RestClient client: jalview.ws.rest.RestClient.getRestClients()) {
-      client.attachWSMenuEntry(JvSwingUtils.findOrCreateMenu(webService, client.getAction()), this);
+
+    for (jalview.ws.rest.RestClient client : jalview.ws.rest.RestClient
+            .getRestClients())
+    {
+      client.attachWSMenuEntry(
+              JvSwingUtils.findOrCreateMenu(webService, client.getAction()),
+              this);
     }
 
     if (Cache.getDefault("SHOW_ENFIN_SERVICES", true))
@@ -4230,7 +4323,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         ths.setProgressBar("Searching for sequences from " + fsrc, sttime);
         try
         {
-          Alignment ds = ths.getViewport().alignment.getDataset(); // update
+          Alignment ds = ths.getViewport().getAlignment().getDataset(); // update
           // our local
           // dataset
           // reference
@@ -4352,8 +4445,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       al = jalview.analysis.Dna.CdnaTranslate(selection, seqstring,
               viewport.getViewAsVisibleContigs(true), viewport
-                      .getGapCharacter(), viewport.alignment
-                      .getAlignmentAnnotation(), viewport.alignment
+                      .getGapCharacter(), viewport.getAlignment()
+                      .getAlignmentAnnotation(), viewport.getAlignment()
                       .getWidth(), viewport.getAlignment().getDataset());
     } catch (Exception ex)
     {
@@ -4390,11 +4483,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     boolean featuresFile = false;
     try
     {
-      featuresFile = new FeaturesFile(file, type)
-              .parse(viewport.alignment.getDataset(),
-                      alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,
-                      false, jalview.bin.Cache.getDefault(
-                              "RELAXEDSEQIDMATCHING", false));
+      featuresFile = new FeaturesFile(file, type).parse(viewport
+              .getAlignment().getDataset(), alignPanel.seqPanel.seqCanvas
+              .getFeatureRenderer().featureColours, false,
+              jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
     } catch (Exception ex)
     {
       ex.printStackTrace();
@@ -4520,7 +4612,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             int l = 0, c = pdbfn.indexOf(".");
             while (mtch == null && c != -1)
             {
-              do 
+              do
               {
                 l = c;
               } while ((c = pdbfn.indexOf(".", l)) > l);
@@ -4573,18 +4665,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               // try and associate
               // TODO: may want to set a standard ID naming formalism for
               // associating PDB files which have no IDs.
-              for (SequenceI toassoc: (SequenceI[])fm[2]) {
-              PDBEntry pe = new AssociatePdbFileWithSeq()
-                      .associatePdbWithSeq((String) fm[0], (String) fm[1],
-                              toassoc, false);
-              if (pe != null)
+              for (SequenceI toassoc : (SequenceI[]) fm[2])
               {
-                System.err
-                        .println("Associated file : " + ((String) fm[0])
-                                + " with "
-                                + toassoc.getDisplayId(true));
-                assocfiles++;
-              }
+                PDBEntry pe = new AssociatePdbFileWithSeq()
+                        .associatePdbWithSeq((String) fm[0],
+                                (String) fm[1], toassoc, false);
+                if (pe != null)
+                {
+                  System.err.println("Associated file : "
+                          + ((String) fm[0]) + " with "
+                          + toassoc.getDisplayId(true));
+                  assocfiles++;
+                }
               }
               alignPanel.paintAlignment(true);
             }
@@ -4641,7 +4733,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       // try to parse as annotation.
       boolean isAnnotation = (format == null || format
               .equalsIgnoreCase("PFAM")) ? new AnnotationFile()
-              .readAnnotationFile(viewport.alignment, file, protocol)
+              .readAnnotationFile(viewport.getAlignment(), file, protocol)
               : false;
 
       if (!isAnnotation)
@@ -4748,7 +4840,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   protected void extractScores_actionPerformed(ActionEvent e)
   {
     ParseProperties pp = new jalview.analysis.ParseProperties(
-            viewport.alignment);
+            viewport.getAlignment());
     // TODO: verify regex and introduce GUI dialog for version 2.5
     // if (pp.getScoresFromDescription("col", "score column ",
     // "\\W*([-+]?\\d*\\.?\\d*e?-?\\d*)\\W+([-+]?\\d*\\.?\\d*e?-?\\d*)",
@@ -5006,6 +5098,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
   }
 
+  protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
+  {
+    viewport.setNormaliseSequenceLogo(normaliseSequenceLogo.getState());
+    alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+  }
+
   protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
   {
     alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
@@ -5025,9 +5123,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       SequenceGroup[] gps = jalview.analysis.Grouping.makeGroupsFrom(
               viewport.getSequenceSelection(),
               viewport.getAlignmentView(true).getSequenceStrings(
-                      viewport.getGapCharacter()),
-              viewport.alignment.getGroups());
-      viewport.alignment.deleteAllGroups();
+                      viewport.getGapCharacter()), viewport.getAlignment()
+                      .getGroups());
+      viewport.getAlignment().deleteAllGroups();
       viewport.sequenceColours = null;
       viewport.setSelectionGroup(null);
       // set view properties for each group
@@ -5035,7 +5133,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       {
         gps[g].setShowNonconserved(viewport.getShowUnconserved());
         gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());
-        viewport.alignment.addGroup(gps[g]);
+        viewport.getAlignment().addGroup(gps[g]);
         Color col = new Color((int) (Math.random() * 255),
                 (int) (Math.random() * 255), (int) (Math.random() * 255));
         col = col.brighter();
@@ -5064,7 +5162,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               "Implementation error: cannot show a view from another alignment in an AlignFrame.");
     }
     if (tabbedPane != null
-            & alignPanels.indexOf(alignmentPanel) != tabbedPane.getSelectedIndex())
+            & alignPanels.indexOf(alignmentPanel) != tabbedPane
+                    .getSelectedIndex())
     {
       tabbedPane.setSelectedIndex(alignPanels.indexOf(alignmentPanel));
     }
index 13f66d9..8f615aa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -40,7 +40,10 @@ import java.util.*;
 import java.awt.*;
 
 import jalview.analysis.*;
-import jalview.api.StructureSelectionManagerProvider;
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.OOMHandlerI;
 
 import jalview.bin.*;
 
@@ -50,6 +53,11 @@ import jalview.schemes.*;
 import jalview.structure.SelectionSource;
 import jalview.structure.StructureSelectionManager;
 import jalview.structure.VamsasSource;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.workers.AlignCalcManager;
+import jalview.workers.ConsensusThread;
+import jalview.workers.ConservationThread;
+import jalview.workers.StrucConsensusThread;
 
 /**
  * DOCUMENT ME!
@@ -57,7 +65,7 @@ import jalview.structure.VamsasSource;
  * @author $author$
  * @version $Revision: 1.141 $
  */
-public class AlignViewport implements SelectionSource, VamsasSource
+public class AlignViewport extends AlignmentViewport implements SelectionSource, VamsasSource, AlignViewportI
 {
   private static final int RIGHT_JUSTIFY = 1;
 
@@ -87,14 +95,10 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   boolean colourAppliesToAllGroups = true;
 
-  ColourSchemeI globalColourScheme = null;
-
   boolean conservationColourSelected = false;
 
   boolean abovePIDThreshold = false;
 
-  SequenceGroup selectionGroup;
-
   int charHeight;
 
   int charWidth;
@@ -107,10 +111,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   boolean seqNameItalics;
 
-  AlignmentI alignment;
-
-  ColumnSelection colSel = new ColumnSelection();
-
   int threshold;
 
   int increment;
@@ -123,10 +123,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   boolean scaleRightWrapped = true;
 
-  boolean hasHiddenColumns = false;
-
-  boolean hasHiddenRows = false;
-
   boolean showHiddenMarkers = true;
 
   boolean cursorMode = false;
@@ -137,42 +133,12 @@ public class AlignViewport implements SelectionSource, VamsasSource
    */
   Hashtable featuresDisplayed = null;
 
-  /** DOCUMENT ME!! */
-  public Hashtable[] hconsensus;
-
-  AlignmentAnnotation consensus;
-
-  AlignmentAnnotation conservation;
-
-  AlignmentAnnotation quality;
-
-  AlignmentAnnotation[] groupConsensus;
-
-  AlignmentAnnotation[] groupConservation;
-
-  boolean autoCalculateConsensus = true;
-
-  /** DOCUMENT ME!! */
-  public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
-
-  // JBPNote Prolly only need this in the applet version.
-  private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
-          this);
-
-  boolean ignoreGapsInConsensusCalculation = false;
-
-  boolean isDataset = false;
-
   boolean antiAlias = false;
 
-  boolean padGaps = false;
-
   Rectangle explodedPosition;
 
   String viewName;
 
-  String sequenceSetID;
-
   boolean gatherViewsHere = false;
 
   Stack historyList = new Stack();
@@ -189,10 +155,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   boolean rightAlignIds = false;
 
-  Hashtable hiddenRepSequences;
-
-  boolean sortByTree;
-
   /**
    * Creates a new AlignViewport object.
    * 
@@ -334,7 +296,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
     centreColumnLabels = Cache.getDefault("CENTRE_COLUMN_LABELS", false);
     autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
 
-    padGaps = Cache.getDefault("PAD_GAPS", true);
+    setPadGaps(Cache.getDefault("PAD_GAPS", true));
     shownpfeats = Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true);
     showdbrefs = Cache.getDefault("SHOW_DBREFS_TOOLTIP", true);
 
@@ -366,53 +328,23 @@ public class AlignViewport implements SelectionSource, VamsasSource
     {
       if (!alignment.isNucleotide())
       {
-        conservation = new AlignmentAnnotation("Conservation",
-                "Conservation of total alignment less than " + ConsPercGaps
-                        + "% gaps", new Annotation[1], 0f, 11f,
-                AlignmentAnnotation.BAR_GRAPH);
-        conservation.hasText = true;
-        conservation.autoCalculated = true;
-
-        if (Cache.getDefault("SHOW_CONSERVATION", true))
-        {
-          alignment.addAnnotation(conservation);
-        }
-
-        if (Cache.getDefault("SHOW_QUALITY", true))
-        {
-          quality = new AlignmentAnnotation("Quality",
-                  "Alignment Quality based on Blosum62 scores",
-                  new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
-          quality.hasText = true;
-          quality.autoCalculated = true;
-
-          alignment.addAnnotation(quality);
-        }
+        showConservation=Cache.getDefault("SHOW_CONSERVATION", true);
+        showQuality=Cache.getDefault("SHOW_QUALITY", true);
         showGroupConservation = Cache.getDefault("SHOW_GROUP_CONSERVATION",
                 false);
-
-        {
-
-        }
-      }
+      } 
       showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM",
               true);
       showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", false);
+      normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO", false);
       showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
-      // TODO: add menu option action that nulls or creates consensus object
-      // depending on if the user wants to see the annotation or not in a
-      // specific alignment
+      showConsensus=Cache.getDefault("SHOW_IDENTITY", true);
       consensus = new AlignmentAnnotation("Consensus", "PID",
               new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
       consensus.hasText = true;
       consensus.autoCalculated = true;
-
-      if (Cache.getDefault("SHOW_IDENTITY", true))
-      {
-        alignment.addAnnotation(consensus);
-      }
     }
-
+    initAutoAnnotation();
     if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
     {
       globalColourScheme = ColourSchemeProperty.getColour(alignment,
@@ -455,20 +387,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return showSequenceFeatures;
   }
 
-  ConservationThread conservationThread;
-
-  ConsensusThread consensusThread;
-
-  boolean consUpdateNeeded = false;
-
-  static boolean UPDATING_CONSENSUS = false;
-
-  static boolean UPDATING_CONSERVATION = false;
-
-  boolean updatingConsensus = false;
-
-  boolean updatingConservation = false;
-
   /**
    * centre columnar annotation labels in displayed alignment annotation TODO:
    * add to jalviewXML and annotation display settings
@@ -479,131 +397,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   private boolean shownpfeats;
 
-  /**
-   * trigger update of conservation annotation
-   */
-  public void updateConservation(final AlignmentPanel ap)
-  {
-    // see note in mantis : issue number 8585
-    if (alignment.isNucleotide() || conservation == null
-            || !autoCalculateConsensus)
-    {
-      return;
-    }
-
-    conservationThread = new ConservationThread(this, ap);
-    conservationThread.start();
-  }
-
-  /**
-   * trigger update of consensus annotation
-   */
-  public void updateConsensus(final AlignmentPanel ap)
-  {
-    // see note in mantis : issue number 8585
-    if (consensus == null || !autoCalculateConsensus)
-    {
-      return;
-    }
-    consensusThread = new ConsensusThread(ap);
-    consensusThread.start();
-  }
-
-  class ConsensusThread extends Thread
-  {
-    AlignmentPanel ap;
-
-    public ConsensusThread(AlignmentPanel ap)
-    {
-      this.ap = ap;
-    }
-
-    public void run()
-    {
-      updatingConsensus = true;
-      while (UPDATING_CONSENSUS)
-      {
-        try
-        {
-          if (ap != null)
-          {
-            ap.paintAlignment(false);
-          }
-
-          Thread.sleep(200);
-        } catch (Exception ex)
-        {
-          ex.printStackTrace();
-        }
-      }
-
-      UPDATING_CONSENSUS = true;
-
-      try
-      {
-        int aWidth = (alignment != null) ? alignment.getWidth() : -1; // null
-        // pointer
-        // possibility
-        // here.
-        if (aWidth <= 0)
-        {
-          updatingConsensus = false;
-          UPDATING_CONSENSUS = false;
-          return;
-        }
-
-        consensus.annotations = null;
-        consensus.annotations = new Annotation[aWidth];
-
-        hconsensus = new Hashtable[aWidth];
-        AAFrequency.calculate(alignment.getSequencesArray(), 0,
-                alignment.getWidth(), hconsensus, true);
-        updateAnnotation(true);
-
-        if (globalColourScheme != null)
-        {
-          globalColourScheme.setConsensus(hconsensus);
-        }
-
-      } catch (OutOfMemoryError error)
-      {
-        alignment.deleteAnnotation(consensus);
-
-        consensus = null;
-        hconsensus = null;
-        new OOMWarning("calculating consensus", error);
-      }
-      UPDATING_CONSENSUS = false;
-      updatingConsensus = false;
-
-      if (ap != null)
-      {
-        ap.paintAlignment(true);
-      }
-    }
-
-    /**
-     * update the consensus annotation from the sequence profile data using
-     * current visualization settings.
-     */
-    public void updateAnnotation()
-    {
-      updateAnnotation(false);
-    }
-
-    protected void updateAnnotation(boolean immediate)
-    {
-      // TODO: make calls thread-safe, so if another thread calls this method,
-      // it will either return or wait until one calculation is finished.
-      if (immediate
-              || (!updatingConsensus && consensus != null && hconsensus != null))
-      {
-        AAFrequency.completeConsensus(consensus, hconsensus, 0,
-                hconsensus.length, ignoreGapsInConsensusCalculation,
-                showSequenceLogo);
-      }
-    }
-  }
+  // --------END Structure Conservation
 
   /**
    * get the consensus sequence as displayed under the PID consensus annotation
@@ -643,29 +437,10 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return sq;
   }
 
-  /**
-   * 
-   * 
-   * @return null or the currently selected sequence region
-   */
-  public SequenceGroup getSelectionGroup()
-  {
-    return selectionGroup;
-  }
-
-  /**
-   * Set the selection group for this window.
-   * 
-   * @param sg - group holding references to sequences in this alignment view
-   *          
-   */
-  public void setSelectionGroup(SequenceGroup sg)
-  {
-    selectionGroup = sg;
-  }
 
   /**
    * GUI state
+   * 
    * @return true if conservation based shading is enabled
    */
   public boolean getConservationSelected()
@@ -675,6 +450,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   /**
    * GUI state
+   * 
    * @param b
    *          enable conservation based shading
    */
@@ -685,6 +461,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   /**
    * GUI state
+   * 
    * @return true if percent identity threshold is applied to shading
    */
   public boolean getAbovePIDThreshold()
@@ -696,7 +473,8 @@ public class AlignViewport implements SelectionSource, VamsasSource
    * GUI state
    * 
    * 
-   * @param b indicate if percent identity threshold is applied to shading
+   * @param b
+   *          indicate if percent identity threshold is applied to shading
    */
   public void setAbovePIDThreshold(boolean b)
   {
@@ -736,27 +514,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
   /**
    * DOCUMENT ME!
    * 
-   * @param cs
-   *          DOCUMENT ME!
-   */
-  public void setGlobalColourScheme(ColourSchemeI cs)
-  {
-    globalColourScheme = cs;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
-  public ColourSchemeI getGlobalColourScheme()
-  {
-    return globalColourScheme;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
    * @param res
    *          DOCUMENT ME!
    */
@@ -941,14 +698,14 @@ public class AlignViewport implements SelectionSource, VamsasSource
   {
     if (alignment != null && alignment.getCodonFrames() != null)
     {
-      StructureSelectionManager.getStructureSelectionManager(Desktop.instance)
-              .removeMappings(alignment.getCodonFrames());
+      StructureSelectionManager.getStructureSelectionManager(
+              Desktop.instance).removeMappings(alignment.getCodonFrames());
     }
     this.alignment = align;
-    if (alignment.getCodonFrames() != null)
+    if (alignment!=null && alignment.getCodonFrames() != null)
     {
-      StructureSelectionManager.getStructureSelectionManager(Desktop.instance).addMappings(
-              alignment.getCodonFrames());
+      StructureSelectionManager.getStructureSelectionManager(
+              Desktop.instance).addMappings(alignment.getCodonFrames());
     }
   }
 
@@ -1270,61 +1027,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     scaleRightWrapped = b;
   }
 
-  /**
-   * Property change listener for changes in alignment
-   * 
-   * @param listener
-   *          DOCUMENT ME!
-   */
-  public void addPropertyChangeListener(
-          java.beans.PropertyChangeListener listener)
-  {
-    changeSupport.addPropertyChangeListener(listener);
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param listener
-   *          DOCUMENT ME!
-   */
-  public void removePropertyChangeListener(
-          java.beans.PropertyChangeListener listener)
-  {
-    changeSupport.removePropertyChangeListener(listener);
-  }
-
-  /**
-   * Property change listener for changes in alignment
-   * 
-   * @param prop
-   *          DOCUMENT ME!
-   * @param oldvalue
-   *          DOCUMENT ME!
-   * @param newvalue
-   *          DOCUMENT ME!
-   */
-  public void firePropertyChange(String prop, Object oldvalue,
-          Object newvalue)
-  {
-    changeSupport.firePropertyChange(prop, oldvalue, newvalue);
-  }
-
-  public void setIgnoreGapsConsensus(boolean b, AlignmentPanel ap)
-  {
-    ignoreGapsInConsensusCalculation = b;
-    updateConsensus(ap);
-    if (globalColourScheme != null)
-    {
-      globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
-              ignoreGapsInConsensusCalculation);
-    }
-  }
-
-  public boolean getIgnoreGapsConsensus()
-  {
-    return ignoreGapsInConsensusCalculation;
-  }
 
   public void setDataset(boolean b)
   {
@@ -1336,352 +1038,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return isDataset;
   }
 
-  public void hideSelectedColumns()
-  {
-    if (colSel.size() < 1)
-    {
-      return;
-    }
-
-    colSel.hideSelectedColumns();
-    setSelectionGroup(null);
 
-    hasHiddenColumns = true;
-  }
-
-  public void hideColumns(int start, int end)
-  {
-    if (start == end)
-    {
-      colSel.hideColumns(start);
-    }
-    else
-    {
-      colSel.hideColumns(start, end);
-    }
-
-    hasHiddenColumns = true;
-  }
-
-  public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
-  {
-    int sSize = sg.getSize();
-    if (sSize < 2)
-    {
-      return;
-    }
-
-    if (hiddenRepSequences == null)
-    {
-      hiddenRepSequences = new Hashtable();
-    }
-
-    hiddenRepSequences.put(repSequence, sg);
-
-    // Hide all sequences except the repSequence
-    SequenceI[] seqs = new SequenceI[sSize - 1];
-    int index = 0;
-    for (int i = 0; i < sSize; i++)
-    {
-      if (sg.getSequenceAt(i) != repSequence)
-      {
-        if (index == sSize - 1)
-        {
-          return;
-        }
-
-        seqs[index++] = sg.getSequenceAt(i);
-      }
-    }
-    sg.setSeqrep(repSequence);
-    sg.setHidereps(true);
-    hideSequence(seqs);
-
-  }
-
-  public void hideAllSelectedSeqs()
-  {
-    if (selectionGroup == null || selectionGroup.getSize() < 1)
-    {
-      return;
-    }
-
-    SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
-
-    hideSequence(seqs);
-
-    setSelectionGroup(null);
-  }
-
-  public void hideSequence(SequenceI[] seq)
-  {
-    if (seq != null)
-    {
-      for (int i = 0; i < seq.length; i++)
-      {
-        alignment.getHiddenSequences().hideSequence(seq[i]);
-      }
-      hasHiddenRows = true;
-      firePropertyChange("alignment", null, alignment.getSequences());
-    }
-  }
-
-  public void showSequence(int index)
-  {
-    Vector tmp = alignment.getHiddenSequences().showSequence(index,
-            hiddenRepSequences);
-    if (tmp.size() > 0)
-    {
-      if (selectionGroup == null)
-      {
-        selectionGroup = new SequenceGroup();
-        selectionGroup.setEndRes(alignment.getWidth() - 1);
-      }
-
-      for (int t = 0; t < tmp.size(); t++)
-      {
-        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
-      }
-      firePropertyChange("alignment", null, alignment.getSequences());
-      sendSelection();
-    }
-
-    if (alignment.getHiddenSequences().getSize() < 1)
-    {
-      hasHiddenRows = false;
-    }
-  }
-
-  public void showColumn(int col)
-  {
-    colSel.revealHiddenColumns(col);
-    if (colSel.getHiddenColumns() == null)
-    {
-      hasHiddenColumns = false;
-    }
-  }
-
-  public void showAllHiddenColumns()
-  {
-    colSel.revealAllHiddenColumns();
-    hasHiddenColumns = false;
-  }
-
-  public void showAllHiddenSeqs()
-  {
-    if (alignment.getHiddenSequences().getSize() > 0)
-    {
-      if (selectionGroup == null)
-      {
-        selectionGroup = new SequenceGroup();
-        selectionGroup.setEndRes(alignment.getWidth() - 1);
-      }
-      Vector tmp = alignment.getHiddenSequences().showAll(
-              hiddenRepSequences);
-      for (int t = 0; t < tmp.size(); t++)
-      {
-        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
-      }
-      firePropertyChange("alignment", null, alignment.getSequences());
-      sendSelection();
-      hasHiddenRows = false;
-      hiddenRepSequences = null;
-    }
-  }
-
-  public void invertColumnSelection()
-  {
-    colSel.invertColumnSelection(0, alignment.getWidth());
-  }
-
-  public int adjustForHiddenSeqs(int alignmentIndex)
-  {
-    return alignment.getHiddenSequences().adjustForHiddenSeqs(
-            alignmentIndex);
-  }
-
-  /**
-   * This method returns an array of new SequenceI objects derived from the
-   * whole alignment or just the current selection with start and end points
-   * adjusted
-   * 
-   * @note if you need references to the actual SequenceI objects in the
-   *       alignment or currently selected then use getSequenceSelection()
-   * @return selection as new sequenceI objects
-   */
-  public SequenceI[] getSelectionAsNewSequence()
-  {
-    SequenceI[] sequences;
-
-    if (selectionGroup == null)
-    {
-      sequences = alignment.getSequencesArray();
-      AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation();
-      for (int i = 0; i < sequences.length; i++)
-      {
-        sequences[i] = new Sequence(sequences[i], annots); // construct new
-        // sequence with
-        // subset of visible
-        // annotation
-      }
-    }
-    else
-    {
-      sequences = selectionGroup.getSelectionAsNewSequences(alignment);
-    }
-
-    return sequences;
-  }
-
-  /**
-   * get the currently selected sequence objects or all the sequences in the
-   * alignment.
-   * 
-   * @return array of references to sequence objects
-   */
-  public SequenceI[] getSequenceSelection()
-  {
-    SequenceI[] sequences = null;
-    if (selectionGroup != null)
-    {
-      sequences = selectionGroup.getSequencesInOrder(alignment);
-    }
-    if (sequences == null)
-    {
-      sequences = alignment.getSequencesArray();
-    }
-    return sequences;
-  }
-
-  /**
-   * This method returns the visible alignment as text, as seen on the GUI, ie
-   * if columns are hidden they will not be returned in the result. Use this for
-   * calculating trees, PCA, redundancy etc on views which contain hidden
-   * columns.
-   * 
-   * @return String[]
-   */
-  public jalview.datamodel.CigarArray getViewAsCigars(
-          boolean selectedRegionOnly)
-  {
-    return new jalview.datamodel.CigarArray(alignment, (hasHiddenColumns ? colSel : null), (selectedRegionOnly ? selectionGroup : null));
-  }
-
-  /**
-   * return a compact representation of the current alignment selection to pass
-   * to an analysis function
-   * 
-   * @param selectedOnly
-   *          boolean true to just return the selected view
-   * @return AlignmentView
-   */
-  public jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly)
-  {
-    return getAlignmentView(selectedOnly, false);
-  }
-  
-  /**
-   * return a compact representation of the current alignment selection to pass
-   * to an analysis function
-   * 
-   * @param selectedOnly
-   *          boolean true to just return the selected view
-   * @param markGroups
-   *          boolean true to annotate the alignment view with groups on the alignment (and intersecting with selected region if selectedOnly is true) 
-   * @return AlignmentView
-   */
-  public jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups)
-  {
-    return new AlignmentView(alignment, colSel, selectionGroup, hasHiddenColumns, selectedOnly, markGroups);
-  }
-
-  /**
-   * This method returns the visible alignment as text, as seen on the GUI, ie
-   * if columns are hidden they will not be returned in the result. Use this for
-   * calculating trees, PCA, redundancy etc on views which contain hidden
-   * columns.
-   * 
-   * @return String[]
-   */
-  public String[] getViewAsString(boolean selectedRegionOnly)
-  {
-    String[] selection = null;
-    SequenceI[] seqs = null;
-    int i, iSize;
-    int start = 0, end = 0;
-    if (selectedRegionOnly && selectionGroup != null)
-    {
-      iSize = selectionGroup.getSize();
-      seqs = selectionGroup.getSequencesInOrder(alignment);
-      start = selectionGroup.getStartRes();
-      end = selectionGroup.getEndRes() + 1;
-    }
-    else
-    {
-      iSize = alignment.getHeight();
-      seqs = alignment.getSequencesArray();
-      end = alignment.getWidth();
-    }
-
-    selection = new String[iSize];
-    if (hasHiddenColumns)
-    {
-      selection = colSel.getVisibleSequenceStrings(start, end, seqs);
-    }
-    else
-    {
-      for (i = 0; i < iSize; i++)
-      {
-        selection[i] = seqs[i].getSequenceAsString(start, end);
-      }
-
-    }
-    return selection;
-  }
-
-  public int[][] getVisibleRegionBoundaries(int min, int max)
-  {
-    Vector regions = new Vector();
-    int start = min;
-    int end = max;
-
-    do
-    {
-      if (hasHiddenColumns)
-      {
-        if (start == 0)
-        {
-          start = colSel.adjustForHiddenColumns(start);
-        }
-
-        end = colSel.getHiddenBoundaryRight(start);
-        if (start == end)
-        {
-          end = max;
-        }
-        if (end > max)
-        {
-          end = max;
-        }
-      }
-
-      regions.addElement(new int[]
-      { start, end });
-
-      if (hasHiddenColumns)
-      {
-        start = colSel.adjustForHiddenColumns(end);
-        start = colSel.getHiddenBoundaryLeft(start) + 1;
-      }
-    } while (end < max);
-
-    int[][] startEnd = new int[regions.size()][2];
-
-    regions.copyInto(startEnd);
-
-    return startEnd;
-
-  }
 
   public boolean getShowHiddenMarkers()
   {
@@ -1693,109 +1050,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     showHiddenMarkers = show;
   }
 
-  public String getSequenceSetId()
-  {
-    if (sequenceSetID == null)
-    {
-      sequenceSetID = alignment.hashCode() + "";
-    }
-
-    return sequenceSetID;
-  }
-
-  /**
-   * unique viewId for synchronizing state with stored Jalview Project
-   * 
-   */
-  private String viewId = null;
-
-  public String getViewId()
-  {
-    if (viewId == null)
-    {
-      viewId = this.getSequenceSetId() + "." + this.hashCode() + "";
-    }
-    return viewId;
-  }
-
-  public void alignmentChanged(AlignmentPanel ap)
-  {
-    if (padGaps)
-    {
-      alignment.padGaps();
-    }
-    if (hconsensus != null && autoCalculateConsensus)
-    {
-      updateConservation(ap);
-    }
-    if (autoCalculateConsensus)
-    {
-      updateConsensus(ap);
-    }
-
-    // Reset endRes of groups if beyond alignment width
-    int alWidth = alignment.getWidth();
-    Vector groups = alignment.getGroups();
-    if (groups != null)
-    {
-      for (int i = 0; i < groups.size(); i++)
-      {
-        SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
-        if (sg.getEndRes() > alWidth)
-        {
-          sg.setEndRes(alWidth - 1);
-        }
-      }
-    }
-
-    if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
-    {
-      selectionGroup.setEndRes(alWidth - 1);
-    }
-
-    resetAllColourSchemes();
-
-    // alignment.adjustSequenceAnnotations();
-  }
-
-  void resetAllColourSchemes()
-  {
-    ColourSchemeI cs = globalColourScheme;
-    if (cs != null)
-    {
-      if (cs instanceof ClustalxColourScheme)
-      {
-        ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
-                alignment.getWidth());
-      }
-
-      cs.setConsensus(hconsensus);
-      if (cs.conservationApplied())
-      {
-        Alignment al = (Alignment) alignment;
-        Conservation c = new Conservation("All",
-                ResidueProperties.propHash, 3, al.getSequences(), 0,
-                al.getWidth() - 1);
-        c.calculate();
-        c.verdict(false, ConsPercGaps);
-
-        cs.setConservation(c);
-      }
-    }
-
-    int s, sSize = alignment.getGroups().size();
-    for (s = 0; s < sSize; s++)
-    {
-      SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
-      if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
-      {
-        ((ClustalxColourScheme) sg.cs).resetClustalX(
-                sg.getSequences(hiddenRepSequences), sg.getWidth());
-      }
-      sg.recalcConservation();
-    }
-  }
-
   public Color getSequenceColour(SequenceI seq)
   {
     if (sequenceColours == null || !sequenceColours.containsKey(seq))
@@ -1917,7 +1171,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
       SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
       if (sg.idColour != null)
       {
-        Vector sqs = sg.getSequences(hiddenRepSequences);
+        Vector sqs = sg.getSequences(getHiddenRepSequences());
         for (int s = 0, sSize = sqs.size(); s < sSize; s++)
         {
           sequenceColours.put(sqs.elementAt(s), sg.idColour);
@@ -2008,46 +1262,8 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return followSelection;
   }
 
-  private long sgrouphash = -1, colselhash = -1;
-
   boolean showSeqFeaturesHeight;
 
-  /**
-   * checks current SelectionGroup against record of last hash value, and
-   * updates record.
-   * @param b update the record of last hash value
-   * 
-   * @return true if SelectionGroup changed since last call (when b is true)
-   */
-  boolean isSelectionGroupChanged(boolean b)
-  {
-    int hc = (selectionGroup == null || selectionGroup.getSize()==0) ? -1 : selectionGroup.hashCode();
-    if (hc!=-1 && hc != sgrouphash)
-    {
-      if (b) {sgrouphash = hc;}
-      return true;
-    }
-    return false;
-  }
-
-  /**
-   * checks current colsel against record of last hash value, and optionally updates
-   * record.
-
-   * @param b update the record of last hash value
-   * @return true if colsel changed since last call (when b is true)
-   */
-  boolean isColSelChanged(boolean b)
-  {
-    int hc = (colSel == null || colSel.size()==0) ? -1 : colSel.hashCode();
-    if (hc!=-1 && hc != colselhash)
-    {
-      if (b) {colselhash = hc;}
-      return true;
-    }
-    return false;
-  }
-
   public void sendSelection()
   {
     jalview.structure.StructureSelectionManager
@@ -2066,18 +1282,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
     return showSeqFeaturesHeight;
   }
 
-  boolean showUnconserved = false;
-
-  public boolean getShowUnconserved()
-  {
-    return showUnconserved;
-  }
-
-  public void setShowUnconserved(boolean showunconserved)
-  {
-    showUnconserved = showunconserved;
-  }
-
   /**
    * return the alignPanel containing the given viewport. Use this to get the
    * components currently handling the given viewport.
@@ -2112,106 +1316,6 @@ public class AlignViewport implements SelectionSource, VamsasSource
   }
 
   /**
-   * should conservation rows be shown for groups
-   */
-  boolean showGroupConservation = false;
-
-  /**
-   * should consensus rows be shown for groups
-   */
-  boolean showGroupConsensus = false;
-
-  /**
-   * should consensus profile be rendered by default
-   */
-  public boolean showSequenceLogo = false;
-
-  /**
-   * should consensus histograms be rendered by default
-   */
-  public boolean showConsensusHistogram = true;
-
-  /**
-   * @return the showConsensusProfile
-   */
-  public boolean isShowSequenceLogo()
-  {
-    return showSequenceLogo;
-  }
-
-  /**
-   * @param showSequenceLogo
-   *          the new value
-   */
-  public void setShowSequenceLogo(boolean showSequenceLogo)
-  {
-    if (showSequenceLogo != this.showSequenceLogo)
-    {
-      // TODO: decouple settings setting from calculation when refactoring
-      // annotation update method from alignframe to viewport
-      this.showSequenceLogo = showSequenceLogo;
-      if (consensusThread != null)
-      {
-        consensusThread.updateAnnotation();
-      }
-    }
-    this.showSequenceLogo = showSequenceLogo;
-  }
-
-  /**
-   * @param showConsensusHistogram
-   *          the showConsensusHistogram to set
-   */
-  public void setShowConsensusHistogram(boolean showConsensusHistogram)
-  {
-    this.showConsensusHistogram = showConsensusHistogram;
-  }
-
-  /**
-   * @return the showGroupConservation
-   */
-  public boolean isShowGroupConservation()
-  {
-    return showGroupConservation;
-  }
-
-  /**
-   * @param showGroupConservation
-   *          the showGroupConservation to set
-   */
-  public void setShowGroupConservation(boolean showGroupConservation)
-  {
-    this.showGroupConservation = showGroupConservation;
-  }
-
-  /**
-   * @return the showGroupConsensus
-   */
-  public boolean isShowGroupConsensus()
-  {
-    return showGroupConsensus;
-  }
-
-  /**
-   * @param showGroupConsensus
-   *          the showGroupConsensus to set
-   */
-  public void setShowGroupConsensus(boolean showGroupConsensus)
-  {
-    this.showGroupConsensus = showGroupConsensus;
-  }
-
-  /**
-   * 
-   * @return flag to indicate if the consensus histogram should be rendered by
-   *         default
-   */
-  public boolean isShowConsensusHistogram()
-  {
-    return this.showConsensusHistogram;
-  }
-
-  /**
    * synthesize a column selection if none exists so it covers the given
    * selection group. if wholewidth is false, no column selection is made if the
    * selection group covers the whole alignment width.
@@ -2246,40 +1350,64 @@ public class AlignViewport implements SelectionSource, VamsasSource
 
   public StructureSelectionManager getStructureSelectionManager()
   {
-    return StructureSelectionManager.getStructureSelectionManager(Desktop.instance);
+    return StructureSelectionManager
+            .getStructureSelectionManager(Desktop.instance);
   }
 
   /**
    * 
    * @param pdbEntries
-   * @return a series of SequenceI arrays, one for each PDBEntry, listing which sequence in the alignment holds a reference to it
+   * @return a series of SequenceI arrays, one for each PDBEntry, listing which
+   *         sequence in the alignment holds a reference to it
    */
   public SequenceI[][] collateForPDB(PDBEntry[] pdbEntries)
   {
     ArrayList<SequenceI[]> seqvectors = new ArrayList<SequenceI[]>();
-    for (PDBEntry pdb: pdbEntries) {
-    ArrayList<SequenceI> seqs = new ArrayList<SequenceI>();
-    for (int i = 0; i < alignment.getHeight(); i++)
+    for (PDBEntry pdb : pdbEntries)
     {
-      Vector pdbs = alignment.getSequenceAt(i)
-              .getDatasetSequence().getPDBId();
-      if (pdbs == null)
-        continue;
-      SequenceI sq;
-      for (int p = 0; p < pdbs.size(); p++)
+      ArrayList<SequenceI> seqs = new ArrayList<SequenceI>();
+      for (int i = 0; i < alignment.getHeight(); i++)
       {
-        PDBEntry p1 = (PDBEntry) pdbs.elementAt(p);
-        if (p1.getId().equals(pdb.getId()))
+        Vector pdbs = alignment.getSequenceAt(i).getDatasetSequence()
+                .getPDBId();
+        if (pdbs == null)
+          continue;
+        SequenceI sq;
+        for (int p = 0; p < pdbs.size(); p++)
         {
-          if (!seqs.contains(sq=alignment.getSequenceAt(i)))
-            seqs.add(sq);
+          PDBEntry p1 = (PDBEntry) pdbs.elementAt(p);
+          if (p1.getId().equals(pdb.getId()))
+          {
+            if (!seqs.contains(sq = alignment.getSequenceAt(i)))
+              seqs.add(sq);
 
-          continue;
+            continue;
+          }
         }
       }
-    }
-    seqvectors.add(seqs.toArray(new SequenceI[seqs.size()]));
+      seqvectors.add(seqs.toArray(new SequenceI[seqs.size()]));
     }
     return seqvectors.toArray(new SequenceI[seqvectors.size()][]);
   }
+
+  
+  public boolean isNormaliseSequenceLogo()
+  {
+    return normaliseSequenceLogo;
+  }
+
+  public void setNormaliseSequenceLogo(boolean state)
+  {
+    normaliseSequenceLogo = state;
+  }
+
+
+  /**
+   * 
+   * @return true if alignment characters should be displayed 
+   */
+  public boolean isValidCharWidth()
+  {
+    return validCharWidth;
+  }
 }
index 95ef295..4c8df4b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -32,7 +32,6 @@ import jalview.bin.Cache;
 import jalview.datamodel.*;
 import jalview.jbgui.*;
 import jalview.schemes.*;
-import jalview.structure.SelectionSource;
 import jalview.structure.StructureSelectionManager;
 
 /**
@@ -276,16 +275,16 @@ public class AlignmentPanel extends GAlignmentPanel implements
     // do we need to scroll the panel?
     // TODO: tons of nullpointereexceptions raised here.
     if (results != null && results.getSize() > 0 && av != null
-            && av.alignment != null)
+            && av.getAlignment() != null)
     {
-      int seqIndex = av.alignment.findIndex(results);
+      int seqIndex = av.getAlignment().findIndex(results);
       if (seqIndex == -1)
       {
         return false;
       }
-      SequenceI seq = av.alignment.getSequenceAt(seqIndex);
+      SequenceI seq = av.getAlignment().getSequenceAt(seqIndex);
       
-      int[] r=results.getResults(seq, 0, av.alignment.getWidth());
+      int[] r=results.getResults(seq, 0, av.getAlignment().getWidth());
       if (r == null)
       {
         return false;
@@ -302,13 +301,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
       {
         return false;
       }
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         start = av.getColumnSelection().findColumnPosition(start);
         end = av.getColumnSelection().findColumnPosition(end);
         if (start==end)
         {
-          if (!av.colSel.isVisible(r[0]))
+          if (!av.getColumnSelection().isVisible(r[0]))
           {
             // don't scroll - position isn't visible
             return false;
@@ -547,14 +546,14 @@ public class AlignmentPanel extends GAlignmentPanel implements
   public void setScrollValues(int x, int y)
   {
     // System.err.println("Scroll to "+x+","+y);
-    if (av == null || av.alignment == null)
+    if (av == null || av.getAlignment() == null)
     {
       return;
     }
-    int width = av.alignment.getWidth();
-    int height = av.alignment.getHeight();
+    int width = av.getAlignment().getWidth();
+    int height = av.getAlignment().getHeight();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       width = av.getColumnSelection().findColumnPosition(width);
     }
@@ -723,9 +722,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     if (av.getWrapAlignment())
     {
-      int maxwidth = av.alignment.getWidth();
+      int maxwidth = av.getAlignment().getWidth();
 
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
       }
@@ -849,7 +848,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       endSeq = av.getAlignment().getHeight();
     }
 
-    int pagesHigh = ((av.alignment.getHeight() / totalSeq) + 1) * pheight;
+    int pagesHigh = ((av.getAlignment().getHeight() / totalSeq) + 1) * pheight;
 
     if (av.showAnnotation)
     {
@@ -920,12 +919,12 @@ public class AlignmentPanel extends GAlignmentPanel implements
     pg.translate(idWidth, 0);
     seqPanel.seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0);
 
-    if (av.showAnnotation && (endSeq == av.alignment.getHeight()))
+    if (av.showAnnotation && (endSeq == av.getAlignment().getHeight()))
     {
       pg.translate(-idWidth - 3, (endSeq - startSeq) * av.charHeight + 3);
       alabels.drawComponent((Graphics2D) pg, idWidth);
       pg.translate(idWidth + 3, 0);
-      annotationPanel.drawComponent((Graphics2D) pg, startRes, endRes + 1);
+      annotationPanel.renderer.drawComponent(annotationPanel, av, (Graphics2D) pg, -1, startRes, endRes + 1);
     }
 
     return Printable.PAGE_EXISTS;
@@ -971,8 +970,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     int idWidth = getVisibleIdWidth(false);
 
-    int maxwidth = av.alignment.getWidth();
-    if (av.hasHiddenColumns)
+    int maxwidth = av.getAlignment().getWidth();
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
@@ -998,10 +997,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     do
     {
-      for (int i = 0; i < av.alignment.getHeight(); i++)
+      for (int i = 0; i < av.getAlignment().getHeight(); i++)
       {
         pg.setFont(idPanel.idCanvas.idfont);
-        SequenceI s = av.alignment.getSequenceAt(i);
+        SequenceI s = av.getAlignment().getSequenceAt(i);
         String string = s.getDisplayId(av.getShowJVSuffix());
         int xPos = 0;
         if (av.rightAlignIds)
@@ -1073,13 +1072,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   void makeAlignmentImage(int type, File file)
   {
-    int maxwidth = av.alignment.getWidth();
-    if (av.hasHiddenColumns)
+    int maxwidth = av.getAlignment().getWidth();
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth);
     }
 
-    int height = ((av.alignment.getHeight() + 1) * av.charHeight)
+    int height = ((av.getAlignment().getHeight() + 1) * av.charHeight)
             + scalePanel.getHeight();
     int width = getVisibleIdWidth(false) + (maxwidth * av.charWidth);
 
@@ -1183,7 +1182,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     {
       try
       {
-        int s, sSize = av.alignment.getHeight(), res, alwidth = av.alignment
+        int s, sSize = av.getAlignment().getHeight(), res, alwidth = av.getAlignment()
                 .getWidth(), g, gSize, f, fSize, sy;
         StringBuffer text = new StringBuffer();
         PrintWriter out = new PrintWriter(new FileWriter(imgMapFile));
@@ -1196,15 +1195,15 @@ public class AlignmentPanel extends GAlignmentPanel implements
         {
           sy = s * av.charHeight + scaleHeight;
 
-          SequenceI seq = av.alignment.getSequenceAt(s);
+          SequenceI seq = av.getAlignment().getSequenceAt(s);
           SequenceFeature[] features = seq.getDatasetSequence()
                   .getSequenceFeatures();
-          SequenceGroup[] groups = av.alignment.findAllGroups(seq);
+          SequenceGroup[] groups = av.getAlignment().findAllGroups(seq);
           for (res = 0; res < alwidth; res++)
           {
             text = new StringBuffer();
             Object obj = null;
-            if (av.alignment.isNucleotide())
+            if (av.getAlignment().isNucleotide())
             {
               obj = ResidueProperties.nucleotideName.get(seq.getCharAt(res)
                       + "");
@@ -1340,8 +1339,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
     int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
             + annotationHeight;
 
-    int maxwidth = av.alignment.getWidth();
-    if (av.hasHiddenColumns)
+    int maxwidth = av.getAlignment().getWidth();
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
@@ -1365,7 +1364,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       jalview.structure.StructureSelectionManager ssm = av.getStructureSelectionManager();
       ssm.removeStructureViewerListener(seqPanel, null);
       ssm.removeSelectionListener(seqPanel);
-      av.alignment = null;
+      av.setAlignment(null);
       av = null;
     }
     else
@@ -1394,16 +1393,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
     boolean cons = av.isShowGroupConsensus();
     boolean showprf = av.isShowSequenceLogo();
     boolean showConsHist = av.isShowConsensusHistogram();
+    boolean normLogo = av.isNormaliseSequenceLogo();
 
     boolean sortg = true;
 
     // remove old automatic annotation
     // add any new annotation
 
-    Vector gr = av.alignment.getGroups(); // OrderedBy(av.alignment.getSequencesArray());
+    Vector gr = av.getAlignment().getGroups(); // OrderedBy(av.getAlignment().getSequencesArray());
     // intersect alignment annotation with alignment groups
 
-    AlignmentAnnotation[] aan = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aan = av.getAlignment().getAlignmentAnnotation();
     Hashtable oldrfs = new Hashtable();
     if (aan != null)
     {
@@ -1412,7 +1412,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
         if (aan[an].autoCalculated && aan[an].groupRef != null)
         {
           oldrfs.put(aan[an].groupRef, aan[an].groupRef);
-          av.alignment.deleteAnnotation(aan[an]);
+          av.getAlignment().deleteAnnotation(aan[an]);
           aan[an] = null;
         }
       }
@@ -1429,16 +1429,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
           // set defaults for this group's conservation/consensus
           sg.setshowSequenceLogo(showprf);
           sg.setShowConsensusHistogram(showConsHist);
+          sg.setNormaliseSequenceLogo(normLogo);
         }
         if (conv)
         {
           updateCalcs = true;
-          av.alignment.addAnnotation(sg.getConservationRow(), 0);
+          av.getAlignment().addAnnotation(sg.getConservationRow(), 0);
         }
         if (cons)
         {
           updateCalcs = true;
-          av.alignment.addAnnotation(sg.getConsensus(), 0);
+          av.getAlignment().addAnnotation(sg.getConsensus(), 0);
         }
         // refresh the annotation rows
         if (updateCalcs)
@@ -1454,7 +1455,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   @Override
   public AlignmentI getAlignment()
   {
-    return av.alignment;
+    return av.getAlignment();
   }
 
   /**
@@ -1487,4 +1488,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     return av.getStructureSelectionManager();
   }
+
+  @Override
+  public void raiseOOMWarning(String string, OutOfMemoryError error)
+  {
+    new OOMWarning(string,  error, this);
+  }
 }
index eca0b4c..7fb868f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -51,10 +51,10 @@ public class AnnotationColourChooser extends JPanel
   public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap)
   {
     oldcs = av.getGlobalColourScheme();
-    if (av.alignment.getGroups() != null)
+    if (av.getAlignment().getGroups() != null)
     {
       oldgroupColours = new Hashtable();
-      Vector allGroups = ap.av.alignment.getGroups();
+      Vector allGroups = ap.av.getAlignment().getGroups();
       SequenceGroup sg;
       for (int g = 0; g < allGroups.size(); g++)
       {
@@ -91,7 +91,7 @@ public class AnnotationColourChooser extends JPanel
       }
     });
 
-    if (av.alignment.getAlignmentAnnotation() == null)
+    if (av.getAlignment().getAlignmentAnnotation() == null)
     {
       return;
     }
@@ -113,9 +113,9 @@ public class AnnotationColourChooser extends JPanel
     adjusting = true;
     Vector list = new Vector();
     int index = 1;
-    for (int i = 0; i < av.alignment.getAlignmentAnnotation().length; i++)
+    for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
     {
-      String label = av.alignment.getAlignmentAnnotation()[i].label;
+      String label = av.getAlignment().getAlignmentAnnotation()[i].label;
       if (!list.contains(label))
         list.addElement(label);
       else
@@ -378,7 +378,7 @@ public class AnnotationColourChooser extends JPanel
       return;
     }
 
-    currentAnnotation = av.alignment.getAlignmentAnnotation()[annotations
+    currentAnnotation = av.getAlignment().getAlignmentAnnotation()[annotations
             .getSelectedIndex()];
 
     int aboveThreshold = -1;
@@ -450,9 +450,9 @@ public class AnnotationColourChooser extends JPanel
 
     av.setGlobalColourScheme(acg);
 
-    if (av.alignment.getGroups() != null)
+    if (av.getAlignment().getGroups() != null)
     {
-      Vector allGroups = ap.av.alignment.getGroups();
+      Vector allGroups = ap.av.getAlignment().getGroups();
       SequenceGroup sg;
       for (int g = 0; g < allGroups.size(); g++)
       {
@@ -508,9 +508,9 @@ public class AnnotationColourChooser extends JPanel
   void reset()
   {
     av.setGlobalColourScheme(oldcs);
-    if (av.alignment.getGroups() != null)
+    if (av.getAlignment().getGroups() != null)
     {
-      Vector allGroups = ap.av.alignment.getGroups();
+      Vector allGroups = ap.av.getAlignment().getGroups();
       SequenceGroup sg;
       for (int g = 0; g < allGroups.size(); g++)
       {
index a6ccc7b..ffc5c1c 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -105,13 +105,13 @@ public class AnnotationExporter extends JPanel
       {\r
         if (GFFFormat.isSelected())\r
         {\r
-          text = new FeaturesFile().printGFFFormat(ap.av.alignment\r
+          text = new FeaturesFile().printGFFFormat(ap.av.getAlignment()\r
                   .getDataset().getSequencesArray(),\r
                   getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());// ap.av.featuresDisplayed//);\r
         }\r
         else\r
         {\r
-          text = new FeaturesFile().printJalviewFormat(ap.av.alignment\r
+          text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment()\r
                   .getDataset().getSequencesArray(),\r
                   getDisplayedFeatureCols(), true, ap.av.isShowNpFeats()); // ap.av.featuresDisplayed);\r
         }\r
@@ -152,13 +152,13 @@ public class AnnotationExporter extends JPanel
     {\r
       if (GFFFormat.isSelected())\r
       {\r
-        text = new FeaturesFile().printGFFFormat(ap.av.alignment\r
+        text = new FeaturesFile().printGFFFormat(ap.av.getAlignment()\r
                 .getDataset().getSequencesArray(),\r
                 getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());\r
       }\r
       else\r
       {\r
-        text = new FeaturesFile().printJalviewFormat(ap.av.alignment\r
+        text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment()\r
                 .getDataset().getSequencesArray(),\r
                 getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());\r
       }\r
index ff3b0cd..6d32c04 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -143,7 +143,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
   void getSelectedRow(int y)
   {
     int height = 0;
-    AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
     selectedRow = -2;
     if (aa != null)
     {
@@ -175,20 +175,20 @@ public class AnnotationLabels extends JPanel implements MouseListener,
    */
   public void actionPerformed(ActionEvent evt)
   {
-    AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
 
     if (evt.getActionCommand().equals(ADDNEW))
     {
       AlignmentAnnotation newAnnotation = new AlignmentAnnotation(null,
-              null, new Annotation[ap.av.alignment.getWidth()]);
+              null, new Annotation[ap.av.getAlignment().getWidth()]);
 
       if (!editLabelDescription(newAnnotation))
       {
         return;
       }
 
-      ap.av.alignment.addAnnotation(newAnnotation);
-      ap.av.alignment.setAnnotationIndex(newAnnotation, 0);
+      ap.av.getAlignment().addAnnotation(newAnnotation);
+      ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
     }
     else if (evt.getActionCommand().equals(EDITNAME))
     {
@@ -201,7 +201,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     }
     else if (evt.getActionCommand().equals(DELETE))
     {
-      ap.av.alignment.deleteAnnotation(aa[selectedRow]);
+      ap.av.getAlignment().deleteAnnotation(aa[selectedRow]);
     }
     else if (evt.getActionCommand().equals(SHOWALL))
     {
@@ -305,16 +305,16 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     if (start != end)
     {
       // Swap these annotations
-      AlignmentAnnotation startAA = ap.av.alignment
+      AlignmentAnnotation startAA = ap.av.getAlignment()
               .getAlignmentAnnotation()[start];
       if (end == -1)
       {
-        end = ap.av.alignment.getAlignmentAnnotation().length - 1;
+        end = ap.av.getAlignment().getAlignmentAnnotation().length - 1;
       }
-      AlignmentAnnotation endAA = ap.av.alignment.getAlignmentAnnotation()[end];
+      AlignmentAnnotation endAA = ap.av.getAlignment().getAlignmentAnnotation()[end];
 
-      ap.av.alignment.getAlignmentAnnotation()[end] = startAA;
-      ap.av.alignment.getAlignmentAnnotation()[start] = endAA;
+      ap.av.getAlignment().getAlignmentAnnotation()[end] = startAA;
+      ap.av.getAlignment().getAlignmentAnnotation()[start] = endAA;
     }
 
     resizePanel = false;
@@ -402,9 +402,9 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     getSelectedRow(evt.getY() - scrollOffset);
 
     if (selectedRow > -1
-            && ap.av.alignment.getAlignmentAnnotation().length > selectedRow)
+            && ap.av.getAlignment().getAlignmentAnnotation().length > selectedRow)
     {
-      AlignmentAnnotation aa = ap.av.alignment.getAlignmentAnnotation()[selectedRow];
+      AlignmentAnnotation aa = ap.av.getAlignment().getAlignmentAnnotation()[selectedRow];
       
       StringBuffer desc = new StringBuffer();
       if (aa.description != null
@@ -460,7 +460,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
    */
   public void mouseClicked(MouseEvent evt)
   {
-    AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
     if (SwingUtilities.isLeftMouseButton(evt))
     {
       if (selectedRow > -1 && selectedRow < aa.length)
@@ -630,6 +630,28 @@ public class AnnotationLabels extends JPanel implements MouseListener,
             }
           });
           pop.add(cprofl);
+          final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem(
+                  "Normalise Group Logo",
+                  aa[selectedRow].groupRef.isNormaliseSequenceLogo());
+          cproflnorm.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              
+              // TODO: pass on reference
+              // to ap
+              // so the
+              // view
+              // can be
+              // updated.
+              aaa.groupRef.setNormaliseSequenceLogo(cproflnorm.getState());
+              // automatically enable logo display if we're clicked
+              aaa.groupRef.setshowSequenceLogo(true);
+              ap.repaint();
+              // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+            }
+          });
+          pop.add(cproflnorm);
         }
         else
         {
@@ -646,6 +668,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
               // can be
               // updated.
               av.setShowConsensusHistogram(chist.getState());
+              ap.alignFrame.setMenusForViewport();
               ap.repaint();
               // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
             }
@@ -664,11 +687,32 @@ public class AnnotationLabels extends JPanel implements MouseListener,
               // can be
               // updated.
               av.setShowSequenceLogo(cprof.getState());
+              ap.alignFrame.setMenusForViewport();
               ap.repaint();
               // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
             }
           });
           pop.add(cprof);
+          final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem(
+                  "Normalise Logo", av.isNormaliseSequenceLogo());
+          cprofnorm.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              // TODO: pass on reference
+              // to ap
+              // so the
+              // view
+              // can be
+              // updated.
+              av.setShowSequenceLogo(true);
+              av.setNormaliseSequenceLogo(cprofnorm.getState());
+              ap.alignFrame.setMenusForViewport();
+              ap.repaint();
+              // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+            }
+          });
+          pop.add(cprofnorm);
         }
         final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
         consclipbrd.addActionListener(this);
@@ -700,7 +744,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
       sq.setDatasetSequence(dseqs[0]);
     }
     Alignment ds = new Alignment(dseqs);
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       omitHidden = av.getColumnSelection().getVisibleSequenceStrings(0,
               sq.getLength(), seqs);
@@ -713,7 +757,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
             .setContents(new StringSelection(output), Desktop.instance);
 
     Vector hiddenColumns = null;
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       hiddenColumns = new Vector();
       for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++)
@@ -782,7 +826,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     g.translate(0, scrollOffset);
     g.setColor(Color.black);
 
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     int fontHeight = g.getFont().getSize();
     int y = 0;
     int x = 0;
index 359c500..2faba52 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -19,16 +19,16 @@ package jalview.gui;
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.font.LineMetrics;
-import java.awt.geom.AffineTransform;
 import java.awt.image.*;
 import java.util.Hashtable;
 
 import javax.swing.*;
 
 import jalview.analysis.AAFrequency;
+import jalview.analysis.StructureFrequency;
 import jalview.datamodel.*;
-import jalview.schemes.ColourSchemeI;
+import jalview.renderer.AnnotationRenderer;
+import jalview.renderer.AwtRenderPanelI;
 
 /**
  * DOCUMENT ME!
@@ -36,39 +36,47 @@ import jalview.schemes.ColourSchemeI;
  * @author $author$
  * @version $Revision$
  */
-public class AnnotationPanel extends JPanel implements MouseListener,
-        MouseMotionListener, ActionListener, AdjustmentListener
+public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
+        MouseListener, MouseMotionListener, ActionListener,
+        AdjustmentListener
 {
   final String HELIX = "Helix";
 
   final String SHEET = "Sheet";
 
+  /**
+   * For RNA secondary structure "stems" aka helices
+   */
+  final String STEM = "RNA Helix";
+
   final String LABEL = "Label";
 
   final String REMOVE = "Remove Annotation";
 
   final String COLOUR = "Colour";
 
-  final Color HELIX_COLOUR = Color.red.darker();
+  public final Color HELIX_COLOUR = Color.red.darker();
 
-  final Color SHEET_COLOUR = Color.green.darker().darker();
+  public final Color SHEET_COLOUR = Color.green.darker().darker();
+
+  public final Color STEM_COLOUR = Color.blue.darker();
 
   /** DOCUMENT ME!! */
-  AlignViewport av;
+  public AlignViewport av;
 
   AlignmentPanel ap;
 
-  int activeRow = -1;
+  public int activeRow = -1;
 
-  BufferedImage image;
+  public BufferedImage image;
 
-  BufferedImage fadedImage;
+  public BufferedImage fadedImage;
 
   Graphics2D gg;
 
-  FontMetrics fm;
+  public FontMetrics fm;
 
-  int imgWidth = 0;
+  public int imgWidth = 0;
 
   boolean fastPaint = false;
 
@@ -85,6 +93,13 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 
   boolean MAC = false;
 
+  // for editing cursor
+  int cursorX = 0;
+
+  int cursorY = 0;
+
+  public final AnnotationRenderer renderer;
+
   /**
    * Creates a new AnnotationPanel object.
    * 
@@ -106,11 +121,13 @@ public class AnnotationPanel extends JPanel implements MouseListener,
     addMouseMotionListener(this);
     ap.annotationScroller.getVerticalScrollBar()
             .addAdjustmentListener(this);
+    renderer = new AnnotationRenderer();
   }
 
   public AnnotationPanel(AlignViewport av)
   {
     this.av = av;
+    renderer = new AnnotationRenderer();
   }
 
   /**
@@ -132,7 +149,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
    */
   public int adjustPanelHeight()
   {
-    int height=calcPanelHeight();
+    int height = calcPanelHeight();
     this.setPreferredSize(new Dimension(1, height));
     if (ap != null)
     {
@@ -144,14 +161,15 @@ public class AnnotationPanel extends JPanel implements MouseListener,
   }
 
   /**
-   * calculate the height for visible annotation, revalidating bounds where necessary
-   * ABSTRACT GUI METHOD
+   * calculate the height for visible annotation, revalidating bounds where
+   * necessary ABSTRACT GUI METHOD
+   * 
    * @return total height of annotation
    */
   public int calcPanelHeight()
   {
     // setHeight of panels
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     int height = 0;
 
     if (aa != null)
@@ -209,7 +227,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
    */
   public void actionPerformed(ActionEvent evt)
   {
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     if (aa == null)
     {
       return;
@@ -251,7 +269,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       {
         int index = av.getColumnSelection().columnAt(i);
 
-        if (!av.colSel.isVisible(index))
+        if (!av.getColumnSelection().isVisible(index))
           continue;
 
         if (anot[index] == null)
@@ -276,7 +294,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       {
         int index = av.getColumnSelection().columnAt(i);
 
-        if (!av.colSel.isVisible(index))
+        if (!av.getColumnSelection().isVisible(index))
           continue;
 
         if (anot[index] == null)
@@ -303,6 +321,13 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         symbol = "\u03B2";
       }
 
+      // Added by LML to color stems
+      else if (evt.getActionCommand().equals(STEM))
+      {
+        type = 'S';
+        symbol = "\u03C3";
+      }
+
       if (!aa[activeRow].hasIcons)
       {
         aa[activeRow].hasIcons = true;
@@ -325,7 +350,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       {
         int index = av.getColumnSelection().columnAt(i);
 
-        if (!av.colSel.isVisible(index))
+        if (!av.getColumnSelection().isVisible(index))
           continue;
 
         if (anot[index] == null)
@@ -337,6 +362,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         anot[index].displayCharacter = label;
       }
     }
+    aa[activeRow].validateRangeAndDisplay();
 
     adjustPanelHeight();
     repaint();
@@ -349,22 +375,25 @@ public class AnnotationPanel extends JPanel implements MouseListener,
   {
     String collatedInput = "";
     String last = "";
+    ColumnSelection viscols=av.getColumnSelection();
+    // TODO: refactor and save av.getColumnSelection for efficiency
     for (int i = 0; i < columnSelection.size(); i++)
     {
       int index = columnSelection.columnAt(i);
       // always check for current display state - just in case
-      if (!av.colSel.isVisible(index))
+      if (!viscols.isVisible(index))
         continue;
       String tlabel = null;
       if (anot[index] != null)
-      {
+      { // LML added stem code
         if (label2.equals(HELIX) || label2.equals(SHEET)
-                || label2.equals(LABEL))
+                || label2.equals(STEM) || label2.equals(LABEL))
         {
           tlabel = anot[index].description;
           if (tlabel == null || tlabel.length() < 1)
           {
-            if (label2.equals(HELIX) || label2.equals(SHEET))
+            if (label2.equals(HELIX) || label2.equals(SHEET)
+                    || label2.equals(STEM))
             {
               tlabel = "" + anot[index].secondaryStructure;
             }
@@ -396,7 +425,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
   public void mousePressed(MouseEvent evt)
   {
 
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
     if (aa == null)
     {
       return;
@@ -437,12 +466,25 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       }
 
       JPopupMenu pop = new JPopupMenu("Structure type");
-      JMenuItem item = new JMenuItem(HELIX);
-      item.addActionListener(this);
-      pop.add(item);
-      item = new JMenuItem(SHEET);
-      item.addActionListener(this);
-      pop.add(item);
+      JMenuItem item;
+      /*
+       * Just display the needed structure options
+       */
+      if (av.getAlignment().isNucleotide() == true)
+      {
+        item = new JMenuItem(STEM);
+        item.addActionListener(this);
+        pop.add(item);
+      }
+      else
+      {
+        item = new JMenuItem(HELIX);
+        item.addActionListener(this);
+        pop.add(item);
+        item = new JMenuItem(SHEET);
+        item.addActionListener(this);
+        pop.add(item);
+      }
       item = new JMenuItem(LABEL);
       item.addActionListener(this);
       pop.add(item);
@@ -512,11 +554,11 @@ public class AnnotationPanel extends JPanel implements MouseListener,
   {
     if (graphStretch > -1)
     {
-      av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
+      av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
               - evt.getY();
-      if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
+      if (av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight < 0)
       {
-        av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
+        av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0;
       }
       graphStretchY = evt.getY();
       adjustPanelHeight();
@@ -536,7 +578,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
    */
   public void mouseMoved(MouseEvent evt)
   {
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
 
     if (aa == null)
     {
@@ -570,7 +612,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 
     int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
@@ -635,6 +677,38 @@ public class AnnotationPanel extends JPanel implements MouseListener,
    */
   public void mouseClicked(MouseEvent evt)
   {
+    if (activeRow != -1)
+    {
+      AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
+      AlignmentAnnotation anot = aa[activeRow];
+
+      if (anot.description.equals("secondary structure"))
+      {
+        // System.out.println(anot.description+" "+anot.getRNAStruc());
+      }
+    }
+  }
+
+  // TODO mouseClicked-content and drawCursor are quite experimental!
+  public void drawCursor(Graphics graphics, SequenceI seq, int res, int x1,
+          int y1)
+  {
+    int pady = av.charHeight / 5;
+    int charOffset = 0;
+    graphics.setColor(Color.black);
+    graphics.fillRect(x1, y1, av.charWidth, av.charHeight);
+
+    if (av.validCharWidth)
+    {
+      graphics.setColor(Color.white);
+
+      char s = seq.getCharAt(res);
+
+      charOffset = (av.charWidth - fm.charWidth(s)) / 2;
+      graphics.drawString(String.valueOf(s), charOffset + x1,
+              (y1 + av.charHeight) - pady);
+    }
+
   }
 
   /**
@@ -694,9 +768,9 @@ public class AnnotationPanel extends JPanel implements MouseListener,
   {
 
     if ((horizontal == 0) || gg == null
-            || av.alignment.getAlignmentAnnotation() == null
-            || av.alignment.getAlignmentAnnotation().length < 1
-            || av.updatingConsensus || av.updatingConservation)
+            || av.getAlignment().getAlignmentAnnotation() == null
+            || av.getAlignment().getAlignmentAnnotation().length < 1
+            || av.isCalcInProgress())
     {
       repaint();
       return;
@@ -740,7 +814,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
    */
   public void drawComponent(Graphics g, int startRes, int endRes)
   {
-    if (av.updatingConsensus || av.updatingConservation)
+    if (av.isCalcInProgress())
     {
       if (image == null)
       {
@@ -781,8 +855,8 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       fm = g.getFontMetrics();
     }
 
-    if ((av.alignment.getAlignmentAnnotation() == null)
-            || (av.alignment.getAlignmentAnnotation().length < 1))
+    if ((av.getAlignment().getAlignmentAnnotation() == null)
+            || (av.getAlignment().getAlignmentAnnotation().length < 1))
     {
       g.setColor(Color.white);
       g.fillRect(0, 0, getWidth(), getHeight());
@@ -794,710 +868,24 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 
       return;
     }
-
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
-
-    int x = 0, y = 0;
-    int column = 0;
-    char lastSS;
-    int lastSSX;
-    int iconOffset = 0;
-    boolean validRes = false;
-    boolean validEnd = false;
-    boolean labelAllCols = false;
-    boolean centreColLabels, centreColLabelsDef = av
-            .getCentreColumnLabels();
-    boolean scaleColLabel = false;
-    boolean[] graphGroupDrawn = new boolean[aa.length];
-    int charOffset = 0; // offset for a label
-    float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
-                                   // column.
-    Font ofont = g.getFont();
-    // \u03B2 \u03B1
-    for (int i = 0; i < aa.length; i++)
-    {
-      AlignmentAnnotation row = aa[i];
-
-      if (!row.visible)
-      {
-        continue;
-      }
-      centreColLabels = row.centreColLabels || centreColLabelsDef;
-      labelAllCols = row.showAllColLabels;
-      scaleColLabel = row.scaleColLabel;
-      lastSS = ' ';
-      lastSSX = 0;
-
-      if (row.graph > 0)
-      {
-        if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
-        {
-          continue;
-        }
-
-        // this is so that we draw the characters below the graph
-        y += row.height;
-
-        if (row.hasText)
-        {
-          iconOffset = av.charHeight - fm.getDescent();
-          y -= av.charHeight;
-        }
-      }
-      else if (row.hasText)
-      {
-        iconOffset = av.charHeight - fm.getDescent();
-
-      }
-      else
-      {
-        iconOffset = 0;
-      }
-
-      if (av.updatingConsensus && aa[i] == av.consensus)
-      {
-        y += av.charHeight;
-
-        g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
-                - row.height, imgWidth, y, this);
-        g.setColor(Color.black);
-        // g.drawString("Calculating Consensus....",20, y-row.height/2);
-
-        continue;
-      }
-      else if (av.updatingConservation
-              && aa[i].label.equals("Conservation"))
-      {
-
-        y += av.charHeight;
-        g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
-                - row.height, imgWidth, y, this);
-
-        g.setColor(Color.black);
-        // g.drawString("Calculating Conservation.....",20, y-row.height/2);
-
-        continue;
-      }
-      else if (av.updatingConservation && aa[i].label.equals("Quality"))
-      {
-
-        y += av.charHeight;
-        g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
-                - row.height, imgWidth, y, this);
-        g.setColor(Color.black);
-        // / g.drawString("Calculating Quality....",20, y-row.height/2);
-
-        continue;
-      }
-
-      x = 0;
-      while (x < endRes - startRes)
-      {
-        if (av.hasHiddenColumns)
-        {
-          column = av.getColumnSelection().adjustForHiddenColumns(
-                  startRes + x);
-          if (column > row.annotations.length - 1)
-          {
-            break;
-          }
-        }
-        else
-        {
-          column = startRes + x;
-        }
-
-        if ((row.annotations == null) || (row.annotations.length <= column)
-                || (row.annotations[column] == null))
-        {
-          validRes = false;
-        }
-        else
-        {
-          validRes = true;
-        }
-
-        if (activeRow == i)
-        {
-          g.setColor(Color.red);
-
-          if (av.getColumnSelection() != null)
-          {
-            for (int n = 0; n < av.getColumnSelection().size(); n++)
-            {
-              int v = av.getColumnSelection().columnAt(n);
-
-              if (v == column)
-              {
-                g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
-              }
-            }
-          }
-        }
-
-        if (av.validCharWidth && validRes
-                && row.annotations[column].displayCharacter != null
-                && (row.annotations[column].displayCharacter.length() > 0))
-        {
-
-          if (centreColLabels || scaleColLabel)
-          {
-            fmWidth = (float) fm.charsWidth(
-                    row.annotations[column].displayCharacter.toCharArray(),
-                    0, row.annotations[column].displayCharacter.length());
-
-            if (scaleColLabel)
-            {
-              // justify the label and scale to fit in column
-              if (fmWidth > av.charWidth)
-              {
-                // scale only if the current font isn't already small enough
-                fmScaling = av.charWidth;
-                fmScaling /= fmWidth;
-                g.setFont(ofont.deriveFont(AffineTransform
-                        .getScaleInstance(fmScaling, 1.0)));
-                // and update the label's width to reflect the scaling.
-                fmWidth = av.charWidth;
-              }
-            }
-          }
-          else
-          {
-            fmWidth = (float) fm
-                    .charWidth(row.annotations[column].displayCharacter
-                            .charAt(0));
-          }
-          charOffset = (int) ((av.charWidth - fmWidth) / 2f);
-
-          if (row.annotations[column].colour == null)
-            g.setColor(Color.black);
-          else
-            g.setColor(row.annotations[column].colour);
-
-          if (column == 0 || row.graph > 0)
-          {
-            g.drawString(row.annotations[column].displayCharacter,
-                    (x * av.charWidth) + charOffset, y + iconOffset);
-          }
-          else if (row.annotations[column - 1] == null
-                  || (labelAllCols
-                          || !row.annotations[column].displayCharacter
-                                  .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
-                          .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
-          {
-            g.drawString(row.annotations[column].displayCharacter, x
-                    * av.charWidth + charOffset, y + iconOffset);
-          }
-          g.setFont(ofont);
-        }
-
-        if (row.hasIcons)
-        {
-          if (!validRes
-                  || (row.annotations[column].secondaryStructure != lastSS))
-          {
-            switch (lastSS)
-            {
-            case 'H':
-              g.setColor(HELIX_COLOUR);
-              if (MAC)
-              {
-                // Off by 1 offset when drawing rects and ovals
-                // to offscreen image on the MAC
-                g.fillRoundRect(lastSSX, y + 4 + iconOffset,
-                        (x * av.charWidth) - lastSSX, 7, 8, 8);
-                break;
-              }
-
-              int sCol = (lastSSX / av.charWidth) + startRes;
-              int x1 = lastSSX;
-              int x2 = (x * av.charWidth);
-
-              if (sCol == 0
-                      || row.annotations[sCol - 1] == null
-                      || row.annotations[sCol - 1].secondaryStructure != 'H')
-              {
-                g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
-                        180);
-                x1 += av.charWidth / 2;
-              }
-
-              if (!validRes || row.annotations[column] == null
-                      || row.annotations[column].secondaryStructure != 'H')
-              {
-                g.fillArc((x * av.charWidth) - av.charWidth, y + 4
-                        + iconOffset, av.charWidth, 8, 270, 180);
-                x2 -= av.charWidth / 2;
-              }
-
-              g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
-              break;
-
-            case 'E':
-              g.setColor(SHEET_COLOUR);
-              g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
-                      - lastSSX - 4, 7);
-              g.fillPolygon(new int[]
-              { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
-                  (x * av.charWidth) }, new int[]
-              { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
-                      3);
-
-              break;
-
-            default:
-              g.setColor(Color.gray);
-              g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
-                      - lastSSX, 2);
-
-              break;
-            }
-
-            if (validRes)
-            {
-              lastSS = row.annotations[column].secondaryStructure;
-            }
-            else
-            {
-              lastSS = ' ';
-            }
-
-            lastSSX = (x * av.charWidth);
-          }
-        }
-
-        column++;
-        x++;
-      }
-
-      if (column >= row.annotations.length)
-      {
-        column = row.annotations.length - 1;
-        validEnd = false;
-      }
-      else
-      {
-        validEnd = true;
-      }
-
-      // x ++;
-
-      if (row.hasIcons)
-      {
-        switch (lastSS)
-        {
-        case 'H':
-          g.setColor(HELIX_COLOUR);
-          if (MAC)
-          {
-            // Off by 1 offset when drawing rects and ovals
-            // to offscreen image on the MAC
-            g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
-                    - lastSSX, 7, 8, 8);
-            break;
-          }
-
-          int sCol = (lastSSX / av.charWidth) + startRes;
-          int x1 = lastSSX;
-          int x2 = (x * av.charWidth);
-
-          if (sCol == 0 || row.annotations[sCol - 1] == null
-                  || row.annotations[sCol - 1].secondaryStructure != 'H')
-          {
-            g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
-            x1 += av.charWidth / 2;
-          }
-
-          if (row.annotations[column] == null
-                  || row.annotations[column].secondaryStructure != 'H')
-          {
-            g.fillArc((x * av.charWidth) - av.charWidth,
-                    y + 4 + iconOffset, av.charWidth, 8, 270, 180);
-            x2 -= av.charWidth / 2;
-          }
-
-          g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
-
-          break;
-
-        case 'E':
-          g.setColor(SHEET_COLOUR);
-
-          if (!validEnd || row.annotations[endRes] == null
-                  || row.annotations[endRes].secondaryStructure != 'E')
-          {
-            g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
-                    - lastSSX - 4, 7);
-            g.fillPolygon(new int[]
-            { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
-                (x * av.charWidth) }, new int[]
-            { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
-          }
-          else
-          {
-            g.fillRect(lastSSX, y + 4 + iconOffset, (x + 1) * av.charWidth
-                    - lastSSX, 7);
-          }
-          break;
-
-        default:
-          g.setColor(Color.gray);
-          g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
-                  - lastSSX, 2);
-
-          break;
-        }
-      }
-
-      if (row.graph > 0 && row.graphHeight > 0)
-      {
-        if (row.graph == AlignmentAnnotation.LINE_GRAPH)
-        {
-          if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
-          {
-            float groupmax = -999999, groupmin = 9999999;
-            for (int gg = 0; gg < aa.length; gg++)
-            {
-              if (aa[gg].graphGroup != row.graphGroup)
-              {
-                continue;
-              }
-
-              if (aa[gg] != row)
-              {
-                aa[gg].visible = false;
-              }
-
-              if (aa[gg].graphMax > groupmax)
-              {
-                groupmax = aa[gg].graphMax;
-              }
-              if (aa[gg].graphMin < groupmin)
-              {
-                groupmin = aa[gg].graphMin;
-              }
-            }
-
-            for (int gg = 0; gg < aa.length; gg++)
-            {
-              if (aa[gg].graphGroup == row.graphGroup)
-              {
-                drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
-                        groupmax, row.graphHeight);
-              }
-            }
-
-            graphGroupDrawn[row.graphGroup] = true;
-          }
-          else
-          {
-            drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
-                    row.graphMax, row.graphHeight);
-          }
-        }
-        else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
-        {
-          drawBarGraph(g, row, startRes, endRes, row.graphMin,
-                  row.graphMax, y);
-        }
-      }
-
-      if (row.graph > 0 && row.hasText)
-      {
-        y += av.charHeight;
-      }
-
-      if (row.graph == 0)
-      {
-        y += aa[i].height;
-      }
-    }
-  }
-
-  public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
-          int eRes, int y, float min, float max, int graphHeight)
-  {
-    if (sRes > aa.annotations.length)
-    {
-      return;
-    }
-
-    int x = 0;
-
-    // Adjustment for fastpaint to left
-    if (eRes < av.endRes)
-    {
-      eRes++;
-    }
-
-    eRes = Math.min(eRes, aa.annotations.length);
-
-    if (sRes == 0)
-    {
-      x++;
-    }
-
-    int y1 = y, y2 = y;
-    float range = max - min;
-
-    // //Draw origin
-    if (min < 0)
-    {
-      y2 = y - (int) ((0 - min / range) * graphHeight);
-    }
-
-    g.setColor(Color.gray);
-    g.drawLine(x - av.charWidth, y2, (eRes - sRes + 1) * av.charWidth, y2);
-
-    eRes = Math.min(eRes, aa.annotations.length);
-
-    int column;
-    int aaMax = aa.annotations.length - 1;
-
-    while (x < eRes - sRes)
-    {
-      column = sRes + x;
-      if (av.hasHiddenColumns)
-      {
-        column = av.getColumnSelection().adjustForHiddenColumns(column);
-      }
-
-      if (column > aaMax)
-      {
-        break;
-      }
-
-      if (aa.annotations[column] == null
-              || aa.annotations[column - 1] == null)
-      {
-        x++;
-        continue;
-      }
-
-      if (aa.annotations[column].colour == null)
-        g.setColor(Color.black);
-      else
-        g.setColor(aa.annotations[column].colour);
-
-      y1 = y
-              - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
-      y2 = y
-              - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
-
-      g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
-              + av.charWidth / 2, y2);
-      x++;
-    }
-
-    if (aa.threshold != null)
-    {
-      g.setColor(aa.threshold.colour);
-      Graphics2D g2 = (Graphics2D) g;
-      g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
-              BasicStroke.JOIN_ROUND, 3f, new float[]
-              { 5f, 3f }, 0f));
-
-      y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
-      g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
-      g2.setStroke(new BasicStroke());
-    }
+    renderer.drawComponent(this, av, g, activeRow, startRes, endRes);
   }
 
-  public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
-          int eRes, float min, float max, int y)
+  @Override
+  public FontMetrics getFontMetrics()
   {
-    ColourSchemeI profcolour = av.getGlobalColourScheme();
-    if (profcolour == null)
-    {
-      profcolour = new jalview.schemes.ZappoColourScheme();
-    }
-    if (sRes > aa.annotations.length)
-    {
-      return;
-    }
-    Font ofont = g.getFont();
-    eRes = Math.min(eRes, aa.annotations.length);
-
-    int x = 0, y1 = y, y2 = y;
-
-    float range = max - min;
-
-    if (min < 0)
-    {
-      y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
-    }
-
-    g.setColor(Color.gray);
-
-    g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
-
-    int column;
-    int aaMax = aa.annotations.length - 1;
-    boolean renderHistogram = true, renderProfile = true;
-    if (aa.autoCalculated && aa.label.startsWith("Consensus"))
-    {
-      // TODO: generalise this to have render styles for consensus/profile data
-      if (aa.groupRef != null)
-      {
-        renderHistogram = aa.groupRef.isShowConsensusHistogram();
-        renderProfile = aa.groupRef.isShowSequenceLogo();
-      }
-      else
-      {
-        renderHistogram = av.isShowConsensusHistogram();
-        renderProfile = av.isShowSequenceLogo();
-      }
-    }
-    while (x < eRes - sRes)
-    {
-      column = sRes + x;
-      if (av.hasHiddenColumns)
-      {
-        column = av.getColumnSelection().adjustForHiddenColumns(column);
-      }
-
-      if (column > aaMax)
-      {
-        break;
-      }
-
-      if (aa.annotations[column] == null)
-      {
-        x++;
-        continue;
-      }
-      if (aa.annotations[column].colour == null)
-        g.setColor(Color.black);
-      else
-        g.setColor(aa.annotations[column].colour);
-
-      y1 = y
-              - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
-
-      if (renderHistogram)
-      {
-        if (y1 - y2 > 0)
-        {
-          g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
-        }
-        else
-        {
-          g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
-        }
-      }
-      // draw profile if available
-      if (renderProfile && aa.annotations[column].value != 0)
-      {
-        int profl[] = getProfileFor(aa, column);
-        int ht = y1, htn = y2 - y1;// aa.graphHeight;
-        float wdth;
-        double ht2 = 0;
-        char[] dc = new char[1];
-        LineMetrics lm;
-        for (int c = 1; profl != null && c < profl[0];)
-        {
-          dc[0] = (char) profl[c++];
-          wdth = av.charWidth;
-          wdth /= (float) fm.charsWidth(dc, 0, 1);
-
-          if (c > 2)
-          {
-            ht += (int) ht2;
-          }
-          {
-            // if (aa.annotations[column].value==0) {
-            // g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth,
-            // (ht2=(aa.graphHeight*0.1/av.charHeight)))));
-            // ht = y2-(int)ht2;
-            // } else {
-            g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(
-                    wdth, (ht2 = (htn * ((double) profl[c++]) / 100.0))
-                            / av.charHeight)));
-            lm = g.getFontMetrics().getLineMetrics(dc, 0, 1, g);
-            // htn -=ht2;
-            // }
-            g.setColor(profcolour.findColour(dc[0])); // (av.globalColourScheme!=null)
-                                                      // ? );// try to get a
-                                                      // colourscheme for the
-                                                      // group(aa.groupRef.cs==null)
-                                                      // ? av.textColour2 :
-                                                      // cs.findColour(dc));
-            g.drawChars(dc, 0, 1, x * av.charWidth,
-                    (int) (ht + lm.getHeight()));
-            // ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent();
-          }
-        }
-        g.setFont(ofont);
-      }
-      x++;
-    }
-    if (aa.threshold != null)
-    {
-      g.setColor(aa.threshold.colour);
-      Graphics2D g2 = (Graphics2D) g;
-      g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
-              BasicStroke.JOIN_ROUND, 3f, new float[]
-              { 5f, 3f }, 0f));
-
-      y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
-      g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
-      g2.setStroke(new BasicStroke());
-    }
+    return fm;
   }
 
-  private int[] getProfileFor(AlignmentAnnotation aa, int column)
+  @Override
+  public Image getFadedImage()
   {
-    if (aa.autoCalculated && aa.label.startsWith("Consensus"))
-    {
-      if (aa.groupRef != null && aa.groupRef.consensusData != null
-              && aa.groupRef.isShowSequenceLogo())
-      {
-        return AAFrequency.extractProfile(
-                aa.groupRef.consensusData[column],
-                aa.groupRef.getIgnoreGapsConsensus());
-      }
-      // TODO extend annotation row to enable dynamic and static profile data to
-      // be stored
-      if (aa.groupRef == null && aa.sequenceRef == null
-              && av.isShowSequenceLogo())
-      {
-        return AAFrequency.extractProfile(av.hconsensus[column],
-                av.getIgnoreGapsConsensus());
-      }
-    }
-    return null;
+    return fadedImage;
   }
 
-  // used by overview window
-  public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
-          int y, int sRes, int eRes)
+  @Override
+  public int getFadedImageWidth()
   {
-    eRes = Math.min(eRes, aa.annotations.length);
-    g.setColor(Color.white);
-    g.fillRect(0, 0, width, y);
-    g.setColor(new Color(0, 0, 180));
-
-    int x = 0, height;
-
-    for (int j = sRes; j < eRes; j++)
-    {
-      if (aa.annotations[j] != null)
-      {
-        if (aa.annotations[j].colour == null)
-          g.setColor(Color.black);
-        else
-          g.setColor(aa.annotations[j].colour);
-
-        height = (int) ((aa.annotations[j].value / aa.graphMax) * y);
-        if (height > y)
-        {
-          height = y;
-        }
-
-        g.fillRect(x, y - height, av.charWidth, height);
-      }
-      x += av.charWidth;
-    }
+    return imgWidth;
   }
-
 }
index 93a2994..e942b88 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -1045,7 +1045,12 @@ public class AppJmol extends GStructureViewer implements Runnable,
     buriedColour.setSelected(true);
     jmb.setJalviewColourScheme(new BuriedColourScheme());
   }
-
+  
+  public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
+  {
+    setJalviewColourScheme(new PurinePyrimidineColourScheme());
+  }
+  
   public void userColour_actionPerformed(ActionEvent actionEvent)
   {
     userColour.setSelected(true);
index 3e243fc..63813a9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java
new file mode 100644 (file)
index 0000000..da6c6e5
--- /dev/null
@@ -0,0 +1,413 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.gui;
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.awt.*;
+
+import javax.swing.*;
+import javax.swing.event.*;
+
+import java.awt.event.*;
+import java.io.*;
+
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.SequenceStructureBinding;
+import jalview.bin.Cache;
+import jalview.datamodel.*;
+import jalview.gui.ViewSelectionMenu.ViewSetProvider;
+import jalview.structure.*;
+import jalview.io.*;
+import jalview.schemes.*;
+import jalview.util.ShiftList;
+import fr.orsay.lri.varna.VARNAPanel;
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
+import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
+import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
+import fr.orsay.lri.varna.interfaces.InterfaceVARNASelectionListener;
+import fr.orsay.lri.varna.models.BaseList;
+import fr.orsay.lri.varna.models.VARNAConfig;
+import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation;
+import fr.orsay.lri.varna.models.rna.ModeleBase;
+import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide;
+import fr.orsay.lri.varna.models.rna.RNA;
+
+public class AppVarna extends JInternalFrame implements
+        InterfaceVARNAListener, SelectionListener,
+        SecondaryStructureListener// implements
+                                  // Runnable,SequenceStructureBinding,
+                                  // ViewSetProvider
+        , InterfaceVARNASelectionListener, VamsasSource
+
+{
+  AppVarnaBinding vab;
+
+  VARNAPanel varnaPanel;
+
+  public String name;
+
+  public StructureSelectionManager ssm;
+
+  /*
+   * public AppVarna(){ vab = new AppVarnaBinding(); initVarna(); }
+   */
+
+  AlignmentPanel ap;
+
+  public AppVarna(String sname, SequenceI seq, String strucseq, String struc,
+          String name, AlignmentPanel ap)
+  {
+    this.ap = ap;
+    ArrayList<RNA> rnaList = new ArrayList<RNA>();
+    RNA rna1 = new RNA(name);
+    try
+    {
+      rna1.setRNA(strucseq, replaceOddGaps(struc));
+    } catch (ExceptionUnmatchedClosingParentheses e2)
+    {
+      e2.printStackTrace();
+    } catch (ExceptionFileFormatOrSyntax e3)
+    {
+      e3.printStackTrace();
+    }
+    RNA trim = trimRNA(rna1, "trimmed "+sname);
+    rnaList.add(trim);
+    rnaList.add(rna1);
+    rnas.put(seq, rna1);
+    rnas.put(seq, trim);
+    rna1.setName(sname+" (with gaps)");
+
+    {
+      seqs.put(trim, seq);
+      seqs.put(rna1, seq);
+
+      /**
+       * if (false || seq.getStart()!=1) { for (RNA rshift:rnaList) { ShiftList
+       * shift=offsets.get(rshift); if (shift==null) { offsets.put(rshift,
+       * shift=new ShiftList());} shift.addShift(1, seq.getStart()-1);
+       * offsetsInv.put(rshift, shift.getInverse()); } }
+       **/
+    }
+    vab = new AppVarnaBinding(rnaList);
+    // vab = new AppVarnaBinding(seq,struc);
+    // System.out.println("Hallo: "+name);
+    this.name = sname+" trimmed to "+name;
+    initVarna();
+    ssm = ap.getStructureSelectionManager();
+    ssm.addStructureViewerListener(this);
+    ssm.addSelectionListener(this);
+  }
+
+  public void initVarna()
+  {
+    // vab.setFinishedInit(false);
+    varnaPanel = vab.get_varnaPanel();
+    setBackground(Color.white);
+    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
+            vab.getListPanel(), varnaPanel);
+    getContentPane().setLayout(new BorderLayout());
+    getContentPane().add(split, BorderLayout.CENTER);
+    // getContentPane().add(vab.getTools(), BorderLayout.NORTH);
+    varnaPanel.addVARNAListener(this);
+    varnaPanel.addSelectionListener(this);
+    jalview.gui.Desktop.addInternalFrame(this, "VARNA -" + name,
+            getBounds().width, getBounds().height);
+    this.pack();
+    showPanel(true);
+  }
+
+  public String replaceOddGaps(String oldStr)
+  {
+    String patternStr = "[^([{<>}])]";
+    String replacementStr = ".";
+    Pattern pattern = Pattern.compile(patternStr);
+    Matcher matcher = pattern.matcher(oldStr);
+    String newStr = matcher.replaceAll(replacementStr);
+    return newStr;
+  }
+
+  public RNA trimRNA(RNA rna, String name)
+  {
+    ShiftList offset = new ShiftList();
+    RNA rnaTrim = new RNA(name);
+    try
+    {
+      rnaTrim.setRNA(rna.getSeq(), replaceOddGaps(rna.getStructDBN()));
+    } catch (ExceptionUnmatchedClosingParentheses e2)
+    {
+      e2.printStackTrace();
+    } catch (ExceptionFileFormatOrSyntax e3)
+    {
+      e3.printStackTrace();
+    }
+
+    StringBuffer seq = new StringBuffer(rnaTrim.getSeq());
+    StringBuffer struc = new StringBuffer(rnaTrim.getStructDBN());
+    int ofstart = -1, sleng = rnaTrim.getSeq().length();
+    for (int i = 0; i < sleng; i++)
+    {
+      // TODO: Jalview utility for gap detection java.utils.isGap()
+      // TODO: Switch to jalview rna datamodel
+      if (jalview.util.Comparison.isGap(seq.charAt(i)))
+      {
+        if (ofstart == -1)
+        {
+          ofstart = i;
+        }
+        if (!rnaTrim.findPair(i).isEmpty())
+        {
+          int m = rnaTrim.findPair(i).get(1);
+          int l = rnaTrim.findPair(i).get(0);
+
+          struc.replace(m, m + 1, "*");
+          struc.replace(l, l + 1, "*");
+        }
+        else
+        {
+          struc.replace(i, i + 1, "*");
+        }
+      }
+      else
+      {
+        if (ofstart > -1)
+        {
+          offset.addShift(offset.shift(ofstart), ofstart - i);
+          ofstart = -1;
+        }
+      }
+    }
+    // final gap
+    if (ofstart > -1)
+    {
+      offset.addShift(offset.shift(ofstart), ofstart - sleng);
+      ofstart = -1;
+    }
+    String newSeq = rnaTrim.getSeq().replace("-", "");
+    rnaTrim.getSeq().replace(".", "");
+    String newStruc = struc.toString().replace("*", "");
+
+    try
+    {
+      rnaTrim.setRNA(newSeq, newStruc);
+      registerOffset(rnaTrim, offset);
+    } catch (ExceptionUnmatchedClosingParentheses e)
+    {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    } catch (ExceptionFileFormatOrSyntax e)
+    {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    }
+    return rnaTrim;
+  }
+
+  // needs to be many-many
+  Map<RNA, SequenceI> seqs = new Hashtable<RNA, SequenceI>();
+
+  Map<SequenceI, RNA> rnas = new Hashtable<SequenceI, RNA>();
+
+  Map<RNA, ShiftList> offsets = new Hashtable<RNA, ShiftList>();
+
+  Map<RNA, ShiftList> offsetsInv = new Hashtable<RNA, ShiftList>();
+
+  private void registerOffset(RNA rnaTrim, ShiftList offset)
+  {
+    offsets.put(rnaTrim, offset);
+    offsetsInv.put(rnaTrim, offset.getInverse());
+  }
+
+  public void showPanel(boolean show)
+  {
+    this.setVisible(show);
+  }
+
+  private boolean _started = false;
+
+  public void run()
+  {
+    _started = true;
+
+    try
+    {
+      initVarna();
+    } catch (OutOfMemoryError oomerror)
+    {
+      new OOMWarning("When trying to open the Varna viewer!", oomerror);
+    } catch (Exception ex)
+    {
+      Cache.log.error("Couldn't open Varna viewer!", ex);
+    }
+  }
+
+  @Override
+  public void onUINewStructure(VARNAConfig v, RNA r)
+  {
+
+  }
+
+  @Override
+  public void onWarningEmitted(String s)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  private class VarnaHighlighter
+  {
+    private HighlightRegionAnnotation _lastHighlight;
+
+    private RNA _lastRNAhighlighted = null;
+
+    public void highlightRegion(RNA rna, int start, int end)
+    {
+      clearSelection(null);
+      HighlightRegionAnnotation highlight = new HighlightRegionAnnotation(
+              rna.getBasesBetween(start, end));
+      rna.addHighlightRegion(highlight);
+      _lastHighlight = highlight;
+      _lastRNAhighlighted = rna;
+
+    }
+
+    public HighlightRegionAnnotation getLastHighlight()
+    {
+      return _lastHighlight;
+    }
+
+    public RNA getLastRNA()
+    {
+      return _lastRNAhighlighted;
+    }
+
+    public void clearSelection(AppVarnaBinding vab)
+    {
+      if (_lastRNAhighlighted != null)
+      {
+        _lastRNAhighlighted.removeHighlightRegion(_lastHighlight);
+        if (vab != null)
+        {
+          vab.updateSelectedRNA(_lastRNAhighlighted);
+        }
+        _lastRNAhighlighted = null;
+        _lastHighlight = null;
+
+      }
+    }
+  }
+
+  VarnaHighlighter mouseOverHighlighter = new VarnaHighlighter(),
+          selectionHighlighter = new VarnaHighlighter();
+
+  /**
+   * If a mouseOver event from the AlignmentPanel is noticed the currently
+   * selected RNA in the VARNA window is highlighted at the specific position.
+   * To be able to remove it before the next highlight it is saved in
+   * _lastHighlight
+   */
+  @Override
+  public void mouseOverSequence(SequenceI sequence, int index)
+  {
+    RNA rna = vab.getSelectedRNA();
+    if (seqs.get(rna) == sequence)
+    {
+      ShiftList shift = offsets.get(rna);
+      if (shift != null)
+      {
+   //      System.err.print("Orig pos:"+index);
+         index = shift.shift(index);
+   //      System.err.println("\nFinal pos:"+index);
+      }
+      mouseOverHighlighter.highlightRegion(rna, index, index);
+      vab.updateSelectedRNA(rna);
+    }
+  }
+
+  @Override
+  public void onStructureRedrawn()
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void selection(SequenceGroup seqsel, ColumnSelection colsel,
+          SelectionSource source)
+  {
+    if (source != ap.av)
+    {
+      // ignore events from anything but our parent alignpanel
+      // TODO - reuse many-one panel-view system in jmol viewer
+      return;
+    }
+    if (seqsel != null && seqsel.getSize() > 0)
+    {
+      int start = seqsel.getStartRes(), end = seqsel.getEndRes();
+      RNA rna = vab.getSelectedRNA();
+      ShiftList shift = offsets.get(rna);
+      if (shift != null)
+      {
+        start = shift.shift(start);
+        end = shift.shift(end);
+      }
+      selectionHighlighter.highlightRegion(rna, start, end);
+      selectionHighlighter.getLastHighlight().setOutlineColor(
+              seqsel.getOutlineColour());
+      // TODO - translate column markings to positions on structure if present.
+      vab.updateSelectedRNA(rna);
+    }
+    else
+    {
+      selectionHighlighter.clearSelection(vab);
+    }
+  }
+
+  @Override
+  public void onHoverChanged(ModeleBase arg0, ModeleBase arg1)
+  {
+    RNA rna = vab.getSelectedRNA();
+    ShiftList shift = offsetsInv.get(rna);
+    SequenceI seq = seqs.get(rna);
+    if (arg1 != null && seq != null)
+    {
+      if (shift != null)
+      {
+        int i = shift.shift(arg1.getIndex());
+ //       System.err.println("shifted "+(arg1.getIndex())+" to "+i);
+        ssm.mouseOverVamsasSequence(seq, i, this);
+      }
+      else
+      {
+        ssm.mouseOverVamsasSequence(seq, arg1.getIndex(), this);
+      }
+    }
+  }
+
+  @Override
+  public void onSelectionChanged(BaseList arg0, BaseList arg1, BaseList arg2)
+  {
+    // TODO translate selected regions in VARNA to a selection on the
+    // alignpanel.
+
+  }
+
+}
diff --git a/src/jalview/gui/AppVarnaBinding.java b/src/jalview/gui/AppVarnaBinding.java
new file mode 100644 (file)
index 0000000..fc1f446
--- /dev/null
@@ -0,0 +1,944 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ComponentEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.File;
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+import javax.swing.DefaultListSelectionModel;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTextField;
+import javax.swing.ListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import fr.orsay.lri.varna.VARNAPanel;
+import fr.orsay.lri.varna.components.ReorderableJList;
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
+import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
+import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
+import fr.orsay.lri.varna.models.FullBackup;
+import fr.orsay.lri.varna.models.VARNAConfig;
+import fr.orsay.lri.varna.models.rna.Mapping;
+import fr.orsay.lri.varna.models.rna.RNA;
+
+public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
+        implements DropTargetListener, InterfaceVARNAListener,
+        MouseListener
+{
+
+  /**
+        * 
+        */
+  // private static final long serialVersionUID = -790155708306987257L;
+
+  private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
+
+  private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
+
+  private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
+
+  public VARNAPanel vp;
+
+  protected JPanel _tools = new JPanel();
+
+  private JPanel _input = new JPanel();
+
+  private JPanel _seqPanel = new JPanel();
+
+  private JPanel _strPanel = new JPanel();
+
+  private JLabel _info = new JLabel();
+
+  private JTextField _str = new JTextField();
+
+  private JTextField _seq = new JTextField();
+
+  private JLabel _strLabel = new JLabel(" Str:");
+
+  private JLabel _seqLabel = new JLabel(" Seq:");
+
+  private JButton _createButton = new JButton("Create");
+
+  private JButton _updateButton = new JButton("Update");
+
+  private JButton _deleteButton = new JButton("Delete");
+
+  private JButton _duplicateButton = new JButton("Snapshot");
+
+  protected JPanel _listPanel = new JPanel();
+
+  private ReorderableJList _sideList = null;
+
+  private static String errorOpt = "error";
+
+  @SuppressWarnings("unused")
+  private boolean _error;
+
+  private Color _backgroundColor = Color.white;
+
+  private static int _nextID = 1;
+
+  @SuppressWarnings("unused")
+  private int _algoCode;
+
+  private BackupHolder _rnaList;
+
+  /*
+   * public AppVarnaBinding() { //super("VARNA in Jalview");
+   * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
+   * 
+   * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
+   * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
+   */
+
+  public AppVarnaBinding(String seq, String struc)
+  {
+    // super("VARNA in Jalview");
+    initVarna(seq, struc);
+  }
+
+  public AppVarnaBinding(ArrayList<RNA> rnaList)
+  {
+    // super("VARNA in Jalview");
+    initVarnaEdit(rnaList);
+  }
+
+  private void initVarna(String seq, String str)
+  {
+    DefaultListModel dlm = new DefaultListModel();
+
+    DefaultListSelectionModel m = new DefaultListSelectionModel();
+    m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+    m.setLeadAnchorNotificationEnabled(false);
+
+    _sideList = new ReorderableJList();
+    _sideList.setModel(dlm);
+    _sideList.addMouseListener(this);
+    _sideList.setSelectionModel(m);
+    _sideList.setPreferredSize(new Dimension(100, 0));
+    _sideList.addListSelectionListener(new ListSelectionListener()
+    {
+      public void valueChanged(ListSelectionEvent arg0)
+      {
+        if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
+        {
+          FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+          Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
+                  .getSize(), sel.rna.getSize());
+          vp.showRNAInterpolated(sel.rna, sel.config, map);
+          _seq.setText(sel.rna.getSeq());
+          _str.setText(sel.rna.getStructDBN());
+        }
+      }
+    });
+
+    _rnaList = new BackupHolder(dlm, _sideList);
+    RNA _RNA1 = new RNA("User defined 1");
+
+    try
+    {
+      vp = new VARNAPanel("0", ".");
+      _RNA1.setRNA(seq, str);
+      _RNA1.drawRNARadiate(vp.getConfig());
+    } catch (ExceptionNonEqualLength e)
+    {
+      vp.errorDialog(e);
+    } catch (ExceptionUnmatchedClosingParentheses e2)
+    {
+      e2.printStackTrace();
+    } catch (ExceptionFileFormatOrSyntax e3)
+    {
+      e3.printStackTrace();
+    }
+    vp.setPreferredSize(new Dimension(400, 400));
+    _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
+
+    // TODO setBackground(_backgroundColor);
+    vp.setBackground(_backgroundColor);
+
+    // TODO getContentPane().setLayout(new BorderLayout());
+    // TODO getContentPane().add(vp, BorderLayout.CENTER);
+
+    // setVisible(true);
+    vp.addVARNAListener(this);
+  }
+
+  private void initVarnaEdit(ArrayList<RNA> rnaInList)
+  {
+    DefaultListModel dlm = new DefaultListModel();
+
+    int marginTools = 40;
+
+    DefaultListSelectionModel m = new DefaultListSelectionModel();
+    m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+    m.setLeadAnchorNotificationEnabled(false);
+
+    _sideList = new ReorderableJList();
+    _sideList.setModel(dlm);
+    _sideList.addMouseListener(this);
+    _sideList.setSelectionModel(m);
+    _sideList.setPreferredSize(new Dimension(100, 0));
+    _sideList.addListSelectionListener(new ListSelectionListener()
+    {
+      public void valueChanged(ListSelectionEvent arg0)
+      {
+        // System.out.println(arg0);
+        if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
+        {
+          FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+          Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
+                  .getSize(), sel.rna.getSize());
+          vp.showRNAInterpolated(sel.rna, sel.config, map);
+          // _seq.setText(sel.rna.getSeq());
+          _str.setText(sel.rna.getStructDBN());
+        }
+      }
+    });
+    _rnaList = new BackupHolder(dlm, _sideList);
+
+    try
+    {
+      vp = new VARNAPanel("0", ".");
+      for (int i = 0; i < rnaInList.size(); i++)
+      {
+        rnaInList.get(i).drawRNARadiate(vp.getConfig());
+      }
+    } catch (ExceptionNonEqualLength e)
+    {
+      vp.errorDialog(e);
+    }
+    vp.setPreferredSize(new Dimension(400, 400));
+    for (int i = 0; i < rnaInList.size(); i++)
+    {
+      if (i < rnaInList.size() - 1)
+      {
+        _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
+                .get(i).getName());
+      }
+      else
+      {
+        _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
+                .get(i).getName(), true);
+      }
+    }
+
+    /*
+     * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
+     * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
+     */
+
+    JScrollPane listScroller = new JScrollPane(_sideList);
+    listScroller.setPreferredSize(new Dimension(150, 0));
+
+    vp.setBackground(_backgroundColor);
+
+    Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
+
+    // _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
+    // _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
+    _seq.setFont(textFieldsFont);
+    _seq.setText(rnaInList.get(0).getSeq());
+
+    _updateButton.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+        sel.rna.setSequence("A");
+      }
+    });
+
+    // _seqPanel.setLayout(new BorderLayout());
+    // _seqPanel.add(_seqLabel, BorderLayout.WEST);
+    // _seqPanel.add(_seq, BorderLayout.CENTER);
+
+    _strLabel.setPreferredSize(new Dimension(marginTools, 15));
+    _strLabel.setHorizontalTextPosition(JLabel.LEFT);
+    _str.setFont(textFieldsFont);
+    _strPanel.setLayout(new BorderLayout());
+    _strPanel.add(_strLabel, BorderLayout.WEST);
+    _strPanel.add(_str, BorderLayout.CENTER);
+
+    _input.setLayout(new GridLayout(1, 0));
+    // _input.add(_seqPanel);
+    _input.add(_strPanel);
+
+    JPanel goPanel = new JPanel();
+    goPanel.setLayout(new BorderLayout());
+
+    _tools.setLayout(new BorderLayout());
+    _tools.add(_input, BorderLayout.CENTER);
+    // _tools.add(_info, BorderLayout.SOUTH);
+    _tools.add(goPanel, BorderLayout.EAST);
+
+    /*
+     * _deleteButton.addActionListener(new ActionListener() { public void
+     * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
+     * _duplicateButton.addActionListener(new ActionListener() { public void
+     * actionPerformed(ActionEvent e) {
+     * _rnaList.add((VARNAConfig)vp.getConfig().
+     * clone(),vp.getRNA().clone(),vp.getRNA
+     * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
+     * Date()),true); }});
+     */
+    goPanel.add(_updateButton, BorderLayout.CENTER);
+
+    JPanel ops = new JPanel();
+    ops.setLayout(new GridLayout(1, 2));
+    ops.add(_deleteButton);
+    ops.add(_duplicateButton);
+
+    JLabel j = new JLabel("Structures Manager", JLabel.CENTER);
+    _listPanel.setLayout(new BorderLayout());
+
+    //_listPanel.add(ops, BorderLayout.SOUTH);
+    _listPanel.add(j, BorderLayout.NORTH);
+    _listPanel.add(listScroller, BorderLayout.CENTER);
+
+    // JSplitPane split = new
+    // JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
+    /**
+     * TODO getContentPane().setLayout(new BorderLayout());
+     * getContentPane().add(split, BorderLayout.CENTER);
+     * getContentPane().add(_tools, BorderLayout.NORTH);
+     */
+
+    // TODO setVisible(true);
+    DropTarget dt = new DropTarget(vp, this);
+
+    vp.addVARNAListener(this);
+  }
+
+  public JPanel getTools()
+  {
+    return _tools;
+  }
+
+  public JPanel getListPanel()
+  {
+    return _listPanel;
+  }
+
+  /**
+   * TODO: Is it effective to transfer the whole RNA?
+   * 
+   * @return Currently selected RNA
+   */
+  public RNA getSelectedRNA()
+  {
+    return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
+  }
+
+  /**
+   * Substitute currently selected RNA with the edited one
+   * 
+   * @param rnaEdit
+   */
+  public void updateSelectedRNA(RNA rnaEdit)
+  {
+    vp.repaint();
+    vp.showRNA(rnaEdit);
+  }
+
+  /*
+   * private void RNAPanelDemoInit() { DefaultListModel dlm = new
+   * DefaultListModel();
+   * 
+   * 
+   * int marginTools = 40;
+   * 
+   * DefaultListSelectionModel m = new DefaultListSelectionModel();
+   * m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+   * m.setLeadAnchorNotificationEnabled(false);
+   * 
+   * 
+   * _sideList = new ReorderableJList(); _sideList.setModel(dlm);
+   * _sideList.addMouseListener(this); _sideList.setSelectionModel(m);
+   * _sideList.setPreferredSize(new Dimension(100, 0));
+   * _sideList.addListSelectionListener( new ListSelectionListener(){ public
+   * void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if
+   * (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup
+   * sel = (FullBackup) _sideList.getSelectedValue(); Mapping map =
+   * Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
+   * vp.showRNAInterpolated(sel.rna,sel.config,map);
+   * _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } }
+   * });
+   * 
+   * _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new
+   * RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { vp =
+   * new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE,
+   * DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(vp.getConfig());
+   * _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
+   * _RNA2.drawRNARadiate(vp.getConfig()); } catch (ExceptionNonEqualLength e) {
+   * vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) {
+   * e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) {
+   * e3.printStackTrace(); } vp.setPreferredSize(new Dimension(400, 400));
+   * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
+   * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
+   * 
+   * JScrollPane listScroller = new JScrollPane(_sideList);
+   * listScroller.setPreferredSize(new Dimension(150, 0));
+   * 
+   * setBackground(_backgroundColor); vp.setBackground(_backgroundColor);
+   * 
+   * 
+   * Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
+   * 
+   * _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
+   * _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
+   * _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE);
+   * 
+   * _createButton.addActionListener(new ActionListener() { public void
+   * actionPerformed(ActionEvent e) { try { RNA nRNA = new
+   * RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText());
+   * nRNA.drawRNARadiate(vp.getConfig()); _rnaList.add(new
+   * VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1)
+   * { JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
+   * JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) {
+   * JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
+   * JOptionPane.ERROR_MESSAGE); } } });
+   * 
+   * 
+   * _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel,
+   * BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER);
+   * 
+   * _strLabel.setPreferredSize(new Dimension(marginTools, 15));
+   * _strLabel.setHorizontalTextPosition(JLabel.LEFT);
+   * _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout());
+   * _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str,
+   * BorderLayout.CENTER);
+   * 
+   * _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel);
+   * _input.add(_strPanel);
+   * 
+   * JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout());
+   * 
+   * _tools.setLayout(new BorderLayout()); _tools.add(_input,
+   * BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH);
+   * _tools.add(goPanel, BorderLayout.EAST);
+   * 
+   * _deleteButton.addActionListener(new ActionListener() { public void
+   * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
+   * _duplicateButton.addActionListener(new ActionListener() { public void
+   * actionPerformed(ActionEvent e) {
+   * _rnaList.add((VARNAConfig)vp.getConfig().clone
+   * (),vp.getRNA().clone(),vp.getRNA
+   * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
+   * Date()),true); }});
+   * 
+   * JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2));
+   * ops.add(_deleteButton); ops.add(_duplicateButton);
+   * 
+   * JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
+   * _listPanel.setLayout(new BorderLayout());
+   * 
+   * _listPanel.add(ops,BorderLayout.SOUTH);
+   * _listPanel.add(j,BorderLayout.NORTH);
+   * _listPanel.add(listScroller,BorderLayout.CENTER);
+   * 
+   * goPanel.add(_createButton, BorderLayout.CENTER);
+   * 
+   * JSplitPane split = new
+   * JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
+   * getContentPane().setLayout(new BorderLayout()); getContentPane().add(split,
+   * BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH);
+   * 
+   * setVisible(true); DropTarget dt = new DropTarget(vp, this);
+   * 
+   * vp.addVARNAListener(this); }
+   */
+  public static String generateDefaultName()
+  {
+    return "User file #" + _nextID++;
+  }
+
+  public RNA getRNA()
+  {
+    return (RNA) _sideList.getSelectedValue();
+  }
+
+  public String[][] getParameterInfo()
+  {
+    String[][] info =
+    {
+        // Parameter Name Kind of Value Description,
+        { "sequenceDBN", "String", "A raw RNA sequence" },
+        { "structureDBN", "String",
+            "An RNA structure in dot bracket notation (DBN)" },
+        { errorOpt, "boolean", "To show errors" }, };
+    return info;
+  }
+
+  public void init()
+  {
+    vp.setBackground(_backgroundColor);
+    _error = true;
+  }
+
+  @SuppressWarnings("unused")
+  private Color getSafeColor(String col, Color def)
+  {
+    Color result;
+    try
+    {
+      result = Color.decode(col);
+    } catch (Exception e)
+    {
+      try
+      {
+        result = Color.getColor(col, def);
+      } catch (Exception e2)
+      {
+        return def;
+      }
+    }
+    return result;
+  }
+
+  public VARNAPanel get_varnaPanel()
+  {
+    return vp;
+  }
+
+  public void set_varnaPanel(VARNAPanel surface)
+  {
+    vp = surface;
+  }
+
+  public String get_seq()
+  {
+    return _seq.getText();
+  }
+
+  public void set_seq(String _seq)
+  {
+    this._seq.setText(_seq);
+  }
+
+  public String get_str()
+  {
+    return _str.getText();
+  }
+
+  public void set_str(String _str)
+  {
+    this._str.setText(_str);
+  }
+
+  public JLabel get_info()
+  {
+    return _info;
+  }
+
+  public void set_info(JLabel _info)
+  {
+    this._info = _info;
+  }
+
+  /*
+   * public static void main(String[] args) { AppVarnaBinding d = new
+   * AppVarnaBinding(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+   * d.pack(); d.setVisible(true); }
+   */
+
+  public void dragEnter(DropTargetDragEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void dragExit(DropTargetEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void dragOver(DropTargetDragEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void drop(DropTargetDropEvent dtde)
+  {
+    try
+    {
+      Transferable tr = dtde.getTransferable();
+      DataFlavor[] flavors = tr.getTransferDataFlavors();
+      for (int i = 0; i < flavors.length; i++)
+      {
+        if (flavors[i].isFlavorJavaFileListType())
+        {
+          dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
+          Object ob = tr.getTransferData(flavors[i]);
+          if (ob instanceof List)
+          {
+            List list = (List) ob;
+            for (int j = 0; j < list.size(); j++)
+            {
+              Object o = list.get(j);
+
+              if (dtde.getSource() instanceof DropTarget)
+              {
+                DropTarget dt = (DropTarget) dtde.getSource();
+                Component c = dt.getComponent();
+                if (c instanceof VARNAPanel)
+                {
+                  String path = o.toString();
+                  VARNAPanel vp = (VARNAPanel) c;
+                  try
+                  {
+                    FullBackup bck = VARNAPanel.importSession(path);
+                    _rnaList.add(bck.config, bck.rna, bck.name, true);
+                  } catch (ExceptionLoadingFailed e3)
+                  {
+                    int mn=1;
+                    Collection<RNA> mdls=fr.orsay.lri.varna.factories.RNAFactory.loadSecStr(path);
+                    for (RNA r:mdls)
+                    {
+                    r.drawRNA(vp.getConfig());
+                    String name = r.getName();
+                    if (name.equals(""))
+                    {
+                      name = path.substring(path
+                              .lastIndexOf(File.separatorChar) + 1);
+                    }
+                    if (mdls.size()>1)
+                    {
+                      name += " (Model "+mn+++")";
+                    }
+                    _rnaList.add(vp.getConfig().clone(), r, name, true);
+                    }
+                  }
+                }
+              }
+            }
+          }
+          // If we made it this far, everything worked.
+          dtde.dropComplete(true);
+          return;
+        }
+      }
+      // Hmm, the user must not have dropped a file list
+      dtde.rejectDrop();
+    } catch (Exception e)
+    {
+      e.printStackTrace();
+      dtde.rejectDrop();
+    }
+
+  }
+
+  public void dropActionChanged(DropTargetDragEvent arg0)
+  {
+  }
+
+  private class BackupHolder
+  {
+    private DefaultListModel _rnaList;
+
+    private ArrayList<RNA> _rnas = new ArrayList<RNA>();
+
+    JList _l;
+
+    public BackupHolder(DefaultListModel rnaList, JList l)
+    {
+      _rnaList = rnaList;
+      _l = l;
+    }
+
+    public void add(VARNAConfig c, RNA r)
+    {
+      add(c, r, r.getName(), false);
+    }
+
+    public void add(VARNAConfig c, RNA r, boolean select)
+    {
+      add(c, r, r.getName(), select);
+    }
+
+    public void add(VARNAConfig c, RNA r, String name)
+    {
+      add(c, r, name, false);
+    }
+
+    public void add(VARNAConfig c, RNA r, String name, boolean select)
+    {
+      if (select)
+      {
+        _l.removeSelectionInterval(0, _rnaList.size());
+      }
+      if (name.equals(""))
+      {
+        name = generateDefaultName();
+      }
+      FullBackup bck = new FullBackup(c, r, name);
+      _rnas.add(0, r);
+      _rnaList.add(0, bck);
+      if (select)
+      {
+        _l.setSelectedIndex(0);
+      }
+    }
+
+    public void remove(int i)
+    {
+      _rnas.remove(i);
+      _rnaList.remove(i);
+
+    }
+
+    public DefaultListModel getModel()
+    {
+      return _rnaList;
+    }
+
+    public boolean contains(RNA r)
+    {
+      return _rnas.contains(r);
+    }
+
+    /*
+     * public int getSize() { return _rnaList.getSize(); }
+     */
+    public FullBackup getElementAt(int i)
+    {
+      return (FullBackup) _rnaList.getElementAt(i);
+    }
+
+    public void removeSelected()
+    {
+      int i = _l.getSelectedIndex();
+      if (i != -1)
+      {
+        if (_rnaList.getSize() == 1)
+        {
+          RNA r = new RNA();
+          try
+          {
+            r.setRNA(" ", ".");
+          } catch (ExceptionUnmatchedClosingParentheses e1)
+          {
+          } catch (ExceptionFileFormatOrSyntax e1)
+          {
+          }
+          vp.showRNA(r);
+          vp.repaint();
+        }
+        else
+        {
+          int newi = i + 1;
+          if (newi == _rnaList.getSize())
+          {
+            newi = _rnaList.getSize() - 2;
+          }
+          FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
+          _l.setSelectedValue(bck, true);
+        }
+        _rnaList.remove(i);
+      }
+
+    }
+  }
+
+  public void onLayoutChanged()
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void onUINewStructure(VARNAConfig v, RNA r)
+  {
+    _rnaList.add(v, r, "", true);
+  }
+
+  public void onWarningEmitted(String s)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void mouseClicked(MouseEvent e)
+  {
+    if (e.getClickCount() == 2)
+    {
+      int index = _sideList.locationToIndex(e.getPoint());
+      ListModel dlm = _sideList.getModel();
+      FullBackup item = (FullBackup) dlm.getElementAt(index);
+      ;
+      _sideList.ensureIndexIsVisible(index);
+      /*
+       * TODO Object newName = JOptionPane.showInputDialog( this,
+       * "Specify a new name for this RNA", "Rename RNA",
+       * JOptionPane.QUESTION_MESSAGE, (Icon)null, null, item.toString()); if
+       * (newName!=null) { item.name = newName.toString();
+       * this._sideList.repaint(); }
+       */
+    }
+  }
+
+  public void mouseEntered(MouseEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void mouseExited(MouseEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void mousePressed(MouseEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  public void mouseReleased(MouseEvent arg0)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public Color getColour(int atomIndex, int pdbResNum, String chain,
+          String pdbId)
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public String[] getPdbFile()
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public void highlightAtom(int atomIndex, int pdbResNum, String chain,
+          String pdbId)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void mouseOverStructure(int atomIndex, String strInfo)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void releaseReferences(Object svl)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void updateColours(Object source)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void componentHidden(ComponentEvent e)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void componentMoved(ComponentEvent e)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void componentResized(ComponentEvent e)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void componentShown(ComponentEvent e)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void onStructureRedrawn()
+  {
+    // TODO Auto-generated method stub
+
+  }
+}
+
+/*
+ * public static void main(String[] args) { JTextField str = new
+ * JTextField("ATGC");
+ * 
+ * AppVarnaBinding vab = new AppVarnaBinding(); vab.varnagui.set_seq(str);
+ * vab.varnagui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ * vab.varnagui.pack(); vab.varnagui.setVisible(true); } }
+ */
\ No newline at end of file
index 5c22e55..6f36a79 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 2b728ae..dad0548 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
diff --git a/src/jalview/gui/ConservationThread.java b/src/jalview/gui/ConservationThread.java
deleted file mode 100644 (file)
index 8f4a6a6..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
- * 
- * 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/>.
- */
-package jalview.gui;
-
-import jalview.analysis.Conservation;
-import jalview.datamodel.Annotation;
-
-import java.awt.Color;
-
-class ConservationThread extends Thread
-{
-  /**
-   * 
-   */
-  private AlignViewport alignViewport;
-
-  AlignmentPanel ap;
-
-  public ConservationThread(AlignViewport alignViewport, AlignmentPanel ap)
-  {
-    this.alignViewport = alignViewport;
-    this.ap = ap;
-  }
-
-  public void run()
-  {
-    try
-    {
-      this.alignViewport.updatingConservation = true;
-
-      while (AlignViewport.UPDATING_CONSERVATION)
-      {
-        try
-        {
-          if (ap != null)
-          {
-            ap.paintAlignment(false);
-          }
-          Thread.sleep(200);
-        } catch (Exception ex)
-        {
-          ex.printStackTrace();
-        }
-      }
-
-      AlignViewport.UPDATING_CONSERVATION = true;
-
-      int alWidth;
-      
-      if (alignViewport==null || alignViewport.alignment==null || (alWidth=alignViewport.alignment.getWidth())< 0)
-      {
-        this.alignViewport.updatingConservation = false;
-        AlignViewport.UPDATING_CONSERVATION = false;
-        return;
-      }
-
-      Conservation cons = new jalview.analysis.Conservation("All",
-              jalview.schemes.ResidueProperties.propHash, 3,
-              this.alignViewport.alignment.getSequences(), 0, alWidth - 1);
-
-      cons.calculate();
-      cons.verdict(false, this.alignViewport.ConsPercGaps);
-
-      if (this.alignViewport.quality != null)
-      {
-        cons.findQuality();
-      }
-      cons.completeAnnotations(alignViewport.conservation,
-              alignViewport.quality, 0, alWidth);
-    } catch (OutOfMemoryError error)
-    {
-      new OOMWarning("calculating conservation", error);
-
-      this.alignViewport.conservation = null;
-      this.alignViewport.quality = null;
-
-    }
-
-    AlignViewport.UPDATING_CONSERVATION = false;
-    this.alignViewport.updatingConservation = false;
-
-    if (ap != null)
-    {
-      ap.paintAlignment(true);
-    }
-
-  }
-}
index b4917ca..603d418 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 18dffd6..38a920a 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 40d936e..10f5f95 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index b6cbea3..b8c224d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -1060,30 +1060,63 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    */
   public void aboutMenuItem_actionPerformed(ActionEvent e)
   {
-    StringBuffer message = new StringBuffer("Jalview version "
+    StringBuffer message = getAboutMessage(false);
+    JOptionPane.showInternalMessageDialog(Desktop.desktop,
+
+    message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+  }
+  public StringBuffer getAboutMessage(boolean shortv)
+  {
+    StringBuffer message=new StringBuffer();
+    message.append("<html>");
+    if (shortv)
+    { 
+      message.append("<h1><strong>Jalview "
+              + jalview.bin.Cache.getProperty("VERSION") + "</strong></h1><br>");
+      message.append("<strong>Last Updated: <em>"+jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")+"</em></strong>");
+      
+    } else {
+      
+    message.append("<strong>Jalview version "
             + jalview.bin.Cache.getProperty("VERSION") + "; last updated: "
             + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
-
-    if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals(
-            jalview.bin.Cache.getProperty("VERSION")))
+    }
+    
+    if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
+            "Checking"))
     {
-      message.append("\n\n!! Jalview version "
-              + jalview.bin.Cache.getProperty("LATEST_VERSION")
-              + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!\n");
-
+      message.append("<br>...Checking latest version...</br>");
     }
-    // TODO: update this text for each release or centrally store it for lite
-    // and application
-    message.append("\nAuthors:  Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,\n    David Martin & Geoff Barton."
-            + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
-            + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
-            + "\nIf  you use Jalview, please cite:"
-            + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
-            + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
-            + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
-    JOptionPane.showInternalMessageDialog(Desktop.desktop,
-
-    message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+    else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
+            .equals(jalview.bin.Cache.getProperty("VERSION")))
+    {
+      boolean red=false;
+      if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+              .indexOf("automated build") == -1)
+      {
+        red=true;
+        // Displayed when code version and jnlp version do not match and code
+        // version is not a development build
+        message.append("<div style=\"color: #FF0000;font-style: bold;\">");
+      }
+      
+      message.append("<br>!! Jalview version "
+                      + jalview.bin.Cache.getDefault("LATEST_VERSION",
+                              "..Checking..")
+                      + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!");
+      if (red) {
+        message.append("</div>");
+      }
+    }    
+    message.append("<br>Authors:  "+jalview.bin.Cache.getDefault("AUTHORNAMES","Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton")
+            + "<br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
+            + "<br>For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list"
+            + "<br>If  you use Jalview, please cite:"
+            + "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+            + "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+            + "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033"
+            + "</html>");
+    return message;
   }
 
   /**
@@ -1592,7 +1625,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     source.viewport.gatherViewsHere = true;
     source.viewport.explodedPosition = source.getBounds();
     JInternalFrame[] frames = desktop.getAllFrames();
-    String viewId = source.viewport.sequenceSetID;
+    String viewId = source.viewport.getSequenceSetId();
 
     for (int t = 0; t < frames.length; t++)
     {
index 5b4e77a..277cffb 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a9fedf6..ecc78b0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e5ea8fe..68052d0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0679873..2db75bf 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -685,9 +685,10 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     {
       minmax = new Hashtable();
     }
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    AlignmentI alignment=av.getAlignment();
+    for (int i = 0; i < alignment.getHeight(); i++)
     {
-      SequenceFeature[] features = av.alignment.getSequenceAt(i)
+      SequenceFeature[] features = alignment.getSequenceAt(i)
               .getDatasetSequence().getSequenceFeatures();
 
       if (features == null)
index 6faa8ac..35690a9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -313,15 +313,15 @@ public class FeatureSettings extends JPanel
     Vector allGroups = new Vector();
     SequenceFeature[] tmpfeatures;
     String group;
-    for (int i = 0; i < af.getViewport().alignment.getHeight(); i++)
+    for (int i = 0; i < af.getViewport().getAlignment().getHeight(); i++)
     {
-      if (af.getViewport().alignment.getSequenceAt(i).getDatasetSequence()
+      if (af.getViewport().getAlignment().getSequenceAt(i).getDatasetSequence()
               .getSequenceFeatures() == null)
       {
         continue;
       }
 
-      tmpfeatures = af.getViewport().alignment.getSequenceAt(i)
+      tmpfeatures = af.getViewport().getAlignment().getSequenceAt(i)
               .getDatasetSequence().getSequenceFeatures();
 
       int index = 0;
@@ -442,10 +442,10 @@ public class FeatureSettings extends JPanel
     // Find out which features should be visible depending on which groups
     // are selected / deselected
     // and recompute average width ordering
-    for (int i = 0; i < af.getViewport().alignment.getHeight(); i++)
+    for (int i = 0; i < af.getViewport().getAlignment().getHeight(); i++)
     {
 
-      tmpfeatures = af.getViewport().alignment.getSequenceAt(i)
+      tmpfeatures = af.getViewport().getAlignment().getSequenceAt(i)
               .getDatasetSequence().getSequenceFeatures();
       if (tmpfeatures == null)
       {
index 05fad6f..3bcb2c0 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -195,7 +195,7 @@ public class Finder extends GFinder
     // TODO: add switches to control what is searched - sequences, IDS,
     // descriptions, features
     jalview.analysis.Finder finder = new jalview.analysis.Finder(
-            av.alignment, av.getSelectionGroup(), seqIndex, resIndex);
+            av.getAlignment(), av.getSelectionGroup(), seqIndex, resIndex);
     finder.setCaseSensitive(caseSensitive.isSelected());
     finder.setFindAll(findAll);
 
index d996aaf..310361a 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 943c83d..3477153 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 3e8fa2f..08445a9 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 5cd7c51..2a2acfb 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -123,7 +123,7 @@ public class IdCanvas extends JPanel
     gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
             (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
 
-    if (av.hasHiddenRows && av.showHiddenMarkers)
+    if (av.hasHiddenRows() && av.showHiddenMarkers)
     {
       drawMarker(i, starty, ypos);
     }
@@ -264,10 +264,10 @@ public class IdCanvas extends JPanel
 
     if (av.getWrapAlignment())
     {
-      int maxwidth = av.alignment.getWidth();
-      int alheight = av.alignment.getHeight();
+      int maxwidth = av.getAlignment().getWidth();
+      int alheight = av.getAlignment().getHeight();
 
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
       }
@@ -304,8 +304,8 @@ public class IdCanvas extends JPanel
       {
         for (int i = starty; i < alheight; i++)
         {
-          SequenceI s = av.alignment.getSequenceAt(i);
-          if (av.hasHiddenRows)
+          SequenceI s = av.getAlignment().getSequenceAt(i);
+          if (av.hasHiddenRows())
           {
             setHiddenFont(s);
           }
@@ -338,14 +338,14 @@ public class IdCanvas extends JPanel
       // Now draw the id strings
       for (int i = starty; i < endy; i++)
       {
-        sequence = av.alignment.getSequenceAt(i);
+        sequence = av.getAlignment().getSequenceAt(i);
 
         if (sequence == null)
         {
           continue;
         }
 
-        if (av.hasHiddenRows)
+        if (av.hasHiddenRows())
         {
           setHiddenFont(sequence);
         }
@@ -387,7 +387,7 @@ public class IdCanvas extends JPanel
                 (((i - starty) * av.charHeight) + av.charHeight)
                         - (av.charHeight / 5));
 
-        if (av.hasHiddenRows && av.showHiddenMarkers)
+        if (av.hasHiddenRows() && av.showHiddenMarkers)
         {
           drawMarker(i, starty, 0);
         }
@@ -400,7 +400,7 @@ public class IdCanvas extends JPanel
   void drawMarker(int i, int starty, int yoffset)
   {
 
-    SequenceI[] hseqs = av.alignment.getHiddenSequences().hiddenSequences;
+    SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences;
     // Use this method here instead of calling hiddenSeq adjust
     // 3 times.
     int hSize = hseqs.length;
@@ -463,8 +463,7 @@ public class IdCanvas extends JPanel
     Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
             .getSize());
 
-    if (av.hiddenRepSequences != null
-            && av.hiddenRepSequences.containsKey(seq))
+    if (av.isHiddenRepSequence(seq))
     {
       gg.setFont(bold);
     }
index 1732291..9d1cae4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -85,9 +85,9 @@ public class IdPanel extends JPanel implements MouseListener,
     SeqPanel sp = alignPanel.seqPanel;
     int seq = Math.max(0, sp.findSeq(e));
     String tmp;
-    if (seq > -1 && seq < av.alignment.getHeight())
+    if (seq > -1 && seq < av.getAlignment().getHeight())
     {
-      SequenceI sequence = av.alignment.getSequenceAt(seq);
+      SequenceI sequence = av.getAlignment().getSequenceAt(seq);
       StringBuffer tip = new StringBuffer();
       tip.append("<i>");
 
@@ -287,7 +287,7 @@ public class IdPanel extends JPanel implements MouseListener,
     }
 
     if (mouseDragging && (e.getY() >= getHeight())
-            && (av.alignment.getHeight() > av.getEndSeq()))
+            && (av.getAlignment().getHeight() > av.getEndSeq()))
     {
       scrollThread = new ScrollThread(false);
     }
@@ -342,7 +342,7 @@ public class IdPanel extends JPanel implements MouseListener,
     {
       av.setSelectionGroup(new SequenceGroup());
       av.getSelectionGroup().setStartRes(0);
-      av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+      av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
     }
 
     if (e.isShiftDown() && (lastid != -1))
@@ -441,7 +441,7 @@ public class IdPanel extends JPanel implements MouseListener,
       return;
     }
 
-    int index = av.alignment.findIndex((SequenceI) found.get(0));
+    int index = av.getAlignment().findIndex((SequenceI) found.get(0));
 
     // do we need to scroll the panel?
     if ((av.getStartSeq() > index) || (av.getEndSeq() < index))
index f7ff75a..15faa74 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b1b1f55..6d55c32 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -427,9 +427,9 @@ public class Jalview2XML
     object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
     object.setVersion(jalview.bin.Cache.getProperty("VERSION"));
 
-    jalview.datamodel.AlignmentI jal = av.alignment;
+    jalview.datamodel.AlignmentI jal = av.getAlignment();
 
-    if (av.hasHiddenRows)
+    if (av.hasHiddenRows())
     {
       jal = jal.getHiddenSequences().getFullAlignment();
     }
@@ -498,15 +498,13 @@ public class Jalview2XML
 
       jseq.setId(id); // jseq id should be a string not a number
 
-      if (av.hasHiddenRows)
+      if (av.hasHiddenRows())
       {
-        jseq.setHidden(av.alignment.getHiddenSequences().isHidden(jds));
+        jseq.setHidden(av.getAlignment().getHiddenSequences().isHidden(jds));
 
-        if (av.hiddenRepSequences != null
-                && av.hiddenRepSequences.containsKey(jal.getSequenceAt(i)))
+        if (av.isHiddenRepSequence(jal.getSequenceAt(i)))
         {
-          jalview.datamodel.SequenceI[] reps = ((jalview.datamodel.SequenceGroup) av.hiddenRepSequences
-                  .get(jal.getSequenceAt(i))).getSequencesInOrder(jal);
+          jalview.datamodel.SequenceI[] reps = av.getRepresentedSequences(jal.getSequenceAt(i)).getSequencesInOrder(jal);
 
           for (int h = 0; h < reps.length; h++)
           {
@@ -708,9 +706,9 @@ public class Jalview2XML
       jms.addJSeq(jseq);
     }
 
-    if (av.hasHiddenRows)
+    if (av.hasHiddenRows())
     {
-      jal = av.alignment;
+      jal = av.getAlignment();
     }
     // SAVE MAPPINGS
     if (jal.getCodonFrames() != null && jal.getCodonFrames().length > 0)
@@ -766,7 +764,7 @@ public class Jalview2XML
           {
             TreePanel tp = (TreePanel) frames[t];
 
-            if (tp.treeCanvas.av.alignment == jal)
+            if (tp.treeCanvas.av.getAlignment() == jal)
             {
               Tree tree = new Tree();
               tree.setTitle(tp.getTitle());
@@ -866,8 +864,8 @@ public class Jalview2XML
 
         an.setLabel(aa[i].label);
 
-        if (aa[i] == av.quality || aa[i] == av.conservation
-                || aa[i] == av.consensus || aa[i].autoCalculated)
+        if (aa[i] == av.getAlignmentQualityAnnot() || aa[i] == av.getAlignmentConservationAnnotation()
+                || aa[i] == av.getAlignmentConsensusAnnotation() || aa[i].autoCalculated)
         {
           // new way of indicating autocalculated annotation -
           an.setAutoCalculated(aa[i].autoCalculated);
@@ -1206,7 +1204,7 @@ public class Jalview2XML
 
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       if (av.getColumnSelection() == null
               || av.getColumnSelection().getHiddenColumns() == null)
@@ -2912,7 +2910,7 @@ public class Jalview2XML
 
     for (int i = 0; i < JSEQ.length; i++)
     {
-      af.viewport.setSequenceColour(af.viewport.alignment.getSequenceAt(i),
+      af.viewport.setSequenceColour(af.viewport.getAlignment().getSequenceAt(i),
               new java.awt.Color(JSEQ[i].getColour()));
     }
 
@@ -2923,7 +2921,7 @@ public class Jalview2XML
       jalview.gui.AlignViewport av = (jalview.gui.AlignViewport) viewportsAdded
               .get(uniqueSeqSetId);
 
-      af.viewport.sequenceSetID = uniqueSeqSetId;
+      af.viewport.setSequenceSetId(uniqueSeqSetId);
       if (av != null)
       {
         // propagate shared settings to this new view
@@ -3013,18 +3011,18 @@ public class Jalview2XML
       else if (view.getBgColour().startsWith("Annotation"))
       {
         // int find annotation
-        if (af.viewport.alignment.getAlignmentAnnotation() != null)
+        if (af.viewport.getAlignment().getAlignmentAnnotation() != null)
         {
-          for (int i = 0; i < af.viewport.alignment
+          for (int i = 0; i < af.viewport.getAlignment()
                   .getAlignmentAnnotation().length; i++)
           {
-            if (af.viewport.alignment.getAlignmentAnnotation()[i].label
+            if (af.viewport.getAlignment().getAlignmentAnnotation()[i].label
                     .equals(view.getAnnotationColours().getAnnotation()))
             {
-              if (af.viewport.alignment.getAlignmentAnnotation()[i]
+              if (af.viewport.getAlignment().getAlignmentAnnotation()[i]
                       .getThreshold() == null)
               {
-                af.viewport.alignment.getAlignmentAnnotation()[i]
+                af.viewport.getAlignment().getAlignmentAnnotation()[i]
                         .setThreshold(new jalview.datamodel.GraphLine(view
                                 .getAnnotationColours().getThreshold(),
                                 "Threshold", java.awt.Color.black)
@@ -3036,7 +3034,7 @@ public class Jalview2XML
                       .equals("None"))
               {
                 cs = new AnnotationColourGradient(
-                        af.viewport.alignment.getAlignmentAnnotation()[i],
+                        af.viewport.getAlignment().getAlignmentAnnotation()[i],
                         new java.awt.Color(view.getAnnotationColours()
                                 .getMinColour()), new java.awt.Color(view
                                 .getAnnotationColours().getMaxColour()),
@@ -3046,7 +3044,7 @@ public class Jalview2XML
                       .startsWith("ucs"))
               {
                 cs = new AnnotationColourGradient(
-                        af.viewport.alignment.getAlignmentAnnotation()[i],
+                        af.viewport.getAlignment().getAlignmentAnnotation()[i],
                         GetUserColourScheme(jms, view
                                 .getAnnotationColours().getColourScheme()),
                         view.getAnnotationColours().getAboveThreshold());
@@ -3054,7 +3052,7 @@ public class Jalview2XML
               else
               {
                 cs = new AnnotationColourGradient(
-                        af.viewport.alignment.getAlignmentAnnotation()[i],
+                        af.viewport.getAlignment().getAlignmentAnnotation()[i],
                         ColourSchemeProperty.getColour(al, view
                                 .getAnnotationColours().getColourScheme()),
                         view.getAnnotationColours().getAboveThreshold());
@@ -3077,7 +3075,7 @@ public class Jalview2XML
                    * if
                    * (view.getAnnotationColours().getColourScheme().equals("None"
                    * )) { sg.cs = new AnnotationColourGradient(
-                   * af.viewport.alignment.getAlignmentAnnotation()[i], new
+                   * af.viewport.getAlignment().getAlignmentAnnotation()[i], new
                    * java.awt.Color(view.getAnnotationColours().
                    * getMinColour()), new
                    * java.awt.Color(view.getAnnotationColours().
@@ -3086,7 +3084,7 @@ public class Jalview2XML
                    */
                   {
                     sg.cs = new AnnotationColourGradient(
-                            af.viewport.alignment.getAlignmentAnnotation()[i],
+                            af.viewport.getAlignment().getAlignmentAnnotation()[i],
                             sg.cs, view.getAnnotationColours()
                                     .getAboveThreshold());
                   }
@@ -3108,7 +3106,7 @@ public class Jalview2XML
       if (cs != null)
       {
         cs.setThreshold(view.getPidThreshold(), true);
-        cs.setConsensus(af.viewport.hconsensus);
+        cs.setConsensus(af.viewport.getSequenceConsensusHash());
       }
     }
 
@@ -3134,8 +3132,8 @@ public class Jalview2XML
     }
     if (view.hasIgnoreGapsinConsensus())
     {
-      af.viewport.ignoreGapsInConsensusCalculation = view
-              .getIgnoreGapsinConsensus();
+      af.viewport.setIgnoreGapsConsensus(view
+              .getIgnoreGapsinConsensus(), null);
     }
     if (view.hasFollowHighlight())
     {
@@ -3156,11 +3154,11 @@ public class Jalview2XML
     }
     if (view.hasShowSequenceLogo())
     {
-      af.viewport.showSequenceLogo = view.getShowSequenceLogo();
+      af.viewport.setShowSequenceLogo(view.getShowSequenceLogo());
     }
     else
     {
-      af.viewport.showSequenceLogo = false;
+      af.viewport.setShowSequenceLogo(false);
     }
     if (view.hasShowDbRefTooltip())
     {
@@ -3724,11 +3722,11 @@ public class Jalview2XML
     af.closeMenuItem_actionPerformed(true);
 
     /*
-     * if(ap.av.alignment.getAlignmentAnnotation()!=null) { for(int i=0;
-     * i<ap.av.alignment.getAlignmentAnnotation().length; i++) {
-     * if(!ap.av.alignment.getAlignmentAnnotation()[i].autoCalculated) {
-     * af.alignPanel.av.alignment.getAlignmentAnnotation()[i] =
-     * ap.av.alignment.getAlignmentAnnotation()[i]; } } }
+     * 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;
index c8ac01c..e264b68 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -271,7 +271,7 @@ public class Jalview2XML_V1
 \r
     for (int i = 0; i < JSEQ.length; i++)\r
     {\r
-      af.viewport.setSequenceColour(af.viewport.alignment.getSequenceAt(i),\r
+      af.viewport.setSequenceColour(af.viewport.getAlignment().getSequenceAt(i),\r
               new java.awt.Color(JSEQ[i].getColour()));\r
     }\r
 \r
@@ -371,7 +371,7 @@ public class Jalview2XML_V1
       if (cs != null)\r
       {\r
         cs.setThreshold(view.getPidThreshold(), true);\r
-        cs.setConsensus(af.viewport.hconsensus);\r
+        cs.setConsensus(af.viewport.getSequenceConsensusHash());\r
       }\r
     }\r
 \r
index 6842fa3..8077e07 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 97e3315..64ecaf3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index eee5ffe..833af15 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 9573e1f..5d7cdd6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b14ac14..2195fb2 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 106c3b7..cca9cee 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 64e3d29..6d653b3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f8299bf..c844315 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.renderer.AnnotationRenderer;
+
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.*;
@@ -36,6 +38,7 @@ public class OverviewPanel extends JPanel implements Runnable
 
   AlignmentPanel ap;
 
+  final AnnotationRenderer renderer = new AnnotationRenderer();
   float scalew = 1f;
 
   float scaleh = 1f;
@@ -80,15 +83,15 @@ public class OverviewPanel extends JPanel implements Runnable
     fr = new FeatureRenderer(ap);
 
     // scale the initial size of overviewpanel to shape of alignment
-    float initialScale = (float) av.alignment.getWidth()
-            / (float) av.alignment.getHeight();
+    float initialScale = (float) av.getAlignment().getWidth()
+            / (float) av.getAlignment().getHeight();
 
-    if (av.conservation == null)
+    if (av.getAlignmentConservationAnnotation()== null)
     {
       graphHeight = 0;
     }
 
-    if (av.alignment.getWidth() > av.alignment.getHeight())
+    if (av.getAlignment().getWidth() > av.getAlignment().getHeight())
     {
       // wider
       width = 400;
@@ -175,7 +178,7 @@ public class OverviewPanel extends JPanel implements Runnable
 
     if (boxX > (width - boxWidth))
     {
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         // Try smallest possible box
         boxWidth = (int) ((av.endRes - av.startRes + 1) * av.getCharWidth() * scalew);
@@ -186,7 +189,7 @@ public class OverviewPanel extends JPanel implements Runnable
     int col = (int) (boxX / scalew / av.getCharWidth());
     int row = (int) (boxY / scaleh / av.getCharHeight());
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       if (!av.getColumnSelection().isVisible(col))
       {
@@ -196,9 +199,9 @@ public class OverviewPanel extends JPanel implements Runnable
       col = av.getColumnSelection().findColumnPosition(col);
     }
 
-    if (av.hasHiddenRows)
+    if (av.hasHiddenRows())
     {
-      row = av.alignment.getHiddenSequences().findIndexWithoutHiddenSeqs(
+      row = av.getAlignment().getHiddenSequences().findIndexWithoutHiddenSeqs(
               row);
     }
 
@@ -248,9 +251,9 @@ public class OverviewPanel extends JPanel implements Runnable
       fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer());
     }
 
-    int alwidth = av.alignment.getWidth();
-    int alheight = av.alignment.getHeight()
-            + av.alignment.getHiddenSequences().getSize();
+    int alwidth = av.getAlignment().getWidth();
+    int alheight = av.getAlignment().getHeight()
+            + av.getAlignment().getHiddenSequences().getSize();
 
     setPreferredSize(new Dimension(width, sequencesHeight + graphHeight));
 
@@ -291,15 +294,15 @@ public class OverviewPanel extends JPanel implements Runnable
       lastrow = (int) (row * sampleRow);
 
       hiddenRow = false;
-      if (av.hasHiddenRows)
+      if (av.hasHiddenRows())
       {
-        seq = av.alignment.getHiddenSequences().getHiddenSequence(lastrow);
+        seq = av.getAlignment().getHiddenSequences().getHiddenSequence(lastrow);
         if (seq == null)
         {
-          int index = av.alignment.getHiddenSequences()
+          int index = av.getAlignment().getHiddenSequences()
                   .findIndexWithoutHiddenSeqs(lastrow);
 
-          seq = av.alignment.getSequenceAt(index);
+          seq = av.getAlignment().getSequenceAt(index);
         }
         else
         {
@@ -308,7 +311,7 @@ public class OverviewPanel extends JPanel implements Runnable
       }
       else
       {
-        seq = av.alignment.getSequenceAt(lastrow);
+        seq = av.getAlignment().getSequenceAt(lastrow);
       }
 
       if (seq == null)
@@ -343,7 +346,7 @@ public class OverviewPanel extends JPanel implements Runnable
         }
 
         if (hiddenRow
-                || (av.hasHiddenColumns && !av.getColumnSelection()
+                || (av.hasHiddenColumns() && !av.getColumnSelection()
                         .isVisible(lastcol)))
         {
           color = new Color(color).darker().darker().getRGB();
@@ -354,14 +357,15 @@ public class OverviewPanel extends JPanel implements Runnable
       }
     }
 
-    if (av.conservation != null)
+    if (av.getAlignmentConservationAnnotation()!= null)
     {
+      renderer.updateFromAlignViewport(av); 
       for (col = 0; col < width; col++)
       {
         lastcol = (int) (col * sampleCol);
         {
           mg.translate(col, sequencesHeight);
-          ap.annotationPanel.drawGraph(mg, av.conservation,
+          renderer.drawGraph(mg, av.getAlignmentConservationAnnotation(),
                   (int) (sampleCol) + 1, graphHeight,
                   (int) (col * sampleCol), (int) (col * sampleCol) + 1);
           mg.translate(-col, -sequencesHeight);
@@ -386,14 +390,14 @@ public class OverviewPanel extends JPanel implements Runnable
    */
   public void setBoxPosition()
   {
-    int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
-    int fullsizeHeight = (av.alignment.getHeight() + av.alignment
+    int fullsizeWidth = av.getAlignment().getWidth() * av.getCharWidth();
+    int fullsizeHeight = (av.getAlignment().getHeight() + av.getAlignment()
             .getHiddenSequences().getSize()) * av.getCharHeight();
 
     int startRes = av.getStartRes();
     int endRes = av.getEndRes();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       startRes = av.getColumnSelection().adjustForHiddenColumns(startRes);
       endRes = av.getColumnSelection().adjustForHiddenColumns(endRes);
@@ -402,12 +406,12 @@ public class OverviewPanel extends JPanel implements Runnable
     int startSeq = av.startSeq;
     int endSeq = av.endSeq;
 
-    if (av.hasHiddenRows)
+    if (av.hasHiddenRows())
     {
-      startSeq = av.alignment.getHiddenSequences().adjustForHiddenSeqs(
+      startSeq = av.getAlignment().getHiddenSequences().adjustForHiddenSeqs(
               startSeq);
 
-      endSeq = av.alignment.getHiddenSequences()
+      endSeq = av.getAlignment().getHiddenSequences()
               .adjustForHiddenSeqs(endSeq);
 
     }
@@ -418,7 +422,7 @@ public class OverviewPanel extends JPanel implements Runnable
     boxX = (int) (startRes * av.getCharWidth() * scalew);
     boxY = (int) (startSeq * av.getCharHeight() * scaleh);
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       boxWidth = (int) ((endRes - startRes + 1) * av.getCharWidth() * scalew);
     }
index ac37106..fe0c4f9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -69,11 +69,11 @@ public class PCAPanel extends GPCAPanel implements Runnable
     seqstrings = av.getAlignmentView(av.getSelectionGroup() != null);
     if (av.getSelectionGroup() == null)
     {
-      seqs = av.alignment.getSequencesArray();
+      seqs = av.getAlignment().getSequencesArray();
     }
     else
     {
-      seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+      seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
     }
     SeqCigar sq[] = seqstrings.getSequences();
     int length = sq[0].getWidth();
index 41a0da9..9dc7f32 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -118,8 +118,8 @@ public class PaintRefresher
       if (validateSequences && comp instanceof AlignmentPanel
               && source instanceof AlignmentPanel)
       {
-        validateSequences(((AlignmentPanel) source).av.alignment,
-                ((AlignmentPanel) comp).av.alignment);
+        validateSequences(((AlignmentPanel) source).av.getAlignment(),
+                ((AlignmentPanel) comp).av.getAlignment());
       }
 
       if (comp instanceof AlignmentPanel && alignmentChanged)
index 5ca572c..fedd8d2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -56,14 +56,14 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel
 
     if (av.getSelectionGroup() == null)
     {
-      seqs = av.alignment.getSequencesArray();
+      seqs = av.getAlignment().getSequencesArray();
     }
     else
     {
-      seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+      seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
     }
 
-    String type = (av.alignment.isNucleotide()) ? AlignSeq.DNA
+    String type = (av.getAlignment().isNucleotide()) ? AlignSeq.DNA
             : AlignSeq.PEP;
 
     float[][] scores = new float[seqs.length][seqs.length];
index 1cc4cd7..24dd031 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -70,6 +70,11 @@ public class PopupMenu extends JPopupMenu
 
   protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
 
+  protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
+  // protected JRadioButtonMenuItem covariationColour = new
+  // JRadioButtonMenuItem();
+
   JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
 
   protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
@@ -80,7 +85,7 @@ public class PopupMenu extends JPopupMenu
 
   JMenuItem sequenceName = new JMenuItem();
 
-  Sequence sequence;
+  SequenceI sequence;
 
   JMenuItem unGroupMenuItem = new JMenuItem();
 
@@ -157,7 +162,7 @@ public class PopupMenu extends JPopupMenu
    * @param links
    * @param groupLinks
    */
-  public PopupMenu(final AlignmentPanel ap, Sequence seq, Vector links,
+  public PopupMenu(final AlignmentPanel ap, final SequenceI seq, Vector links,
           Vector groupLinks)
   {
     // /////////////////////////////////////////////////////////
@@ -183,6 +188,8 @@ public class PopupMenu extends JPopupMenu
     colours.add(userDefinedColour);
     colours.add(PIDColour);
     colours.add(BLOSUM62Colour);
+    colours.add(purinePyrimidineColour);
+    // colours.add(covariationColour);
 
     for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
     {
@@ -248,10 +255,67 @@ public class PopupMenu extends JPopupMenu
       }
       else
       {
+        if (ap.av.getAlignment().isNucleotide() == false)
+        {
         structureMenu.remove(viewStructureMenu);
+        }
         // structureMenu.remove(colStructureMenu);
       }
 
+      if (ap.av.getAlignment().isNucleotide() == true)
+      {
+        AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+        for (int i = 0; i < aa.length; i++)
+        {
+          if (aa[i].getRNAStruc() != null)
+          {
+            final String rnastruc = aa[i].getRNAStruc();
+            final String structureLine=aa[i].label;
+            menuItem = new JMenuItem();
+            menuItem.setText("2D RNA "+structureLine);
+            menuItem.addActionListener(new java.awt.event.ActionListener()
+            {
+              public void actionPerformed(ActionEvent e)
+              {
+                new AppVarna(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
+                        .getName(), ap);
+              }
+            });
+            viewStructureMenu.add(menuItem);
+          }
+        }
+
+        // SequenceFeatures[] test = seq.getSequenceFeatures();
+
+        if (seq.getAnnotation() != null)
+        {
+          AlignmentAnnotation seqAnno[] = seq.getAnnotation();
+          for (int i = 0; i < seqAnno.length; i++)
+          {
+            if (seqAnno[i].getRNAStruc() != null)
+            {
+              final String rnastruc = seqAnno[i].getRNAStruc();
+              
+           // TODO: make rnastrucF a bit more nice
+              menuItem = new JMenuItem();
+              menuItem.setText("2D RNA - "+seq.getName());
+              menuItem.addActionListener(new java.awt.event.ActionListener()
+              {
+                public void actionPerformed(ActionEvent e)
+                {
+                  // TODO: VARNA does'nt print gaps in the sequence
+                  new AppVarna(seq.getName()+" structure",seq,seq.getSequenceAsString(), rnastruc, seq
+                          .getName(), ap);
+                }
+              });
+              viewStructureMenu.add(menuItem);
+            }
+          }
+        }
+
+        
+      }
+
       menuItem = new JMenuItem("Hide Sequences");
       menuItem.addActionListener(new java.awt.event.ActionListener()
       {
@@ -276,9 +340,9 @@ public class PopupMenu extends JPopupMenu
         sequenceMenu.add(menuItem);
       }
 
-      if (ap.av.hasHiddenRows)
+      if (ap.av.hasHiddenRows())
       {
-        final int index = ap.av.alignment.findIndex(seq);
+        final int index = ap.av.getAlignment().findIndex(seq);
 
         if (ap.av.adjustForHiddenSeqs(index)
                 - ap.av.adjustForHiddenSeqs(index - 1) > 1)
@@ -300,7 +364,7 @@ public class PopupMenu extends JPopupMenu
       }
     }
     // for the case when no sequences are even visible
-    if (ap.av.hasHiddenRows) {
+    if (ap.av.hasHiddenRows()) {
       {
         menuItem = new JMenuItem("Reveal All");
         menuItem.addActionListener(new ActionListener()
@@ -371,6 +435,14 @@ public class PopupMenu extends JPopupMenu
       {
         clustalColour.setSelected(true);
       }
+      else if (sg.cs instanceof PurinePyrimidineColourScheme)
+      {
+        purinePyrimidineColour.setSelected(true);
+      }
+      /*
+       * else if (sg.cs instanceof CovariationColourScheme) {
+       * covariationColour.setSelected(true); }
+       */
       else
       {
         noColourmenuItem.setSelected(true);
@@ -434,7 +506,7 @@ public class PopupMenu extends JPopupMenu
       editMenu.setVisible(false);
     }
 
-    if (!ap.av.alignment.getGroups().contains(sg))
+    if (!ap.av.getAlignment().getGroups().contains(sg))
     {
       unGroupMenuItem.setVisible(false);
     }
@@ -1009,6 +1081,10 @@ public class PopupMenu extends JPopupMenu
     colourMenu.add(turnColour);
     colourMenu.add(buriedColour);
     colourMenu.add(nucleotideMenuItem);
+    if (ap.getAlignment().isNucleotide()) {
+       colourMenu.add(purinePyrimidineColour);
+    }
+    // colourMenu.add(covariationColour);
     colourMenu.add(userDefinedColour);
 
     if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
@@ -1160,6 +1236,21 @@ public class PopupMenu extends JPopupMenu
         BLOSUM62Colour_actionPerformed();
       }
     });
+    purinePyrimidineColour.setText("Purine/Pyrimidine");
+    purinePyrimidineColour
+            .addActionListener(new java.awt.event.ActionListener()
+            {
+              public void actionPerformed(ActionEvent e)
+              {
+                purinePyrimidineColour_actionPerformed();
+              }
+            });
+    /*
+     * covariationColour.addActionListener(new java.awt.event.ActionListener() {
+     * public void actionPerformed(ActionEvent e) {
+     * covariationColour_actionPerformed(); } });
+     */
+
     conservationMenuItem.setText("Conservation");
     conservationMenuItem
             .addActionListener(new java.awt.event.ActionListener()
@@ -1198,8 +1289,8 @@ public class PopupMenu extends JPopupMenu
   {
     SequenceGroup sg = getGroup();
     sg.cs = new ClustalxColourScheme(
-            sg.getSequences(ap.av.hiddenRepSequences),
-            ap.av.alignment.getWidth());
+            sg.getSequences(ap.av.getHiddenRepSequences()),
+            ap.av.getAlignment().getWidth());
     refresh();
   }
 
@@ -1299,6 +1390,16 @@ public class PopupMenu extends JPopupMenu
     refresh();
   }
 
+  protected void purinePyrimidineColour_actionPerformed()
+  {
+    getGroup().cs = new PurinePyrimidineColourScheme();
+    refresh();
+  }
+
+  /*
+   * protected void covariationColour_actionPerformed() { getGroup().cs = new
+   * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
+   */
   /**
    * DOCUMENT ME!
    * 
@@ -1316,7 +1417,7 @@ public class PopupMenu extends JPopupMenu
     if (abovePIDColour.isSelected())
     {
       sg.cs.setConsensus(AAFrequency.calculate(
-              sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+              sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
               sg.getEndRes() + 1));
 
       int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
@@ -1370,7 +1471,7 @@ public class PopupMenu extends JPopupMenu
     SequenceGroup sg = getGroup();
     sg.cs = new PIDColourScheme();
     sg.cs.setConsensus(AAFrequency.calculate(
-            sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+            sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
             sg.getEndRes() + 1));
     refresh();
   }
@@ -1388,7 +1489,7 @@ public class PopupMenu extends JPopupMenu
     sg.cs = new Blosum62ColourScheme();
 
     sg.cs.setConsensus(AAFrequency.calculate(
-            sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+            sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
             sg.getEndRes() + 1));
 
     refresh();
@@ -1424,11 +1525,11 @@ public class PopupMenu extends JPopupMenu
     {
       Conservation c = new Conservation("Group",
               ResidueProperties.propHash, 3,
-              sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+              sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
               sg.getEndRes() + 1);
 
       c.calculate();
-      c.verdict(false, ap.av.ConsPercGaps);
+      c.verdict(false, ap.av.getConsPercGaps());
 
       sg.cs.setConservation(c);
 
@@ -1498,7 +1599,7 @@ public class PopupMenu extends JPopupMenu
     // this method won't add a new group if it already exists
     if (sg != null)
     {
-      ap.av.alignment.addGroup(sg);
+      ap.av.getAlignment().addGroup(sg);
     }
 
     return sg;
@@ -1552,7 +1653,7 @@ public class PopupMenu extends JPopupMenu
   void unGroupMenuItem_actionPerformed()
   {
     SequenceGroup sg = ap.av.getSelectionGroup();
-    ap.av.alignment.deleteGroup(sg);
+    ap.av.getAlignment().deleteGroup(sg);
     ap.av.setSelectionGroup(null);
     refresh();
   }
@@ -1706,7 +1807,7 @@ public class PopupMenu extends JPopupMenu
       }
 
       ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
-              sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
+              sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), startEnd,
               caseChange);
 
       ap.alignFrame.addHistoryItem(caseCommand);
@@ -1733,7 +1834,7 @@ public class PopupMenu extends JPopupMenu
     ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection());
     omitHidden = ap.av.getViewAsString(true);
     Alignment oal = new Alignment(ap.av.getSequenceSelection());
-    AlignmentAnnotation[] nala = ap.av.alignment.getAlignmentAnnotation();
+    AlignmentAnnotation[] nala = ap.av.getAlignment().getAlignmentAnnotation();
     if (nala != null)
     {
       for (int i = 0; i < nala.length; i++)
@@ -1782,9 +1883,9 @@ public class PopupMenu extends JPopupMenu
   public void discoverPDB_actionPerformed()
   {
 
-    final SequenceI[] sequences = ((ap.av.selectionGroup == null) ? new Sequence[]
+    final SequenceI[] sequences = ((ap.av.getSelectionGroup() == null) ? new SequenceI[]
     { sequence }
-            : ap.av.selectionGroup.getSequencesInOrder(ap.av.alignment));
+            : ap.av.getSequenceSelection());
     Thread discpdb = new Thread(new Runnable()
     {
       public void run()
@@ -1853,10 +1954,10 @@ public class PopupMenu extends JPopupMenu
     AlignmentAnnotation an = new AlignmentAnnotation("Structure",
             "Coloured by " + pdbid, anots);
 
-    ap.av.alignment.addAnnotation(an);
+    ap.av.getAlignment().addAnnotation(an);
     an.createSequenceMapping(sequence, 0, true);
     // an.adjustForAlignment();
-    ap.av.alignment.setAnnotationIndex(an, 0);
+    ap.av.getAlignment().setAnnotationIndex(an, 0);
 
     ap.adjustAnnotationHeight();
 
@@ -1883,8 +1984,8 @@ public class PopupMenu extends JPopupMenu
         EditCommand editCommand = new EditCommand("Edit Sequences",
                 EditCommand.REPLACE, dialog.getName().replace(' ',
                         ap.av.getGapCharacter()),
-                sg.getSequencesAsArray(ap.av.hiddenRepSequences),
-                sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
+                sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
+                sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
 
         ap.alignFrame.addHistoryItem(editCommand);
 
index 789799e..acb9654 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fae7783..95d9c69 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 16db1fa..9f117b6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -131,15 +131,15 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
 
     if ((sg != null) && (sg.getSize() >= 1))
     {
-      originalSequences = sg.getSequencesInOrder(ap.av.alignment);
+      originalSequences = sg.getSequencesInOrder(ap.av.getAlignment());
       start = sg.getStartRes();
       end = sg.getEndRes();
     }
     else
     {
-      originalSequences = ap.av.alignment.getSequencesArray();
+      originalSequences = ap.av.getAlignment().getSequencesArray();
       start = 0;
-      end = ap.av.alignment.getWidth();
+      end = ap.av.getAlignment().getWidth();
     }
 
     height = originalSequences.length;
@@ -150,7 +150,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
       redundancy[i] = 0f;
     }
 
-    if (ap.av.hasHiddenColumns)
+    if (ap.av.hasHiddenColumns())
     {
       omitHidden = ap.av.getViewAsString(sg != null);
     }
@@ -273,11 +273,11 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
       }
 
       EditCommand cut = new EditCommand("Remove Redundancy",
-              EditCommand.CUT, deleted, 0, width, ap.av.alignment);
+              EditCommand.CUT, deleted, 0, width, ap.av.getAlignment());
 
       for (int i = 0; i < del.size(); i++)
       {
-        ap.av.alignment.deleteSequence(deleted[i]);
+        ap.av.getAlignment().deleteSequence(deleted[i]);
         PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true);
         if (sg != null)
         {
index c085e8c..9cf73f4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index dee5d7e..3863f40 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 713f9b1..f3312c3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -644,7 +644,7 @@ public class RotatableCanvas extends JPanel implements MouseListener,
           aps[a].av.setSelectionGroup(new SequenceGroup());
           aps[a].av.getSelectionGroup().addOrRemove(found, true);
           aps[a].av.getSelectionGroup().setEndRes(
-                  aps[a].av.alignment.getWidth() - 1);
+                  aps[a].av.getAlignment().getWidth() - 1);
         }
       }
       PaintRefresher.Refresh(this, av.getSequenceSetId());
index a4f6546..c70f3c1 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -70,14 +70,14 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
     int x = (evt.getX() / av.getCharWidth()) + av.getStartRes();
     final int res;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       x = av.getColumnSelection().adjustForHiddenColumns(x);
     }
 
-    if (x >= av.alignment.getWidth())
+    if (x >= av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
     else
     {
@@ -137,7 +137,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
           {
             av.hideColumns(res, res);
             if (av.getSelectionGroup() != null
-                    && av.getSelectionGroup().getSize() == av.alignment
+                    && av.getSelectionGroup().getSize() == av.getAlignment()
                             .getHeight())
             {
               av.setSelectionGroup(null);
@@ -165,7 +165,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
       av.getColumnSelection().addElement(res);
       SequenceGroup sg = new SequenceGroup();
       // try to be as quick as possible
-      SequenceI[] iVec = av.alignment.getSequencesArray();
+      SequenceI[] iVec = av.getAlignment().getSequencesArray();
       for (int i = 0; i < iVec.length; i++)
       {
         sg.addSequence(iVec[i], false);
@@ -205,14 +205,14 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
 
     int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
 
-    if (res >= av.alignment.getWidth())
+    if (res >= av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
 
     if (!stretchingGroup)
@@ -256,14 +256,14 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
       res = 0;
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
 
-    if (res >= av.alignment.getWidth())
+    if (res >= av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
 
     if (res < min)
@@ -337,7 +337,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
 
   public void mouseMoved(MouseEvent evt)
   {
-    if (!av.hasHiddenColumns)
+    if (!av.hasHiddenColumns())
     {
       return;
     }
@@ -409,7 +409,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
       for (int i = 0; i < cs.size(); i++)
       {
         int sel = cs.columnAt(i);
-        if (av.hasHiddenColumns)
+        if (av.hasHiddenColumns())
         {
           if (cs.isVisible(sel))
           {
@@ -473,7 +473,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
       }
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       gg.setColor(Color.blue);
       int res;
index 9211d0f..adebec8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b55e32b..f982ccc 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -105,7 +105,7 @@ public class SeqCanvas extends JComponent
     for (int i = scalestartx; i < endx; i += 10)
     {
       int value = i;
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         value = av.getColumnSelection().adjustForHiddenColumns(value);
       }
@@ -137,22 +137,22 @@ public class SeqCanvas extends JComponent
     FontMetrics fm = getFontMetrics(av.getFont());
     ypos += av.charHeight;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       startx = av.getColumnSelection().adjustForHiddenColumns(startx);
       endx = av.getColumnSelection().adjustForHiddenColumns(endx);
     }
 
-    int maxwidth = av.alignment.getWidth();
-    if (av.hasHiddenColumns)
+    int maxwidth = av.getAlignment().getWidth();
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
 
     // WEST SCALE
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    for (int i = 0; i < av.getAlignment().getHeight(); i++)
     {
-      SequenceI seq = av.alignment.getSequenceAt(i);
+      SequenceI seq = av.getAlignment().getSequenceAt(i);
       int index = startx;
       int value = -1;
 
@@ -165,7 +165,7 @@ public class SeqCanvas extends JComponent
           continue;
         }
 
-        value = av.alignment.getSequenceAt(i).findPosition(index);
+        value = av.getAlignment().getSequenceAt(i).findPosition(index);
 
         break;
       }
@@ -196,16 +196,16 @@ public class SeqCanvas extends JComponent
   {
     ypos += av.charHeight;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       endx = av.getColumnSelection().adjustForHiddenColumns(endx);
     }
 
     SequenceI seq;
     // EAST SCALE
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    for (int i = 0; i < av.getAlignment().getHeight(); i++)
     {
-      seq = av.alignment.getSequenceAt(i);
+      seq = av.getAlignment().getSequenceAt(i);
       int index = endx;
       int value = -1;
 
@@ -425,9 +425,9 @@ public class SeqCanvas extends JComponent
     String mask = "00";
     int maxWidth = 0;
     int tmp;
-    for (int i = 0; i < av.alignment.getHeight(); i++)
+    for (int i = 0; i < av.getAlignment().getHeight(); i++)
     {
-      tmp = av.alignment.getSequenceAt(i).getEnd();
+      tmp = av.getAlignment().getSequenceAt(i).getEnd();
       if (tmp > maxWidth)
       {
         maxWidth = tmp;
@@ -485,9 +485,9 @@ public class SeqCanvas extends JComponent
 
     int endx;
     int ypos = hgap;
-    int maxwidth = av.alignment.getWidth() - 1;
+    int maxwidth = av.getAlignment().getWidth() - 1;
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
@@ -523,7 +523,7 @@ public class SeqCanvas extends JComponent
         drawNorthScale(g, startRes, endx, ypos);
       }
 
-      if (av.hasHiddenColumns && av.showHiddenMarkers)
+      if (av.hasHiddenColumns() && av.showHiddenMarkers)
       {
         g.setColor(Color.blue);
         int res;
@@ -572,7 +572,7 @@ public class SeqCanvas extends JComponent
           annotations = new AnnotationPanel(av);
         }
 
-        annotations.drawComponent((Graphics2D) g, startRes, endx + 1);
+        annotations.renderer.drawComponent(annotations, av, (Graphics2D) g, -1, startRes, endx + 1);
         g.translate(0, -cHeight - ypos - 3);
       }
       g.setClip(clip);
@@ -620,7 +620,7 @@ public class SeqCanvas extends JComponent
   void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
           int endSeq, int offset)
   {
-    if (!av.hasHiddenColumns)
+    if (!av.hasHiddenColumns())
     {
       draw(g1, startRes, endRes, startSeq, endSeq, offset);
     }
@@ -690,14 +690,14 @@ public class SeqCanvas extends JComponent
     // ///////////////////////////
     for (int i = startSeq; i < endSeq; i++)
     {
-      nextSeq = av.alignment.getSequenceAt(i);
+      nextSeq = av.getAlignment().getSequenceAt(i);
       if (nextSeq == null)
       {
         // occasionally, a race condition occurs such that the alignment row is
         // empty
         continue;
       }
-      sr.drawSequence(nextSeq, av.alignment.findAllGroups(nextSeq),
+      sr.drawSequence(nextSeq, av.getAlignment().findAllGroups(nextSeq),
               startRes, endRes, offset + ((i - startSeq) * av.charHeight));
 
       if (av.showSequenceFeatures)
@@ -734,7 +734,7 @@ public class SeqCanvas extends JComponent
     }
 
     if (av.getSelectionGroup() != null
-            || av.alignment.getGroups().size() > 0)
+            || av.getAlignment().getGroups().size() > 0)
     {
       drawGroupsBoundaries(g, startRes, endRes, startSeq, endSeq, offset);
     }
@@ -757,9 +757,9 @@ public class SeqCanvas extends JComponent
     int groupIndex = -1;
     int visWidth = (endRes - startRes + 1) * av.charWidth;
 
-    if ((group == null) && (av.alignment.getGroups().size() > 0))
+    if ((group == null) && (av.getAlignment().getGroups().size() > 0))
     {
-      group = (SequenceGroup) av.alignment.getGroups().elementAt(0);
+      group = (SequenceGroup) av.getAlignment().getGroups().elementAt(0);
       groupIndex = 0;
     }
 
@@ -786,11 +786,11 @@ public class SeqCanvas extends JComponent
 
           if ((sx <= (endRes - startRes) * av.charWidth)
                   && group.getSequences(null).contains(
-                          av.alignment.getSequenceAt(i)))
+                          av.getAlignment().getSequenceAt(i)))
           {
             if ((bottom == -1)
                     && !group.getSequences(null).contains(
-                            av.alignment.getSequenceAt(i + 1)))
+                            av.getAlignment().getSequenceAt(i + 1)))
             {
               bottom = sy + av.charHeight;
             }
@@ -799,7 +799,7 @@ public class SeqCanvas extends JComponent
             {
               if (((top == -1) && (i == 0))
                       || !group.getSequences(null).contains(
-                              av.alignment.getSequenceAt(i - 1)))
+                              av.getAlignment().getSequenceAt(i - 1)))
               {
                 top = sy;
               }
@@ -915,15 +915,15 @@ public class SeqCanvas extends JComponent
 
         g.setStroke(new BasicStroke());
 
-        if (groupIndex >= av.alignment.getGroups().size())
+        if (groupIndex >= av.getAlignment().getGroups().size())
         {
           break;
         }
 
-        group = (SequenceGroup) av.alignment.getGroups().elementAt(
+        group = (SequenceGroup) av.getAlignment().getGroups().elementAt(
                 groupIndex);
 
-      } while (groupIndex < av.alignment.getGroups().size());
+      } while (groupIndex < av.getAlignment().getGroups().size());
 
     }
 
index ca5d7f7..3cf869c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -176,7 +176,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       res = (x / av.getCharWidth()) + av.getStartRes();
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       res = av.getColumnSelection().adjustForHiddenColumns(res);
     }
@@ -204,12 +204,12 @@ public class SeqPanel extends JPanel implements MouseListener,
       y -= hgap;
 
       seq = Math.min((y % cHeight) / av.getCharHeight(),
-              av.alignment.getHeight() - 1);
+              av.getAlignment().getHeight() - 1);
     }
     else
     {
       seq = Math.min((y / av.getCharHeight()) + av.getStartSeq(),
-              av.alignment.getHeight() - 1);
+              av.getAlignment().getHeight() - 1);
     }
 
     return seq;
@@ -308,19 +308,19 @@ public class SeqPanel extends JPanel implements MouseListener,
   {
     seqCanvas.cursorX += dx;
     seqCanvas.cursorY += dy;
-    if (av.hasHiddenColumns && !av.colSel.isVisible(seqCanvas.cursorX))
+    if (av.hasHiddenColumns() && !av.getColumnSelection().isVisible(seqCanvas.cursorX))
     {
       int original = seqCanvas.cursorX - dx;
-      int maxWidth = av.alignment.getWidth();
+      int maxWidth = av.getAlignment().getWidth();
 
-      while (!av.colSel.isVisible(seqCanvas.cursorX)
+      while (!av.getColumnSelection().isVisible(seqCanvas.cursorX)
               && seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0)
       {
         seqCanvas.cursorX += dx;
       }
 
       if (seqCanvas.cursorX >= maxWidth
-              || !av.colSel.isVisible(seqCanvas.cursorX))
+              || !av.getColumnSelection().isVisible(seqCanvas.cursorX))
       {
         seqCanvas.cursorX = original;
       }
@@ -335,18 +335,18 @@ public class SeqPanel extends JPanel implements MouseListener,
     {
       seqCanvas.cursorX = 0;
     }
-    else if (seqCanvas.cursorX > av.alignment.getWidth() - 1)
+    else if (seqCanvas.cursorX > av.getAlignment().getWidth() - 1)
     {
-      seqCanvas.cursorX = av.alignment.getWidth() - 1;
+      seqCanvas.cursorX = av.getAlignment().getWidth() - 1;
     }
 
     if (seqCanvas.cursorY < 0)
     {
       seqCanvas.cursorY = 0;
     }
-    else if (seqCanvas.cursorY > av.alignment.getHeight() - 1)
+    else if (seqCanvas.cursorY > av.getAlignment().getHeight() - 1)
     {
-      seqCanvas.cursorY = av.alignment.getHeight() - 1;
+      seqCanvas.cursorY = av.getAlignment().getHeight() - 1;
     }
 
     endEditing();
@@ -366,7 +366,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       }
       if (!av.wrapAlignment)
       {
-        while (seqCanvas.cursorX < av.colSel
+        while (seqCanvas.cursorX < av.getColumnSelection()
                 .adjustForHiddenColumns(av.startRes))
         {
           if (!ap.scrollRight(false))
@@ -374,7 +374,7 @@ public class SeqPanel extends JPanel implements MouseListener,
             break;
           }
         }
-        while (seqCanvas.cursorX > av.colSel
+        while (seqCanvas.cursorX > av.getColumnSelection()
                 .adjustForHiddenColumns(av.endRes))
         {
           if (!ap.scrollRight(true))
@@ -384,7 +384,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         }
       }
     }
-    setStatusMessage(av.alignment.getSequenceAt(seqCanvas.cursorY),
+    setStatusMessage(av.getAlignment().getSequenceAt(seqCanvas.cursorY),
             seqCanvas.cursorX, seqCanvas.cursorY);
 
     seqCanvas.repaint();
@@ -397,12 +397,12 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     if (av.getSelectionGroup() != null)
     {
-      SequenceGroup sg = av.selectionGroup;
+      SequenceGroup sg = av.getSelectionGroup();
       // Find the top and bottom of this group
-      int min = av.alignment.getHeight(), max = 0;
+      int min = av.getAlignment().getHeight(), max = 0;
       for (int i = 0; i < sg.getSize(); i++)
       {
-        int index = av.alignment.findIndex(sg.getSequenceAt(i));
+        int index = av.getAlignment().findIndex(sg.getSequenceAt(i));
         if (index > max)
         {
           max = index;
@@ -447,7 +447,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         sg.getSequences(null).clear();
         for (int i = min; i < max; i++)
         {
-          sg.addSequence(av.alignment.getSequenceAt(i), false);
+          sg.addSequence(av.getAlignment().getSequenceAt(i), false);
         }
       }
     }
@@ -470,7 +470,7 @@ public class SeqPanel extends JPanel implements MouseListener,
     groupEditing = group;
     startseq = seqCanvas.cursorY;
     lastres = seqCanvas.cursorX;
-    editSequence(true, seqCanvas.cursorX + getKeyboardNo1());
+    editSequence(true, false, seqCanvas.cursorX + getKeyboardNo1());
     endEditing();
   }
 
@@ -479,9 +479,17 @@ public class SeqPanel extends JPanel implements MouseListener,
     groupEditing = group;
     startseq = seqCanvas.cursorY;
     lastres = seqCanvas.cursorX + getKeyboardNo1();
-    editSequence(false, seqCanvas.cursorX);
+    editSequence(false, false, seqCanvas.cursorX);
     endEditing();
   }
+  
+  void insertNucAtCursor(boolean group,String nuc){
+         groupEditing = group;
+           startseq = seqCanvas.cursorY;
+           lastres = seqCanvas.cursorX;
+           editSequence(false, true, seqCanvas.cursorX + getKeyboardNo1());
+           endEditing();
+  }
 
   void numberPressed(char value)
   {
@@ -665,7 +673,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     tooltipText.setLength(6); // Cuts the buffer back to <html>
 
-    SequenceGroup[] groups = av.alignment.findAllGroups(sequence);
+    SequenceGroup[] groups = av.getAlignment().findAllGroups(sequence);
     if (groups != null)
     {
       for (int g = 0; g < groups.length; g++)
@@ -904,7 +912,7 @@ public class SeqPanel extends JPanel implements MouseListener,
             + sequence.getName());
 
     Object obj = null;
-    if (av.alignment.isNucleotide())
+    if (av.getAlignment().isNucleotide())
     {
       obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res)
               + "");
@@ -1013,11 +1021,11 @@ public class SeqPanel extends JPanel implements MouseListener,
     if ((res < av.getAlignment().getWidth()) && (res < lastres))
     {
       // dragLeft, delete gap
-      editSequence(false, res);
+      editSequence(false, false,res);
     }
     else
     {
-      editSequence(true, res);
+      editSequence(true, false,res);
     }
 
     mouseDragging = true;
@@ -1027,22 +1035,22 @@ public class SeqPanel extends JPanel implements MouseListener,
     }
   }
 
-  synchronized void editSequence(boolean insertGap, int startres)
+  //TODO: Make it more clever than many booleans
+  synchronized void editSequence(boolean insertGap, boolean editSeq, int startres)
   {
     int fixedLeft = -1;
     int fixedRight = -1;
     boolean fixedColumns = false;
     SequenceGroup sg = av.getSelectionGroup();
 
-    SequenceI seq = av.alignment.getSequenceAt(startseq);
+    SequenceI seq = av.getAlignment().getSequenceAt(startseq);
 
     // No group, but the sequence may represent a group
-    if (!groupEditing && av.hasHiddenRows)
+    if (!groupEditing && av.hasHiddenRows())
     {
-      if (av.hiddenRepSequences != null
-              && av.hiddenRepSequences.containsKey(seq))
+      if (av.isHiddenRepSequence(seq))
       {
-        sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+        sg = av.getRepresentedSequences(seq);
         groupEditing = true;
       }
     }
@@ -1084,7 +1092,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     // Are we editing within a selection group?
     if (groupEditing
-            || (sg != null && sg.getSequences(av.hiddenRepSequences)
+            || (sg != null && sg.getSequences(av.getHiddenRepSequences())
                     .contains(seq)))
     {
       fixedColumns = true;
@@ -1093,13 +1101,12 @@ public class SeqPanel extends JPanel implements MouseListener,
       // but the sequence represents a group
       if (sg == null)
       {
-        if (av.hiddenRepSequences == null
-                || !av.hiddenRepSequences.containsKey(seq))
+        if (!av.isHiddenRepSequence(seq))
         {
           endEditing();
           return;
         }
-        sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+        sg = av.getRepresentedSequences(seq);
       }
 
       fixedLeft = sg.getStartRes();
@@ -1126,7 +1133,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       }
     }
 
-    if (av.hasHiddenColumns)
+    if (av.hasHiddenColumns())
     {
       fixedColumns = true;
       int y1 = av.getColumnSelection().getHiddenBoundaryLeft(startres);
@@ -1156,7 +1163,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     if (groupEditing)
     {
-      Vector vseqs = sg.getSequences(av.hiddenRepSequences);
+      Vector vseqs = sg.getSequences(av.getHiddenRepSequences());
       int g, groupSize = vseqs.size();
       SequenceI[] groupSeqs = new SequenceI[groupSize];
       for (g = 0; g < groupSeqs.length; g++)
@@ -1170,9 +1177,9 @@ public class SeqPanel extends JPanel implements MouseListener,
         // If the user has selected the whole sequence, and is dragging to
         // the right, we can still extend the alignment and selectionGroup
         if (sg.getStartRes() == 0 && sg.getEndRes() == fixedRight
-                && sg.getEndRes() == av.alignment.getWidth() - 1)
+                && sg.getEndRes() == av.getAlignment().getWidth() - 1)
         {
-          sg.setEndRes(av.alignment.getWidth() + startres - lastres);
+          sg.setEndRes(av.getAlignment().getWidth() + startres - lastres);
           fixedRight = sg.getEndRes();
         }
 
@@ -1204,19 +1211,19 @@ public class SeqPanel extends JPanel implements MouseListener,
 
         if (!blank)
         {
-          if (sg.getSize() == av.alignment.getHeight())
+          if (sg.getSize() == av.getAlignment().getHeight())
           {
-            if ((av.hasHiddenColumns && startres < av.getColumnSelection()
+            if ((av.hasHiddenColumns() && startres < av.getColumnSelection()
                     .getHiddenBoundaryRight(startres)))
             {
               endEditing();
               return;
             }
 
-            int alWidth = av.alignment.getWidth();
-            if (av.hasHiddenRows)
+            int alWidth = av.getAlignment().getWidth();
+            if (av.hasHiddenRows())
             {
-              int hwidth = av.alignment.getHiddenSequences().getWidth();
+              int hwidth = av.getAlignment().getHiddenSequences().getWidth();
               if (hwidth > alWidth)
               {
                 alWidth = hwidth;
@@ -1273,7 +1280,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         else
         {
           editCommand.appendEdit(EditCommand.INSERT_GAP, groupSeqs,
-                  startres, startres - lastres, av.alignment, true);
+                  startres, startres - lastres, av.getAlignment(), true);
         }
       }
       else
@@ -1289,7 +1296,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         else
         {
           editCommand.appendEdit(EditCommand.DELETE_GAP, groupSeqs,
-                  startres, lastres - startres, av.alignment, true);
+                  startres, lastres - startres, av.getAlignment(), true);
         }
 
       }
@@ -1311,11 +1318,12 @@ public class SeqPanel extends JPanel implements MouseListener,
         else
         {
           editCommand.appendEdit(EditCommand.INSERT_GAP, new SequenceI[]
-          { seq }, lastres, startres - lastres, av.alignment, true);
-        }
+          { seq }, lastres, startres - lastres, av.getAlignment(), true);
+         }
       }
       else
       {
+       if(!editSeq){
         // dragging to the left
         if (fixedColumns && fixedRight != -1)
         {
@@ -1346,9 +1354,24 @@ public class SeqPanel extends JPanel implements MouseListener,
           if (max > 0)
           {
             editCommand.appendEdit(EditCommand.DELETE_GAP, new SequenceI[]
-            { seq }, startres, max, av.alignment, true);
+            { seq }, startres, max, av.getAlignment(), true);
           }
         }
+       }else{//insertGap==false AND editSeq==TRUE;
+               if (fixedColumns && fixedRight != -1)
+            {
+              for (int j = lastres; j < startres; j++)
+              {
+                insertChar(j, new SequenceI[]
+                { seq }, fixedRight);
+              }
+              }
+            else
+            {
+              editCommand.appendEdit(EditCommand.INSERT_NUC, new SequenceI[]
+              { seq }, lastres, startres - lastres, av.getAlignment(), true);
+             }
+       }
       }
     }
 
@@ -1382,9 +1405,9 @@ public class SeqPanel extends JPanel implements MouseListener,
     }
 
     editCommand.appendEdit(EditCommand.DELETE_GAP, seq, blankColumn, 1,
-            av.alignment, true);
+            av.getAlignment(), true);
 
-    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.alignment,
+    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.getAlignment(),
             true);
 
   }
@@ -1392,11 +1415,11 @@ public class SeqPanel extends JPanel implements MouseListener,
   void deleteChar(int j, SequenceI[] seq, int fixedColumn)
   {
 
-    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.alignment,
+    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.getAlignment(),
             true);
 
     editCommand.appendEdit(EditCommand.INSERT_GAP, seq, fixedColumn, 1,
-            av.alignment, true);
+            av.getAlignment(), true);
   }
 
   /**
@@ -1441,7 +1464,7 @@ public class SeqPanel extends JPanel implements MouseListener,
   public void mouseClicked(MouseEvent evt)
   {
     SequenceGroup sg = null;
-    SequenceI sequence = av.alignment.getSequenceAt(findSeq(evt));
+    SequenceI sequence = av.getAlignment().getSequenceAt(findSeq(evt));
     if (evt.getClickCount() > 1)
     {
       sg = av.getSelectionGroup();
@@ -1500,7 +1523,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     startWrapBlock = wrappedBlock;
 
-    if (av.wrapAlignment && seq > av.alignment.getHeight())
+    if (av.wrapAlignment && seq > av.getAlignment().getHeight())
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
               "Cannot edit annotations in wrapped view.",
@@ -1524,7 +1547,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     if (stretchGroup == null)
     {
-      stretchGroup = av.alignment.findGroup(sequence);
+      stretchGroup = av.getAlignment().findGroup(sequence);
 
       if ((stretchGroup != null) && (res > stretchGroup.getStartRes())
               && (res < stretchGroup.getEndRes()))
@@ -1542,7 +1565,7 @@ public class SeqPanel extends JPanel implements MouseListener,
     {
       stretchGroup = null;
 
-      SequenceGroup[] allGroups = av.alignment.findAllGroups(sequence);
+      SequenceGroup[] allGroups = av.getAlignment().findAllGroups(sequence);
 
       if (allGroups != null)
       {
@@ -1651,7 +1674,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       if (stretchGroup.cs instanceof ClustalxColourScheme)
       {
         ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(
-                stretchGroup.getSequences(av.hiddenRepSequences),
+                stretchGroup.getSequences(av.getHiddenRepSequences()),
                 stretchGroup.getWidth());
       }
 
@@ -1696,9 +1719,9 @@ public class SeqPanel extends JPanel implements MouseListener,
       return;
     }
 
-    if (res >= av.alignment.getWidth())
+    if (res >= av.getAlignment().getWidth())
     {
-      res = av.alignment.getWidth() - 1;
+      res = av.getAlignment().getWidth() - 1;
     }
 
     if (stretchGroup.getEndRes() == res)
@@ -1743,7 +1766,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       dragDirection = -1;
     }
 
-    while ((y != oldSeq) && (oldSeq > -1) && (y < av.alignment.getHeight()))
+    while ((y != oldSeq) && (oldSeq > -1) && (y < av.getAlignment().getHeight()))
     {
       // This routine ensures we don't skip any sequences, as the
       // selection is quite slow.
@@ -1848,7 +1871,7 @@ public class SeqPanel extends JPanel implements MouseListener,
           }
 
           if (mouseDragging && (evt.getY() >= getHeight())
-                  && (av.alignment.getHeight() > av.getEndSeq()))
+                  && (av.getAlignment().getHeight() > av.getEndSeq()))
           {
             running = ap.scrollUp(false);
           }
@@ -1901,15 +1924,15 @@ public class SeqPanel extends JPanel implements MouseListener,
       SequenceGroup sgroup = null;
       if (seqsel != null && seqsel.getSize()>0)
       {
-        if (av.alignment == null)
+        if (av.getAlignment() == null)
         {
           jalview.bin.Cache.log.warn("alignviewport av SeqSetId="
                   + av.getSequenceSetId() + " ViewId=" + av.getViewId()
                   + " 's alignment is NULL! returning immediatly.");
           return;
         }
-        sgroup = seqsel.intersect(av.alignment,
-                (av.hasHiddenRows) ? av.hiddenRepSequences : null);
+        sgroup = seqsel.intersect(av.getAlignment(),
+                (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null);
         if ((sgroup == null || sgroup.getSize() == 0)
                 || (colsel == null || colsel.size() == 0))
         {
@@ -1934,29 +1957,29 @@ public class SeqPanel extends JPanel implements MouseListener,
       // so import the new colsel.
       if (colsel == null || colsel.size() == 0)
       {
-        if (av.colSel != null)
+        if (av.getColumnSelection() != null)
         {
-          av.colSel.clear();
+          av.getColumnSelection().clear();
           repaint=true;
         }
       }
       else
       {
         // TODO: shift colSel according to the intersecting sequences
-        if (av.colSel == null)
+        if (av.getColumnSelection() == null)
         {
-          av.colSel = new ColumnSelection(colsel);
+          av.setColumnSelection(new ColumnSelection(colsel));
         }
         else
         {
-          av.colSel.setElementsFrom(colsel);
+          av.getColumnSelection().setElementsFrom(colsel);
         }
       }
       av.isColSelChanged(true);
       repaint = true;
     }
-    if (copycolsel && av.hasHiddenColumns
-            && (av.colSel == null || av.colSel.getHiddenColumns() == null))
+    if (copycolsel && av.hasHiddenColumns()
+            && (av.getColumnSelection() == null || av.getColumnSelection().getHiddenColumns() == null))
     {
       System.err.println("Bad things");
     }
index 7ffd3e4..260950f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -796,16 +796,16 @@ public class SequenceFetcher extends JPanel implements Runnable
       {
         for (int i = 0; i < al.getHeight(); i++)
         {
-          alignFrame.viewport.alignment.addSequence(al.getSequenceAt(i)); // this
+          alignFrame.viewport.getAlignment().addSequence(al.getSequenceAt(i)); // this
           // also
           // creates
           // dataset
           // sequence
           // entries
         }
-        alignFrame.viewport.setEndSeq(alignFrame.viewport.alignment
+        alignFrame.viewport.setEndSeq(alignFrame.viewport.getAlignment()
                 .getHeight());
-        alignFrame.viewport.alignment.getWidth();
+        alignFrame.viewport.getAlignment().getWidth();
         alignFrame.viewport.firePropertyChange("alignment", null,
                 alignFrame.viewport.getAlignment().getSequences());
       }
index b3dfc97..ad704c3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -80,7 +80,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
 
   public Color getResidueBoxColour(SequenceI seq, int i)
   {
-    allGroups = av.alignment.findAllGroups(seq);
+    allGroups = av.getAlignment().findAllGroups(seq);
 
     if (inCurrentSequenceGroup(i))
     {
@@ -91,7 +91,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     }
     else if (av.getShowBoxes())
     {
-      getBoxColour(av.globalColourScheme, seq, i);
+      getBoxColour(av.getGlobalColourScheme(), seq, i);
     }
 
     return resBoxColour;
@@ -205,7 +205,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
         }
         else if (av.getShowBoxes())
         {
-          getBoxColour(av.globalColourScheme, seq, i);
+          getBoxColour(av.getGlobalColourScheme(), seq, i);
         }
 
       }
@@ -328,7 +328,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
           if (currentSequenceGroup.getShowNonconserved()) // todo optimize
           {
             // todo - use sequence group consensus
-            s = getDisplayChar(av.consensus, i, s, '.');
+            s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
 
           }
 
@@ -343,7 +343,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
           if (av.getColourText())
           {
             getboxColour = true;
-            getBoxColour(av.globalColourScheme, seq, i);
+            getBoxColour(av.getGlobalColourScheme(), seq, i);
 
             if (av.getShowBoxes())
             {
@@ -359,7 +359,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
           {
             if (!getboxColour)
             {
-              getBoxColour(av.globalColourScheme, seq, i);
+              getBoxColour(av.getGlobalColourScheme(), seq, i);
             }
 
             if (resBoxColour.getRed() + resBoxColour.getBlue()
@@ -368,9 +368,9 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
               graphics.setColor(av.textColour2);
             }
           }
-          if (av.showUnconserved)
+          if (av.getShowUnconserved())
           {
-            s = getDisplayChar(av.consensus, i, s, '.');
+            s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
 
           }
 
index 3eccf63..601bf6d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -133,7 +133,7 @@ public class SliderPanel extends GSliderPanel
     conservationSlider.setTitle("Conservation Colour Increment  (" + source
             + ")");
 
-    if (ap.av.alignment.getGroups() != null)
+    if (ap.av.getAlignment().getGroups() != null)
     {
       sp.setAllGroupsCheckEnabled(true);
     }
@@ -209,7 +209,7 @@ public class SliderPanel extends GSliderPanel
 
     PIDSlider.setTitle("Percentage Identity Threshold (" + source + ")");
 
-    if (ap.av.alignment.getGroups() != null)
+    if (ap.av.getAlignment().getGroups() != null)
     {
       pid.setAllGroupsCheckEnabled(true);
     }
@@ -271,7 +271,7 @@ public class SliderPanel extends GSliderPanel
 
     if (allGroupsCheck.isSelected())
     {
-      allGroups = ap.av.alignment.getGroups();
+      allGroups = ap.av.getAlignment().getGroups();
       groupIndex = allGroups.size() - 1;
     }
     else
index cf424e8..f7c42b3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -19,6 +19,7 @@ package jalview.gui;
 
 import java.awt.*;
 import java.awt.event.*;
+
 import javax.swing.*;
 
 /**
@@ -31,6 +32,10 @@ public class SplashScreen extends JPanel implements Runnable
 {
   boolean visible = true;
 
+  JPanel iconimg = new JPanel(new BorderLayout());
+
+  JTextPane authlist = new JTextPane();
+
   JInternalFrame iframe;
 
   Image image;
@@ -48,26 +53,27 @@ public class SplashScreen extends JPanel implements Runnable
     t.start();
   }
 
+  MouseAdapter closer = new MouseAdapter()
+  {
+    public void mousePressed(MouseEvent evt)
+    {
+      try
+      {
+        visible = false;
+        closeSplash();
+      } catch (Exception ex)
+      {
+      }
+    }
+  };
+
   /**
    * ping the jalview version page then create and display the jalview
    * splashscreen window.
    */
   void initSplashScreenWindow()
   {
-    addMouseListener(new MouseAdapter()
-    {
-      public void mousePressed(MouseEvent evt)
-      {
-        try
-        {
-          visible = false;
-          closeSplash();
-        } catch (Exception ex)
-        {
-        }
-      }
-    });
-
+    addMouseListener(closer);
     try
     {
       java.net.URL url = getClass().getResource("/images/logo.gif");
@@ -88,14 +94,41 @@ public class SplashScreen extends JPanel implements Runnable
     iframe = new JInternalFrame();
     iframe.setFrameIcon(null);
     iframe.setClosable(false);
+    this.setLayout(new BorderLayout());
     iframe.setContentPane(this);
     iframe.setLayer(JLayeredPane.PALETTE_LAYER);
 
     Desktop.desktop.add(iframe);
-
+    SplashImage splashimg = new SplashImage(image);
+    iconimg.add(splashimg, BorderLayout.CENTER);
+    add(iconimg, BorderLayout.WEST);
+    add(authlist, BorderLayout.CENTER);
+    authlist.setEditable(false);
+    authlist.addMouseListener(closer);
+    refreshText();
     iframe.setVisible(true);
     iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
-            (int) ((Desktop.instance.getHeight() - 160) / 2), 750, 190);
+            (int) ((Desktop.instance.getHeight() - 160) / 2), 750,
+            iframe.getPreferredSize().height);
+
+  }
+
+  long oldtext = -1;
+
+  /**
+   * update text in author text panel reflecting current version information
+   */
+  protected boolean refreshText()
+  {
+    String newtext = Desktop.instance.getAboutMessage(true).toString();
+    if (oldtext != newtext.hashCode())
+    {
+      oldtext = newtext.hashCode();
+      authlist.setContentType("text/html");
+      authlist.setText(newtext);
+      return true;
+    }
+    return false;
   }
 
   /**
@@ -104,6 +137,7 @@ public class SplashScreen extends JPanel implements Runnable
   public void run()
   {
     initSplashScreenWindow();
+
     long startTime = System.currentTimeMillis() / 1000;
 
     while (visible)
@@ -120,7 +154,12 @@ public class SplashScreen extends JPanel implements Runnable
         visible = false;
       }
       else
-        repaint();
+      {
+        if (refreshText())
+        {
+          repaint();
+        }
+      }
     }
 
     closeSplash();
@@ -140,82 +179,69 @@ public class SplashScreen extends JPanel implements Runnable
     }
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param g
-   *          DOCUMENT ME!
-   */
-  public void paintComponent(Graphics g)
+  public class SplashImage extends JPanel
   {
-    g.setColor(Color.white);
-    g.fillRect(0, 0, getWidth(), getHeight());
-    g.setColor(Color.black);
-    g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));
+    Image image;
 
-    if (image != null)
+    public SplashImage(Image todisplay)
     {
-      g.drawImage(image, 5, yoffset + 12, this);
+      image = todisplay;
+      setPreferredSize(new Dimension(image.getWidth(this) + 8,
+              image.getHeight(this)));
     }
 
-    int y = yoffset;
-
-    g.drawString("Jalview " + jalview.bin.Cache.getProperty("VERSION"), 50,
-            y);
-
-    FontMetrics fm = g.getFontMetrics();
-    int vwidth = fm.stringWidth("Jalview "
-            + jalview.bin.Cache.getProperty("VERSION"));
-    g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2));
-    g.drawString(
-            "Last updated: "
-                    + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
-            50 + vwidth + 5, y);
-    if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
-            "Checking"))
+    public void paintComponent(Graphics g)
     {
-      // Displayed when code version and jnlp version do not match
-      g.drawString("...Checking latest version...", 50, y += fontSize + 10);
-      y += 5;
+      g.setColor(Color.white);
+      g.fillRect(0, 0, getWidth(), getHeight());
       g.setColor(Color.black);
-    }
-    else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
-            .equals(jalview.bin.Cache.getProperty("VERSION")))
-    {
-      if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
-              .indexOf("automated build") == -1)
+      g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));
+
+      if (image != null)
       {
-        // Displayed when code version and jnlp version do not match and code
-        // version is not a development build
-        g.setColor(Color.red);
+        g.drawImage(image, 4, (getHeight() - image.getHeight(this)) / 2,
+                this);
       }
-      g.drawString(
-              "!! Jalview version "
-                      + jalview.bin.Cache.getDefault("LATEST_VERSION",
-                              "..Checking..")
-                      + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!",
-              50, y += fontSize + 10);
-      y += 5;
-      g.setColor(Color.black);
     }
-
-    g.setFont(new Font("Verdana", Font.BOLD, fontSize));
-    g.drawString(
-            "Authors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,",
-            50, y += fontSize + 4);
-    g.drawString("David Martin & Geoff Barton.", 60, y += fontSize + 4);
-    g.drawString(
-            "Development managed by The Barton Group, University of Dundee.",
-            50, y += fontSize + 4);
-    g.drawString("If  you use Jalview, please cite: ", 50,
-            y += fontSize + 4);
-    g.drawString(
-            "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",
-            50, y += fontSize + 4);
-    g.drawString(
-            "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",
-            50, y += fontSize + 4);
-    g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50,
-            y += fontSize + 4);
+    /*
+     * int y = yoffset;
+     * 
+     * g.drawString("Jalview " + jalview.bin.Cache.getProperty("VERSION"), 50,
+     * y);
+     * 
+     * FontMetrics fm = g.getFontMetrics(); int vwidth =
+     * fm.stringWidth("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
+     * g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2)); g.drawString(
+     * "Last updated: " + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
+     * 50 + vwidth + 5, y); if (jalview.bin.Cache.getDefault("LATEST_VERSION",
+     * "Checking").equals( "Checking")) { // Displayed when code version and
+     * jnlp version do not match g.drawString("...Checking latest version...",
+     * 50, y += fontSize + 10); y += 5; g.setColor(Color.black); } else if
+     * (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
+     * .equals(jalview.bin.Cache.getProperty("VERSION"))) { if
+     * (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+     * .indexOf("automated build") == -1) { // Displayed when code version and
+     * jnlp version do not match and code // version is not a development build
+     * g.setColor(Color.red); } g.drawString( "!! Jalview version " +
+     * jalview.bin.Cache.getDefault("LATEST_VERSION", "..Checking..") +
+     * " is available for download from "
+     * +jalview.bin.Cache.getDefault("www.jalview.org"
+     * ,"http://www.jalview.org")+" !!", 50, y += fontSize + 10); y += 5;
+     * g.setColor(Color.black); }
+     * 
+     * g.setFont(new Font("Verdana", Font.BOLD, fontSize)); g.drawString(
+     * "Authors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,"
+     * , 50, y += fontSize + 4); g.drawString("David Martin & Geoff Barton.",
+     * 60, y += fontSize + 4); g.drawString(
+     * "Development managed by The Barton Group, University of Dundee.", 50, y
+     * += fontSize + 4); g.drawString("If  you use Jalview, please cite: ", 50,
+     * y += fontSize + 4); g.drawString(
+     * "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+     * , 50, y += fontSize + 4); g.drawString(
+     * "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+     * , 50, y += fontSize + 4);
+     * g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50, y
+     * += fontSize + 4); }
+     */
   }
-}
+}
\ No newline at end of file
index 804dc0b..3ada67e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -188,12 +188,12 @@ public class TextColourChooser
 
   void setGroupTextColour()
   {
-    if (ap.av.alignment.getGroups() == null)
+    if (ap.av.getAlignment().getGroups() == null)
     {
       return;
     }
 
-    Vector groups = ap.av.alignment.getGroups();
+    Vector groups = ap.av.getAlignment().getGroups();
 
     for (int i = 0; i < groups.size(); i++)
     {
index 02be03f..b23fbc2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -125,7 +125,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         aps[a].av.setSelectionGroup(selected);
       }
 
-      selected.setEndRes(aps[a].av.alignment.getWidth() - 1);
+      selected.setEndRes(aps[a].av.getAlignment().getWidth() - 1);
       selected.addOrRemove(sequence, true);
     }
   }
@@ -851,7 +851,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         for (int a = 0; a < aps.length; a++)
         {
           aps[a].av.setSelectionGroup(null);
-          aps[a].av.alignment.deleteAllGroups();
+          aps[a].av.getAlignment().deleteAllGroups();
           aps[a].av.sequenceColours = null;
         }
         colourGroups();
@@ -901,7 +901,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         }
         else
         {
-          cs = ColourSchemeProperty.getColour(sequences, av.alignment
+          cs = ColourSchemeProperty.getColour(sequences, av.getAlignment()
                   .getWidth(), ColourSchemeProperty.getColourName(av
                   .getGlobalColourScheme()));
         }
@@ -914,7 +914,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
       }
 
       SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true,
-              false, 0, av.alignment.getWidth() - 1);
+              false, 0, av.getAlignment().getWidth() - 1);
 
       sg.setName("JTreeGroup:" + sg.hashCode());
       sg.setIdColour(col);
@@ -928,11 +928,11 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
                   sg.getStartRes(), sg.getEndRes());
 
           c.calculate();
-          c.verdict(false, aps[a].av.ConsPercGaps);
+          c.verdict(false, aps[a].av.getConsPercGaps());
           sg.cs.setConservation(c);
         }
 
-        aps[a].av.alignment.addGroup(sg);
+        aps[a].av.getAlignment().addGroup(sg);
       }
     }
     // notify the panel to redo any group specific stuff.
index d8253db..602ded6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -255,11 +255,11 @@ public class TreePanel extends GTreePanel
       {
         if (odata == null)
         {
-          tree = new NJTree(av.alignment.getSequencesArray(), newtree);
+          tree = new NJTree(av.getAlignment().getSequencesArray(), newtree);
         }
         else
         {
-          tree = new NJTree(av.alignment.getSequencesArray(), odata,
+          tree = new NJTree(av.getAlignment().getSequencesArray(), odata,
                   newtree);
         }
         if (!tree.hasOriginalSequenceData())
@@ -276,14 +276,14 @@ public class TreePanel extends GTreePanel
         if (av.getSelectionGroup() == null)
         {
           start = 0;
-          end = av.alignment.getWidth();
-          seqs = av.alignment.getSequencesArray();
+          end = av.getAlignment().getWidth();
+          seqs = av.getAlignment().getSequencesArray();
         }
         else
         {
           start = av.getSelectionGroup().getStartRes();
           end = av.getSelectionGroup().getEndRes() + 1;
-          seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+          seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
         }
 
         tree = new NJTree(seqs, seqStrings, type, pwtype, start, end);
@@ -570,7 +570,7 @@ public class TreePanel extends GTreePanel
     AlignmentSorter.sortByTree(av.getAlignment(), tree);
     CommandI undo;
     undo=new OrderCommand("Tree Sort", oldOrder,
-          av.alignment);
+          av.getAlignment());
 
     ap.paintAlignment(true);    
     return undo;
index 792ef7d..aefc9c8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 182ab1c..f06eaa6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 03b83cd..011f24e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 47e96b2..26c52c9 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index ba7f4f3..9f8a8a8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b199489..b9bd873 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -22,7 +22,7 @@ import jalview.gui.OptsAndParamsPage.ParamBox;
 import jalview.ws.jws2.JabaParamStore;
 import jalview.ws.jws2.JabaPreset;
 import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.ArgumentI;
 import jalview.ws.params.OptionI;
 import jalview.ws.params.ParamDatastoreI;
@@ -867,8 +867,8 @@ public class WsJobParameters extends JPanel implements ItemListener,
       e.printStackTrace();
       return;
     }
-    Jws2Discoverer.Jws2Instance lastserv = null;
-    for (Jws2Discoverer.Jws2Instance service : disc.getServices())
+    Jws2Instance lastserv = null;
+    for (Jws2Instance service : disc.getServices())
     {
       lastserv = service;
       if (p >= args.length || service.serviceType.equalsIgnoreCase(args[p]))
index f7d6bc4..9452ff5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e2482f6..7104fa9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
  */
 package jalview.gui;
 
+import jalview.bin.Cache;
+import jalview.jbgui.GWsPreferences;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.rest.RestServiceDescription;
+
 import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.net.URL;
 import java.util.Vector;
 
-import javax.swing.JCheckBox;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
+import javax.swing.JTable;
 import javax.swing.JTextField;
-
-import jalview.bin.Cache;
-import jalview.jbgui.GWsPreferences;
-import jalview.ws.rest.RestServiceDescription;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableCellRenderer;
 
 public class WsPreferences extends GWsPreferences
 {
 
+
   public WsPreferences()
   {
     super();
     initFromPreferences();
   }
 
-  Vector<String> wsUrls, oldUrls,rsbsUrls,oldRsbsUrls;
+  Vector<String> wsUrls, oldUrls, rsbsUrls, oldRsbsUrls;
 
   private boolean needWsMenuUpdate;
 
@@ -62,6 +69,8 @@ public class WsPreferences extends GWsPreferences
       oldUrls = null;
       wsUrls = new Vector<String>();
     }
+    wsList.setDefaultRenderer(Integer.class, new JabaWSStatusRenderer());
+    wsList.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
     updateList();
     rsbsUrls = jalview.ws.rest.RestClient.getRsbsDescriptions();
     if (rsbsUrls != null)
@@ -101,11 +110,109 @@ public class WsPreferences extends GWsPreferences
 
   };
 
-  private void updateList()
+  private void updateList() {
+    Object tdat[][] = new Object[wsUrls.size()][2];
+    int r=0;
+    for (String url : wsUrls)
+    {
+      int status = Jws2Discoverer.getDiscoverer().getServerStatusFor(url);
+      tdat[r][1]=new Integer(status);
+      tdat[r++][0]=url;
+    }
+    
+    wsList.setModel(new WsUrlTableModel(tdat));
+    wsList.getColumn("Status").setMinWidth(10);
+  }
+  private class JabaWSStatusRenderer extends JPanel implements TableCellRenderer
   {
-    wsList.setListData(wsUrls);
+    public JabaWSStatusRenderer()
+    {
+      setOpaque(true);
+      setMinimumSize(new Dimension(10,10));
+//      setText(" ");
+      
+    }
+    /**
+     * render an Integer reflecting service status as a colour and symbol
+     */
+
+    @Override
+    public Component getTableCellRendererComponent(JTable arg0,
+            Object status, boolean isSelected, boolean hasFocus, int row, int column)
+    {
+      Color c;
+      String t=new String("");
+      switch (((Integer) status).intValue())
+      {
+      case 1:
+//        cb.setSelected(true);
+        //cb.setBackground(
+        c=Color.green;
+        break;
+      case 0:
+//        cb.setSelected(true);
+//        cb.setBackground(
+        c=Color.lightGray;
+        break;
+      case -1:
+        //cb.setSelected(false);
+        //cb.setBackground(
+        c=Color.red;
+        break;
+      default:
+        //cb.setSelected(false);
+        //cb.setBackground(
+        c=Color.orange;
+      }
+      setBackground(c);
+      //setText(t);
+      return this;
+      
+    }
+
   }
+  private class WsUrlTableModel extends AbstractTableModel {
+    
+    private Object[][] data;
+    public WsUrlTableModel(Object[][] tdat)
+    {
+      this.data=tdat;
+    }
 
+    @Override
+    public int getColumnCount()
+    {
+      return 2;
+    }
+    @Override
+    public String getColumnName(int column)
+    {
+      if (column==1)
+      {
+        return "Status";
+      }
+      return "Service URL";
+    }
+    @Override
+    public int getRowCount()
+    {
+      if (data==null)
+      {
+        return 0;
+      }
+      return data.length;
+    }
+    @Override
+    public java.lang.Class<?> getColumnClass(int columnIndex) {
+      return getValueAt(0, columnIndex).getClass();
+    };
+    @Override
+    public Object getValueAt(int rowIndex, int columnIndex)
+    {
+      return data[rowIndex][columnIndex];
+    }
+    
+  }
   private void updateRsbsList()
   {
     sbrsList.setListData(rsbsUrls);
@@ -131,7 +238,7 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void deleteWsUrl_actionPerformed(ActionEvent e)
   {
-    int sel = wsList.getSelectedIndex();
+    int sel = wsList.getSelectedRow();
     if (sel > -1)
     {
       wsUrls.removeElementAt(sel);
@@ -149,7 +256,7 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void editWsUrl_actionPerformed(ActionEvent e)
   {
-    int sel = wsList.getSelectedIndex();
+    int sel = wsList.getSelectedRow();
     if (sel > -1)
     {
       String url = editUrl(wsUrls.elementAt(sel), "Edit JABAWS URL");
@@ -173,37 +280,44 @@ public class WsPreferences extends GWsPreferences
       }
     }
   }
+
   @Override
   protected void newSbrsUrl_actionPerformed(ActionEvent e)
   {
     RestServiceEditorPane rse = new RestServiceEditorPane();
     rse.showDialog("Add a new Simple Bioinformatics Rest Service");
     String rservice = rse.getEditedRestService();
-    if (rservice!=null && !rsbsUrls.contains(rservice))
+    if (rservice != null && !rsbsUrls.contains(rservice))
     {
       rsbsUrls.add(rservice);
       update++;
       updateRsbsList();
     }
   }
+
   @Override
   protected void editSbrsUrl_actionPerformed(ActionEvent e)
   {
     int sel = sbrsList.getSelectedIndex();
     if (sel > -1)
     {
-      RestServiceEditorPane rse = new RestServiceEditorPane(new RestServiceDescription(rsbsUrls.elementAt(sel)));
+      RestServiceEditorPane rse = new RestServiceEditorPane(
+              new RestServiceDescription(rsbsUrls.elementAt(sel)));
       rse.showDialog("Edit Simple Bioinformatics Rest Service entry");
       String rservice = rse.getEditedRestService();
-      if (rservice!=null)
+      if (rservice != null)
       {
         int present = rsbsUrls.indexOf(rservice);
-        if (present==-1) {
+        if (present == -1)
+        {
           update++;
-          rsbsUrls.setElementAt(rservice,sel);
+          rsbsUrls.setElementAt(rservice, sel);
           updateRsbsList();
-        } else {
-          if (present!=sel) {
+        }
+        else
+        {
+          if (present != sel)
+          {
             rsbsUrls.removeElementAt(sel);
             update++;
             updateRsbsList();
@@ -212,17 +326,21 @@ public class WsPreferences extends GWsPreferences
       }
     }
   }
-  
+
   void updateWsMenuConfig(boolean old)
   {
     if (old)
     {
-      if (oldUrls!=wsUrls || (wsUrls!=null && oldUrls!=null && !wsUrls.equals(oldUrls)))
+      if (oldUrls != wsUrls
+              || (wsUrls != null && oldUrls != null && !wsUrls
+                      .equals(oldUrls)))
       {
         update++;
       }
       wsUrls = (oldUrls == null) ? null : new Vector(oldUrls);
-      if (oldRsbsUrls!=rsbsUrls || (rsbsUrls!=null && oldRsbsUrls!=null && !oldRsbsUrls.equals(rsbsUrls)))
+      if (oldRsbsUrls != rsbsUrls
+              || (rsbsUrls != null && oldRsbsUrls != null && !oldRsbsUrls
+                      .equals(rsbsUrls)))
       {
         update++;
       }
@@ -249,9 +367,12 @@ public class WsPreferences extends GWsPreferences
             "WSMENU_BYTYPE",
             Boolean.valueOf(old ? oldIndexByType : indexByType.isSelected())
                     .toString());
-    
-    Cache.setProperty("SHOW_WSDISCOVERY_ERRORS",
-            Boolean.valueOf(old ? oldWsWarning : displayWsWarning.isSelected()).toString());
+
+    Cache.setProperty(
+            "SHOW_WSDISCOVERY_ERRORS",
+            Boolean.valueOf(
+                    old ? oldWsWarning : displayWsWarning.isSelected())
+                    .toString());
     updateServiceList();
     updateRsbsServiceList();
   }
@@ -266,14 +387,14 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void moveWsUrlDown_actionPerformed(ActionEvent e)
   {
-    int p = wsList.getSelectedIndex();
+    int p = wsList.getSelectedRow();
     if (p > -1 && p < wsUrls.size() - 1)
     {
       String t = wsUrls.get(p + 1);
       wsUrls.setElementAt(wsUrls.elementAt(p), p + 1);
       wsUrls.setElementAt(t, p);
       updateList();
-      wsList.setSelectedIndex(p + 1);
+      wsList.getSelectionModel().setSelectionInterval(p+1,p + 1);
       update++;
     }
   }
@@ -288,14 +409,14 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void moveWsUrlUp_actionPerformed(ActionEvent e)
   {
-    int p = wsList.getSelectedIndex();
+    int p = wsList.getSelectedRow();
     if (p > 0)
     {
       String t = wsUrls.get(p - 1);
       wsUrls.setElementAt(wsUrls.elementAt(p), p - 1);
       wsUrls.setElementAt(t, p);
       updateList();
-      wsList.setSelectedIndex(p - 1);
+      wsList.getSelectionModel().setSelectionInterval(p-1,p - 1);
       update++;
     }
   }
@@ -326,9 +447,9 @@ public class WsPreferences extends GWsPreferences
         // TODO: do a better job of checking that the url is a valid discovery
         // URL for web services.
         String tx = urltf.getText().trim();
-        while (tx.length()>0 && tx.lastIndexOf('/')==tx.length()-1)
+        while (tx.length() > 0 && tx.lastIndexOf('/') == tx.length() - 1)
         {
-          tx = tx.substring(0, tx.length()-1);
+          tx = tx.substring(0, tx.length() - 1);
         }
         foo = new URL(tx);
         valid = true;
@@ -384,7 +505,7 @@ public class WsPreferences extends GWsPreferences
     {
       if (!wsUrls.contains(url))
       {
-        int selind = wsList.getSelectedIndex();
+        int selind = wsList.getSelectedRow();
         if (selind > -1)
         {
           wsUrls.insertElementAt(url, selind);
@@ -446,6 +567,8 @@ public class WsPreferences extends GWsPreferences
             lastrefresh = update;
             Desktop.instance.startServiceDiscovery(true); // wait around for all
                                                           // threads to complete
+            updateList();
+
           }
           progressBar.setIndeterminate(false);
           progressBar.setVisible(false);
@@ -468,6 +591,7 @@ public class WsPreferences extends GWsPreferences
           {
             lastrefresh = update;
             Desktop.instance.startServiceDiscovery(true);
+            updateList();
           }
           Desktop.instance.setProgressBar(null, ct);
         }
@@ -493,12 +617,13 @@ public class WsPreferences extends GWsPreferences
   {
     jalview.ws.jws2.Jws2Discoverer.setServiceUrls(null);
     Vector nwsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls();
-    if (!wsUrls.equals(nwsUrls)) {
+    if (!wsUrls.equals(nwsUrls))
+    {
       update++;
     }
-    wsUrls=nwsUrls;
+    wsUrls = nwsUrls;
     updateList();
-    
+
     updateAndRefreshWsMenuConfig(true);
   }
 
index 64f8399..373a918 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ad834be..a4fb830 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -127,7 +127,17 @@ public abstract class AlignFile extends FileParse
     addProperties(al);
     for (int i = 0; i < annotations.size(); i++)
     {
-      al.addAnnotation((AlignmentAnnotation) annotations.elementAt(i));
+      // detect if annotations.elementAt(i) rna secondary structure
+      // if so then do:
+      /*
+       * SequenceFeature[] pairArray =
+       * Rna.GetBasePairsFromAlignmentAnnotation(annotations.elementAt(i));
+       * Rna.HelixMap(pairArray);
+       */
+      AlignmentAnnotation an = (AlignmentAnnotation) annotations
+              .elementAt(i);
+      an.validateRangeAndDisplay();
+      al.addAnnotation(an);
     }
 
   }
index 9bb6ea9..14cc9c4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 69926b5..5266d08 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -1018,7 +1018,7 @@ public class AnnotationFile
         }\r
       }\r
       if (hasSymbols\r
-              && (token.equals("H") || token.equals("E") || token\r
+              && (token.equals("H") || token.equals("E") || token.equals("S") || token\r
                       .equals(" ")))\r
       {\r
         // Either this character represents a helix or sheet\r
@@ -1343,7 +1343,7 @@ public class AnnotationFile
                   sg.getStartRes(), sg.getEndRes() + 1);\r
 \r
           c.calculate();\r
-          c.verdict(false, 25);\r
+          c.verdict(false, 25); // TODO: refer to conservation percent threshold\r
 \r
           sg.cs.setConservation(c);\r
 \r
index 635c801..0709a2f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -67,7 +67,7 @@ public class AppletFormatAdapter
    */
   public static final String[] READABLE_EXTENSIONS = new String[]
   { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
-      "sto" }; // ,
+      "sto,stk" }; // ,
 
   // ".blast"
   // };
index 7b080a4..03b2edf 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9f32c70..a134cbb 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 6a36078..8c0cac1 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -49,7 +49,9 @@ 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 tempseq;
@@ -60,6 +62,10 @@ public class ClustalFile extends AlignFile
     {
       while ((line = nextLine()) != null)
       {
+        if (line.length()==0)
+        {
+          top=true;
+        }
         if (line.indexOf(" ") != 0)
         {
           str = new StringTokenizer(line, " ");
@@ -95,6 +101,7 @@ public class ClustalFile extends AlignFile
                 {
                   tempseq.append(str.nextToken());
                 }
+                top=false;
               }
             }
           }
@@ -102,6 +109,16 @@ public class ClustalFile extends AlignFile
           {
             flag = true;
           }
+        } else {
+          if (line.matches("\\s+(-|\\.|\\(|\\[|\\]|\\))+"))
+          {
+            if (top)
+            {
+              pssecstr.append(line.trim());
+            } else {
+              consstr.append(line.trim());
+            }
+          }
         }
       }
     } catch (IOException e)
@@ -139,12 +156,30 @@ public class ClustalFile extends AlignFile
                           + headers.elementAt(i));
         }
       }
+      AlignmentAnnotation lastssa=null;
+      if (pssecstr.length()==maxLength)
+      {
+        Vector ss=new Vector();
+        AlignmentAnnotation ssa=lastssa=StockholmFile.parseAnnotationRow(ss, "secondary structure", pssecstr.toString());
+        ssa.label="Secondary Structure";
+        annotations.addElement(ssa);
+      }
+      if (consstr.length()==maxLength)
+      {
+        Vector ss=new Vector();
+        AlignmentAnnotation ssa=StockholmFile.parseAnnotationRow(ss, "secondary structure", consstr.toString());
+        ssa.label="Consensus Secondary Structure";
+        if (lastssa==null || !lastssa.getRNAStruc().equals(ssa.getRNAStruc().replace('-', '.')))
+        {
+          annotations.addElement(ssa);
+        }
+      }
     }
   }
-
   public String print()
   {
     return print(getSeqsAsArray());
+    // TODO: locaRNA style aln output
   }
 
   public String print(SequenceI[] s)
index f2df79a..0249a32 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1f51f44..3b74855 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8664cba..2ac0e13 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index cbdfc6f..0e098aa 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 718eab3..05a7212 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 643e971..81460eb 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e06acec..6be11a8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7313043..7c5223c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 59a010d..396847d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7f0bab1..b128997 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -80,12 +80,11 @@ public class JalviewFileChooser extends JFileChooser
     // SelectAllFilter needs to be set first before adding further
     // file filters to fix bug on Mac OSX
     setAcceptAllFileFilterUsed(selectAll);
-
+    
     for (int i = 0; i < suffix.length; i++)
     {
       JalviewFileFilter jvf = new JalviewFileFilter(suffix[i], desc[i]);
       addChoosableFileFilter(jvf);
-
       if ((selected != null) && selected.equalsIgnoreCase(desc[i]))
       {
         chosen = jvf;
index 4fa2ae8..fad3dab 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 82d0061..a4db9f4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7c6c61d..7252e5d 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7c2e1b2..6b584a8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 11463ce..1aa87a5 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 21b2aaf..3b58519 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5fdcc01..769f9bd 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 571248a..07dc6b5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b5415a3..f74a15a 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index bb55e02..571c469 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2f4f2e2..ec1cbd0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1625241..6b60cd5 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -25,6 +25,7 @@ import java.util.*;
 \r
 import com.stevesoft.pat.*;\r
 import jalview.datamodel.*;\r
+import jalview.analysis.Rna;\r
 \r
 // import org.apache.log4j.*;\r
 \r
@@ -82,6 +83,9 @@ public class StockholmFile extends AlignFile
     Hashtable seqs = new Hashtable();\r
     Regex p, r, rend, s, x;\r
 \r
+    // Temporary line for processing RNA annotation\r
+    // String RNAannot = "";\r
+\r
     // ------------------ Parsing File ----------------------\r
     // First, we have to check that this file has STOCKHOLM format, i.e. the\r
     // first line must match\r
@@ -105,11 +109,20 @@ public class StockholmFile extends AlignFile
     r = new Regex("#=(G[FSRC]?)\\s+(.*)"); // Finds any annotation line\r
     x = new Regex("(\\S+)\\s+(\\S+)"); // split id from sequence\r
 \r
+    // Convert all bracket types to parentheses (necessary for passing to VARNA)\r
+    Regex openparen = new Regex("(<|\\[)", "(");\r
+    Regex closeparen = new Regex("(>|\\])", ")");\r
+\r
+    // Detect if file is RNA by looking for bracket types\r
+    Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
+\r
     rend.optimize();\r
     p.optimize();\r
     s.optimize();\r
     r.optimize();\r
     x.optimize();\r
+    openparen.optimize();\r
+    closeparen.optimize();\r
 \r
     while ((line = nextLine()) != null)\r
     {\r
@@ -136,12 +149,16 @@ public class StockholmFile extends AlignFile
           int start = 1;\r
           int end = -1;\r
           String sid = acc;\r
-          // Retrieve hash of annotations for this accession\r
+          /*\r
+           * Retrieve hash of annotations for this accession\r
+           * Associate Annotation with accession\r
+           */\r
           Hashtable accAnnotations = null;\r
 \r
           if (seqAnn != null && seqAnn.containsKey(acc))\r
           {\r
             accAnnotations = (Hashtable) seqAnn.remove(acc);\r
+            //TODO: add structures to sequence\r
           }\r
 \r
           // Split accession in id and from/to\r
@@ -171,7 +188,19 @@ public class StockholmFile extends AlignFile
               jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);\r
               // seqO.addDBRef(dbref);\r
             }\r
+          }        \r
+          if (accAnnotations != null && accAnnotations.containsKey("SS"))\r
+          {\r
+                 Vector v = (Vector) accAnnotations.get("SS");\r
+                 \r
+                 for (int i = 0; i < v.size(); i++)\r
+                   {\r
+                         AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i);\r
+                         seqO.addAlignmentAnnotation(an);\r
+                         //annotations.add(an);\r
+                   }\r
           }\r
+        \r
           Hashtable features = null;\r
           // We need to adjust the positions of all features to account for gaps\r
           try\r
@@ -413,7 +442,7 @@ public class StockholmFile extends AlignFile
               ann = new Hashtable();\r
               seqAnn.put(acc, ann);\r
             }\r
-\r
+            //TODO test structure, call parseAnnotationRow with vector from hashtable for specific sequence\r
             Hashtable features;\r
             // Get an object with all the content for an annotation\r
             if (ann.containsKey("features"))\r
@@ -448,6 +477,24 @@ public class StockholmFile extends AlignFile
             }\r
             ns += seq;\r
             content.put(description, ns);\r
+
+            if(type.equals("SS")){\r
+                Hashtable strucAnn;\r
+                if (seqAnn.containsKey(acc))\r
+                {\r
+                  strucAnn = (Hashtable) seqAnn.get(acc);\r
+                }\r
+                else\r
+                {\r
+                  strucAnn = new Hashtable();\r
+                }\r
+                \r
+                Vector newStruc=new Vector();\r
+                parseAnnotationRow(newStruc, type,ns);\r
+                \r
+                strucAnn.put(type, newStruc);\r
+                seqAnn.put(acc, strucAnn);\r
+             }\r
           }\r
           else\r
           {\r
@@ -474,9 +521,22 @@ public class StockholmFile extends AlignFile
     }\r
   }\r
 \r
-  private AlignmentAnnotation parseAnnotationRow(Vector annotation,\r
+  protected static AlignmentAnnotation parseAnnotationRow(Vector annotation,\r
           String label, String annots)\r
   {\r
+    String convert1, convert2 = null;\r
+\r
+    // Convert all bracket types to parentheses\r
+    Regex openparen = new Regex("(<|\\[)", "(");\r
+    Regex closeparen = new Regex("(>|\\])", ")");\r
+\r
+    // Detect if file is RNA by looking for bracket types\r
+    Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
+\r
+    convert1 = openparen.replaceAll(annots);\r
+    convert2 = closeparen.replaceAll(convert1);\r
+    annots = convert2;\r
+\r
     String type = (label.indexOf("_cons") == label.length() - 5) ? label\r
             .substring(0, label.length() - 5) : label;\r
     boolean ss = false;\r
@@ -495,8 +555,17 @@ public class StockholmFile extends AlignFile
       // be written out\r
       if (ss)\r
       {\r
-        ann.secondaryStructure = jalview.schemes.ResidueProperties\r
-                .getDssp3state(pos).charAt(0);\r
+        if (detectbrackets.search(pos))\r
+        {\r
+          ann.secondaryStructure = jalview.schemes.ResidueProperties\r
+                  .getRNASecStrucState(pos).charAt(0);\r
+        }\r
+        else\r
+        {\r
+          ann.secondaryStructure = jalview.schemes.ResidueProperties\r
+                  .getDssp3state(pos).charAt(0);\r
+        }\r
+\r
         if (ann.secondaryStructure == pos.charAt(0) || pos.charAt(0) == 'C')\r
         {\r
           ann.displayCharacter = ""; // null; // " ";\r
@@ -531,6 +600,7 @@ public class StockholmFile extends AlignFile
               annot.annotations.length);\r
       System.arraycopy(els, 0, anns, annot.annotations.length, els.length);\r
       annot.annotations = anns;\r
+      //System.out.println("else: ");\r
     }\r
     return annot;\r
   }\r
@@ -570,7 +640,7 @@ public class StockholmFile extends AlignFile
     }\r
   }\r
 \r
-  private String id2type(String id)\r
+  protected static String id2type(String id)\r
   {\r
     if (typeIds.containsKey(id))\r
     {\r
@@ -580,4 +650,38 @@ public class StockholmFile extends AlignFile
             + id);\r
     return id;\r
   }\r
+  /**\r
+   * //ssline is complete secondary structure line private AlignmentAnnotation\r
+   * addHelices(Vector annotation, String label, String ssline) {\r
+   * \r
+   * // decide on secondary structure or not. Annotation[] els = new\r
+   * Annotation[ssline.length()]; for (int i = 0; i < ssline.length(); i++) {\r
+   * String pos = ssline.substring(i, i + 1); Annotation ann; ann = new\r
+   * Annotation(pos, "", ' ', 0f); // 0f is 'valid' null - will not\r
+   * \r
+   * ann.secondaryStructure =\r
+   * jalview.schemes.ResidueProperties.getRNAssState(pos).charAt(0);\r
+   * \r
+   * ann.displayCharacter = "x" + ann.displayCharacter;\r
+   * \r
+   * System.out.println(ann.displayCharacter);\r
+   * \r
+   * els[i] = ann; } AlignmentAnnotation helicesAnnot = null; Enumeration e =\r
+   * annotation.elements(); while (e.hasMoreElements()) { helicesAnnot =\r
+   * (AlignmentAnnotation) e.nextElement(); if (helicesAnnot.label.equals(type))\r
+   * break; helicesAnnot = null; } if (helicesAnnot == null) { helicesAnnot =\r
+   * new AlignmentAnnotation(type, type, els);\r
+   * annotation.addElement(helicesAnnot); } else { Annotation[] anns = new\r
+   * Annotation[helicesAnnot.annotations.length + els.length];\r
+   * System.arraycopy(helicesAnnot.annotations, 0, anns, 0,\r
+   * helicesAnnot.annotations.length); System.arraycopy(els, 0, anns,\r
+   * helicesAnnot.annotations.length, els.length); helicesAnnot.annotations =\r
+   * anns; }\r
+   * \r
+   * helicesAnnot.features = Rna.GetBasePairs(ssline);\r
+   * Rna.HelixMap(helicesAnnot.features);\r
+   * \r
+   * \r
+   * return helicesAnnot; }\r
+   */\r
 }\r
index 8228239..fb6465c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f4569dc..cae1f1b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b3e8b3d..5c867c8 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index bb70274..95de89d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1b760df..b611d5e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 879c64f..4374bd4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e57942b..d15ceb3 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1a5a1ea..365f8a8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f00426a..8b23e4c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 218aa5b..899a3ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1ff29af..7cdbe58 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2fd2333..7914797 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f69db60..0dedee3 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 2174553..ec2a407 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index eab51f0..5fdd0c9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 93b35e5..4e337ff 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index d064790..de3d29e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b069dee..8a9e7d8 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 93731a9..326c259 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f6742b7..c62d48d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index fbb179f..581c3f9 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6253e36..7ea492f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -113,6 +113,13 @@ public class GAlignFrame extends JInternalFrame
 
   protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
 
+  protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
+
+  protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
+  // protected JRadioButtonMenuItem covariationColour = new
+  // JRadioButtonMenuItem();
+
   JMenuItem njTreeBlosumMenuItem = new JMenuItem();
 
   JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem();
@@ -149,8 +156,6 @@ public class GAlignFrame extends JInternalFrame
 
   public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
 
-  protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
-
   JMenuItem deleteGroups = new JMenuItem();
 
   JMenuItem delete = new JMenuItem();
@@ -211,12 +216,14 @@ public class GAlignFrame extends JInternalFrame
 
   protected JMenu showProducts = new JMenu();
 
-  public JMenuItem featureSettings = new JMenuItem();
+  public JMenuItem openFeatureSettings = new JMenuItem();
 
   JMenuItem fetchSequence = new JMenuItem();
 
   JMenuItem annotationColour = new JMenuItem();
 
+  protected JMenuItem rnahelicesColour = new JMenuItem();
+
   JMenuItem associatedData = new JMenuItem();
 
   protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
@@ -307,6 +314,8 @@ public class GAlignFrame extends JInternalFrame
 
   protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
 
+  protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
+
   protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
 
   private JMenuItem grpsFromSelection = new JMenuItem();
@@ -417,6 +426,8 @@ public class GAlignFrame extends JInternalFrame
     colours.add(PIDColour);
     colours.add(BLOSUM62Colour);
     colours.add(nucleotideColour);
+    colours.add(purinePyrimidineColour);
+    // colours.add(covariationColour);
 
     setColourSelected(jalview.bin.Cache
             .getDefault("DEFAULT_COLOUR", "None"));
@@ -487,6 +498,16 @@ public class GAlignFrame extends JInternalFrame
 
         break;
 
+      case ColourSchemeProperty.PURINEPYRIMIDINE:
+        purinePyrimidineColour.setSelected(true);
+
+        break;
+      /*
+       * case ColourSchemeProperty.COVARIATION:
+       * covariationColour.setSelected(true);
+       * 
+       * break;
+       */
       case ColourSchemeProperty.USER_DEFINED:
         userDefinedColour.setSelected(true);
 
@@ -850,6 +871,31 @@ public class GAlignFrame extends JInternalFrame
         BLOSUM62Colour_actionPerformed(e);
       }
     });
+    nucleotideColour.setText("Nucleotide");
+    nucleotideColour.addActionListener(new java.awt.event.ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        nucleotideColour_actionPerformed(e);
+      }
+    });
+
+    purinePyrimidineColour.setText("Purine/Pyrimidine");
+    purinePyrimidineColour
+            .addActionListener(new java.awt.event.ActionListener()
+            {
+              public void actionPerformed(ActionEvent e)
+              {
+                purinePyrimidineColour_actionPerformed(e);
+              }
+            });
+    /*
+     * covariationColour.setText("Covariation");
+     * covariationColour.addActionListener(new java.awt.event.ActionListener() {
+     * public void actionPerformed(ActionEvent e) {
+     * covariationColour_actionPerformed(e); } });
+     */
+
     avDistanceTreeBlosumMenuItem.setText("Average Distance Using BLOSUM62");
     avDistanceTreeBlosumMenuItem
             .addActionListener(new java.awt.event.ActionListener()
@@ -1069,6 +1115,16 @@ public class GAlignFrame extends JInternalFrame
       }
 
     });
+    normaliseSequenceLogo.setText("Normalise Consensus Logo");
+    normaliseSequenceLogo.addActionListener(new ActionListener()
+    {
+
+      public void actionPerformed(ActionEvent e)
+      {
+        normaliseSequenceLogo_actionPerformed(e);
+      }
+
+    });
     applyAutoAnnotationSettings.setText("Apply to all groups");
     applyAutoAnnotationSettings.setState(false);
     applyAutoAnnotationSettings.setVisible(true);
@@ -1364,8 +1420,8 @@ public class GAlignFrame extends JInternalFrame
      * public void actionPerformed(ActionEvent e) {
      * showProducts_actionPerformed(e); } });
      */
-    featureSettings.setText("Feature Settings...");
-    featureSettings.addActionListener(new ActionListener()
+    openFeatureSettings.setText("Feature Settings...");
+    openFeatureSettings.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
@@ -1389,6 +1445,16 @@ public class GAlignFrame extends JInternalFrame
         annotationColour_actionPerformed(e);
       }
     });
+
+    rnahelicesColour.setText("By RNA helices");
+    rnahelicesColour.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        rnahelicesColour_actionPerformed(e);
+      }
+    });
+
     associatedData.setText("Load Features / Annotations");
     associatedData.addActionListener(new ActionListener()
     {
@@ -1729,6 +1795,7 @@ public class GAlignFrame extends JInternalFrame
     autoAnnMenu.add(applyAutoAnnotationSettings);
     autoAnnMenu.add(showConsensusHistogram);
     autoAnnMenu.add(showSequenceLogo);
+    autoAnnMenu.add(normaliseSequenceLogo);
     autoAnnMenu.addSeparator();
     autoAnnMenu.add(showGroupConservation);
     autoAnnMenu.add(showGroupConsensus);
@@ -1737,7 +1804,7 @@ public class GAlignFrame extends JInternalFrame
     viewMenu.add(showSeqFeatures);
     // viewMenu.add(showSeqFeaturesHeight);
 
-    viewMenu.add(featureSettings);
+    viewMenu.add(openFeatureSettings);
     tooltipSettingsMenu.add(showDbRefsMenuitem);
     tooltipSettingsMenu.add(showNpFeatsMenuitem);
     viewMenu.add(tooltipSettingsMenu);
@@ -1760,6 +1827,8 @@ public class GAlignFrame extends JInternalFrame
     colourMenu.add(turnColour);
     colourMenu.add(buriedColour);
     colourMenu.add(nucleotideColour);
+    colourMenu.add(purinePyrimidineColour);
+    // colourMenu.add(covariationColour);
     colourMenu.add(userDefinedColour);
     colourMenu.addSeparator();
     colourMenu.add(conservationMenuItem);
@@ -1767,6 +1836,7 @@ public class GAlignFrame extends JInternalFrame
     colourMenu.add(abovePIDThreshold);
     colourMenu.add(modifyPID);
     colourMenu.add(annotationColour);
+    colourMenu.add(rnahelicesColour);
     calculateMenu.add(sort);
     calculateMenu.add(calculateTree);
     calculateMenu.addSeparator();
@@ -1837,6 +1907,12 @@ public class GAlignFrame extends JInternalFrame
     //selectMenu.add(listenToViewSelections);
   }
 
+  protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
+  {
+    // TODO Auto-generated method stub
+    
+  }
+
   protected void listenToViewSelections_actionPerformed(ActionEvent e)
   {
     // TODO Auto-generated method stub
@@ -2141,6 +2217,14 @@ public class GAlignFrame extends JInternalFrame
   {
   }
 
+  protected void purinePyrimidineColour_actionPerformed(ActionEvent e)
+  {
+  }
+
+  /*
+   * protected void covariationColour_actionPerformed(ActionEvent e) { }
+   */
+
   protected void noColourmenuItem_actionPerformed(ActionEvent e)
   {
   }
@@ -2293,6 +2377,11 @@ public class GAlignFrame extends JInternalFrame
 
   }
 
+  public void rnahelicesColour_actionPerformed(ActionEvent e)
+  {
+
+  }
+
   public void associatedData_actionPerformed(ActionEvent e)
   {
 
index bcab09f..fc66218 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5024fc2..05759cd 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f2fc849..69bba49 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index d7e8be3..16fe9a9 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 78ae0a8..dd749e3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3352e42..2035be7 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 843a4ec..62234bf 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index dc0d511..6f8c8d2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 29e11ce..64bcf5c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f389430..4173b03 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index de35733..e964a22 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
diff --git a/src/jalview/jbgui/GRnaStructureViewer.java b/src/jalview/jbgui/GRnaStructureViewer.java
new file mode 100644 (file)
index 0000000..8c7f1f2
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.jbgui;
+
+import javax.swing.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+public class GRnaStructureViewer extends JInternalFrame
+{
+  public GRnaStructureViewer()
+  {
+    try
+    {
+      jbInit();
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    }
+  }
+
+  private void jbInit() throws Exception
+  {
+   
+  }
+  
+}
index c8c5a5d..f15b4bf 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8cd67db..82acc2c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 28d2c7a..b1b5200 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -164,6 +164,15 @@ public class GStructureViewer extends JInternalFrame
         buriedColour_actionPerformed(actionEvent);
       }
     });
+    purinePyrimidineColour.setText("Purine/Pyrimidine");
+    purinePyrimidineColour.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent actionEvent)
+      {
+         purinePyrimidineColour_actionPerformed(actionEvent);
+      }
+    });
+    
     userColour.setText("User Defined ...");
     userColour.addActionListener(new ActionListener()
     {
@@ -224,6 +233,7 @@ public class GStructureViewer extends JInternalFrame
     colourMenu.add(strandColour);
     colourMenu.add(turnColour);
     colourMenu.add(buriedColour);
+    colourMenu.add(purinePyrimidineColour);
     colourMenu.add(userColour);
     colourMenu.add(jmolColour);
     colourMenu.add(backGround);
@@ -300,6 +310,9 @@ public class GStructureViewer extends JInternalFrame
   protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
 
   protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
+  
+  protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+  
 
   protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
 
@@ -380,6 +393,11 @@ public class GStructureViewer extends JInternalFrame
   {
 
   }
+  
+  public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
+  {
+
+  }
 
   public void userColour_actionPerformed(ActionEvent actionEvent)
   {
index 53c1248..4d847c0 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 06b57db..2c10974 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b76e48e..5d6b6eb 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d94b047..4e855af 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -36,8 +36,8 @@ import javax.swing.JPanel;
 import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
+import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
-import javax.swing.SwingConstants;
 import javax.swing.border.TitledBorder;
 
 /**
@@ -58,8 +58,9 @@ public class GWsPreferences extends JPanel
 
   protected JButton deleteSbrsUrl = new JButton();
 
-  protected JList wsList = new JList();
-
+  // Web service status and url table
+  protected JTable wsList=new JTable();
+  
   protected TitledBorder wsListTitleBorder = new TitledBorder(
           "Web Service Discovery URLS");
 
@@ -288,11 +289,12 @@ public class GWsPreferences extends JPanel
     progressBar.setString("");
     wsListUrlPanel.setBorder(BorderFactory.createEtchedBorder());
     wsListUrlPanel.setLayout(new BorderLayout());
-    // wsListUrlPanel.setPreferredSize(new Dimension(482,202));
     wsListPane.setBorder(BorderFactory.createEtchedBorder());
     wsListPane.getViewport().add(wsList);
-    // wsListPane.setPreferredSize(new Dimension(380, 80));
+    wsList.setPreferredSize(new Dimension(482,202));
+    wsListPane.setPreferredSize(new Dimension(380, 80));
     wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+    wsList.setColumnSelectionAllowed(false);
     wsList.addMouseListener(new MouseListener()
     {
 
@@ -325,13 +327,11 @@ public class GWsPreferences extends JPanel
       }
 
     });
-    // wsListButtons.setPreferredSize(new Dimension(480, 60));
     wsListButtons.setLayout(new FlowLayout());
-    // wsListButtons.add(moveWsUrlUp);
-    // wsListButtons.add(moveWsUrlDown);
     wsListButtons.add(newWsUrl);
     wsListButtons.add(editWsUrl);
     wsListButtons.add(deleteWsUrl);
+    wsListButtons.setMinimumSize(new Dimension(350,80));
     wsListNavButs.setSize(new Dimension(80, 80));
     wsListNavButs.setPreferredSize(new Dimension(80, 80));
     wsListNavButs.setLayout(new FlowLayout());
@@ -348,7 +348,6 @@ public class GWsPreferences extends JPanel
     srbsListUrlPanel.setLayout(new BorderLayout());
     srbsListPane.setBorder(BorderFactory.createEtchedBorder());
     srbsListPane.getViewport().add(sbrsList);
-    //srbsListPane.setMinimumSize(new Dimension(380, 80));
     sbrsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     sbrsList.addMouseListener(new MouseListener()
     {
index bb55ed6..b6e77ed 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1af539b..614c70a 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java
new file mode 100644 (file)
index 0000000..d063c5b
--- /dev/null
@@ -0,0 +1,971 @@
+package jalview.renderer;
+
+import jalview.analysis.AAFrequency;
+import jalview.analysis.StructureFrequency;
+import jalview.api.AlignViewportI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.schemes.ColourSchemeI;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.font.LineMetrics;
+import java.awt.geom.AffineTransform;
+import java.awt.image.ImageObserver;
+import java.util.Hashtable;
+
+import com.stevesoft.pat.Regex;
+
+public class AnnotationRenderer
+{
+
+  public AnnotationRenderer()
+  {
+    // TODO Auto-generated constructor stub
+  }
+
+  public void drawStemAnnot(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+  {
+    g.setColor(STEM_COLOUR);
+    int sCol = (lastSSX / charWidth) + startRes;
+    int x1 = lastSSX;
+    int x2 = (x * charWidth);
+    Regex closeparen = new Regex("(\\))");
+  
+    String dc = (column == 0 || row.annotations[column-1]==null) ? ""
+            : row.annotations[column - 1].displayCharacter;
+  
+    boolean diffupstream = sCol == 0 || row.annotations[sCol - 1] == null
+            || !dc.equals(row.annotations[sCol - 1].displayCharacter);
+    boolean diffdownstream = !validRes || !validEnd
+            || row.annotations[column] == null
+            || !dc.equals(row.annotations[column].displayCharacter);
+    // System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream);
+    // If a closing base pair half of the stem, display a backward arrow
+    if (column > 0 && closeparen.search(dc))
+    {
+      if (diffupstream)
+      // if (validRes && column>1 && row.annotations[column-2]!=null &&
+      // dc.equals(row.annotations[column-2].displayCharacter))
+      {
+        g.fillPolygon(new int[]
+        { lastSSX + 5, lastSSX + 5, lastSSX }, new int[]
+        { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3);
+        x1 += 5;
+      }
+      if (diffdownstream)
+      {
+        x2 -= 1;
+      }
+    }
+    else
+    {
+      // display a forward arrow
+      if (diffdownstream)
+      {
+        g.fillPolygon(new int[]
+        { x2 - 5, x2 - 5, x2 }, new int[]
+        { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3);
+        x2 -= 5;
+      }
+      if (diffupstream)
+      {
+        x1 += 1;
+      }
+    }
+    // draw arrow body
+    g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 7);
+  }
+  private int charWidth,endRes,charHeight;
+  private boolean validCharWidth, hasHiddenColumns;
+  private FontMetrics fm;
+  private boolean MAC=new jalview.util.Platform().isAMac();
+  boolean av_renderHistogram = true, av_renderProfile = true, av_normaliseProfile=false;
+  ColourSchemeI profcolour=null;
+  private ColumnSelection columnSelection;
+  private Hashtable[] hconsensus;
+  private Hashtable[] hStrucConsensus;
+  private boolean av_ignoreGapsConsensus;
+  
+  /**
+   * attributes set from AwtRenderPanelI
+   */
+  /**
+   * old image used when data is currently being calculated and cannot be rendered
+   */
+  private Image fadedImage;
+  /**
+   * panel being rendered into
+   */
+  private ImageObserver annotationPanel;
+  /**
+   * width of image to render in panel
+   */
+  private int imgWidth; 
+  
+  //  public void updateFromAnnotationPanel(FontMetrics annotFM, AlignViewportI av)
+  public void updateFromAwtRenderPanel(AwtRenderPanelI annotPanel, AlignViewportI av)
+  {
+    fm = annotPanel.getFontMetrics();
+    annotationPanel = annotPanel;
+    fadedImage=annotPanel.getFadedImage();
+    imgWidth=annotPanel.getFadedImageWidth();
+    updateFromAlignViewport(av);
+  }
+  public void updateFromAlignViewport(AlignViewportI av)
+  {
+    charWidth = av.getCharWidth();
+    endRes = av.getEndRes();
+    charHeight = av.getCharHeight();
+    hasHiddenColumns = av.hasHiddenColumns();
+    validCharWidth = av.isValidCharWidth();
+    av_renderHistogram = av.isShowConsensusHistogram();
+    av_renderProfile = av.isShowSequenceLogo();
+    av_normaliseProfile= av.isNormaliseSequenceLogo();
+    profcolour = av.getGlobalColourScheme();
+    if (profcolour == null)
+    {
+      // Set the default colour for sequence logo if the alignnent has no colourscheme set
+      profcolour = av.getAlignment().isNucleotide() ? new jalview.schemes.NucleotideColourScheme() : new jalview.schemes.ZappoColourScheme();
+    }
+    columnSelection = av.getColumnSelection();
+    hconsensus = av.getSequenceConsensusHash();//hconsensus;
+    hStrucConsensus = av.getRnaStructureConsensusHash(); //hStrucConsensus;
+    av_ignoreGapsConsensus=av.getIgnoreGapsConsensus();
+  }
+  public int[] getProfileFor(AlignmentAnnotation aa, int column)
+  {
+    // TODO : consider refactoring the global alignment calculation properties/rendering attributes as a global 'alignment group' which holds all vis settings for the alignment as a whole rather than a subset 
+    // 
+    if (aa.autoCalculated && aa.label.startsWith("Consensus"))
+    {
+      if (aa.groupRef != null && aa.groupRef.consensusData != null
+              && aa.groupRef.isShowSequenceLogo())
+      {
+        return AAFrequency.extractProfile(
+                aa.groupRef.consensusData[column], aa.groupRef
+                        .getIgnoreGapsConsensus());
+      }
+      // TODO extend annotation row to enable dynamic and static profile data to
+      // be stored
+      if (aa.groupRef == null && aa.sequenceRef == null
+              && av_renderProfile)
+      {
+        return AAFrequency.extractProfile(hconsensus[column], av_ignoreGapsConsensus);
+      }
+    }
+    else
+    {
+      if (aa.autoCalculated && aa.label.startsWith("StrucConsensus"))
+      {
+        // TODO implement group structure consensus
+        /* if (aa.groupRef != null && aa.groupRef.consensusData != null
+                && aa.groupRef.isShowSequenceLogo())
+        {
+          //TODO check what happens for group selections
+          return StructureFrequency.extractProfile(
+                  aa.groupRef.consensusData[column], aa.groupRef
+                          .getIgnoreGapsConsensus());
+        }
+        */
+        // TODO extend annotation row to enable dynamic and static profile data
+        // to
+        // be stored
+        if (aa.groupRef == null && aa.sequenceRef == null
+                && av_renderProfile && hStrucConsensus!=null && hStrucConsensus.length>column)
+        {
+          return StructureFrequency.extractProfile(hStrucConsensus[column],
+                  av_ignoreGapsConsensus);
+        }
+      }
+    }
+    return null;
+  }
+  
+  /**
+   * DOCUMENT ME!
+   * 
+   * @param annotationPanel TODO
+   * @param g
+   *          DOCUMENT ME!
+   * @param startRes
+   *          DOCUMENT ME!
+   * @param endRes
+   *          DOCUMENT ME!
+   */
+  public void drawComponent(AwtRenderPanelI annotPanel, AlignViewportI av, Graphics g, int activeRow, int startRes, int endRes)
+  {
+    // NOTES:
+    // AnnotationPanel needs to implement: ImageObserver, access to AlignViewport
+    updateFromAwtRenderPanel(annotPanel, av);
+    fm = g.getFontMetrics();  
+    AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
+  
+    int x = 0, y = 0;
+    int column = 0;
+    char lastSS;
+    int lastSSX;
+    int iconOffset = 0;
+    boolean validRes = false;
+    boolean validEnd = false;
+    boolean labelAllCols = false;
+    boolean centreColLabels, centreColLabelsDef = av
+            .getCentreColumnLabels();
+    boolean scaleColLabel = false;
+    boolean[] graphGroupDrawn = new boolean[aa.length];
+    int charOffset = 0; // offset for a label
+    float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
+    // column.
+    Font ofont = g.getFont();
+    // \u03B2 \u03B1
+    for (int i = 0; i < aa.length; i++)
+    {
+      AlignmentAnnotation row = aa[i];
+  
+      if (!row.visible)
+      {
+        continue;
+      }
+      centreColLabels = row.centreColLabels || centreColLabelsDef;
+      labelAllCols = row.showAllColLabels;
+      scaleColLabel = row.scaleColLabel;
+      lastSS = ' ';
+      lastSSX = 0;
+      if (row.graph > 0)
+      {
+        if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
+        {
+          continue;
+        }
+  
+        // this is so that we draw the characters below the graph
+        y += row.height;
+  
+        if (row.hasText)
+        {
+          iconOffset = charHeight - fm.getDescent();
+          y -= charHeight;
+        }
+      }
+      else if (row.hasText)
+      {
+        iconOffset = charHeight - fm.getDescent();
+  
+      }
+      else
+      {
+        iconOffset = 0;
+      }
+  
+      if (aa[i].autoCalculated && av.isCalculationInProgress(aa[i]))
+      {
+        y += charHeight;
+  
+        g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
+                - row.height, imgWidth, y, annotationPanel);
+        g.setColor(Color.black);
+        // g.drawString("Calculating "+aa[i].label+"....",20, y-row.height/2);
+  
+        continue;
+      }
+      
+/*      else if (annotationPanel.av.updatingConservation
+              && aa[i].label.equals("Conservation"))
+      {
+  
+        y += charHeight;
+        g.drawImage(annotationPanel.fadedImage, 0, y - row.height, annotationPanel.imgWidth, y, 0, y
+                - row.height, annotationPanel.imgWidth, y, annotationPanel);
+  
+        g.setColor(Color.black);
+        // g.drawString("Calculating Conservation.....",20, y-row.height/2);
+  
+        continue;
+      }
+      else if (annotationPanel.av.updatingConservation && aa[i].label.equals("Quality"))
+      {
+  
+        y += charHeight;
+        g.drawImage(annotationPanel.fadedImage, 0, y - row.height, annotationPanel.imgWidth, y, 0, y
+                - row.height, annotationPanel.imgWidth, y, annotationPanel);
+        g.setColor(Color.black);
+        // / g.drawString("Calculating Quality....",20, y-row.height/2);
+  
+        continue;
+      }
+  */
+      // first pass sets up state for drawing continuation from left-hand column
+      // of startRes
+      x = (startRes == 0) ? 0 : -1;
+      while (x < endRes - startRes)
+      {
+        if (hasHiddenColumns)
+        {
+          column = columnSelection.adjustForHiddenColumns(
+                  startRes + x);
+          if (column > row.annotations.length - 1)
+          {
+            break;
+          }
+        }
+        else
+        {
+          column = startRes + x;
+        }
+  
+        if ((row.annotations == null) || (row.annotations.length <= column)
+                || (row.annotations[column] == null))
+        {
+          validRes = false;
+        }
+        else
+        {
+          validRes = true;
+        }
+        if (x > -1)
+        {
+          if (activeRow == i)
+          {
+            g.setColor(Color.red);
+  
+            if (columnSelection != null)
+            {
+              for (int n = 0; n < columnSelection.size(); n++)
+              {
+                int v = columnSelection.columnAt(n);
+  
+                if (v == column)
+                {
+                  g.fillRect(x * charWidth, y, charWidth,
+                          charHeight);
+                }
+              }
+            }
+          }
+          if (!row.isValidStruc())
+          {
+            g.setColor(Color.orange);
+            g.fillRect((int)row.getInvalidStrucPos()*charWidth, y, charWidth, charHeight);
+          }
+          if (validCharWidth
+                  && validRes
+                  && row.annotations[column].displayCharacter != null
+                  && (row.annotations[column].displayCharacter.length() > 0))
+          {
+  
+            if (centreColLabels || scaleColLabel)
+            {
+              fmWidth = (float) fm.charsWidth(
+                      row.annotations[column].displayCharacter
+                              .toCharArray(), 0,
+                      row.annotations[column].displayCharacter.length());
+  
+              if (scaleColLabel)
+              {
+                // justify the label and scale to fit in column
+                if (fmWidth > charWidth)
+                {
+                  // scale only if the current font isn't already small enough
+                  fmScaling = charWidth;
+                  fmScaling /= fmWidth;
+                  g.setFont(ofont.deriveFont(AffineTransform
+                          .getScaleInstance(fmScaling, 1.0)));
+                  // and update the label's width to reflect the scaling.
+                  fmWidth = charWidth;
+                }
+              }
+            }
+            else
+            {
+              fmWidth = (float) fm
+                      .charWidth(row.annotations[column].displayCharacter
+                              .charAt(0));
+            }
+            charOffset = (int) ((charWidth - fmWidth) / 2f);
+  
+            if (row.annotations[column].colour == null)
+              g.setColor(Color.black);
+            else
+              g.setColor(row.annotations[column].colour);
+  
+            if (column == 0 || row.graph > 0)
+            {
+              g.drawString(row.annotations[column].displayCharacter,
+                      (x * charWidth) + charOffset, y + iconOffset);
+            }
+            else if (row.annotations[column - 1] == null
+                    || (labelAllCols
+                            || !row.annotations[column].displayCharacter
+                                    .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
+                            .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
+            {
+              g.drawString(row.annotations[column].displayCharacter, x
+                      * charWidth + charOffset, y + iconOffset);
+            }
+            g.setFont(ofont);
+          }
+        }
+        if (row.hasIcons)
+        {
+          char ss = validRes ? row.annotations[column].secondaryStructure
+                  : ' ';
+          if (ss == 'S')
+          {
+            // distinguish between forward/backward base-pairing
+            if (row.annotations[column].displayCharacter.indexOf(')') > -1)
+            {
+              ss = 's';
+            }
+          }
+          if (!validRes || (ss != lastSS))
+          {
+            if (x > -1)
+            {
+              switch (lastSS)
+              {
+              case 'H':
+                drawHelixAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+                        column, validRes, validEnd);
+                break;
+  
+              case 'E':
+                drawSheetAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+                        column, validRes, validEnd);
+                break;
+  
+              case 'S': // Stem case for RNA secondary structure
+              case 's': // and opposite direction
+                drawStemAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+                        column, validRes, validEnd);
+                break;
+  
+              default:
+                g.setColor(Color.gray);
+                g.fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
+                        - lastSSX, 2);
+  
+                break;
+              }
+            }
+            if (validRes)
+            {
+              lastSS = ss;
+            }
+            else
+            {
+              lastSS = ' ';
+            }
+            if (x > -1)
+            {
+              lastSSX = (x * charWidth);
+            }
+          }
+        }
+        column++;
+        x++;
+      }
+      if (column >= row.annotations.length)
+      {
+        column = row.annotations.length - 1;
+        validEnd = false;
+      }
+      else
+      {
+        validEnd = true;
+      }
+      if ((row.annotations == null) || (row.annotations.length <= column)
+              || (row.annotations[column] == null))
+      {
+        validRes = false;
+      }
+      else
+      {
+        validRes = true;
+      }
+  
+      // x ++;
+  
+      if (row.hasIcons)
+      {
+        switch (lastSS)
+        {
+        case 'H':
+          drawHelixAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+                  column, validRes, validEnd);
+          break;
+  
+        case 'E':
+          drawSheetAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+                  column, validRes, validEnd);
+          break;
+        case 's':
+        case 'S': // Stem case for RNA secondary structure
+          drawStemAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+                  column, validRes, validEnd);
+          break;
+        default:
+          drawGlyphLine(g, row, lastSSX, x, y, iconOffset, startRes,
+                  column, validRes, validEnd);
+          break;
+        }
+      }
+  
+      if (row.graph > 0 && row.graphHeight > 0)
+      {
+        if (row.graph == AlignmentAnnotation.LINE_GRAPH)
+        {
+          if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
+          {
+            float groupmax = -999999, groupmin = 9999999;
+            for (int gg = 0; gg < aa.length; gg++)
+            {
+              if (aa[gg].graphGroup != row.graphGroup)
+              {
+                continue;
+              }
+  
+              if (aa[gg] != row)
+              {
+                aa[gg].visible = false;
+              }
+  
+              if (aa[gg].graphMax > groupmax)
+              {
+                groupmax = aa[gg].graphMax;
+              }
+              if (aa[gg].graphMin < groupmin)
+              {
+                groupmin = aa[gg].graphMin;
+              }
+            }
+  
+            for (int gg = 0; gg < aa.length; gg++)
+            {
+              if (aa[gg].graphGroup == row.graphGroup)
+              {
+                drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
+                        groupmax, row.graphHeight);
+              }
+            }
+  
+            graphGroupDrawn[row.graphGroup] = true;
+          }
+          else
+          {
+            drawLineGraph( g, row, startRes, endRes, y, row.graphMin,
+                    row.graphMax, row.graphHeight);
+          }
+        }
+        else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
+        {
+          drawBarGraph(g, row, startRes, endRes, row.graphMin,
+                  row.graphMax, y);
+        }
+      }
+  
+      if (row.graph > 0 && row.hasText)
+      {
+        y += charHeight;
+      }
+  
+      if (row.graph == 0)
+      {
+        y += aa[i].height;
+      }
+    }
+  }
+
+  private Color GLYPHLINE_COLOR=Color.gray;
+  private Color SHEET_COLOUR=Color.green;
+  private Color HELIX_COLOUR=Color.red;
+  private Color STEM_COLOUR=Color.blue;
+  
+  
+  public void drawGlyphLine(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+  {
+    g.setColor(GLYPHLINE_COLOR);
+    g
+            .fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
+                    - lastSSX, 2);
+  }
+
+  public void drawSheetAnnot(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+  {
+    g.setColor(SHEET_COLOUR);
+  
+    if (!validEnd || !validRes || row.annotations[column] == null
+            || row.annotations[column].secondaryStructure != 'E')
+    {
+      g.fillRect(lastSSX, y + 4 + iconOffset, (x * charWidth) - lastSSX
+              - 4, 7);
+      g.fillPolygon(
+              new int[]
+              { (x * charWidth) - 4, (x * charWidth) - 4,
+                  (x * charWidth) }, new int[]
+              { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset },
+              3);
+    }
+    else
+    {
+      g.fillRect(lastSSX, y + 4 + iconOffset, (x + 1) * charWidth
+              - lastSSX, 7);
+    }
+  
+  }
+
+  public void drawHelixAnnot(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+  {
+    g.setColor(HELIX_COLOUR);
+  
+    int sCol = (lastSSX / charWidth) + startRes;
+    int x1 = lastSSX;
+    int x2 = (x * charWidth);
+  
+    if (MAC)
+    {
+      int ofs = charWidth / 2;
+      // Off by 1 offset when drawing rects and ovals
+      // to offscreen image on the MAC
+      g.fillRoundRect(lastSSX, y + 4 + iconOffset, x2 - x1, 8, 8, 8);
+      if (sCol == 0 || row.annotations[sCol - 1] == null
+              || row.annotations[sCol - 1].secondaryStructure != 'H')
+      {
+      }
+      else
+      {
+        // g.setColor(Color.orange);
+        g.fillRoundRect(lastSSX, y + 4 + iconOffset, x2 - x1 - ofs + 1, 8,
+                0, 0);
+      }
+      if (!validRes || row.annotations[column] == null
+              || row.annotations[column].secondaryStructure != 'H')
+      {
+  
+      }
+      else
+      {
+        // g.setColor(Color.magenta);
+        g.fillRoundRect(lastSSX + ofs, y + 4 + iconOffset, x2 - x1 - ofs
+                + 1, 8, 0, 0);
+  
+      }
+  
+      return;
+    }
+  
+    if (sCol == 0 || row.annotations[sCol - 1] == null
+            || row.annotations[sCol - 1].secondaryStructure != 'H')
+    {
+      g.fillArc(lastSSX, y + 4 + iconOffset, charWidth, 8, 90, 180);
+      x1 += charWidth / 2;
+    }
+  
+    if (!validRes || row.annotations[column] == null
+            || row.annotations[column].secondaryStructure != 'H')
+    {
+      g.fillArc((x * charWidth) - charWidth, y + 4 + iconOffset,
+              charWidth, 8, 270, 180);
+      x2 -= charWidth / 2;
+    }
+  
+    g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
+  }
+
+  public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes, int eRes, int y, float min, float max, int graphHeight)
+  {
+    if (sRes > aa.annotations.length)
+    {
+      return;
+    }
+  
+    int x = 0;
+  
+    // Adjustment for fastpaint to left
+    if (eRes < endRes)
+    {
+      eRes++;
+    }
+  
+    eRes = Math.min(eRes, aa.annotations.length);
+  
+    if (sRes == 0)
+    {
+      x++;
+    }
+  
+    int y1 = y, y2 = y;
+    float range = max - min;
+  
+    // //Draw origin
+    if (min < 0)
+    {
+      y2 = y - (int) ((0 - min / range) * graphHeight);
+    }
+  
+    g.setColor(Color.gray);
+    g.drawLine(x - charWidth, y2, (eRes - sRes + 1) * charWidth, y2);
+  
+    eRes = Math.min(eRes, aa.annotations.length);
+  
+    int column;
+    int aaMax = aa.annotations.length - 1;
+  
+    while (x < eRes - sRes)
+    {
+      column = sRes + x;
+      if (hasHiddenColumns)
+      {
+        column = columnSelection.adjustForHiddenColumns(column);
+      }
+  
+      if (column > aaMax)
+      {
+        break;
+      }
+  
+      if (aa.annotations[column] == null
+              || aa.annotations[column - 1] == null)
+      {
+        x++;
+        continue;
+      }
+  
+      if (aa.annotations[column].colour == null)
+        g.setColor(Color.black);
+      else
+        g.setColor(aa.annotations[column].colour);
+  
+      y1 = y
+              - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
+      y2 = y
+              - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
+  
+      g.drawLine(x * charWidth - charWidth / 2, y1, x * charWidth
+              + charWidth / 2, y2);
+      x++;
+    }
+  
+    if (aa.threshold != null)
+    {
+      g.setColor(aa.threshold.colour);
+      Graphics2D g2 = (Graphics2D) g;
+      g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
+              BasicStroke.JOIN_ROUND, 3f, new float[]
+              { 5f, 3f }, 0f));
+  
+      y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
+      g.drawLine(0, y2, (eRes - sRes) * charWidth, y2);
+      g2.setStroke(new BasicStroke());
+    }
+  }
+
+  public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes, int eRes, float min, float max, int y)
+  {
+    if (sRes > aa.annotations.length)
+    {
+      return;
+    }
+    Font ofont = g.getFont();
+    eRes = Math.min(eRes, aa.annotations.length);
+  
+    int x = 0, y1 = y, y2 = y;
+  
+    float range = max - min;
+  
+    if (min < 0)
+    {
+      y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
+    }
+  
+    g.setColor(Color.gray);
+  
+    g.drawLine(x, y2, (eRes - sRes) * charWidth, y2);
+  
+    int column;
+    int aaMax = aa.annotations.length - 1;
+    boolean renderHistogram = true, renderProfile = true, normaliseProfile=false;
+  //    if (aa.autoCalculated && aa.label.startsWith("Consensus"))
+    {
+      // TODO: generalise this to have render styles for consensus/profile data
+      if (aa.groupRef != null)
+      {
+        renderHistogram = aa.groupRef.isShowConsensusHistogram();
+        renderProfile = aa.groupRef.isShowSequenceLogo();
+        normaliseProfile= aa.groupRef.isNormaliseSequenceLogo();
+      }
+      else
+      {
+        renderHistogram = av_renderHistogram;
+        renderProfile = av_renderProfile;
+        normaliseProfile= av_normaliseProfile;
+      }
+    }
+    while (x < eRes - sRes)
+    {
+      column = sRes + x;
+      if (hasHiddenColumns)
+      {
+        column = columnSelection.adjustForHiddenColumns(column);
+      }
+  
+      if (column > aaMax)
+      {
+        break;
+      }
+  
+      if (aa.annotations[column] == null)
+      {
+        x++;
+        continue;
+      }
+      if (aa.annotations[column].colour == null)
+        g.setColor(Color.black);
+      else
+        g.setColor(aa.annotations[column].colour);
+  
+      y1 = y
+              - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
+  
+      if (renderHistogram)
+      {
+        if (y1 - y2 > 0)
+        {
+          g.fillRect(x * charWidth, y2, charWidth, y1 - y2);
+        }
+        else
+        {
+          g.fillRect(x * charWidth, y1, charWidth, y2 - y1);
+        }
+      }
+      // draw profile if available
+      if (renderProfile && aa.annotations[column].value != 0)
+      {
+  
+        int profl[] = getProfileFor(aa, column);
+        // just try to draw the logo if profl is not null
+        if (profl != null)
+        {
+  
+          float ht = normaliseProfile ? y-aa.graphHeight : y1;
+          double htn = normaliseProfile ? aa.graphHeight : (y2 - y1);// aa.graphHeight;
+          float wdth;
+          double ht2 = 0;
+          char[] dc;
+  
+          /**
+           * profl.length == 52 indicates that the profile of a secondary
+           * structure conservation row was accesed.
+           * Therefore dc gets length 2, to have space for a basepair instead of
+           * just a single nucleotide
+           */
+          if (profl.length == 52)
+          {
+            dc = new char[2];
+          }
+          else
+          {
+            dc = new char[1];
+          }
+          LineMetrics lm=g.getFontMetrics(ofont).getLineMetrics("Q", g);
+          double scale = 1f/(normaliseProfile ? profl[1] : 100f);
+          float ofontHeight = 1f/lm.getAscent();// magnify to fill box
+          double scl=0.0;
+          for (int c = 2; profl != null && c < profl[0];)
+          {
+            dc[0] = (char) profl[c++];
+  
+            if (aa.label.startsWith("StrucConsensus"))
+            {
+              dc[1] = (char) profl[c++];
+            }
+            
+            wdth = charWidth;
+            wdth /= (float) fm.charsWidth(dc, 0, dc.length);
+            
+            ht +=  scl;
+            {
+              // if (aa.annotations[column].value==0) {
+              // g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth,
+              // (ht2=(aa.graphHeight*0.1/av.charHeight)))));
+              // ht = y2-(int)ht2;
+              // } else {
+              scl=((double)htn)*scale* ((double) profl[c++]);
+              lm = ofont.getLineMetrics(dc, 0, 1, g.getFontMetrics().getFontRenderContext());
+              g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(
+                      wdth, scl/lm.getAscent())));
+              lm = g.getFontMetrics().getLineMetrics(dc, 0, 1, g);
+              
+              // htn -=ht2;
+              // }
+              // ? );// try to get a
+              // colourscheme for the
+              // group(aa.groupRef.cs==null)
+              // ? av.textColour2 :
+              // cs.findColour(dc));
+              // System.out.println(dc[0]);
+              // Debug - render boxes around characters
+              // g.setColor(Color.red);
+              // g.drawRect(x*av.charWidth, (int)ht, av.charWidth, (int)(scl));
+              // g.setColor(profcolour.findColour(dc[0]).darker());
+              g.setColor(profcolour.findColour(dc[0]));
+              // (av.globalColourScheme!=null)
+              g.drawChars(dc, 0, dc.length, x * charWidth,
+                      (int) (ht + (scl-lm.getDescent()-lm.getBaselineOffsets()[lm.getBaselineIndex()])));
+              // ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent();
+            }
+          }
+          g.setFont(ofont);
+        }
+      }
+      x++;
+    }
+    if (aa.threshold != null)
+    {
+      g.setColor(aa.threshold.colour);
+      Graphics2D g2 = (Graphics2D) g;
+      g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
+              BasicStroke.JOIN_ROUND, 3f, new float[]
+              { 5f, 3f }, 0f));
+  
+      y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
+      g.drawLine(0, y2, (eRes - sRes) * charWidth, y2);
+      g2.setStroke(new BasicStroke());
+    }
+  }
+  // used by overview window
+  public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
+          int y, int sRes, int eRes)
+  {
+    eRes = Math.min(eRes, aa.annotations.length);
+    g.setColor(Color.white);
+    g.fillRect(0, 0, width, y);
+    g.setColor(new Color(0, 0, 180));
+
+    int x = 0, height;
+
+    for (int j = sRes; j < eRes; j++)
+    {
+      if (aa.annotations[j] != null)
+      {
+        if (aa.annotations[j].colour == null)
+          g.setColor(Color.black);
+        else
+          g.setColor(aa.annotations[j].colour);
+
+        height = (int) ((aa.annotations[j].value / aa.graphMax) * y);
+        if (height > y)
+        {
+          height = y;
+        }
+
+        g.fillRect(x, y - height, charWidth, height);
+      }
+      x += charWidth;
+    }
+  }
+}
diff --git a/src/jalview/renderer/AwtRenderPanelI.java b/src/jalview/renderer/AwtRenderPanelI.java
new file mode 100644 (file)
index 0000000..09b8c7c
--- /dev/null
@@ -0,0 +1,25 @@
+package jalview.renderer;
+
+import java.awt.FontMetrics;
+import java.awt.Image;
+import java.awt.image.ImageObserver;
+
+public interface AwtRenderPanelI extends ImageObserver
+{
+  /**
+   * old image used when data is currently being calculated and cannot be rendered
+   */
+  Image getFadedImage();
+
+  /**
+   * FontMetrics to use for rendering into Panel
+   * @return
+   */
+  FontMetrics getFontMetrics();
+
+  /**
+   * width of image to render in panel
+   */
+  int getFadedImageWidth();
+
+}
index a98ab62..8e4bec5 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 0ed8292..068951b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 33fdf99..2155996 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 9fd0802..285e730 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 223c652..5f1b1c7 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 7e17396..0432af3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index a5fc601..172ae9e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b93ca1f..bedb407 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 55ac992..50a39a3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index fb2c04e..029b4f4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f109523..9a46e5f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 3ade8c4..e590e3f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e25182f..4e0b408 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index cb83036..c27e083 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index d6d0192..65b1124 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6e6b46c..759e83f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 927f447..41a1580 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 5aa62f8..22c6a96 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index aba37ec..e9f2ae3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6cb7e0d..9d19a0b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e4240f4..1afc99f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6fbc00c..8bd3a2a 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6ea0e09..2101c10 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 69046dc..bf64182 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 32eae8d..c34fd73 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index ab879e4..922086a 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 5432b30..62651df 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 20d36bf..66eb6fa 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b8c1d19..07343c1 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index c9e124e..0b98118 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4288229..ab3a399 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index df0f1da..d5afcab 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 9b052e1..05367ce 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 39fea56..2feb11e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 653ea68..14f65ae 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 8d24990..50b1428 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b8c7608..65b6108 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 0a0753e..4ae22d3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 3bb565f..b5ebab4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 2b1499f..7998b55 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 0db130f..948d7d0 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index ba7f6a1..4514ba5 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index edfba43..a0994af 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 998bc98..bad96cd 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 30d9c98..44ee825 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index c0e7e8f..ce385a0 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 968c661..e922cd2 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 644e8af..d481cb2 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 38d8159..64f5c8e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 3618b65..c3782be 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f10d1d7..20e41b1 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b15bad4..7646791 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 29d3f16..fdff616 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 531a24a..b7df12e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 944c9e9..e729dec 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index d87439d..f7509a1 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b99687c..45911d3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 2b5e02a..1eb8d22 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e33e6c5..62866dd 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index bcc6801..4ac8e75 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1c30225..4a58034 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 393eb3f..7b63ce4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index c7b217f..ede544f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6edaa47..db3513d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 937b298..17cb1b1 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 516d841..74af98b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f5f95a7..6d41dc5 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1800aa8..1e93ebd 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 9728465..3fcf5ec 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 8960603..cbfb4ee 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 2798c1a..d4740a3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4d7daca..f0595d3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e90908f..aa11cfc 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 9638913..f00e6b9 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 44ea42c..2687ccc 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index a01f2f5..faf841e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4d8f645..4cc1dfd 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6b46c5b..93643c5 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6c71d87..7ba9073 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 1fb1b50..7da0970 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 506e479..6ccb291 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 72f0b41..67a7588 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 13ad9f7..c4fc82d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 005a71f..24cfc51 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e265598..41ee01c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3236b55..e9ac579 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index af85e08..6ccdef5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 309bdc2..14f0ce6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fdda463..5c036e3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0f758e0..f06c10f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -153,6 +153,14 @@ public class ColourSchemeProperty
     {
       ret = NONE;
     }
+    else if (name.equalsIgnoreCase("Purine/Pyrimidine"))
+    {
+      ret = PURINEPYRIMIDINE;
+    }
+    // else if (name.equalsIgnoreCase("Covariation"))
+    // {
+    // ret = COVARIATION;
+    // }
 
     return ret;
   }
@@ -214,6 +222,13 @@ public class ColourSchemeProperty
     {
       index = NUCLEOTIDE;
     }
+    else if (cs instanceof PurinePyrimidineColourScheme)
+    {
+      index = PURINEPYRIMIDINE;
+    }
+    /*
+     * else if (cs instanceof CovariationColourScheme) { index = COVARIATION; }
+     */
     else if (cs instanceof UserColourScheme)
     {
       if ((((UserColourScheme) cs).getName() != null)
@@ -296,6 +311,16 @@ public class ColourSchemeProperty
 
       break;
 
+    case PURINEPYRIMIDINE:
+      ret = "Purine/Pyrimidine";
+
+      break;
+
+    /*
+     * case COVARIATION: ret = "Covariation";
+     * 
+     * break;
+     */
     case USER_DEFINED:
       ret = "User Defined";
 
@@ -447,6 +472,16 @@ public class ColourSchemeProperty
 
       break;
 
+    case PURINEPYRIMIDINE:
+      cs = new PurinePyrimidineColourScheme();
+
+      break;
+
+    // case COVARIATION:
+    // cs = new CovariationColourScheme(annotation);
+
+    // break;
+
     case USER_DEFINED:
       Color[] col = new Color[24];
       for (int i = 0; i < 24; i++)
index 0c010d5..a2de3c6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/schemes/CovariationColourScheme.java b/src/jalview/schemes/CovariationColourScheme.java
new file mode 100644 (file)
index 0000000..0434574
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.schemes;
+
+import java.awt.*;
+import java.util.Hashtable;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+/**
+ * Became RNAHelicesColour.java. Placeholder for true covariation color scheme
+ * 
+ * @author Lauren Michelle Lui
+ * @version 2.5
+ */
+public class CovariationColourScheme extends ResidueColourScheme
+{
+  public Hashtable helixcolorhash = new Hashtable();
+
+  public Hashtable positionsToHelix = new Hashtable();
+
+  int numHelix = 0;
+
+  public AlignmentAnnotation annotation;
+
+  /**
+   * Creates a new CovariationColourScheme object.
+   */
+  public CovariationColourScheme(AlignmentAnnotation annotation)
+  {
+    this.annotation = annotation;
+
+    for (int x = 0; x < this.annotation._rnasecstr.length; x++)
+    {
+      // System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+      // this.annotation._rnasecstr[x].getBegin());
+      // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+      // pairs.put(this.annotation._rnasecstr[x].getBegin(),
+      // this.annotation._rnasecstr[x].getEnd());
+
+      positionsToHelix.put(this.annotation._rnasecstr[x].getBegin(),
+              this.annotation._rnasecstr[x].getFeatureGroup());
+      positionsToHelix.put(this.annotation._rnasecstr[x].getEnd(),
+              this.annotation._rnasecstr[x].getFeatureGroup());
+
+      if (Integer.parseInt(this.annotation._rnasecstr[x].getFeatureGroup()) > numHelix)
+      {
+        numHelix = Integer.parseInt(this.annotation._rnasecstr[x]
+                .getFeatureGroup());
+      }
+
+    }
+
+    for (int j = 0; j <= numHelix; j++)
+    {
+      helixcolorhash.put(Integer.toString(j), jalview.util.ColorUtils
+              .generateRandomColor(Color.white));
+    }
+
+  }
+
+  /**
+   * DOCUMENT ME!
+   * 
+   * @param n
+   *          DOCUMENT ME!
+   * 
+   * @return DOCUMENT ME!
+   */
+  public Color findColour(char c)
+  {
+    // System.out.println("called"); log.debug
+    // Generate a random pastel color
+
+    return ResidueProperties.purinepyrimidine[ResidueProperties.purinepyrimidineIndex[c]];// jalview.util.ColorUtils.generateRandomColor(Color.white);
+  }
+
+  /**
+   * DOCUMENT ME!
+   * 
+   * @param n
+   *          DOCUMENT ME!
+   * @param j
+   *          DOCUMENT ME!
+   * 
+   * @return DOCUMENT ME!
+   */
+  public Color findColour(char c, int j)
+  {
+    Color currentColour = Color.white;
+    String currentHelix = null;
+    // System.out.println(c + " " + j);
+    currentHelix = (String) positionsToHelix.get(j);
+    // System.out.println(positionsToHelix.get(j));
+
+    if (currentHelix != null)
+    {
+      currentColour = (Color) helixcolorhash.get(currentHelix);
+    }
+
+    // System.out.println(c + " " + j + " helix " + currentHelix + " " +
+    // currentColour);
+    return currentColour;
+  }
+
+}
index 037b6ca..f5c3688 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 32dd06e..ca2bb61 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5714a28..4dd05c1 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 249d87d..0e2ecff 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 23a2ee2..4e07cba 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/schemes/PurinePyrimidineColourScheme.java b/src/jalview/schemes/PurinePyrimidineColourScheme.java
new file mode 100644 (file)
index 0000000..0498536
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.schemes;
+
+import java.awt.*;
+
+/**
+ * Class is based off of NucleotideColourScheme
+ * 
+ * @author Lauren Michelle Lui
+ */
+public class PurinePyrimidineColourScheme extends ResidueColourScheme
+{
+  /**
+   * Creates a new PurinePyrimidineColourScheme object.
+   */
+  public PurinePyrimidineColourScheme()
+  {
+    super(ResidueProperties.purinepyrimidine, 0);
+  }
+
+  /**
+   * Finds the corresponding color for the type of character inputed
+   * 
+   * @param c
+   *          Character in sequence
+   * 
+   * @return Color from purinepyrimidineIndex in
+   *         jalview.schemes.ResidueProperties
+   */
+  public Color findColour(char c)
+  {
+    return colors[ResidueProperties.purinepyrimidineIndex[c]];
+  }
+
+  /**
+   * Returns color based on conservation
+   * 
+   * @param c
+   *          Character in sequence
+   * @param j
+   *          Threshold
+   * 
+   * @return Color in RGB
+   */
+  public Color findColour(char c, int j)
+  {
+    Color currentColour;
+    if ((threshold == 0) || aboveThreshold(c, j))
+    {
+      try
+      {
+        currentColour = colors[ResidueProperties.purinepyrimidineIndex[c]];
+      } catch (Exception ex)
+      {
+        return Color.white;
+      }
+    }
+    else
+    {
+      return Color.white;
+    }
+
+    if (conservationColouring)
+    {
+      currentColour = applyConservation(currentColour, j);
+    }
+
+    return currentColour;
+  }
+}
diff --git a/src/jalview/schemes/RNAHelicesColour.java b/src/jalview/schemes/RNAHelicesColour.java
new file mode 100644 (file)
index 0000000..16f822f
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.schemes;
+
+import java.awt.*;
+import java.util.Hashtable;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+/**
+ * Looks at the information computed from an RNA Stockholm format file on the
+ * secondary structure of the alignment. Extracts the information on the
+ * positions of the helices present and assigns colors.
+ * 
+ * @author Lauren Michelle Lui
+ * @version 2.5
+ */
+public class RNAHelicesColour extends ResidueColourScheme
+{
+
+  /**
+   * Stores random colors generated for the number of helices
+   */
+  public Hashtable helixcolorhash = new Hashtable();
+
+  /**
+   * Maps sequence positions to the RNA helix they belong to. Key: position,
+   * Value: helix
+   */
+  public Hashtable positionsToHelix = new Hashtable();
+
+  /**
+   * Number of helices in the RNA secondary structure
+   */
+  int numHelix = 0;
+
+  public AlignmentAnnotation annotation;
+
+  /**
+   * Creates a new RNAHelicesColour object.
+   */
+  public RNAHelicesColour(AlignmentAnnotation annotation)
+  {
+    this.annotation = annotation;
+    refresh();
+  }
+
+  private long lastrefresh = -1;
+
+  public void refresh()
+  {
+    if (lastrefresh != annotation._rnasecstr.hashCode() && annotation.isValidStruc())
+    {
+      annotation.getRNAStruc();
+      lastrefresh = annotation._rnasecstr.hashCode();
+      numHelix = 0;
+      positionsToHelix = new Hashtable();
+
+      // Figure out number of helices
+      // Length of rnasecstr is the number of pairs of positions that base pair
+      // with each other in the secondary structure
+      for (int x = 0; x < this.annotation._rnasecstr.length; x++)
+      {
+
+        /*
+         * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+         * this.annotation._rnasecstr[x].getBegin());
+         */
+        // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+
+        positionsToHelix.put(this.annotation._rnasecstr[x].getBegin(),
+                this.annotation._rnasecstr[x].getFeatureGroup());
+        positionsToHelix.put(this.annotation._rnasecstr[x].getEnd(),
+                this.annotation._rnasecstr[x].getFeatureGroup());
+
+        if (Integer.parseInt(this.annotation._rnasecstr[x]
+                .getFeatureGroup()) > numHelix)
+        {
+          numHelix = Integer.parseInt(this.annotation._rnasecstr[x]
+                  .getFeatureGroup());
+        }
+
+      }
+
+      // Generate random colors and store
+      for (int j = 0; j <= numHelix; j++)
+      {
+        if (!helixcolorhash.containsKey(Integer.toString(j)))
+        {
+          helixcolorhash.put(Integer.toString(j),
+                  jalview.util.ColorUtils.generateRandomColor(Color.white));
+        }
+      }
+    }
+  }
+
+  /**
+   * Returns default color base on purinepyrimidineIndex in
+   * jalview.schemes.ResidueProperties (Allows coloring in sequence logo)
+   * 
+   * @param c
+   *          Character in sequence
+   * 
+   * @return color in RGB
+   */
+  public Color findColour(char c)
+  {
+    return ResidueProperties.purinepyrimidine[ResidueProperties.purinepyrimidineIndex[c]];
+    // random colors for all positions
+    // jalview.util.ColorUtils.generateRandomColor(Color.white); If you want
+  }
+
+  /**
+   * Returns color based on helices
+   * 
+   * @param c
+   *          Character in sequence
+   * @param j
+   *          Threshold
+   * 
+   * @return Color in RGB
+   */
+  public Color findColour(char c, int j)
+  {
+    refresh();
+    Color currentColour = Color.white;
+    String currentHelix = null;
+    currentHelix = (String) positionsToHelix.get(j);
+
+    if (currentHelix != null)
+    {
+      currentColour = (Color) helixcolorhash.get(currentHelix);
+    }
+
+    // System.out.println(c + " " + j + " helix " + currentHelix + " " +
+    // currentColour);
+    return currentColour;
+  }
+}
diff --git a/src/jalview/schemes/RNAHelicesColourChooser.java b/src/jalview/schemes/RNAHelicesColourChooser.java
new file mode 100644 (file)
index 0000000..e58099d
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.schemes;
+
+import java.util.*;
+import java.awt.event.*;
+
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.*;
+import jalview.schemes.*;
+
+/**
+ * Helps generate the colors for RNA secondary structure. Future: add option to
+ * change colors based on covariation.
+ * 
+ * @author Lauren Michelle Lui
+ * 
+ */
+public class RNAHelicesColourChooser
+{
+
+  AlignViewportI av;
+
+  AlignmentViewPanel ap;
+
+  ColourSchemeI oldcs;
+
+  Hashtable oldgroupColours;
+
+  jalview.datamodel.AlignmentAnnotation currentAnnotation;
+
+  boolean adjusting = false;
+
+  public RNAHelicesColourChooser(AlignViewportI av, final AlignmentViewPanel ap)
+  {
+    oldcs = av.getGlobalColourScheme();
+    if (av.getAlignment().getGroups() != null)
+    {
+      oldgroupColours = new Hashtable();
+      Vector allGroups = ap.getAlignment().getGroups();
+      SequenceGroup sg;
+      for (int g = 0; g < allGroups.size(); g++)
+      {
+        sg = (SequenceGroup) allGroups.get(g);
+        if (sg.cs != null)
+        {
+          oldgroupColours.put(sg, sg.cs);
+        }
+      }
+    }
+    this.av = av;
+    this.ap = ap;
+
+    if (oldcs instanceof RNAHelicesColour)
+    {
+      RNAHelicesColour rhc = (RNAHelicesColour) oldcs;
+
+    }
+
+    adjusting = true;
+    Vector list = new Vector();
+    int index = 1;
+    for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
+    {
+      String label = av.getAlignment().getAlignmentAnnotation()[i].label;
+      if (!list.contains(label))
+        list.addElement(label);
+      else
+        list.addElement(label + "_" + (index++));
+    }
+
+    adjusting = false;
+
+    changeColour();
+
+  }
+
+  void changeColour()
+  {
+    // Check if combobox is still adjusting
+    if (adjusting)
+    {
+      return;
+    }
+
+    currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
+
+    RNAHelicesColour rhc = null;
+
+    rhc = new RNAHelicesColour(currentAnnotation);
+   
+    av.setGlobalColourScheme(rhc);
+
+    if (av.getAlignment().getGroups() != null)
+    {
+      Vector allGroups = ap.getAlignment().getGroups();
+      SequenceGroup sg;
+      for (int g = 0; g < allGroups.size(); g++)
+      {
+        sg = (SequenceGroup) allGroups.get(g);
+
+        if (sg.cs == null)
+        {
+          continue;
+        }
+
+        sg.cs = new RNAHelicesColour(currentAnnotation);
+
+      }
+    }
+
+    ap.paintAlignment(false);
+  }
+
+  void reset()
+  {
+    av.setGlobalColourScheme(oldcs);
+    if (av.getAlignment().getGroups() != null)
+    {
+      Vector allGroups = ap.getAlignment().getGroups();
+      SequenceGroup sg;
+      for (int g = 0; g < allGroups.size(); g++)
+      {
+        sg = (SequenceGroup) allGroups.get(g);
+        sg.cs = (ColourSchemeI) oldgroupColours.get(sg);
+      }
+    }
+  }
+
+  public void annotations_actionPerformed(ActionEvent e)
+  {
+    changeColour();
+  }
+
+}
index 5402d75..bc1e92b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c46c07d..4c8394f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -30,6 +30,8 @@ public class ResidueProperties
 
   public static final int[] nucleotideIndex;
 
+  public static final int[] purinepyrimidineIndex;
+
   public static final Hashtable aa3Hash = new Hashtable();
 
   public static final Hashtable aa2Triplet = new Hashtable();
@@ -144,6 +146,54 @@ public class ResidueProperties
     nucleotideName.put("y", "Unknown Pyrimidine");
     nucleotideName.put("N", "Unknown");
     nucleotideName.put("n", "Unknown");
+    nucleotideName.put("W", "Weak nucleotide (A or T)");
+    nucleotideName.put("w", "Weak nucleotide (A or T)");
+    nucleotideName.put("S", "Strong nucleotide (G or C)");
+    nucleotideName.put("s", "Strong nucleotide (G or C)");
+    nucleotideName.put("M", "Amino (A or C)");
+    nucleotideName.put("m", "Amino (A or C)");
+    nucleotideName.put("K", "Keto (G or T)");
+    nucleotideName.put("k", "Keto (G or T)");
+    nucleotideName.put("B", "Not A (G or C or T)");
+    nucleotideName.put("b", "Not A (G or C or T)");
+    nucleotideName.put("H", "Not G (A or C or T)");
+    nucleotideName.put("h", "Not G (A or C or T)");
+    nucleotideName.put("D", "Not C (A or G or T)");
+    nucleotideName.put("d", "Not C (A or G or T)");
+    nucleotideName.put("V", "Not T (A or G or C");
+    nucleotideName.put("v", "Not T (A or G or C");
+
+  }
+
+  static
+  {
+    purinepyrimidineIndex = new int[255];
+    for (int i = 0; i < 255; i++)
+    {
+      purinepyrimidineIndex[i] = 3; // non-nucleotide symbols are all non-gap
+      // gaps.
+    }
+
+    purinepyrimidineIndex['A'] = 0;
+    purinepyrimidineIndex['a'] = 0;
+    purinepyrimidineIndex['C'] = 1;
+    purinepyrimidineIndex['c'] = 1;
+    purinepyrimidineIndex['G'] = 0;
+    purinepyrimidineIndex['g'] = 0;
+    purinepyrimidineIndex['T'] = 1;
+    purinepyrimidineIndex['t'] = 1;
+    purinepyrimidineIndex['U'] = 1;
+    purinepyrimidineIndex['u'] = 1;
+    purinepyrimidineIndex['I'] = 2;
+    purinepyrimidineIndex['i'] = 2;
+    purinepyrimidineIndex['X'] = 2;
+    purinepyrimidineIndex['x'] = 2;
+    purinepyrimidineIndex['R'] = 0;
+    purinepyrimidineIndex['r'] = 0;
+    purinepyrimidineIndex['Y'] = 1;
+    purinepyrimidineIndex['y'] = 1;
+    purinepyrimidineIndex['N'] = 2;
+    purinepyrimidineIndex['n'] = 2;
   }
 
   static
@@ -280,14 +330,22 @@ public class ResidueProperties
       new Color(235, 65, 60), // G
       new Color(60, 136, 238), // T
       new Color(60, 136, 238), // U
-      Color.white, // I
-      Color.white, // X
+      Color.white, // I (inosine)
+      Color.white, // X (xanthine)
       Color.white, // R
       Color.white, // Y
       Color.white, // N
       Color.white, // Gap
   };
 
+  // Added for PurinePyrimidineColourScheme
+  public static final Color[] purinepyrimidine =
+  { new Color(255, 131, 250), // A, G, R purines purplish/orchid
+      new Color(64, 224, 208), // C,U, T, Y pyrimidines turquoise
+      Color.white, // all other nucleotides
+      Color.white // Gap
+  };
+
   // Zappo
   public static final Color[] zappo =
   { Color.pink, // A
@@ -1258,6 +1316,46 @@ public class ResidueProperties
     return ss.toString();
   }
 
+  /**
+   * Used by getRNASecStrucState
+   * 
+   */
+  public static Hashtable toRNAssState;
+  static
+  {
+    toRNAssState = new Hashtable();
+    toRNAssState.put(")", "S");
+    toRNAssState.put("(", "S");
+  }
+
+  /**
+   * translate to RNA secondary structure representation
+   * 
+   * @param ssstring
+   * @return ssstring as a RNA-state secondary structure assignment.
+   */
+  public static String getRNASecStrucState(String ssstring)
+  {
+    if (ssstring == null)
+    {
+      return null;
+    }
+    StringBuffer ss = new StringBuffer();
+    for (int i = 0; i < ssstring.length(); i++)
+    {
+      String ssc = ssstring.substring(i, i + 1);
+      if (toRNAssState.containsKey(ssc))
+      {
+        ss.append((String) toRNAssState.get(ssc));
+      }
+      else
+      {
+        ss.append(" ");
+      }
+    }
+    return ss.toString();
+  }
+
   // main method generates perl representation of residue property hash
   // / cut here
   public static void main(String[] args)
index 37dd9e5..ca76c8e 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6a4ceec..f5d30a9 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 5de9cdb..ef88c38 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3416a51..ceee169 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 208db8d..a2c1eda 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b6602ea..5034134 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index bc193fd..c6dffe5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5794a42..b91e70f 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
diff --git a/src/jalview/structure/SecondaryStructureListener.java b/src/jalview/structure/SecondaryStructureListener.java
new file mode 100644 (file)
index 0000000..6116ded
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.structure;
+
+import jalview.datamodel.*;
+
+public interface SecondaryStructureListener
+{
+  //  TODO - redefine to allow RNA mouseovers to be passed back correctly to listeners
+  public void mouseOverSequence(SequenceI sequence, int index);
+}
index c4bb355..3df8863 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1cf7007..1e22e67 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f7ba696..88c3021 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c2d1ecb..5ceefd3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 84e25ba..b706f17 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 44631a8..64cfdda 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f9e8fdb..35e0ea5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -433,9 +433,14 @@ public class StructureSelectionManager
     int atomNo = 0;
     for (int i = 0; i < listeners.size(); i++)
     {
-      if (listeners.elementAt(i) instanceof StructureListener)
+      Object listener=listeners.elementAt(i);
+      if (listener==source)
       {
-        sl = (StructureListener) listeners.elementAt(i);
+        continue;
+      }
+      if (listener instanceof StructureListener)
+      {
+        sl = (StructureListener) listener;
         if (mappings == null)
         {
           continue;
@@ -458,7 +463,7 @@ public class StructureSelectionManager
       else
       {
         if (relaySeqMappings && hasSequenceListeners
-                && listeners.elementAt(i) instanceof SequenceListener)
+                && listener instanceof SequenceListener)
         {
           // DEBUG
           // System.err.println("relay Seq " + seq.getDisplayId(false) + " " +
@@ -493,11 +498,11 @@ public class StructureSelectionManager
           }
           if (hasSequenceListeners)
           {
-            ((SequenceListener) listeners.elementAt(i))
+            ((SequenceListener) listener)
                     .highlightSequence(results);
           }
         }
-        else if (listeners.elementAt(i) instanceof VamsasListener
+        else if (listener instanceof VamsasListener
                 && !handlingVamsasMo)
         {
           // DEBUG
@@ -506,9 +511,12 @@ public class StructureSelectionManager
           // index);
           // pass the mouse over and absolute position onto the
           // VamsasListener(s)
-          ((VamsasListener) listeners.elementAt(i)).mouseOver(seq,
+          ((VamsasListener) listener).mouseOver(seq,
                   indexpos, source);
         }
+        else if(listener instanceof SecondaryStructureListener){
+               ((SecondaryStructureListener) listener).mouseOverSequence(seq,indexpos);
+        }
       }
     }
   }
index af5d720..b94945a 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 2e3d78d..683812c 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index c2a73f7..ad2e08b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 23324a0..9014de2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/util/ColorUtils.java b/src/jalview/util/ColorUtils.java
new file mode 100644 (file)
index 0000000..f03588e
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+
+/**
+ * author: Lauren Michelle Lui
+ */
+
+package jalview.util;
+
+import java.awt.Color;
+import java.util.Random;
+
+public class ColorUtils
+{
+
+  /**
+   * Generates a random color, will mix with input color. Code taken from
+   * http://stackoverflow
+   * .com/questions/43044/algorithm-to-randomly-generate-an-aesthetically
+   * -pleasing-color-palette
+   * 
+   * @param mix
+   * @return Random color in RGB
+   */
+  public static final Color generateRandomColor(Color mix)
+  {
+    Random random = new Random();
+    int red = random.nextInt(256);
+    int green = random.nextInt(256);
+    int blue = random.nextInt(256);
+
+    // mix the color
+    if (mix != null)
+    {
+      red = (red + mix.getRed()) / 2;
+      green = (green + mix.getGreen()) / 2;
+      blue = (blue + mix.getBlue()) / 2;
+    }
+
+    Color color = new Color(red, green, blue);
+    return color;
+
+  }
+
+}
index ff4e1a9..f8e1fcd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 42fbef6..70ef47c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 89d5a5c..d85013c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 581ca4b..b4eb2ab 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b4547be..3c6b05f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e5a0254..2e81276 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8bd19a0..1c633a4 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index ad9a9b7..3e508eb 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 94ec1aa..6b77fad 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9fb5eca..e57b872 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index f1a8794..5e9556e 100755 (executable)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 84a327a..007b502 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1f02d31..8f1f051 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java
new file mode 100644 (file)
index 0000000..703e9a7
--- /dev/null
@@ -0,0 +1,1150 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.viewmodel;
+
+import jalview.analysis.Conservation;
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.schemes.ClustalxColourScheme;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
+import jalview.workers.AlignCalcManager;
+import jalview.workers.ConsensusThread;
+import jalview.workers.ConservationThread;
+import jalview.workers.StrucConsensusThread;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+/**
+ * base class holding visualization and analysis attributes and common logic for an active alignment view displayed in the GUI
+ * @author jimp
+ *
+ */
+public abstract class AlignmentViewport implements AlignViewportI
+{
+  /**
+   * alignment displayed in the viewport. Please use get/setter
+   */
+  protected AlignmentI alignment;
+
+  protected String sequenceSetID;
+
+  /**
+   * probably unused indicator that view is of a dataset rather than an alignment
+   */
+  protected boolean isDataset = false;
+
+  private Hashtable hiddenRepSequences;
+
+  protected ColumnSelection colSel = new ColumnSelection();
+
+
+  public boolean autoCalculateConsensus = true;
+
+  protected boolean autoCalculateStrucConsensus = true;
+
+  protected boolean ignoreGapsInConsensusCalculation = false;
+  
+
+  protected ColourSchemeI globalColourScheme = null;
+
+
+  public void setGlobalColourScheme(ColourSchemeI cs)
+  {
+    globalColourScheme = cs;
+  }
+
+  public ColourSchemeI getGlobalColourScheme()
+  {
+    return globalColourScheme;
+  }
+
+
+  protected AlignmentAnnotation consensus;
+
+  protected AlignmentAnnotation strucConsensus;
+
+  protected AlignmentAnnotation conservation;
+
+  protected AlignmentAnnotation quality;
+
+  protected AlignmentAnnotation[] groupConsensus;
+
+  protected AlignmentAnnotation[] groupConservation;
+
+  /** 
+   * results of alignment consensus analysis for visible portion of view 
+   */
+  protected Hashtable[] hconsensus=null;
+
+  /**
+   * results of secondary structure base pair consensus for visible portion of view
+   */
+  protected Hashtable[] hStrucConsensus=null;
+
+  /**
+   * percentage gaps allowed in a column before all amino acid properties should be considered unconserved
+   */
+  int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
+
+
+  public int getConsPercGaps()
+  {
+    return ConsPercGaps;
+  }
+  @Override
+  public void setSequenceConsensusHash(Hashtable[] hconsensus)
+  {
+    this.hconsensus=hconsensus;
+    
+  }
+
+  @Override
+  public Hashtable[] getSequenceConsensusHash()
+  {
+    return hconsensus;
+  }
+
+  @Override
+  public Hashtable[] getRnaStructureConsensusHash()
+  {
+    return hStrucConsensus;
+  }
+  @Override
+  public void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus)
+  {
+    this.hStrucConsensus=hStrucConsensus;
+    
+  }
+  @Override
+  public AlignmentAnnotation getAlignmentQualityAnnot()
+  {
+    return quality;
+  }
+
+  @Override
+  public AlignmentAnnotation getAlignmentConservationAnnotation()
+  {
+    return conservation;
+  }
+  @Override
+  public AlignmentAnnotation getAlignmentConsensusAnnotation()
+  {
+    return consensus;
+  }
+  @Override
+  public AlignmentAnnotation getAlignmentStrucConsensusAnnotation()
+  {
+    return strucConsensus;
+  }
+  
+  protected AlignCalcManagerI calculator=new AlignCalcManager();
+
+  /**
+   * trigger update of conservation annotation
+   */
+  public void updateConservation(final AlignmentViewPanel ap)
+  {
+    // see note in mantis : issue number 8585
+    if (alignment.isNucleotide() || conservation == null
+            || !autoCalculateConsensus)
+    {
+      return;
+    }
+    if (!calculator.startRegisteredWorkersOfClass(jalview.workers.ConservationThread.class))
+    {
+      calculator.registerWorker(new jalview.workers.ConservationThread(this, ap));
+    }
+  }
+
+  /**
+   * trigger update of consensus annotation
+   */
+  public void updateConsensus(final AlignmentViewPanel ap)
+  {
+    // see note in mantis : issue number 8585
+    if (consensus == null || !autoCalculateConsensus)
+    {
+      return;
+    }
+    if (!calculator.startRegisteredWorkersOfClass(ConsensusThread.class))
+    {
+      calculator.registerWorker(new ConsensusThread(this, ap));
+    }
+  }
+
+  // --------START Structure Conservation
+  public void updateStrucConsensus(final AlignmentViewPanel ap)
+  {
+    if (autoCalculateStrucConsensus && strucConsensus==null && alignment.isNucleotide() && alignment.hasRNAStructure())
+    {
+      
+    }
+
+    // see note in mantis : issue number 8585
+    if (strucConsensus == null || !autoCalculateStrucConsensus)
+    {
+      return;
+    }
+    if (!calculator.startRegisteredWorkersOfClass(StrucConsensusThread.class))
+    {
+      calculator.registerWorker(new StrucConsensusThread(this,ap));
+    }
+  }
+
+  public boolean isCalcInProgress()
+  {
+    return calculator.isWorking();
+  }
+
+  public boolean isCalculationInProgress(
+          AlignmentAnnotation alignmentAnnotation)
+  {
+    if (!alignmentAnnotation.autoCalculated)
+      return false;
+    if (calculator.workingInvolvedWith(alignmentAnnotation))
+    {
+//      System.err.println("grey out ("+alignmentAnnotation.label+")");
+      return true;
+    }
+    return false;
+  }
+  @Override
+  public boolean isClosed()
+  {
+    // TODO: check that this isClosed is only true after panel is closed, not before it is fully constructed.
+    return alignment==null;
+  }
+
+  @Override
+  public AlignCalcManagerI getCalcManager()
+  {
+    return calculator;
+  }
+
+  /**
+   * should conservation rows be shown for groups
+   */
+  protected boolean showGroupConservation = false;
+
+  /**
+   * should consensus rows be shown for groups
+   */
+  protected boolean showGroupConsensus = false;
+
+  /**
+   * should consensus profile be rendered by default
+   */
+  protected boolean showSequenceLogo = false;
+  /**
+   * should consensus profile be rendered normalised to row height
+   */
+  protected boolean normaliseSequenceLogo = false;
+  /**
+   * should consensus histograms be rendered by default
+   */
+  protected boolean showConsensusHistogram = true;
+
+  /**
+   * @return the showConsensusProfile
+   */
+  public boolean isShowSequenceLogo()
+  {
+    return showSequenceLogo;
+  }
+
+  /**
+   * @param showSequenceLogo
+   *          the new value
+   */
+  public void setShowSequenceLogo(boolean showSequenceLogo)
+  {
+    if (showSequenceLogo != this.showSequenceLogo)
+    {
+      // TODO: decouple settings setting from calculation when refactoring
+      // annotation update method from alignframe to viewport
+      this.showSequenceLogo = showSequenceLogo;
+      calculator.updateAnnotationFor(ConsensusThread.class);
+      calculator.updateAnnotationFor(StrucConsensusThread.class);
+    }
+    this.showSequenceLogo = showSequenceLogo;
+  }
+
+  /**
+   * @param showConsensusHistogram
+   *          the showConsensusHistogram to set
+   */
+  public void setShowConsensusHistogram(boolean showConsensusHistogram)
+  {
+    this.showConsensusHistogram = showConsensusHistogram;
+  }
+
+  /**
+   * @return the showGroupConservation
+   */
+  public boolean isShowGroupConservation()
+  {
+    return showGroupConservation;
+  }
+
+  /**
+   * @param showGroupConservation
+   *          the showGroupConservation to set
+   */
+  public void setShowGroupConservation(boolean showGroupConservation)
+  {
+    this.showGroupConservation = showGroupConservation;
+  }
+
+  /**
+   * @return the showGroupConsensus
+   */
+  public boolean isShowGroupConsensus()
+  {
+    return showGroupConsensus;
+  }
+
+  /**
+   * @param showGroupConsensus
+   *          the showGroupConsensus to set
+   */
+  public void setShowGroupConsensus(boolean showGroupConsensus)
+  {
+    this.showGroupConsensus = showGroupConsensus;
+  }
+
+  /**
+   * 
+   * @return flag to indicate if the consensus histogram should be rendered by
+   *         default
+   */
+  public boolean isShowConsensusHistogram()
+  {
+    return this.showConsensusHistogram;
+  }
+
+  /**
+   * show non-conserved residues only
+   */
+  protected boolean showUnconserved = false;
+
+
+  /**
+   * when set, updateAlignment will always ensure sequences are of equal length
+   */
+  private boolean padGaps = false;
+
+  /**
+   * when set, alignment should be reordered according to a newly opened tree
+   */
+  public boolean sortByTree = false;
+
+  public boolean getShowUnconserved()
+  {
+    return showUnconserved;
+  }
+
+  public void setShowUnconserved(boolean showunconserved)
+  {
+    showUnconserved = showunconserved;
+  }
+
+  /**
+   * @param showNonconserved
+   *          the showUnconserved to set
+   */
+  public void setShowunconserved(boolean displayNonconserved)
+  {
+    this.showUnconserved = displayNonconserved;
+  }
+
+  /**
+   * 
+   * 
+   * @return null or the currently selected sequence region
+   */
+  public SequenceGroup getSelectionGroup()
+  {
+    return selectionGroup;
+  }
+
+  /**
+   * Set the selection group for this window.
+   * 
+   * @param sg
+   *          - group holding references to sequences in this alignment view
+   * 
+   */
+  public void setSelectionGroup(SequenceGroup sg)
+  {
+    selectionGroup = sg;
+  }
+
+  public void setHiddenColumns(ColumnSelection colsel)
+  {
+    this.colSel = colsel;
+    if (colSel.getHiddenColumns() != null)
+    {
+      hasHiddenColumns = true;
+    }
+  }
+
+  public ColumnSelection getColumnSelection()
+  {
+    return colSel;
+  }
+  public void setColumnSelection(ColumnSelection colSel)
+  {
+    this.colSel=colSel;
+  }
+  public Hashtable getHiddenRepSequences()
+  {
+    return hiddenRepSequences;
+  }
+  public void setHiddenRepSequences(Hashtable hiddenRepSequences)
+  {
+    this.hiddenRepSequences = hiddenRepSequences;
+  }
+  protected boolean hasHiddenColumns = false;
+
+  public void updateHiddenColumns()
+  {
+    hasHiddenColumns = colSel.getHiddenColumns() != null;  
+  }
+  
+  protected boolean hasHiddenRows = false;
+  
+  public boolean hasHiddenRows() {
+    return hasHiddenRows;
+  }
+
+  protected SequenceGroup selectionGroup;
+
+  public void setSequenceSetId(String newid)
+  {
+    if (sequenceSetID!=null)
+    {
+      System.err.println("Warning - overwriting a sequenceSetId for a viewport!");
+    }
+    sequenceSetID=new String(newid);
+  }
+  public String getSequenceSetId()
+  {
+    if (sequenceSetID == null)
+    {
+      sequenceSetID = alignment.hashCode() + "";
+    }
+
+    return sequenceSetID;
+  }
+  /**
+   * unique viewId for synchronizing state (e.g. with stored Jalview Project)
+   * 
+   */
+  protected String viewId = null;
+
+  public String getViewId()
+  {
+    if (viewId == null)
+    {
+      viewId = this.getSequenceSetId() + "." + this.hashCode() + "";
+    }
+    return viewId;
+  }
+  public void setIgnoreGapsConsensus(boolean b, AlignmentViewPanel ap)
+  {
+    ignoreGapsInConsensusCalculation = b;
+    if (ap!=null) {updateConsensus(ap);
+    if (globalColourScheme != null)
+    {
+      globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
+              ignoreGapsInConsensusCalculation);
+    }}
+    
+  }
+  private long sgrouphash = -1, colselhash = -1;
+
+  /**
+   * checks current SelectionGroup against record of last hash value, and
+   * updates record.
+   * 
+   * @param b
+   *          update the record of last hash value
+   * 
+   * @return true if SelectionGroup changed since last call (when b is true)
+   */
+  public boolean isSelectionGroupChanged(boolean b)
+  {
+    int hc = (selectionGroup == null || selectionGroup.getSize() == 0) ? -1
+            : selectionGroup.hashCode();
+    if (hc != -1 && hc != sgrouphash)
+    {
+      if (b)
+      {
+        sgrouphash = hc;
+      }
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * checks current colsel against record of last hash value, and optionally
+   * updates record.
+   * 
+   * @param b
+   *          update the record of last hash value
+   * @return true if colsel changed since last call (when b is true)
+   */
+  public boolean isColSelChanged(boolean b)
+  {
+    int hc = (colSel == null || colSel.size() == 0) ? -1 : colSel
+            .hashCode();
+    if (hc != -1 && hc != colselhash)
+    {
+      if (b)
+      {
+        colselhash = hc;
+      }
+      return true;
+    }
+    return false;
+  }
+
+  public boolean getIgnoreGapsConsensus()
+  {
+    return ignoreGapsInConsensusCalculation;
+  }
+
+  /// property change stuff
+
+  // JBPNote Prolly only need this in the applet version.
+  private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
+          this);
+
+  protected boolean showConservation = true;
+
+  protected boolean showQuality = true;
+
+  protected boolean showConsensus = true;
+
+
+  /**
+   * Property change listener for changes in alignment
+   * 
+   * @param listener
+   *          DOCUMENT ME!
+   */
+  public void addPropertyChangeListener(
+          java.beans.PropertyChangeListener listener)
+  {
+    changeSupport.addPropertyChangeListener(listener);
+  }
+
+  /**
+   * DOCUMENT ME!
+   * 
+   * @param listener
+   *          DOCUMENT ME!
+   */
+  public void removePropertyChangeListener(
+          java.beans.PropertyChangeListener listener)
+  {
+    changeSupport.removePropertyChangeListener(listener);
+  }
+
+  /**
+   * Property change listener for changes in alignment
+   * 
+   * @param prop
+   *          DOCUMENT ME!
+   * @param oldvalue
+   *          DOCUMENT ME!
+   * @param newvalue
+   *          DOCUMENT ME!
+   */
+  public void firePropertyChange(String prop, Object oldvalue,
+          Object newvalue)
+  {
+    changeSupport.firePropertyChange(prop, oldvalue, newvalue);
+  }
+
+  // common hide/show column stuff
+  
+
+  public void hideSelectedColumns()
+  {
+    if (colSel.size() < 1)
+    {
+      return;
+    }
+
+    colSel.hideSelectedColumns();
+    setSelectionGroup(null);
+
+    hasHiddenColumns = true;
+  }
+
+  public void hideColumns(int start, int end)
+  {
+    if (start == end)
+    {
+      colSel.hideColumns(start);
+    }
+    else
+    {
+      colSel.hideColumns(start, end);
+    }
+
+    hasHiddenColumns = true;
+  }
+
+  public void showColumn(int col)
+  {
+    colSel.revealHiddenColumns(col);
+    if (colSel.getHiddenColumns() == null)
+    {
+      hasHiddenColumns = false;
+    }
+  }
+
+  public void showAllHiddenColumns()
+  {
+    colSel.revealAllHiddenColumns();
+    hasHiddenColumns = false;
+  }
+
+  
+  // common hide/show seq stuff
+  public void showAllHiddenSeqs()
+  {
+    if (alignment.getHiddenSequences().getSize() > 0)
+    {
+      if (selectionGroup == null)
+      {
+        selectionGroup = new SequenceGroup();
+        selectionGroup.setEndRes(alignment.getWidth() - 1);
+      }
+      Vector tmp = alignment.getHiddenSequences().showAll(
+              hiddenRepSequences);
+      for (int t = 0; t < tmp.size(); t++)
+      {
+        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
+      }
+
+      hasHiddenRows = false;
+      hiddenRepSequences = null;
+
+      firePropertyChange("alignment", null, alignment.getSequences());
+      // used to set hasHiddenRows/hiddenRepSequences here, after the property changed event
+      sendSelection();
+    }
+  }
+
+  public void showSequence(int index)
+  {
+    Vector tmp = alignment.getHiddenSequences().showSequence(index,
+            hiddenRepSequences);
+    if (tmp.size() > 0)
+    {
+      if (selectionGroup == null)
+      {
+        selectionGroup = new SequenceGroup();
+        selectionGroup.setEndRes(alignment.getWidth() - 1);
+      }
+
+      for (int t = 0; t < tmp.size(); t++)
+      {
+        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
+      }
+      // JBPNote: refactor: only update flag if we modified visiblity (used to do this regardless) 
+      if (alignment.getHiddenSequences().getSize() < 1)
+      {
+        hasHiddenRows = false;
+      }
+      firePropertyChange("alignment", null, alignment.getSequences());
+      sendSelection();
+    }
+  }
+
+
+  
+  public void hideAllSelectedSeqs()
+  {
+    if (selectionGroup == null || selectionGroup.getSize() < 1)
+    {
+      return;
+    }
+
+    SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
+
+    hideSequence(seqs);
+
+    setSelectionGroup(null);
+  }
+  
+
+  public void hideSequence(SequenceI[] seq)
+  {
+    if (seq != null)
+    {
+      for (int i = 0; i < seq.length; i++)
+      {
+        alignment.getHiddenSequences().hideSequence(seq[i]);
+      }
+      hasHiddenRows = true;
+      firePropertyChange("alignment", null, alignment.getSequences());
+    }
+  }
+
+  public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
+  {
+    int sSize = sg.getSize();
+    if (sSize < 2)
+    {
+      return;
+    }
+
+    if (hiddenRepSequences == null)
+    {
+      hiddenRepSequences = new Hashtable();
+    }
+
+    hiddenRepSequences.put(repSequence, sg);
+
+    // Hide all sequences except the repSequence
+    SequenceI[] seqs = new SequenceI[sSize - 1];
+    int index = 0;
+    for (int i = 0; i < sSize; i++)
+    {
+      if (sg.getSequenceAt(i) != repSequence)
+      {
+        if (index == sSize - 1)
+        {
+          return;
+        }
+
+        seqs[index++] = sg.getSequenceAt(i);
+      }
+    }
+    sg.setSeqrep(repSequence); // note: not done in 2.7applet 
+    sg.setHidereps(true); // note: not done in 2.7applet
+    hideSequence(seqs);
+
+  }
+
+  public boolean isHiddenRepSequence(SequenceI seq)
+  {
+    return hiddenRepSequences != null
+          && hiddenRepSequences.containsKey(seq);
+  }
+  public SequenceGroup getRepresentedSequences(SequenceI seq)
+  {
+    return (SequenceGroup) (hiddenRepSequences == null ? null : hiddenRepSequences.get(seq));
+  }
+
+  public int adjustForHiddenSeqs(int alignmentIndex)
+  {
+    return alignment.getHiddenSequences().adjustForHiddenSeqs(
+            alignmentIndex);
+  }
+
+  // Selection manipulation
+  /**
+   * broadcast selection to any interested parties
+   */
+  public abstract void sendSelection();
+  
+
+  public void invertColumnSelection()
+  {
+    colSel.invertColumnSelection(0, alignment.getWidth());
+  }
+
+
+  /**
+   * This method returns an array of new SequenceI objects derived from the
+   * whole alignment or just the current selection with start and end points
+   * adjusted
+   * 
+   * @note if you need references to the actual SequenceI objects in the
+   *       alignment or currently selected then use getSequenceSelection()
+   * @return selection as new sequenceI objects
+   */
+  public SequenceI[] getSelectionAsNewSequence()
+  {
+    SequenceI[] sequences;
+    // JBPNote: Need to test jalviewLite.getSelectedSequencesAsAlignmentFrom - this was the only caller in the applet for this method
+    // JBPNote: in applet, this method returned references to the alignment sequences, and it did not honour the presence/absence of annotation attached to the alignment (probably!)
+    if (selectionGroup == null)
+    {
+      sequences = alignment.getSequencesArray();
+      AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation();
+      for (int i = 0; i < sequences.length; i++)
+      {
+        sequences[i] = new Sequence(sequences[i], annots); // construct new
+        // sequence with
+        // subset of visible
+        // annotation
+      }
+    }
+    else
+    {
+      sequences = selectionGroup.getSelectionAsNewSequences(alignment);
+    }
+
+    return sequences;
+  }
+
+
+  /**
+   * get the currently selected sequence objects or all the sequences in the
+   * alignment.
+   * 
+   * @return array of references to sequence objects
+   */
+  public SequenceI[] getSequenceSelection()
+  {
+    SequenceI[] sequences = null;
+    if (selectionGroup != null)
+    {
+      sequences = selectionGroup.getSequencesInOrder(alignment);
+    }
+    if (sequences == null)
+    {
+      sequences = alignment.getSequencesArray();
+    }
+    return sequences;
+  }
+
+
+  /**
+   * This method returns the visible alignment as text, as seen on the GUI, ie
+   * if columns are hidden they will not be returned in the result. Use this for
+   * calculating trees, PCA, redundancy etc on views which contain hidden
+   * columns.
+   * 
+   * @return String[]
+   */
+  public jalview.datamodel.CigarArray getViewAsCigars(
+          boolean selectedRegionOnly)
+  {
+    return new jalview.datamodel.CigarArray(alignment,
+            (hasHiddenColumns ? colSel : null),
+            (selectedRegionOnly ? selectionGroup : null));
+  }
+
+  /**
+   * return a compact representation of the current alignment selection to pass
+   * to an analysis function
+   * 
+   * @param selectedOnly
+   *          boolean true to just return the selected view
+   * @return AlignmentView
+   */
+  public jalview.datamodel.AlignmentView getAlignmentView(
+          boolean selectedOnly)
+  {
+    return getAlignmentView(selectedOnly, false);
+  }
+
+  /**
+   * return a compact representation of the current alignment selection to pass
+   * to an analysis function
+   * 
+   * @param selectedOnly
+   *          boolean true to just return the selected view
+   * @param markGroups
+   *          boolean true to annotate the alignment view with groups on the
+   *          alignment (and intersecting with selected region if selectedOnly
+   *          is true)
+   * @return AlignmentView
+   */
+  public jalview.datamodel.AlignmentView getAlignmentView(
+          boolean selectedOnly, boolean markGroups)
+  {
+    return new AlignmentView(alignment, colSel, selectionGroup,
+            hasHiddenColumns, selectedOnly, markGroups);
+  }
+
+
+  /**
+   * This method returns the visible alignment as text, as seen on the GUI, ie
+   * if columns are hidden they will not be returned in the result. Use this for
+   * calculating trees, PCA, redundancy etc on views which contain hidden
+   * columns.
+   * 
+   * @return String[]
+   */
+  public String[] getViewAsString(boolean selectedRegionOnly)
+  {
+    String[] selection = null;
+    SequenceI[] seqs = null;
+    int i, iSize;
+    int start = 0, end = 0;
+    if (selectedRegionOnly && selectionGroup != null)
+    {
+      iSize = selectionGroup.getSize();
+      seqs = selectionGroup.getSequencesInOrder(alignment);
+      start = selectionGroup.getStartRes();
+      end = selectionGroup.getEndRes() + 1;
+    }
+    else
+    {
+      iSize = alignment.getHeight();
+      seqs = alignment.getSequencesArray();
+      end = alignment.getWidth();
+    }
+
+    selection = new String[iSize];
+    if (hasHiddenColumns)
+    {
+      selection = colSel.getVisibleSequenceStrings(start, end, seqs);
+    }
+    else
+    {
+      for (i = 0; i < iSize; i++)
+      {
+        selection[i] = seqs[i].getSequenceAsString(start, end);
+      }
+
+    }
+    return selection;
+  }
+
+
+  /**
+   * return visible region boundaries within given column range
+   * @param min first column (inclusive, from 0)
+   * @param max last column (exclusive)
+   * @return int[][] range of {start,end} visible positions
+   */
+  public int[][] getVisibleRegionBoundaries(int min, int max)
+  {
+    Vector regions = new Vector();
+    int start = min;
+    int end = max;
+
+    do
+    {
+      if (hasHiddenColumns)
+      {
+        if (start == 0)
+        {
+          start = colSel.adjustForHiddenColumns(start);
+        }
+
+        end = colSel.getHiddenBoundaryRight(start);
+        if (start == end)
+        {
+          end = max;
+        }
+        if (end > max)
+        {
+          end = max;
+        }
+      }
+
+      regions.addElement(new int[]
+      { start, end });
+
+      if (hasHiddenColumns)
+      {
+        start = colSel.adjustForHiddenColumns(end);
+        start = colSel.getHiddenBoundaryLeft(start) + 1;
+      }
+    } while (end < max);
+
+    int[][] startEnd = new int[regions.size()][2];
+
+    regions.copyInto(startEnd);
+
+    return startEnd;
+
+  }
+  /**
+   * @return the padGaps
+   */
+  public boolean isPadGaps()
+  {
+    return padGaps;
+  }
+  /**
+   * @param padGaps the padGaps to set
+   */
+  public void setPadGaps(boolean padGaps)
+  {
+    this.padGaps = padGaps;
+  }
+  /**
+   * apply any post-edit constraints and trigger any calculations needed after an edit has been performed on the alignment 
+   * @param ap
+   */
+  public void alignmentChanged(AlignmentViewPanel ap)
+  {
+    if (isPadGaps())
+    {
+      alignment.padGaps();
+    }
+    if (autoCalculateConsensus)
+    {
+      updateConsensus(ap);
+    }
+    if (hconsensus != null && autoCalculateConsensus)
+    {
+      updateConservation(ap);
+    }
+    if (autoCalculateStrucConsensus)
+    {
+      updateStrucConsensus(ap);
+    }
+
+    // Reset endRes of groups if beyond alignment width
+    int alWidth = alignment.getWidth();
+    Vector groups = alignment.getGroups();
+    if (groups != null)
+    {
+      for (int i = 0; i < groups.size(); i++)
+      {
+        SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
+        if (sg.getEndRes() > alWidth)
+        {
+          sg.setEndRes(alWidth - 1);
+        }
+      }
+    }
+
+    if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
+    {
+      selectionGroup.setEndRes(alWidth - 1);
+    }
+
+    resetAllColourSchemes();
+    calculator.restartWorkers();
+    // alignment.adjustSequenceAnnotations();
+  }
+
+  
+  /**
+   * reset scope and do calculations for all applied colourschemes on alignment
+   */
+  void resetAllColourSchemes()
+  {
+    ColourSchemeI cs = globalColourScheme;
+    if (cs != null)
+    {
+      if (cs instanceof ClustalxColourScheme)
+      {
+        ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
+                alignment.getWidth());
+      }
+
+      cs.setConsensus(hconsensus);
+      if (cs.conservationApplied())
+      {
+        cs.setConservation(Conservation.calculateConservation("All",
+                ResidueProperties.propHash, 3, alignment.getSequences(), 0,
+                alignment.getWidth(), false, getConsPercGaps(), false));
+      }
+    }
+
+    int s, sSize = alignment.getGroups().size();
+    for (s = 0; s < sSize; s++)
+    {
+      SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
+      if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
+      {
+        ((ClustalxColourScheme) sg.cs).resetClustalX(sg
+                .getSequences(hiddenRepSequences), sg.getWidth());
+      }
+      sg.recalcConservation();
+    }
+  }
+
+  protected void initAutoAnnotation()
+  {
+    // TODO: add menu option action that nulls or creates consensus object
+    // depending on if the user wants to see the annotation or not in a
+    // specific alignment
+
+    if (hconsensus == null && !isDataset)
+    {
+      if (!alignment.isNucleotide())
+      {
+        if (showConservation)
+        {
+          if (conservation==null)
+        {
+        conservation = new AlignmentAnnotation("Conservation",
+                "Conservation of total alignment less than " + getConsPercGaps()
+                        + "% gaps", new Annotation[1], 0f, 11f,
+                AlignmentAnnotation.BAR_GRAPH);
+        conservation.hasText = true;
+        conservation.autoCalculated = true;
+          alignment.addAnnotation(conservation);
+        }
+        }
+        if (showQuality)
+        {
+          if (quality==null)
+          {
+          quality = new AlignmentAnnotation("Quality",
+                  "Alignment Quality based on Blosum62 scores",
+                  new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
+          quality.hasText = true;
+          quality.autoCalculated = true;
+          alignment.addAnnotation(quality);
+        }
+        }
+      } else {
+        if (alignment.hasRNAStructure())
+        {
+          strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
+                  new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+          strucConsensus.hasText = true;
+          strucConsensus.autoCalculated = true;
+        }
+      }
+        
+      consensus = new AlignmentAnnotation("Consensus", "PID",
+              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+      consensus.hasText = true;
+      consensus.autoCalculated = true;
+  
+      if (showConsensus)
+      {
+        alignment.addAnnotation(consensus);
+        if (strucConsensus!=null)
+        {
+          alignment.addAnnotation(strucConsensus);
+        }
+      }
+    }
+  }
+
+}
diff --git a/src/jalview/workers/AlignCalcManager.java b/src/jalview/workers/AlignCalcManager.java
new file mode 100644 (file)
index 0000000..63ba828
--- /dev/null
@@ -0,0 +1,200 @@
+package jalview.workers;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.AlignmentAnnotation;
+
+public class AlignCalcManager implements AlignCalcManagerI
+{
+  private volatile List<AlignCalcWorkerI> restartable = new ArrayList<AlignCalcWorkerI>();
+
+  private List<Class> blackList = new ArrayList<Class>();
+
+  /**
+   * global record of calculations in progress
+   */
+  private static Hashtable<Class, AlignCalcWorkerI> inProgress = new Hashtable<Class, AlignCalcWorkerI>();
+
+  /**
+   * record of calculations pending or in progress in the current context
+   */
+  private Map<Class, List<AlignCalcWorkerI>> updating = new Hashtable<Class, List<AlignCalcWorkerI>>();
+
+  @Override
+  public void notifyStart(AlignCalcWorkerI worker)
+  {
+    List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
+    if (upd == null)
+    {
+      updating.put(worker.getClass(),
+              upd = new ArrayList<AlignCalcWorkerI>());
+    }
+    upd.add(worker);
+  }
+
+  @Override
+  public synchronized boolean alreadyDoing(AlignCalcWorkerI worker)
+  {
+    return inProgress.containsKey(worker.getClass());
+  }
+
+  @Override
+  public synchronized boolean notifyWorking(AlignCalcWorkerI worker)
+  {
+    // synchronized (inProgress)
+    {
+      // TODO: decide if we should throw exceptions here if multiple workers
+      // start to work
+      if (inProgress.get(worker.getClass()) != null)
+      {
+        if (false)
+        {
+          System.err
+                  .println("Warning: Multiple workers are running of type "
+                          + worker.getClass());
+        }
+        return false;
+      }
+      inProgress.put(worker.getClass(), worker);
+    }
+    return true;
+  }
+
+  private HashSet<AlignCalcWorkerI> canUpdate=new HashSet<AlignCalcWorkerI>();
+  @Override
+  public synchronized void workerComplete(AlignCalcWorkerI worker)
+  {
+    inProgress.remove(worker.getClass());
+    List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
+    if (upd != null)
+    {
+      upd.remove(worker);
+      canUpdate.add(worker);
+    }
+
+  }
+
+  @Override
+  public void workerCannotRun(AlignCalcWorkerI worker)
+  {
+    blackList.add(worker.getClass());
+  }
+
+  public boolean isBlackListed(Class workerType)
+  {
+    return blackList.contains(workerType);
+  }
+
+  @Override
+  public void startWorker(AlignCalcWorkerI worker)
+  {
+    new Thread(worker).start();
+  }
+
+  @Override
+  public synchronized boolean isWorking(AlignCalcWorkerI worker)
+  {
+    // System.err.println("isWorking : worker "+(worker!=null ?
+    // worker.getClass():"null")+ " "+hashCode());
+    return worker != null && inProgress.get(worker.getClass()) == worker;
+  }
+
+  @Override
+  public boolean isWorking()
+  {
+    // System.err.println("isWorking "+hashCode());
+    return inProgress.size() > 0;
+  }
+
+  @Override
+  public void registerWorker(AlignCalcWorkerI worker)
+  {
+    if (!restartable.contains(worker))
+    {
+      restartable.add(worker);
+    }
+    startWorker(worker);
+  }
+
+  @Override
+  public void restartWorkers()
+  {
+    for (AlignCalcWorkerI worker : restartable)
+    {
+      startWorker(worker);
+    }
+  }
+
+  @Override
+  public boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation)
+  {
+    if (isWorking())
+    {
+      for (List<AlignCalcWorkerI> workers: updating.values())
+      {
+        for (AlignCalcWorkerI worker:workers)
+        if (worker.involves(alignmentAnnotation))
+        {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  @Override
+  public void updateAnnotationFor(Class workerClass)
+  {
+    for (AlignCalcWorkerI worker:canUpdate.toArray(new AlignCalcWorkerI[0]))
+    {
+      if (workerClass.equals(worker.getClass()))
+      {
+        worker.updateAnnotation();
+      }
+    }
+  }
+
+  @Override
+  public List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
+          Class workerClass)
+  {
+    List<AlignCalcWorkerI> workingClass=new ArrayList<AlignCalcWorkerI>();
+    for (AlignCalcWorkerI worker:canUpdate.toArray(new AlignCalcWorkerI[0]))
+    {
+      if (workerClass.equals(worker.getClass()))
+      {
+        workingClass.add(worker);
+      }
+    }
+    return (workingClass.size()==0) ? null : workingClass;
+  }
+
+  @Override
+  public boolean startRegisteredWorkersOfClass(Class workerClass)
+  {
+         List<AlignCalcWorkerI> workers=getRegisteredWorkersOfClass(workerClass);
+         if (workers==null)
+         {
+                 return false;
+         }
+         for (AlignCalcWorkerI worker: workers) {
+                 startWorker(worker);
+         }
+         return true;
+  }
+
+  @Override
+  public void workerMayRun(AlignCalcWorkerI worker)
+  {
+    if (blackList.contains(worker.getClass()))
+    {
+      blackList.remove(worker.getClass());
+    }
+  }
+}
diff --git a/src/jalview/workers/AlignCalcWorker.java b/src/jalview/workers/AlignCalcWorker.java
new file mode 100644 (file)
index 0000000..19a92fb
--- /dev/null
@@ -0,0 +1,53 @@
+/**
+ * 
+ */
+package jalview.workers;
+
+import java.util.List;
+
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+
+/**
+ * Base class for alignment calculation workers 
+ * @author jimp
+ *
+ */
+public abstract class AlignCalcWorker implements AlignCalcWorkerI
+{
+  /**
+   * manager and data source for calculations
+   */
+  protected AlignViewportI alignViewport;
+  protected AlignCalcManagerI calcMan;
+  protected AlignmentViewPanel ap;
+  protected List<AlignmentAnnotation> ourAnnots=null;
+  
+  public AlignCalcWorker(AlignViewportI alignViewport,
+          AlignmentViewPanel alignPanel)
+  {
+    this.alignViewport = alignViewport;
+    calcMan=alignViewport.getCalcManager();
+    ap = alignPanel;    
+  }
+  protected void abortAndDestroy()
+  {
+    if (calcMan!=null) {
+      calcMan.workerComplete(this);
+    }
+    alignViewport=null;
+    calcMan=null;
+    ap=null;
+    
+  }
+  public boolean involves(AlignmentAnnotation i)
+  {
+    return ourAnnots!=null && ourAnnots.contains(i);
+  }
+  
+  // TODO: allow GUI to query workers associated with annotation to add items to annotation label panel popup menu
+
+}
diff --git a/src/jalview/workers/ConsensusThread.java b/src/jalview/workers/ConsensusThread.java
new file mode 100644 (file)
index 0000000..7dd25f8
--- /dev/null
@@ -0,0 +1,117 @@
+package jalview.workers;
+
+import jalview.analysis.AAFrequency;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.schemes.ColourSchemeI;
+
+import java.util.Hashtable;
+
+public class ConsensusThread extends AlignCalcWorker implements AlignCalcWorkerI
+{
+  public ConsensusThread(AlignViewportI alignViewport,
+          AlignmentViewPanel alignPanel)
+  {
+    super(alignViewport, alignPanel);
+  }
+
+  public void run()
+  {
+    try
+    {
+      AlignmentAnnotation consensus = alignViewport.getAlignmentConsensusAnnotation();
+      if (consensus==null) { return; 
+      }
+      calcMan.notifyStart(this); 
+      while (!calcMan.notifyWorking(this)) 
+      {
+        try
+        {
+          if (ap != null)
+          {
+            ap.paintAlignment(false);
+          }
+
+          Thread.sleep(200);
+        } catch (Exception ex)
+        {
+          ex.printStackTrace();
+        }
+      }
+      calcMan.notifyWorking(this);
+      if (alignViewport.isClosed())
+      {
+        abortAndDestroy();
+      }
+      AlignmentI alignment = alignViewport.getAlignment();
+
+      int aWidth = -1;
+
+      if (alignment == null || (aWidth = alignment.getWidth()) < 0)
+      {
+        calcMan.workerComplete(this);
+        // .updatingConservation = false;
+        // AlignViewport.UPDATING_CONSERVATION = false;
+
+        return;
+      }
+      consensus = alignViewport
+              .getAlignmentConsensusAnnotation();
+
+      consensus.annotations = null;
+      consensus.annotations = new Annotation[aWidth];
+      Hashtable[] hconsensus = alignViewport.getSequenceConsensusHash();
+      hconsensus = new Hashtable[aWidth];
+      AAFrequency.calculate(alignment.getSequencesArray(), 0,
+              alignment.getWidth(), hconsensus, true);
+      alignViewport.setSequenceConsensusHash(hconsensus);
+      updateResultAnnotation(true);
+      ColourSchemeI globalColourScheme = alignViewport
+              .getGlobalColourScheme();
+      if (globalColourScheme != null)
+      {
+        globalColourScheme.setConsensus(hconsensus);
+      }
+
+    } catch (OutOfMemoryError error)
+    {
+      calcMan.workerCannotRun(this);
+
+      // consensus = null;
+      // hconsensus = null;
+      ap.raiseOOMWarning("calculating consensus", error);
+    }
+
+    calcMan.workerComplete(this);
+    if (ap != null)
+    {
+      ap.paintAlignment(true);
+    }
+  }
+
+  /**
+   * update the consensus annotation from the sequence profile data using
+   * current visualization settings.
+   */
+  public void updateAnnotation()
+  {
+    updateResultAnnotation(false);
+  }
+
+  public void updateResultAnnotation(boolean immediate)
+  {
+    AlignmentAnnotation consensus = alignViewport
+            .getAlignmentConsensusAnnotation();
+    Hashtable[] hconsensus = alignViewport.getSequenceConsensusHash();
+    if (immediate || !calcMan.isWorking(this) && consensus!=null && hconsensus!=null)
+    {
+      AAFrequency.completeConsensus(consensus, hconsensus, 0,
+            hconsensus.length, alignViewport.getIgnoreGapsConsensus(),
+            alignViewport.isShowSequenceLogo());
+    }
+  }
+}
diff --git a/src/jalview/workers/ConservationThread.java b/src/jalview/workers/ConservationThread.java
new file mode 100644 (file)
index 0000000..7d5c661
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.workers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jalview.analysis.Conservation;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.AlignViewportI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+
+public class ConservationThread extends AlignCalcWorker implements AlignCalcWorkerI
+{
+
+  private int ConsPercGaps = 25; // JBPNote : This should be a configurable property!
+  
+  public ConservationThread(AlignViewportI alignViewport, AlignmentViewPanel alignPanel)
+  {
+    super(alignViewport, alignPanel);
+    ConsPercGaps = alignViewport.getConsPercGaps();
+  }
+  
+  private Conservation cons;
+  AlignmentAnnotation conservation,quality;
+  int alWidth;
+  public void run()
+  {
+    try
+    {
+      calcMan.notifyStart(this); // updatingConservation = true;
+
+      while (!calcMan.notifyWorking(this)) 
+      {
+        try
+        {
+          if (ap != null)
+          {
+            ap.paintAlignment(false);
+          }
+          Thread.sleep(200);
+        } catch (Exception ex)
+        {
+          ex.printStackTrace();
+        }
+      }
+      if (alignViewport.isClosed()) {
+        abortAndDestroy();
+      }
+      List<AlignmentAnnotation>ourAnnot = new ArrayList<AlignmentAnnotation>();
+      AlignmentI alignment=alignViewport.getAlignment();
+      conservation=alignViewport.getAlignmentConservationAnnotation();
+      quality=alignViewport.getAlignmentQualityAnnot();
+      ourAnnot.add(conservation);
+      ourAnnot.add(quality);
+      ourAnnots = ourAnnot;
+      
+      // AlignViewport.UPDATING_CONSERVATION = true;
+      
+      if (alignment==null || (alWidth=alignment.getWidth())< 0)
+      {
+        calcMan.workerComplete(this);
+        //.updatingConservation = false;
+        //AlignViewport.UPDATING_CONSERVATION = false;
+        
+        return;
+      }
+
+      cons = Conservation.calculateConservation("All",
+              jalview.schemes.ResidueProperties.propHash, 3,
+              alignment.getSequences(), 0, alWidth - 1, false, ConsPercGaps, quality!=null);
+      updateResultAnnotation(true);
+    } catch (OutOfMemoryError error)
+    {
+      ap.raiseOOMWarning("calculating conservation", error);
+      calcMan.workerCannotRun(this);
+      // alignViewport.conservation = null;
+      // this.alignViewport.quality = null;
+
+    }
+    calcMan.workerComplete(this);
+
+    if (ap != null)
+    {
+      ap.paintAlignment(true);
+    }
+
+  }
+
+  private void updateResultAnnotation(boolean b)
+  {
+    if (b || !calcMan.isWorking(this) && cons!=null && conservation!=null && quality!=null)
+    cons.completeAnnotations(conservation,
+            quality, 0, alWidth);
+  }
+  @Override
+  public void updateAnnotation()
+  {
+    updateResultAnnotation(false);
+    
+  }
+}
diff --git a/src/jalview/workers/StrucConsensusThread.java b/src/jalview/workers/StrucConsensusThread.java
new file mode 100644 (file)
index 0000000..69236d8
--- /dev/null
@@ -0,0 +1,130 @@
+package jalview.workers;
+
+import java.util.Hashtable;
+
+import jalview.analysis.AAFrequency;
+import jalview.analysis.StructureFrequency;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+
+public class StrucConsensusThread extends AlignCalcWorker implements AlignCalcWorkerI
+{
+  public StrucConsensusThread(AlignViewportI alignViewport,
+          AlignmentViewPanel alignPanel)
+  {
+    super(alignViewport, alignPanel);
+  }
+  AlignmentAnnotation strucConsensus;
+  Hashtable[] hStrucConsensus;
+
+  public void run()
+  {
+    try
+    {
+      calcMan.notifyStart(this);
+      while (!calcMan.notifyWorking(this))
+      {
+        try
+        {
+          if (ap != null)
+          {
+            ap.paintAlignment(false);
+          }
+
+          Thread.sleep(200);
+        } catch (Exception ex)
+        {
+          ex.printStackTrace();
+        }
+      }
+      if (alignViewport.isClosed())
+      {
+        abortAndDestroy();
+      }
+      AlignmentI alignment = alignViewport.getAlignment();
+
+      int aWidth = -1;
+
+      if (alignment == null || (aWidth = alignment.getWidth()) < 0)
+      {
+        calcMan.workerComplete(this);
+        return;
+      }
+      strucConsensus=alignViewport.getAlignmentStrucConsensusAnnotation();
+      hStrucConsensus=alignViewport.getRnaStructureConsensusHash();
+      strucConsensus.annotations = null;
+      strucConsensus.annotations = new Annotation[aWidth];
+
+      hStrucConsensus = new Hashtable[aWidth];
+
+      AlignmentAnnotation[] aa = alignViewport.getAlignment()
+              .getAlignmentAnnotation();
+      AlignmentAnnotation rnaStruc = null;
+      // select rna struct to use for calculation
+      for (int i = 0; i < aa.length; i++)
+      {
+        if (aa[i].getRNAStruc() != null && aa[i].isValidStruc())
+        {
+          rnaStruc = aa[i];
+          break;
+        }
+      }
+      // check to see if its valid
+      
+      if (rnaStruc==null || !rnaStruc.isValidStruc())
+      {
+        calcMan.workerComplete(this);
+        return;
+      }
+      
+      jalview.analysis.StructureFrequency.calculate(alignment.getSequencesArray(), 0,
+              alignment.getWidth(), hStrucConsensus, true, rnaStruc);
+      alignViewport.setRnaStructureConsensusHash(hStrucConsensus);
+      // TODO AlignmentAnnotation rnaStruc!!!
+      updateResultAnnotation(true);
+      if (alignViewport.getGlobalColourScheme()!= null)
+      {
+        alignViewport.getGlobalColourScheme().setConsensus(hStrucConsensus);
+      }
+
+    } catch (OutOfMemoryError error)
+    {
+      calcMan.workerCannotRun(this);
+
+      // consensus = null;
+      // hconsensus = null;
+      ap.raiseOOMWarning("calculating RNA structure consensus", error);
+    }
+
+    calcMan.workerComplete(this);
+    if (ap != null)
+    {
+      ap.paintAlignment(true);
+    }
+
+  }
+  /**
+   * update the consensus annotation from the sequence profile data using
+   * current visualization settings.
+   */
+  public void updateAnnotation()
+  {
+    updateResultAnnotation(false);
+  }
+
+  public void updateResultAnnotation(boolean immediate)
+  {
+    if (immediate || !calcMan.isWorking(this) && strucConsensus!=null && hStrucConsensus!=null)
+    {
+      StructureFrequency.completeConsensus(strucConsensus,
+              hStrucConsensus, 0, hStrucConsensus.length,
+              alignViewport.getIgnoreGapsConsensus(),
+            alignViewport.isShowSequenceLogo());
+    }
+  }
+
+}
\ No newline at end of file
index 108ca03..7d174bc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1b89758..5c6a716 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0686778..9565679 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1220df7..c530b62 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 7c9f575..503245b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c117e4b..9953978 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8c9e08f..d5b3d11 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -57,6 +57,8 @@ public class SequenceFetcher extends ASequenceFetcher
     // alignment is\r
     // 'default' for\r
     // PFAM\r
+    addDBRefSourceImpl(jalview.ws.dbsources.RfamFull.class);\r
+    addDBRefSourceImpl(jalview.ws.dbsources.RfamSeed.class);\r
     registerDasSequenceSources();\r
   }\r
 \r
index 3f10686..cc7f70c 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 993865c..ed58e20 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 608a282..fc0bdb3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d803bea..536ba32 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1345f48..899fa03 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 9573f72..6a3b3f7 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 80206c0..8832ff6 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1cbfef8..ea60232 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 7586856..0b44e5a 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 8ce586a..37108ca 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -37,7 +37,7 @@ import jalview.ws.seqfetcher.DbSourceProxyImpl;
  * @author JimP\r
  * \r
  */\r
-abstract public class Pfam extends DbSourceProxyImpl implements\r
+abstract public class Pfam extends Xfam implements\r
         DbSourceProxy\r
 {\r
 \r
@@ -95,17 +95,19 @@ abstract public class Pfam extends DbSourceProxyImpl implements
    * \r
    * @see jalview.ws.DbSourceProxy#getDbVersion()\r
    */\r
-  public String getDbVersion()\r
+  @Override\r
+public String getDbVersion()\r
   {\r
     // TODO Auto-generated method stub\r
     return null;\r
   }\r
 \r
-  /**\r
+  /**Returns base URL for selected Pfam alignment type\r
    * \r
    * @return PFAM URL stub for this DbSource\r
    */\r
-  protected abstract String getPFAMURL();\r
+  @Override\r
+protected abstract String getXFAMURL();\r
 \r
   /*\r
    * (non-Javadoc)\r
@@ -118,7 +120,7 @@ abstract public class Pfam extends DbSourceProxyImpl implements
     // individual references to each sequence in each family alignment that's\r
     // retrieved.\r
     startQuery();\r
-    AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getPFAMURL()\r
+    AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getXFAMURL()\r
             + queries.trim().toUpperCase(), jalview.io.FormatAdapter.URL,\r
             "STH");\r
     for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)\r
@@ -151,4 +153,9 @@ abstract public class Pfam extends DbSourceProxyImpl implements
   /*\r
    * public String getDbName() { return "PFAM"; // getDbSource(); }\r
    */\r
+  \r
+  \r
+  public String getXfamSource() { return jalview.datamodel.DBRefSource.PFAM; }\r
+  \r
+  \r
 }\r
index 5f579f6..93b6227 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -35,7 +35,7 @@ public class PfamFull extends Pfam implements DbSourceProxy
    * \r
    * @see jalview.ws.dbsources.Pfam#getPFAMURL()\r
    */\r
-  protected String getPFAMURL()\r
+  protected String getXFAMURL()\r
   {\r
     return "http://pfam.sanger.ac.uk/family/alignment/download/format?alnType=full&format=stockholm&order=t&case=l&gaps=default&entry=";\r
   }\r
@@ -60,4 +60,8 @@ public class PfamFull extends Pfam implements DbSourceProxy
     return "PF03760";\r
   }\r
 \r
+public String getDbVersion() {\r
+       return null;\r
+}\r
+\r
 }\r
index 0e85f65..98febad 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
@@ -37,7 +37,7 @@ public class PfamSeed extends Pfam implements DbSourceProxy
    * \r
    * @see jalview.ws.dbsources.Pfam#getPFAMURL()\r
    */\r
-  protected String getPFAMURL()\r
+  protected String getXFAMURL()\r
   {\r
     return "http://pfam.sanger.ac.uk/family/alignment/download/format?alnType=seed&format=stockholm&order=t&case=l&gaps=default&entry=";\r
   }\r
diff --git a/src/jalview/ws/dbsources/Rfam.java b/src/jalview/ws/dbsources/Rfam.java
new file mode 100644 (file)
index 0000000..2842b82
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.ws.dbsources;
+
+import com.stevesoft.pat.Regex;
+
+import jalview.ws.seqfetcher.DbSourceProxy;
+
+/**
+ * Contains methods for fetching sequences from Rfam database
+ * 
+ * @author Lauren Michelle Lui
+ */
+abstract public class Rfam extends Xfam implements DbSourceProxy
+{
+
+  public Rfam()
+  {
+    super();
+    // all extensions of this RFAM source base class are DOMAINDB sources
+    addDbSourceProperty(jalview.datamodel.DBRefSource.DOMAINDB);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.DbSourceProxy#getAccessionSeparator() Left here for
+   * consistency with Pfam class
+   */
+  public String getAccessionSeparator()
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.DbSourceProxy#getAccessionValidator() * Left here for
+   */
+  public Regex getAccessionValidator()
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * Left here for consistency with Pfam class
+   * 
+   * @see jalview.ws.DbSourceProxy#getDbSource() public String getDbSource() { *
+   * this doesn't work - DbSource is key for the hash of DbSourceProxy instances
+   * - 1:many mapping for DbSource to proxy will be lost. * suggest : RFAM is an
+   * 'alignment' source - means proxy is higher level than a sequence source.
+   * return jalview.datamodel.DBRefSource.RFAM; }
+   */
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.DbSourceProxy#getDbVersion()
+   */
+  @Override
+  public String getDbVersion()
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  /**Returns base URL for selected Rfam alignment type
+   * 
+   * @return RFAM URL stub for this DbSource
+   */
+  @Override
+  protected abstract String getXFAMURL();
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
+   */
+  public boolean isValidReference(String accession)
+  {
+    return accession.indexOf("RF") == 0;
+  }
+
+  /* (non-Javadoc)
+   * @see jalview.ws.dbsources.Xfam#getXfamSource()
+   */
+  public String getXfamSource()
+  {
+    return jalview.datamodel.DBRefSource.RFAM;
+  }
+
+}
diff --git a/src/jalview/ws/dbsources/RfamFull.java b/src/jalview/ws/dbsources/RfamFull.java
new file mode 100644 (file)
index 0000000..122a39f
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+
+package jalview.ws.dbsources;
+
+import jalview.ws.seqfetcher.DbSourceProxy;
+
+/**
+ * Flyweight class specifying retrieval of Full family alignments from RFAM
+ * 
+ * @author Lauren Michelle Lui
+ * 
+ */
+public class RfamFull extends Rfam implements DbSourceProxy
+{
+  public RfamFull()
+  {
+    super();
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.dbsources.Rfam#getXFAMURL()
+   */
+  protected String getXFAMURL()
+  {
+    return "http://rfam.sanger.ac.uk/family/alignment/download/format?alnType=full&nseLabels=0&format=stockholm&acc=";
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.seqfetcher.DbSourceProxy#getDbName()
+   */
+  public String getDbName()
+  {
+    return "RFAM (Full)";
+  }
+
+  public String getDbSource()
+  {
+    return getDbName(); // so we have unique DbSource string.
+  }
+
+  public String getTestQuery()
+  {
+    // Can be retrieved from http://rfam.janelia.org/cgi-bin/getdesc?acc=RF00014
+    // or
+    // http://rfam.sanger.ac.uk/family/alignment/download/format?alnType=full&nseLabels=0&format=stockholm&acc=RF00014
+    return "RF00014";
+  }
+
+  public String getDbVersion()
+  {
+    return null;
+  }
+
+}
diff --git a/src/jalview/ws/dbsources/RfamSeed.java b/src/jalview/ws/dbsources/RfamSeed.java
new file mode 100644 (file)
index 0000000..63431bc
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.ws.dbsources;
+
+import jalview.ws.seqfetcher.DbSourceProxy;
+
+/**
+ * Flyweight class specifying retrieval of Seed family alignments from RFAM
+ * 
+ * @author Lauren Michelle Lui
+ * 
+ */
+public class RfamSeed extends Rfam implements DbSourceProxy
+{
+  public RfamSeed()
+  {
+    super();
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.dbsources.Rfam#getRFAMURL()
+   */
+  protected String getXFAMURL()
+  {
+    return "http://rfam.sanger.ac.uk/family/alignment/download/format?alnType=seed&nseLabels=0&format=stockholm&acc=";
+    // Janelia Farms url
+    // "http://rfam.janelia.org/cgi-bin/getalignment?type=seed&fmt=stockholm&acc=";
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.seqfetcher.DbSourceProxy#getDbName()
+   */
+  public String getDbName()
+  {
+    return "RFAM (Seed)";
+  }
+
+  public String getDbSource()
+  {
+    return getDbName(); // so we have unique DbSource string.
+  }
+
+  public String getTestQuery()
+  {
+    return "RF00014";
+  } // http://rfam.janelia.org/cgi-bin/getdesc?acc=RF00014
+
+  public String getDbVersion()
+  {
+    return null;
+  }
+
+}
index 17d0ca8..167758f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1d1b9f0..901d615 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
diff --git a/src/jalview/ws/dbsources/Xfam.java b/src/jalview/ws/dbsources/Xfam.java
new file mode 100644 (file)
index 0000000..031ef2e
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * 
+ * 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/>.
+ */
+package jalview.ws.dbsources;
+
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.ws.seqfetcher.DbSourceProxyImpl;
+
+/**
+ * Acts as a superclass for the Rfam and Pfam classes
+ * 
+ * @author Lauren Michelle Lui
+ * 
+ */
+public abstract class Xfam extends DbSourceProxyImpl
+{
+
+  public Xfam()
+  {
+    super();
+  }
+
+  protected abstract String getXFAMURL();
+
+  public abstract String getDbVersion();
+
+  abstract String getXfamSource();
+
+  public AlignmentI getSequenceRecords(String queries) throws Exception
+  {
+    // TODO: this is not a perfect implementation. We need to be able to add
+    // individual references to each sequence in each family alignment that's
+    // retrieved.
+    startQuery();
+    AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getXFAMURL()
+            + queries.trim().toUpperCase(), jalview.io.FormatAdapter.URL,
+            "STH");
+    for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
+    {
+      rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(),
+      // getDbSource(),
+              getDbVersion(), queries.trim().toUpperCase()));
+      if (!getDbSource().equals(getXfamSource()))
+      { // add the specific ref too
+        rcds.getSequenceAt(s).addDBRef(
+                new DBRefEntry(getDbSource(), getDbVersion(), queries
+                        .trim().toUpperCase()));
+      }
+    }
+    stopQuery();
+    return rcds;
+  }
+
+}
\ No newline at end of file
index 7135d0c..b837354 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 03cc637..b7e08be 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 53f6436..5226f2d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 5dd1e42..7d5b334 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index c401452..3bbf3a3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b429c97..aba0f92 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 796c2af..a478b87 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 18fed82..98061f5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1a9552b..f6f1779 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 602eb50..363296e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2628f04..8cd2fe1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index aeefcd1..d080c4a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 79ef6d1..061a63f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 481ff27..6c38750 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/ws/jws2/AAConsClient.java b/src/jalview/ws/jws2/AAConsClient.java
new file mode 100644 (file)
index 0000000..289d49b
--- /dev/null
@@ -0,0 +1,150 @@
+package jalview.ws.jws2;
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.gui.AlignFrame;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
+
+import compbio.data.sequence.Score;
+import compbio.metadata.Argument;
+
+public class AAConsClient extends JabawsAlignCalcWorker
+{
+
+  public AAConsClient(Jws2Instance service, AlignFrame alignFrame,
+          WsParamSetI preset, List<Argument> paramset)
+  {
+    super(service, alignFrame, preset, paramset);
+    submitGaps=true;
+    alignedSeqs=true;
+    nucleotidesAllowed=false;
+    proteinAllowed=true;
+  }
+
+  public String getServiceActionText()
+  {
+    return "calculating Amino acid consensus using AACons service";
+  }
+
+  /**
+   * update the consensus annotation from the sequence profile data using
+   * current visualization settings.
+   */
+
+  public void updateResultAnnotation(boolean immediate)
+  {
+
+    if (immediate || !calcMan.isWorking(this) && scoremanager != null)
+    {
+      AlignmentAnnotation annotation;
+      ;
+      Map<String, TreeSet<Score>> scoremap = scoremanager.asMap();
+      int alWidth = alignViewport.getAlignment().getWidth();
+      AlignmentI alignment;
+      int ann = (alignment = alignViewport.getAlignment())
+              .getAlignmentAnnotation().length;
+      ArrayList<AlignmentAnnotation> ourAnnot = new ArrayList<AlignmentAnnotation>();
+      for (String score : scoremap.keySet())
+      {
+        TreeSet<Score> scores = scoremap.get(score);
+        for (Score scr : scores)
+        {
+          if (scr.getRanges() != null && scr.getRanges().size() > 0)
+          {
+            /**
+             * annotation in range annotation = findOrCreate(scr.getMethod(),
+             * true, null, null); Annotation[] elm = new Annotation[alWidth];
+             * Iterator<Float> vals = scr.getScores().iterator(); for (Range rng
+             * : scr.getRanges()) { float val = vals.next().floatValue(); for
+             * (int i = rng.from; i <= rng.to; i++) { elm[i] = new
+             * Annotation("", "", ' ', val); } } annotation.annotations = elm;
+             * annotation.validateRangeAndDisplay();
+             */
+          }
+          else
+          {
+            // simple annotation row
+            annotation = findOrCreate(scr.getMethod(), true, null, null);
+            Annotation[] elm = new Annotation[alWidth];
+            if (alWidth == scr.getScores().size())
+            {
+              Iterator<Float> vals = scr.getScores().iterator();
+              float m = 0f, x = 0f;
+              for (int i = 0; vals.hasNext(); i++)
+              {
+                float val = vals.next().floatValue();
+                if (i == 0)
+                {
+                  m = val;
+                  x = val;
+                }
+                else
+                {
+                  if (m > val)
+                  {
+                    m = val;
+                  }
+                  ;
+                  if (x < val)
+                  {
+                    x = val;
+                  }
+                }
+                elm[i] = new Annotation("", "" + val, ' ', val);
+              }
+
+              annotation.annotations = elm;
+              annotation.belowAlignment = true;
+              if (x < 0)
+              {
+                x = 0;
+              }
+              x += (x - m) * 0.1;
+              annotation.graphMax = x;
+              annotation.graphMin = m;
+              annotation.validateRangeAndDisplay();
+              ourAnnot.add(annotation);
+            }
+          }
+        }
+      }
+      if (ourAnnot.size() > 0)
+      {
+        List<AlignmentAnnotation> our = ourAnnots;
+        ourAnnots = ourAnnot;
+        if (our != null)
+        {
+          if (our.size() > 0)
+          {
+            for (AlignmentAnnotation an : our)
+            {
+              if (!ourAnnots.contains(an))
+              {
+                // remove the old annotation
+                alignment.deleteAnnotation(an);
+              }
+            }
+          }
+          our.clear();
+        }
+      }
+      // if (ann !=
+      // alignViewport.getAlignment().getAlignmentAnnotation().length)
+      {
+        ap.adjustAnnotationHeight();
+      }
+      /*
+       * else { ap.paintAlignment(true); }
+       */
+    }
+  }
+
+}
diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java
new file mode 100644 (file)
index 0000000..3fe25af
--- /dev/null
@@ -0,0 +1,123 @@
+package jalview.ws.jws2;
+
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.Iterator;
+import java.util.List;
+
+import compbio.data.sequence.Range;
+import compbio.data.sequence.Score;
+import compbio.data.sequence.ScoreManager.ScoreHolder;
+import compbio.metadata.Argument;
+
+public class AADisorderClient extends JabawsAlignCalcWorker implements
+        AlignCalcWorkerI
+{
+
+  String typeName;
+
+  String methodName;
+
+  String groupName;
+
+  AlignFrame af;
+
+  public AADisorderClient(Jws2Instance sh, AlignFrame alignFrame,
+          WsParamSetI preset, List<Argument> paramset)
+  {
+    super(sh, alignFrame, preset, paramset);
+    af = alignFrame;
+    typeName = sh.action;
+    methodName = sh.serviceType;
+
+    submitGaps = false;
+    alignedSeqs = false;
+    nucleotidesAllowed = false;
+    proteinAllowed = true;
+    bySequence = true;
+  }
+
+  @Override
+  public String getServiceActionText()
+  {
+    return "Submitting amino acid sequences for disorder prediction.";
+  }
+
+  @Override
+  public void updateResultAnnotation(boolean immediate)
+  {
+
+    if (immediate || !calcMan.isWorking(this) && scoremanager != null)
+    {
+      boolean dispFeatures = false;
+      for (String seqId : seqNames.keySet())
+      {
+        SequenceI dseq, seq = seqNames.get(seqId);
+        int base = seq.getStart() - 1;
+        while ((dseq = seq).getDatasetSequence() != null)
+        {
+          seq = seq.getDatasetSequence();
+        }
+        ;
+        ScoreHolder scores = scoremanager.getAnnotationForSequence(seqId);
+
+        for (Score scr : scores.scores)
+        {
+
+          if (scr.getRanges() != null && scr.getRanges().size() > 0)
+          {
+            Iterator<Float> vals = scr.getScores().iterator();
+            // make features on sequence
+            for (Range rn : scr.getRanges())
+            {
+
+              SequenceFeature sf;
+              if (vals.hasNext())
+              {
+                sf = new SequenceFeature(typeName + "(" + scr.getMethod()
+                        + ")", "Disordered Region", base + rn.from, base
+                        + rn.to, vals.next().floatValue(), methodName);
+              }
+              else
+              {
+                sf = new SequenceFeature(typeName + "(" + scr.getMethod()
+                        + ")", "Disordered Region", null, base + rn.from,
+                        base + rn.to, methodName);
+              }
+              dseq.addSequenceFeature(sf);
+              dispFeatures = true;
+            }
+          }
+          else
+          {
+            Iterator<Float> vals = scr.getScores().iterator();
+            for (int start = base + 1; vals.hasNext(); start++)
+            {
+              SequenceFeature sf = new SequenceFeature(typeName + "("
+                      + scr.getMethod() + ")", "Disordered Region", start,
+                      start, vals.next().floatValue(), methodName);
+              dseq.addSequenceFeature(sf);
+              dispFeatures = true;
+            }
+          }
+        }
+      }
+      {
+        if (dispFeatures)
+        {
+          af.alignPanel.av.setShowSequenceFeatures(true);
+          ap.paintAlignment(true);
+        }
+      }
+      /*
+       * else { ap.paintAlignment(true); }
+       */
+    }
+  }
+
+}
index 28ed672..d05f4f6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7382b9f..3da8f92 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 856646c..766bcf7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -33,10 +33,10 @@ import compbio.metadata.Preset;
 import compbio.metadata.PresetManager;
 import compbio.metadata.RunnerConfig;
 
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
 import jalview.ws.jws2.dm.JabaOption;
 import jalview.ws.jws2.dm.JabaParameter;
 import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.ArgumentI;
 import jalview.ws.params.ParamDatastoreI;
 import jalview.ws.params.ParamManager;
index 8586d24..401a9af 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -17,7 +17,7 @@
  */
 package jalview.ws.jws2;
 
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.ArgumentI;
 import jalview.ws.params.WsParamSetI;
 
index 74a5df1..089acea 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
 package jalview.ws.jws2;
 
 import jalview.bin.Cache;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
 
-import compbio.data.msa.MsaWS;
+import java.util.HashSet;
+import java.util.Set;
+
+import compbio.data.msa.Category;
+import compbio.data.msa.JABAService;
 import compbio.ws.client.Jws2Client;
 import compbio.ws.client.Services;
 
 /**
  * @author JimP
- *
+ * 
  */
 public class JabaWsServerQuery implements Runnable
 {
 
-  Jws2Discoverer jws2Discoverer=null;
-  String jwsservers=null;
-  boolean quit=false,
-  running=false;
+  Jws2Discoverer jws2Discoverer = null;
+
+  String jwsservers = null;
+
+  boolean quit = false, running = false;
+
   /**
    * @return the running
    */
-  public  boolean isRunning()
+  public boolean isRunning()
   {
     return running;
   }
 
   /**
-   * @param quit the quit to set
+   * @param quit
+   *          the quit to set
    */
   public void setQuit(boolean quit)
   {
@@ -56,52 +64,122 @@ public class JabaWsServerQuery implements Runnable
   public JabaWsServerQuery(Jws2Discoverer jws2Discoverer, String jwsservers)
   {
     this.jws2Discoverer = jws2Discoverer;
-    this.jwsservers=jwsservers;
+    this.jwsservers = jwsservers;
   }
-
-  /* (non-Javadoc)
+  Services[] JABAWS1SERVERS=new Services[]
+          { Services.ClustalWS, Services.MuscleWS, Services.MafftWS,
+          Services.ProbconsWS, Services.TcoffeeWS };
+  Services[] JABAWS2SERVERS=new Services[]
+          { Services.ClustalWS, Services.MuscleWS, Services.MafftWS,
+          Services.ProbconsWS, Services.TcoffeeWS, Services.AAConWS, Services.DisemblWS, Services.GlobPlotWS, Services.IUPredWS, Services.JronnWS };
+  
+  /*
+   * (non-Javadoc)
+   * 
    * @see java.lang.Runnable#run()
    */
   @Override
   public void run()
   {
-    running=true;
-        try
+    running = true;
+    try
     {
       if (Jws2Client.validURL(jwsservers))
       {
-        boolean noservices=true;
+        compbio.data.msa.RegistryWS registry = null;
+        Set svccategories = null;
+        boolean noservices = true;
         // look for services
-        for (Services srv : Services.values())
+        boolean jabasws2 = false;
+        // If we are dealing with a JABAWS2 service, then just go and ask the
+        // JABAWS 2 service registry
+        Set<Services> srv_set = new HashSet<Services>();
+
+        Set<Category> categories = Category.getCategories();
+        String svc_cat;
+
+        try
         {
-          if (quit)
+          // JBPNote: why is RegistryWS in compbio.data.msa ?
+          registry = Jws2Client.connectToRegistry(jwsservers);
+          if (registry != null)
           {
-            running=false;
-            return;
+            // System.err.println("Test Services Output\n"
+            // + registry.testAllServices());
+            // TODO: enumerate services and test those that haven't been tested
+            // in the last n-days/hours/etc.
+
+            jabasws2 = true;
+            srv_set = registry.getSupportedServices();
+            svccategories = registry.getServiceCategories();
+
           }
-          MsaWS service = null;
-          try
+        } catch (Exception ex)
+        {
+          System.err.println("Exception whilst trying to get at registry:");
+          ex.printStackTrace();
+          // if that failed, then we are probably working with a JABAWS1 server.
+          // in that case, look for each service endpoint
+          System.err.println("JWS2 Discoverer: " + jwsservers
+                  + " is a JABAWS1 server. Using hardwired list.");
+          for (Services srv : JABAWS1SERVERS)
           {
-            service = Jws2Client.connect(jwsservers, srv);
-          } catch (Exception e)
+            srv_set.add(srv);
+          }
+        }
+        for (Category cat : categories)
+        {
+          for (Services srv : cat.getServices())
           {
-            System.err.println("Jws2 Discoverer: Problem on "
-                    + jwsservers + " with service " + srv + ":\n"
-                    + e.getMessage());
-            if (!(e instanceof javax.xml.ws.WebServiceException))
+            if (quit)
             {
-              e.printStackTrace();
+              running = false;
+              return;
             }
-            // For moment, report service as a problem.
-            jws2Discoverer.addInvalidServiceUrl(jwsservers);
-          }
-          ;
-          if (service != null)
-          {
-            noservices=false;
-            jws2Discoverer.addService(jwsservers, srv, service);
+            if (!srv_set.contains(srv))
+            {
+              continue;
+            }
+            JABAService service = null;
+            try
+            {
+              service = Jws2Client.connect(jwsservers, srv);
+            } catch (Exception e)
+            {
+              System.err.println("Jws2 Discoverer: Problem on "
+                      + jwsservers + " with service " + srv + ":\n"
+                      + e.getMessage());
+              if (!(e instanceof javax.xml.ws.WebServiceException))
+              {
+                e.printStackTrace();
+              }
+              // For moment, report service as a problem.
+              jws2Discoverer.addInvalidServiceUrl(jwsservers);
+            }
+            ;
+            if (service != null)
+            {
+              noservices = false;
+              Jws2Instance svc = null;
+              if (registry != null)
+              {
+
+                String description = registry.getServiceDescription(srv);
+
+                svc = new Jws2Instance(jwsservers, srv.toString(),
+                        cat.name, description, service);
+              }
+              if (svc == null)
+              {
+                svc = new Jws2Instance(jwsservers, srv.toString(), cat.name,
+                        "JABAWS 1 Alignment Service", service);
+              }
+              jws2Discoverer.addService(jwsservers, svc);
+            }
+
           }
         }
+
         if (noservices)
         {
           jws2Discoverer.addUrlwithnoservices(jwsservers);
@@ -122,7 +200,7 @@ public class JabaWsServerQuery implements Runnable
       Cache.log.error("Exception when discovering Jws2 services.", e);
       jws2Discoverer.addInvalidServiceUrl(jwsservers);
     }
-    running=false;
+    running = false;
   }
 
 }
diff --git a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java
new file mode 100644 (file)
index 0000000..a11cc35
--- /dev/null
@@ -0,0 +1,432 @@
+package jalview.ws.jws2;
+
+import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.workers.AlignCalcWorker;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import compbio.data.msa.SequenceAnnotation;
+import compbio.data.sequence.FastaSequence;
+import compbio.data.sequence.ScoreManager;
+import compbio.metadata.Argument;
+import compbio.metadata.ChunkHolder;
+import compbio.metadata.JobStatus;
+import compbio.metadata.JobSubmissionException;
+import compbio.metadata.Option;
+import compbio.metadata.ResultNotAvailableException;
+import compbio.metadata.WrongParameterException;
+
+public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
+{
+
+  @SuppressWarnings("unchecked")
+  protected SequenceAnnotation aaservice;
+
+  protected ScoreManager scoremanager;
+
+  protected WsParamSetI preset;
+
+  protected List<Argument> arguments;
+
+  public JabawsAlignCalcWorker(AlignViewportI alignViewport,
+          AlignmentViewPanel alignPanel)
+  {
+    super(alignViewport, alignPanel);
+  }
+
+  public JabawsAlignCalcWorker(Jws2Instance service, AlignFrame alignFrame,
+          WsParamSetI preset, List<Argument> paramset)
+  {
+    this(alignFrame.getCurrentView(), alignFrame.alignPanel);
+    this.preset = preset;
+    this.arguments = paramset;
+    aaservice = (SequenceAnnotation) service.service;
+
+  }
+
+  public WsParamSetI getPreset()
+  {
+    return preset;
+  }
+
+  public List<Argument> getArguments()
+  {
+    return arguments;
+  }
+
+  /**
+   * reconfigure and restart the AAConsClient. This method will spawn a new
+   * thread that will wait until any current jobs are finished, modify the
+   * parameters and restart the conservation calculation with the new values.
+   * 
+   * @param newpreset
+   * @param newarguments
+   */
+  public void updateParameters(final WsParamSetI newpreset,
+          final List<Argument> newarguments)
+  {
+    if (calcMan.isWorking(this))
+    {
+      new Thread(new Runnable()
+      {
+        @Override
+        public void run()
+        {
+
+          try
+          {
+            Thread.sleep(200);
+          } catch (InterruptedException x)
+          {
+          }
+          ;
+          updateParameters(newpreset, newarguments);
+        }
+      }).start();
+    }
+    else
+    {
+      preset = newpreset;
+      arguments = newarguments;
+      calcMan.startWorker(this);
+    }
+  }
+
+  public List<Option> getJabaArguments()
+  {
+    List<Option> newargs = new ArrayList<Option>();
+    if (preset != null && preset instanceof JabaWsParamSet)
+    {
+      newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
+    }
+    if (arguments != null && arguments.size() > 0)
+    {
+      for (Argument rg : arguments)
+      {
+        if (Option.class.isAssignableFrom(rg.getClass()))
+        {
+          newargs.add((Option) rg);
+        }
+      }
+    }
+    return newargs;
+  }
+
+  @Override
+  public void run()
+  {
+    if (aaservice == null)
+    {
+      return;
+    }
+
+    try
+    {
+      if (checkDone())
+      {
+        return;
+      }
+      List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
+              .getAlignment());
+
+      if (seqs == null)
+      {
+        calcMan.workerComplete(this);
+        return;
+      }
+
+      AlignmentAnnotation[] aa = alignViewport.getAlignment()
+              .getAlignmentAnnotation();
+
+      String rslt;
+      if (preset == null)
+      {
+        rslt = aaservice.analize(seqs);
+      }
+      else
+      {
+        try
+        {
+          rslt = aaservice.customAnalize(seqs, getJabaArguments());
+        } catch (WrongParameterException x)
+        {
+          throw new JobSubmissionException(
+                  "Invalid paremeter set. Check Jalview implementation.", x);
+
+        }
+      }
+      boolean finished = false;
+      long rpos = 0;
+      do
+      {
+        JobStatus status = aaservice.getJobStatus(rslt);
+        if (status.equals(JobStatus.FINISHED))
+        {
+          finished = true;
+        }
+        long cpos;
+        ChunkHolder stats;
+        do
+        {
+          cpos = rpos;
+          try
+          {
+            stats = aaservice.pullExecStatistics(rslt, rpos);
+          } catch (Exception x)
+          {
+
+            if (x.getMessage().contains(
+                    "Position in a file could not be negative!"))
+            {
+              // squash index out of bounds exception- seems to happen for
+              // disorder predictors which don't (apparently) produce any
+              // progress information and JABA server throws an exception
+              // because progress length is -1.
+              stats = null;
+            }
+            else
+            {
+              throw x;
+            }
+          }
+          if (stats != null)
+          {
+            System.out.print(stats.getChunk());
+            rpos = stats.getNextPosition();
+          }
+        } while (stats != null && rpos > cpos);
+
+        if (!finished && status.equals(JobStatus.FAILED))
+        {
+          try
+          {
+            Thread.sleep(200);
+          } catch (InterruptedException x)
+          {
+          }
+          ;
+        }
+
+      } while (!finished);
+      try
+      {
+        Thread.sleep(200);
+      } catch (InterruptedException x)
+      {
+      }
+      ;
+      scoremanager = aaservice.getAnnotation(rslt);
+      if (scoremanager != null)
+      {
+        updateResultAnnotation(true);
+      }
+    } catch (JobSubmissionException x)
+    {
+
+      System.err.println("submission error:");
+      x.printStackTrace();
+      calcMan.workerCannotRun(this);
+    } catch (ResultNotAvailableException x)
+    {
+      System.err.println("collection error:");
+      x.printStackTrace();
+      calcMan.workerCannotRun(this);
+
+    } catch (OutOfMemoryError error)
+    {
+      calcMan.workerCannotRun(this);
+
+      // consensus = null;
+      // hconsensus = null;
+      ap.raiseOOMWarning(getServiceActionText(), error);
+    } catch (Exception x)
+    {
+      calcMan.workerCannotRun(this);
+
+      // consensus = null;
+      // hconsensus = null;
+      System.err
+              .println("Blacklisting worker due to unexpected exception:");
+      x.printStackTrace();
+    } finally
+    {
+
+      calcMan.workerComplete(this);
+      if (ap != null)
+      {
+        ap.paintAlignment(true);
+      }
+    }
+
+  }
+
+  public void updateAnnotation()
+  {
+    updateResultAnnotation(false);
+  }
+
+  public abstract void updateResultAnnotation(boolean immediate);
+
+  public abstract String getServiceActionText();
+
+  boolean submitGaps = true;
+
+  boolean alignedSeqs = true;
+
+  boolean nucleotidesAllowed = false;
+
+  boolean proteinAllowed = false;
+
+  /**
+   * record sequences for mapping result back to afterwards
+   */
+  protected boolean bySequence = false;
+
+  Map<String, SequenceI> seqNames;
+
+  public List<FastaSequence> getInputSequences(AlignmentI alignment)
+  {
+
+    if (alignment == null || alignment.getWidth() <= 0
+            || alignment.getSequences() == null
+//             || (alignedSeqs && !alignment.isAligned() && !submitGaps)
+            || alignment.isNucleotide() ? !nucleotidesAllowed
+            : !proteinAllowed)
+    {
+      return null;
+    }
+    List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
+
+    int minlen = 10;
+    int ln=-1;
+    if (bySequence)
+    {
+      seqNames = new HashMap<String, SequenceI>();
+    }
+    for (SequenceI sq : ((List<SequenceI>) alignment.getSequences()))
+    {
+
+      if (sq.getEnd() - sq.getStart() > minlen - 1)
+      {
+        String newname = SeqsetUtils.unique_name(seqs.size() + 1);
+        // make new input sequence with or without gaps
+        if (seqNames != null)
+        {
+          seqNames.put(newname, sq);
+        }
+        FastaSequence seq;
+        seqs.add(seq=new compbio.data.sequence.FastaSequence(newname,
+                (submitGaps) ? sq.getSequenceAsString() : AlignSeq
+                        .extractGaps(jalview.util.Comparison.GapChars,
+                                sq.getSequenceAsString())));
+        if (seq.getSequence().length()>ln)
+        {
+          ln = seq.getSequence().length();
+        }
+      }
+    }
+    if (alignedSeqs && submitGaps)
+    {
+      // try real hard to return something submittable
+      // TODO: some of AAcons measures need a minimum of two or three amino acids at each position, and aacons doesn't gracefully degrade.
+      for (int p=0; p<seqs.size();p++)
+      {
+        FastaSequence sq=seqs.get(p);
+        int l=sq.getSequence().length();
+        if (l<ln)
+        {
+          char[] padded=new char[ln];
+          System.arraycopy(sq.getSequence().toCharArray(),0,padded,0,sq.getSequence().length());
+          while (l<ln)
+          {
+            padded[l++]='-';
+          }
+          seqs.set(p, new compbio.data.sequence.FastaSequence(sq.getId(), new String(padded)));
+        }
+      }
+      
+    }
+    return seqs;
+  }
+
+  protected AlignmentAnnotation findOrCreate(String name, boolean autoCalc,
+          SequenceI seqRef, SequenceGroup groupRef)
+  {
+    for (AlignmentAnnotation annot : alignViewport.getAlignment()
+            .getAlignmentAnnotation())
+    {
+      if (annot.autoCalculated == autoCalc
+              && annot.getCalcId().equals(name)
+              && annot.sequenceRef == seqRef && annot.groupRef == groupRef)
+      {
+        return annot;
+      }
+    }
+    AlignmentAnnotation annot = new AlignmentAnnotation(name, name,
+            new Annotation[1], 0f, 0f, AlignmentAnnotation.BAR_GRAPH);
+    annot.hasText = false;
+    annot.setCalcId(new String(name));
+    annot.autoCalculated = autoCalc;
+    if (seqRef != null)
+    {
+      annot.setSequenceRef(seqRef);
+    }
+    annot.groupRef = groupRef;
+    alignViewport.getAlignment().addAnnotation(annot);
+
+    return annot;
+  }
+
+  /**
+   * notify manager that we have started, and wait for a free calculation slot
+   * 
+   * @return true if slot is obtained and work still valid, false if another
+   *         thread has done our work for us.
+   */
+  boolean checkDone()
+  {
+    calcMan.notifyStart(this);
+    // ap.paintAlignment(false);
+    while (!calcMan.notifyWorking(this))
+    {
+      if (calcMan.isWorking(this))
+      {
+        return true;
+      }
+      try
+      {
+        if (ap != null)
+        {
+          ap.paintAlignment(false);
+        }
+
+        Thread.sleep(200);
+      } catch (Exception ex)
+      {
+        ex.printStackTrace();
+      }
+    }
+    if (alignViewport.isClosed())
+    {
+      abortAndDestroy();
+      return true;
+    }
+    return false;
+  }
+
+}
index 6e60c07..e6b4cf5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
  */
 package jalview.ws.jws2;
 
+import java.util.List;
+
 import javax.swing.JMenu;
 
+import compbio.metadata.Argument;
+
 import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
 import jalview.gui.WebserviceInfo;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
+import jalview.gui.WsJobParameters;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
 
 /**
- * provides metadata for a jws2 service instance - resolves names, etc.
+ * provides metadata for a jabaws2 service instance - resolves names, etc.
  * 
  * @author JimP
  * 
  */
 public abstract class Jws2Client extends jalview.ws.WSClient
 {
+  protected AlignFrame alignFrame;
+
+  protected WsParamSetI preset;
+
+  protected List<Argument> paramset;
+
+  public Jws2Client(AlignFrame _alignFrame,
+          WsParamSetI preset, List<Argument> arguments)
+  {
+    alignFrame = _alignFrame;
+    this.preset = preset;
+    if (preset != null)
+    {
+      if (!((preset instanceof JabaPreset) || preset instanceof JabaWsParamSet))
+      {
+        /*
+         * { this.preset = ((JabaPreset) preset).p; } else if (preset instanceof
+         * JabaWsParamSet) { List<Argument> newargs = new ArrayList<Argument>();
+         * JabaWsParamSet pset = ((JabaWsParamSet) preset); for (Option opt :
+         * pset.getjabaArguments()) { newargs.add(opt); } if (arguments != null
+         * && arguments.size() > 0) { // merge arguments with preset's own
+         * arguments. for (Argument opt : arguments) { newargs.add(opt); } }
+         * paramset = newargs; } else {
+         */
+        throw new Error(
+                "Implementation error: Can only instantiate Jaba parameter sets.");
+      }
+    }
+    else
+    {
+      // just provided with a bunch of arguments
+      this.paramset = arguments;
+    }
+  }
+
+  boolean processParams(Jws2Instance sh, boolean editParams)
+  {
+    return processParams(sh, editParams, false);
+  }
+  protected boolean processParams(Jws2Instance sh, boolean editParams,
+          boolean adjustingExisting)
+  {
+
+    if (editParams)
+    {
+      if (sh.paramStore == null)
+      {
+        sh.paramStore = new JabaParamStore(sh,
+                Desktop.getUserParameterStore());
+      }
+      WsJobParameters jobParams = new WsJobParameters(sh, preset);
+      if (adjustingExisting)
+      {
+        jobParams.setName("Adjusting parameters for existing Calculation");
+      }
+      if (!jobParams.showRunDialog())
+      {
+        return false;
+      }
+      WsParamSetI prset = jobParams.getPreset();
+      if (prset == null)
+      {
+        paramset = JabaParamStore.getJabafromJwsArgs(jobParams
+                .getJobParams());
+      }
+      else
+      {
+        this.preset = prset; // ((JabaPreset) prset).p;
+        paramset = null; // no user supplied parameters.
+      }
+    }
+    return true;
+
+  }
+
+  public Jws2Client()
+  {
+    // anonymous constructor - used for headless method calls only
+  }
+
   protected WebserviceInfo setWebService(Jws2Instance serv, boolean b)
   {
     // serviceHandle = serv;
-    String serviceInstance = serv.service.getClass().getName();
+    String serviceInstance = serv.action; // serv.service.getClass().getName();
     WebServiceName = serv.serviceType;
     WebServiceJobTitle = serv.getActionText();
     WsURL = serv.hosturl;
     if (!b)
     {
       return new WebserviceInfo(WebServiceJobTitle, WebServiceJobTitle
-              + " using service hosted at " + serv.hosturl);
+              + " using service hosted at " + serv.hosturl + "\n"
+              + (serv.description != null ? serv.description : ""));
     }
     return null;
   }
index ed808f6..b440de8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
  */
 package jalview.ws.jws2;
 
+import jalview.bin.Cache;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JvSwingUtils;
+import jalview.ws.WSMenuEntryProviderI;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+
 import java.awt.Color;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.io.Closeable;
-import java.net.ConnectException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.StringTokenizer;
@@ -34,26 +38,7 @@ import java.util.Vector;
 
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
 
-import org.apache.log4j.Level;
-
-import jalview.bin.Cache;
-import jalview.datamodel.AlignmentView;
-import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
-import jalview.gui.JalviewChangeSupport;
-import jalview.gui.JvSwingUtils;
-import jalview.ws.WSMenuEntryProviderI;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
-import jalview.ws.params.ParamDatastoreI;
-import compbio.data.msa.MsaWS;
-import compbio.metadata.Option;
-import compbio.metadata.Preset;
-import compbio.metadata.PresetManager;
-import compbio.metadata.RunnerConfig;
-import compbio.ws.client.Jws2Client;
 import compbio.ws.client.Services;
 
 /**
@@ -136,6 +121,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       Cache.log.debug("Old discovery thread has finished.");
     }
     running = true;
+    changeSupport.firePropertyChange("services", services, new Vector());
     oldthread = Thread.currentThread();
     try
     {
@@ -162,17 +148,32 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     {
       invalidServiceUrls.removeAllElements();
     }
+    if (validServiceUrls != null)
+    {
+      validServiceUrls.removeAllElements();
+    }
+    ArrayList<String> svctypes=new ArrayList<String>();
 
     List<JabaWsServerQuery> qrys = new ArrayList<JabaWsServerQuery>();
     for (final String jwsservers : getServiceUrls())
     {
       JabaWsServerQuery squery = new JabaWsServerQuery(this, jwsservers);
+      if (svctypes.size()==0)
+      {
+        // TODO: remove this ugly hack to get Canonical JABA service ordering for all possible services 
+        for (Services sv:squery.JABAWS2SERVERS)
+        {
+          svctypes.add(sv.toString());
+        }
+
+      }
       qrys.add(squery);
       new Thread(squery).start();
     }
-    boolean finished = false;
+    boolean finished = true;
     do
     {
+      finished=true;
       try
       {
         Thread.sleep(100);
@@ -182,7 +183,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       ;
       for (JabaWsServerQuery squery : qrys)
       {
-        finished |= !squery.isRunning();
+        finished = finished && !squery.isRunning();
       }
       if (aborted)
       {
@@ -194,12 +195,32 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         }
       }
     } while (!aborted && !finished);
-    oldthread = null;
-    running = false;
     if (!aborted)
     {
-      changeSupport.firePropertyChange("services", new Vector(), services);
+      // resort services according to order found in jabaws service list
+      // also ensure servics for each host are ordered in same way.
+      
+      if (services!=null && services.size()>0)
+      {
+        Jws2Instance[] svcs=new Jws2Instance[services.size()];
+        int[] spos=new int[services.size()];
+        int ipos=0;
+        Vector svcUrls = getServiceUrls();
+        for (Jws2Instance svc:services)
+        {
+          svcs[ipos]=svc;
+          spos[ipos++]=1000*svcUrls.indexOf(svc.getHost()) + 1+svctypes.indexOf(svc.serviceType);
+        }
+        jalview.util.QuickSort.sort(spos, svcs);
+        services=new Vector<Jws2Instance>();
+        for (Jws2Instance svc:svcs) {
+          services.add(svc);
+        }
+      }
     }
+    oldthread = null;
+    running = false;
+    changeSupport.firePropertyChange("services", new Vector(), services);
   }
 
   /**
@@ -209,199 +230,42 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
    * @param srv
    * @param service2
    */
-  synchronized void addService(String jwsservers, Services srv,
-          MsaWS service2)
+  synchronized void addService(String jwsservers, Jws2Instance service)
   {
     if (services == null)
     {
       services = new Vector<Jws2Instance>();
     }
     System.out.println("Discovered service: " + jwsservers + " "
-            + srv.toString());
-    Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(),
-            service2);
+            + service.toString());
+//    Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(),
+//            service2);
 
     services.add(service);
     // retrieve the presets and parameter set and cache now
     service.getParamStore().getPresets();
     service.hasParameters();
-  }
-
-  public class Jws2Instance
-  {
-    public String hosturl;
-
-    public String serviceType;
-
-    public MsaWS service;
-
-    public Jws2Instance(String hosturl, String serviceType, MsaWS service)
-    {
-      super();
-      this.hosturl = hosturl;
-      this.serviceType = serviceType;
-      this.service = service;
-    }
-
-    PresetManager presets = null;
-
-    public JabaParamStore paramStore = null;
-
-    /**
-     * non thread safe - gets the presets for this service (blocks whilst it
-     * calls the service to get the preset set)
-     * 
-     * @return service presets or null if exceptions were raised.
-     */
-    public PresetManager getPresets()
+    if (validServiceUrls==null)
     {
-      if (presets == null)
-      {
-        try
-        {
-          presets = service.getPresets();
-        } catch (Exception ex)
-        {
-          System.err
-                  .println("Exception when retrieving presets for service "
-                          + serviceType + " at " + hosturl);
-        }
-      }
-      return presets;
+      validServiceUrls=new Vector();
     }
-
-    public String getHost()
-    {
-      return hosturl;
-      /*
-       * try { URL serviceurl = new URL(hosturl); if (serviceurl.getPort()!=80)
-       * { return serviceurl.getHost()+":"+serviceurl.getPort(); } return
-       * serviceurl.getHost(); } catch (Exception e) {
-       * System.err.println("Failed to parse service URL '" + hosturl +
-       * "' as a valid URL!"); } return null;
-       */
-    }
-
-    /**
-     * @return short description of what the service will do
-     */
-    public String getActionText()
-    {
-      return "Align with " + serviceType;
-    }
-
-    /**
-     * non-thread safe - blocks whilst accessing service to get complete set of
-     * available options and parameters
-     * 
-     * @return
-     */
-    public RunnerConfig getRunnerConfig()
-    {
-      return service.getRunnerOptions();
-    }
-
-    @Override
-    protected void finalize() throws Throwable
-    {
-      if (service != null)
-      {
-        try
-        {
-          Closeable svc = (Closeable) service;
-          service = null;
-          svc.close();
-        } catch (Exception e)
-        {
-        }
-        ;
-      }
-      super.finalize();
-    }
-
-    public ParamDatastoreI getParamStore()
-    {
-      if (paramStore == null)
-      {
-        try
-        {
-          paramStore = new JabaParamStore(this,
-                  (Desktop.instance != null ? Desktop
-                          .getUserParameterStore() : null));
-        } catch (Exception ex)
-        {
-        }
-
-      }
-      return paramStore;
-    }
-
-    public String getUri()
-    {
-      // this is only valid for Jaba 1.0 - this formula might have to change!
-      return hosturl
-              + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? ""
-                      : "/") + serviceType;
-    }
-
-    private boolean hasParams = false, lookedForParams = false;
-
-    public boolean hasParameters()
-    {
-      if (!lookedForParams)
-      {
-        lookedForParams = true;
-        try
-        {
-          hasParams = (getRunnerConfig().getArguments().size() > 0);
-        } catch (Exception e)
-        {
-
-        }
-      }
-      return hasParams;
-    }
-  };
+    validServiceUrls.add(jwsservers);
+  }
 
   /**
    * holds list of services.
    */
   protected Vector<Jws2Instance> services;
-
+  /**
+   * attach all available web services to the appropriate submenu in the given JMenu
+   */
   public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame)
   {
     // dynamically regenerate service list.
-    final JMenu jws2al = wsmenu; // new JMenu("JABAWS Alignment");
-    jws2al.addMenuListener(new MenuListener()
-    {
-      // TODO: future: add menu listener to parent menu - so submenus are
-      // populated *before* they are selected.
-      @Override
-      public void menuSelected(MenuEvent e)
-      {
-        populateWSMenuEntry(jws2al, alignFrame);
-      }
-
-      @Override
-      public void menuDeselected(MenuEvent e)
-      {
-        // TODO Auto-generated method stub
-
-      }
-
-      @Override
-      public void menuCanceled(MenuEvent e)
-      {
-        // TODO Auto-generated method stub
-
-      }
-
-    });
-    wsmenu.add(jws2al);
-
+    populateWSMenuEntry(wsmenu, alignFrame, null);
   }
 
-  private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame)
+  private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame, String typeFilter)
   {
     if (running || services == null || services.size() == 0)
     {
@@ -417,9 +281,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     MsaWSClient msacl = new MsaWSClient();
     Vector hostLabels = new Vector();
     jws2al.removeAll();
-    String lasthost = null;
+    Hashtable<String,String> lasthostFor = new Hashtable<String,String>();
     Hashtable<String, ArrayList<Jws2Instance>> hosts = new Hashtable<String, ArrayList<Jws2Instance>>();
-    String[] sorton;
+    ArrayList<String> hostlist=new ArrayList<String>();
     for (Jws2Instance service : services)
     {
       ArrayList<Jws2Instance> hostservices = hosts.get(service.getHost());
@@ -427,12 +291,11 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       {
         hosts.put(service.getHost(),
                 hostservices = new ArrayList<Jws2Instance>());
+        hostlist.add(service.getHost());
       }
       hostservices.add(service);
     }
-    sorton = hosts.keySet().toArray(new String[1]);
-    String hostlist[] = sorton.clone();
-    jalview.util.QuickSort.sort(sorton, hostlist);
+    // now add hosts in order of the given array
     for (String host : hostlist)
     {
       Jws2Instance orderedsvcs[] = hosts.get(host).toArray(
@@ -445,7 +308,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       jalview.util.QuickSort.sort(sortbytype, orderedsvcs);
       for (final Jws2Instance service : orderedsvcs)
       {
-        atpoint = jws2al;
+        atpoint = JvSwingUtils.findOrCreateMenu(jws2al,service.action);
         String type = service.serviceType;
         if (byhost)
         {
@@ -475,7 +338,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
           // group
           JMenuItem hitm;
           atpoint.addSeparator();
-          if (lasthost == null || !lasthost.equals(host))
+          if (lasthostFor.get(service.action) == null || !lasthostFor.get(service.action).equals(host))
           {
             atpoint.add(hitm = new JMenuItem(host));
             hitm.setForeground(Color.blue);
@@ -490,14 +353,15 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
             });
             hitm.setToolTipText(JvSwingUtils
                     .wrapTooltip("Opens the JABAWS server's homepage in web browser"));
-            lasthost = host;
+            lasthostFor.put(service.action,host);
           }
           hostLabels.addElement(host + service.serviceType
                   + service.getActionText());
           // hostLabels.addElement(host + (bytype ?
           // service.serviceType+service.getActionText() : ""));
         }
-        msacl.attachWSMenuEntry(atpoint, service, alignFrame);
+        
+        service.attachWSMenuEntry(atpoint, alignFrame);
         /*
          * JMenuItem sitem = new JMenuItem(service.serviceType);
          * sitem.setToolTipText("Hosted at " + service.hosturl);
@@ -517,6 +381,14 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
   public static void main(String[] args)
   {
+    if (args.length>0)
+    {
+      testUrls = new Vector<String>();
+      for (String url:args)
+      {
+        testUrls.add(url);
+      };
+    }
     Thread runner = getDiscoverer().startDiscoverer(
             new PropertyChangeListener()
             {
@@ -527,6 +399,11 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
                 {
                   System.out.println("Changesupport: There are now "
                           + getDiscoverer().services.size() + " services");
+                  int i=1;
+                  for (Jws2Instance instance:getDiscoverer().services)
+                  {
+                    System.out.println("Service "+i+++" "+instance.getClass()+"@"+instance.getHost()+": "+instance.getActionText());
+                  }
 
                 }
               }
@@ -541,6 +418,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       }
       ;
     }
+    try {
+      Thread.sleep(50);
+    } catch (InterruptedException x) {}
   }
 
   private static Jws2Discoverer discoverer;
@@ -590,8 +470,14 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     }
   }
 
+  private static Vector<String> testUrls=null;
   public static Vector<String> getServiceUrls()
   {
+    if (testUrls!=null)
+    {
+      // return test urls, if there are any, instead of touching cache
+      return testUrls;
+    }
     String surls = Cache.getDefault(JWS2HOSTURLS,
             "http://www.compbio.dundee.ac.uk/jabaws");
     Vector<String> urls = new Vector<String>();
@@ -694,7 +580,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     return thr;
   }
 
-  Vector<String> invalidServiceUrls = null, urlsWithoutServices = null;
+  Vector<String> invalidServiceUrls = null, urlsWithoutServices = null, validServiceUrls=null;
 
   /**
    * @return the invalidServiceUrls
@@ -801,4 +687,18 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     return null;
   }
 
+  public int getServerStatusFor(String url)
+  {
+    if (validServiceUrls!=null && validServiceUrls.contains(url))
+    {
+      return 1;
+    }
+    if (urlsWithoutServices!=null && urlsWithoutServices.contains(url))
+    return 0;
+    if (invalidServiceUrls!=null && invalidServiceUrls.contains(url))
+    {
+      return -1;
+    }
+    return -2;
+  }
 }
index 4f6ce09..66ef9a6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -31,8 +31,8 @@ import compbio.metadata.Argument;
 import compbio.metadata.Option;
 import compbio.metadata.Preset;
 import compbio.metadata.PresetManager;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
 import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.WsParamSetI;
 
 /**
@@ -48,13 +48,7 @@ public class MsaWSClient extends Jws2Client
    */
   MsaWS server;
 
-  AlignFrame alignFrame;
-
-  private WsParamSetI preset;
-
-  private List<Argument> paramset;
-
-  public MsaWSClient(Jws2Discoverer.Jws2Instance sh, String altitle,
+  public MsaWSClient(Jws2Instance sh, String altitle,
           jalview.datamodel.AlignmentView msa, boolean submitGaps,
           boolean preserveOrder, Alignment seqdataset,
           AlignFrame _alignFrame)
@@ -64,7 +58,7 @@ public class MsaWSClient extends Jws2Client
     // TODO Auto-generated constructor stub
   }
 
-  public MsaWSClient(Jws2Discoverer.Jws2Instance sh, WsParamSetI preset,
+  public MsaWSClient(Jws2Instance sh, WsParamSetI preset,
           String altitle, jalview.datamodel.AlignmentView msa,
           boolean submitGaps, boolean preserveOrder, Alignment seqdataset,
           AlignFrame _alignFrame)
@@ -90,14 +84,18 @@ public class MsaWSClient extends Jws2Client
    *          DOCUMENT ME!
    */
 
-  public MsaWSClient(Jws2Discoverer.Jws2Instance sh, WsParamSetI preset,
+  public MsaWSClient(Jws2Instance sh, WsParamSetI preset,
           List<Argument> arguments, boolean editParams, String altitle,
           jalview.datamodel.AlignmentView msa, boolean submitGaps,
           boolean preserveOrder, Alignment seqdataset,
           AlignFrame _alignFrame)
   {
-    super();
-    alignFrame = _alignFrame;
+    super(_alignFrame, preset, arguments);
+    if (!processParams(sh, editParams))
+    {
+      return;
+    }
+
     if (!(sh.service instanceof MsaWS))
     {
       // redundant at mo - but may change
@@ -111,68 +109,7 @@ public class MsaWSClient extends Jws2Client
 
       return;
     }
-    server = sh.service;
-    this.preset=preset;
-    if (preset != null)
-    {
-      if (!((preset instanceof JabaPreset) || preset instanceof JabaWsParamSet)) {
-      /*{
-        this.preset = ((JabaPreset) preset).p;
-      }
-      else if (preset instanceof JabaWsParamSet)
-      {
-        List<Argument> newargs = new ArrayList<Argument>();
-        JabaWsParamSet pset = ((JabaWsParamSet) preset);
-        for (Option opt : pset.getjabaArguments())
-        {
-          newargs.add(opt);
-        }
-        if (arguments != null && arguments.size() > 0)
-        {
-          // merge arguments with preset's own arguments.
-          for (Argument opt : arguments)
-          {
-            newargs.add(opt);
-          }
-        }
-        paramset = newargs;
-      }
-      else
-      {*/
-        throw new Error(
-                "Implementation error: Can only instantiate Jaba parameter sets.");
-      }
-    }
-    else
-    {
-      // just provided with a bunch of arguments
-      this.paramset = arguments;
-    }
-    if (editParams)
-    {
-      if (sh.paramStore == null)
-      {
-        sh.paramStore = new JabaParamStore(sh,
-                Desktop.getUserParameterStore());
-      }
-      WsJobParameters jobParams = new WsJobParameters(sh, preset);
-      if (!jobParams.showRunDialog())
-      {
-        return;
-      }
-      WsParamSetI prset = jobParams.getPreset();
-      if (prset == null)
-      {
-        paramset = JabaParamStore.getJabafromJwsArgs(jobParams
-                .getJobParams());
-      }
-      else
-      {
-        this.preset = prset; // ((JabaPreset) prset).p;
-        paramset = null; // no user supplied parameters.
-      }
-    }
-
+    server = (MsaWS) sh.service;
     if ((wsInfo = setWebService(sh, false)) == null)
     {
       JOptionPane.showMessageDialog(Desktop.desktop,
@@ -254,6 +191,7 @@ public class MsaWSClient extends Jws2Client
     return (WebServiceName.indexOf("lustal") > -1); // cheat!
   }
 
+  
   public void attachWSMenuEntry(JMenu rmsawsmenu,
           final Jws2Instance service, final AlignFrame alignFrame)
   {
index 3ecba74..65873f2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c4e1ca8..09630f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/ws/jws2/SequenceAnnotationWSClient.java b/src/jalview/ws/jws2/SequenceAnnotationWSClient.java
new file mode 100644 (file)
index 0000000..e3f3674
--- /dev/null
@@ -0,0 +1,177 @@
+/**
+ * 
+ */
+package jalview.ws.jws2;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.List;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+
+import compbio.metadata.Argument;
+
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.AlignmentView;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JalviewDialog;
+import jalview.gui.JvSwingUtils;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+/**
+ * @author jimp
+ * 
+ */
+public class SequenceAnnotationWSClient extends Jws2Client
+{
+
+  /**
+   * initialise a client so its attachWSMenuEntry method can be called.
+   */
+  public SequenceAnnotationWSClient()
+  {
+    // TODO Auto-generated constructor stub
+  }
+
+  public SequenceAnnotationWSClient(final Jws2Instance sh,
+          AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
+  {
+    super(alignFrame, preset, null);
+    if (alignFrame.getViewport().getAlignment().isNucleotide())
+    {
+      JOptionPane
+              .showMessageDialog(
+                      Desktop.desktop,
+                      sh.serviceType+" can only be used\nfor amino acid alignments.",
+                      "Wrong type of sequences!",
+                      JOptionPane.WARNING_MESSAGE);
+      return;
+
+    }
+    if (sh.action.toLowerCase().contains("conservation"))
+    {
+      // Build an AACons style client - take alignment, return annotation for columns
+
+      List<AlignCalcWorkerI> clnts = alignFrame.getViewport()
+              .getCalcManager()
+              .getRegisteredWorkersOfClass(AAConsClient.class);
+      if (clnts == null || clnts.size() == 0)
+      {
+        if (!processParams(sh, editParams))
+        {
+          return;
+        }
+        alignFrame
+                .getViewport()
+                .getCalcManager()
+                .registerWorker(
+                        new AAConsClient(sh, alignFrame, preset, paramset));
+      }
+      else
+      {
+        AAConsClient worker = (AAConsClient) clnts.get(0);
+        if (editParams)
+        {
+          paramset = worker.getArguments();
+          preset = worker.getPreset();
+        }
+
+        if (!processParams(sh, editParams, true))
+          return;
+        // reinstate worker if it was blacklisted (might have happened due to
+        // invalid parameters)
+        alignFrame.getViewport().getCalcManager().workerMayRun(worker);
+        worker.updateParameters(preset, paramset);
+
+      }
+    }
+    if (sh.action.toLowerCase().contains("disorder"))
+    {
+      // build IUPred style client. take sequences, returns annotation per sequence.
+      if (!processParams(sh, editParams))
+      {
+        return;
+      }
+
+      alignFrame
+              .getViewport()
+              .getCalcManager()
+              .startWorker(
+                      new AADisorderClient(sh, alignFrame, preset, paramset));
+    }
+
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see jalview.ws.jws2.Jws2Client#attachWSMenuEntry(javax.swing.JMenu,
+   * jalview.ws.jws2.jabaws2.Jws2Instance, jalview.gui.AlignFrame)
+   */
+  public void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
+          final AlignFrame alignFrame)
+  {
+    boolean hasparams = service.hasParameters();
+    // Assume name ends in WS
+    String calcName = service.serviceType.substring(0,service.serviceType.length()-2);
+
+    JMenuItem aacons = new JMenuItem(calcName + " Defaults");
+    aacons.addActionListener(new ActionListener()
+    {
+
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        new SequenceAnnotationWSClient(service, alignFrame, null, false);
+      }
+    });
+    wsmenu.add(aacons);
+    if (hasparams)
+    {
+      // only add these menu options if the service has user-modifiable
+      // arguments
+      aacons = new JMenuItem("Edit settings and run ...");
+      aacons.setToolTipText("View and change parameters before running calculation");
+
+      aacons.addActionListener(new ActionListener()
+      {
+        public void actionPerformed(ActionEvent e)
+        {
+          new SequenceAnnotationWSClient(service, alignFrame, null, true);
+        }
+      });
+      wsmenu.add(aacons);
+      List<WsParamSetI> presets = service.getParamStore().getPresets();
+      if (presets != null && presets.size() > 0)
+      {
+        JMenu presetlist = new JMenu("Run " + calcName + "with preset");
+
+        for (final WsParamSetI preset : presets)
+        {
+          final JMenuItem methodR = new JMenuItem(preset.getName());
+          methodR.setToolTipText("<html><p>"
+                  + JvSwingUtils.wrapTooltip("<strong>"
+                          + (preset.isModifiable() ? "User Preset"
+                                  : "Service Preset") + "</strong><br/>"
+                          + preset.getDescription() + "</p>") + "</html>");
+          methodR.addActionListener(new ActionListener()
+          {
+            public void actionPerformed(ActionEvent e)
+            {
+              new SequenceAnnotationWSClient(service, alignFrame, preset,
+                      false);
+            }
+
+          });
+          presetlist.add(methodR);
+        }
+        wsmenu.add(presetlist);
+      }
+
+    }
+  }
+}
index c313bd1..9e9e926 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d833725..e527ca3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2c63841..b30326f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6fc8169..5904775 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
diff --git a/src/jalview/ws/jws2/jabaws2/Jws2Instance.java b/src/jalview/ws/jws2/jabaws2/Jws2Instance.java
new file mode 100644 (file)
index 0000000..49371a8
--- /dev/null
@@ -0,0 +1,185 @@
+package jalview.ws.jws2.jabaws2;
+
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.ws.jws2.JabaParamStore;
+import jalview.ws.jws2.MsaWSClient;
+import jalview.ws.jws2.SequenceAnnotationWSClient;
+import jalview.ws.params.ParamDatastoreI;
+
+import java.io.Closeable;
+
+import javax.swing.JMenu;
+
+import compbio.data.msa.JABAService;
+import compbio.data.msa.MsaWS;
+import compbio.data.msa.SequenceAnnotation;
+import compbio.metadata.PresetManager;
+import compbio.metadata.RunnerConfig;
+
+public class Jws2Instance
+{
+  public String hosturl;
+
+  public String serviceType;
+  public String action;
+  public JABAService service;
+  public String description;
+
+  public Jws2Instance(String hosturl, String serviceType, String action, String description, 
+          JABAService service)
+  {
+    super();
+    this.hosturl = hosturl;
+    this.serviceType = serviceType;
+    this.service = service;
+    this.action=action;
+    this.description = description;
+    
+  }
+
+  PresetManager presets = null;
+
+  public JabaParamStore paramStore = null;
+
+  /**
+   * non thread safe - gets the presets for this service (blocks whilst it calls
+   * the service to get the preset set)
+   * 
+   * @return service presets or null if exceptions were raised.
+   */
+  public PresetManager getPresets()
+  {
+    if (presets == null)
+    {
+      try
+      {
+        if (service instanceof MsaWS<?>)
+        {
+          presets = ((MsaWS) service).getPresets();
+
+        }
+        if (service instanceof SequenceAnnotation<?>)
+        {
+          presets = ((SequenceAnnotation) service).getPresets();
+        }
+      } catch (Exception ex)
+      {
+        System.err.println("Exception when retrieving presets for service "
+                + serviceType + " at " + hosturl);
+      }
+    }
+    return presets;
+  }
+
+  public String getHost()
+  {
+    return hosturl;
+    /*
+     * try { URL serviceurl = new URL(hosturl); if (serviceurl.getPort()!=80) {
+     * return serviceurl.getHost()+":"+serviceurl.getPort(); } return
+     * serviceurl.getHost(); } catch (Exception e) {
+     * System.err.println("Failed to parse service URL '" + hosturl +
+     * "' as a valid URL!"); } return null;
+     */
+  }
+
+  /**
+   * @return short description of what the service will do
+   */
+  public String getActionText()
+  {
+    return action+" with " + serviceType;
+  }
+
+  /**
+   * non-thread safe - blocks whilst accessing service to get complete set of
+   * available options and parameters
+   * 
+   * @return
+   */
+  public RunnerConfig getRunnerConfig()
+  {
+    if (service instanceof MsaWS<?>)
+    {
+      return ((MsaWS) service).getRunnerOptions();
+    }
+    if (service instanceof SequenceAnnotation<?>)
+    {
+      return ((SequenceAnnotation) service).getRunnerOptions();
+    }
+    throw new Error("Implementation Error: Runner Config not available for a JABAWS service of type "+serviceType+" ("+service.getClass()+")");
+  }
+
+  @Override
+  protected void finalize() throws Throwable
+  {
+    if (service != null)
+    {
+      try
+      {
+        Closeable svc = (Closeable) service;
+        service = null;
+        svc.close();
+      } catch (Exception e)
+      {
+      }
+      ;
+    }
+    super.finalize();
+  }
+
+  public ParamDatastoreI getParamStore()
+  {
+    if (paramStore == null)
+    {
+      try
+      {
+        paramStore = new JabaParamStore(this,
+                (Desktop.instance != null ? Desktop.getUserParameterStore()
+                        : null));
+      } catch (Exception ex)
+      {
+      }
+
+    }
+    return paramStore;
+  }
+
+  public String getUri()
+  {
+    // this is only valid for Jaba 1.0 - this formula might have to change!
+    return hosturl
+            + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? ""
+                    : "/") + serviceType;
+  }
+
+  private boolean hasParams = false, lookedForParams = false;
+
+  public boolean hasParameters()
+  {
+    if (!lookedForParams)
+    {
+      lookedForParams = true;
+      try
+      {
+        hasParams = (getRunnerConfig().getArguments().size() > 0);
+      } catch (Exception e)
+      {
+
+      }
+    }
+    return hasParams;
+  }
+
+  public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
+  {
+    if (service instanceof MsaWS<?>)
+    {
+      new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
+    } else 
+    if (service instanceof SequenceAnnotation<?>){
+      new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
+    }
+  }
+}
\ No newline at end of file
index 7cb6a35..09eecca 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7aefe16..20dabaf 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 02f4829..1993603 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b3e8d6e..2a6cea4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5f25e2e..44f7551 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fb23dce..2603f9c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 851be86..147e17c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8d72b2c..ba7d91a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5983d05..1e8f418 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index e83af2c..c277f70 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4efeaeb..2608eed 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 54210f4..4c886a8 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f1a50a2..17e7dce 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 05d9c1a..51f9001 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 53d15de..fddc4e3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 26b5ea6..981861e 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 00ae610..ca3cba3 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 95de391..ac1188d 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 200c573..e5dd841 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index bdd20c9..ffbce62 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index d5df528..e0c56da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0cd1578..2d28a9c 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index b05b4ed..663f7d7 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 6534e93..d643c15 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index f02c262..1af0440 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 559cadf..43993ed 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 4930e0f..7632067 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index 50fe7e8..e442b5b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  *
  * This file is part of Jalview.
  *
index d3385f3..d4bcfe8 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 3f48904..fa02285 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 1467aaf..89d41fa 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index caae608..6fe8f8f 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 21dd4f3..36d05c9 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 818eab1..160293a 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 871832c..c38720d 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index ca7d651..3a7df11 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 106d3b4..a946bc5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 37cebc0..53d57df 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e31f5d0..7cd7410 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7e45712..278dc31 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 849a0f8..0d2f76b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ddd94d4..4d33eb1 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cdfd618..3535305 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 3a4a2ab..3e76fd0 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 05ded00..c884909 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 80a870b..b581d05 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index 37eefad..e5fe2f4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 27d233d..38c1079 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d525218..268ab5b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8c427cb..7e453ba 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4270e55..f3e7d51 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cf5fdb0..f812ac8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3205207..1302463 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f36c6cc..ed62d9f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7df1599..35bb843 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3520905..258df90 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fab0138..5c92a28 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0f0e7e2..d309db8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ed2f541..aa1795b 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 82332bd..0055387 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 63bf731..59ef7e6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 71084c0..82331fd 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index fb11db5..7a0433d 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
  * \r
  * This file is part of Jalview.\r
  * \r
index ac44b66..e11eb74 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index dc866f4..a3c8088 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c8aef7f..018b1d6 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 82a7e4b..dddef03 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7e44a42..16e0dcb 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 3444b8d..40126bc 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9b317a7..a227676 100755 (executable)
@@ -1148,7 +1148,7 @@ and any path to a file to save to the file]]></string>
                                                                <string><![CDATA[664]]></string>
                                                        </property>
                                                        <property name="sourceName">
-                                                               <string><![CDATA[min-jaba-client.jar]]></string>
+                                                               <string><![CDATA[min-jaba-client-2.0.jar]]></string>
                                                        </property>
                                                        <property name="overrideUnixPermissions">
                                                                <boolean>false</boolean>
@@ -1166,7 +1166,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>true</boolean>
                                                        </property>
                                                        <property name="destinationName">
-                                                               <string><![CDATA[min-jaba-client.jar]]></string>
+                                                               <string><![CDATA[min-jaba-client-2.0.jar]]></string>
                                                        </property>
                                                        <property name="fileSize">
                                                                <long>81728</long>
@@ -1501,6 +1501,53 @@ and any path to a file to save to the file]]></string>
                                                        </property>
                                                </object>
                                        </method>
+                                       
+                                       <method name="addElement">
+                                               <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="df3a5220b6bc">
+                                                       <property name="belongsToUninstallPhase">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="unixPermissions">
+                                                               <string><![CDATA[664]]></string>
+                                                       </property>
+                                                       <property name="sourceName">
+                                                               <string><![CDATA[VARNAv3-9-dev.jar]]></string>
+                                                       </property>
+                                                       <property name="overrideUnixPermissions">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="sourcePath">
+                                                               <string><![CDATA[/homes/ws-dev1/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[VARNAv3-9-dev.jar]]></string>
+                                                       </property>
+                                                       <property name="fileSize">
+                                                               <long>663408</long>
+                                                       </property>
+                                                       <property name="macBinary">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="targetCheckKind">
+                                                               <int>0</int>
+                                                       </property>
+                                               </object>
+                                       </method>
                                </object>
                        </property>
                        <property name="rulesFailedMessage">
@@ -4156,6 +4203,7 @@ and any path to a file to read from that file]]></string>
                                                                                <object refID="8fbb17529b9d"/>
                                                                                <object refID="aa3a521fb6bc"/>
                                                                                <object refID="aa3a5220b6bc"/>
+                                                                               <object refID="df3a5220b6bc"/>
                                                                                <object refID="aa3a5220b6bc1"/>
                                                                                <object class="com.zerog.ia.installer.actions.InstallDirectory" objectID="24485f85a670">
                                                                                        <property name="belongsToUninstallPhase">
@@ -4219,6 +4267,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <object refID="8fbb17529b9d"/>
                                                                                                <object refID="aa3a521fb6bc"/>
                                                                                                <object refID="aa3a5220b6bc"/>
+                                                                                               <object refID="df3a5220b6bc"/>
                                                                                                <object refID="aa3a5220b6bc1"/>
                                                                                        </visualChildren>
                                                                                </object>
index fa17a26..b43ee7e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index bf92753..632f709 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 663224a..c94602d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index efffcd6..afe8c9f 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index abe255c..048fb91 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5cef455..aed643b 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 76b2568..a03a669 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 68ad176..8c5fad9 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 7349d5b..8c08a14 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index a99514d..0e2e81c 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d2b0676..669f417 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 788e27e..c424c06 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c6075d5..78a141c 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8c5e599..b68494c 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 60f50a4..1451f11 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4b45dc1..9c28929 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f3aa3dc..ba1c7e3 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0b9a518..18455fe 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 767376e..9c83b28 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 537e110..e7edc5c 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index bef1bb7..867c704 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 91ac51e..b32a071 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index adcf3bd..d6baade 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 208eba4..89189bf 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d092461..9338ba2 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 701ce16..e0c916a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 0e69868..50c87ce 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 58804fb..d5d80f5 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index adc862c..c17223a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 44db0d6..ea66215 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ae1e75c..7a6c732 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 58bade3..08cf3b7 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 745a414..d8c663a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 28cd01b..3732fd5 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index be025aa..8984c2c 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1c8785e..648157e 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 06b1056..4f21931 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 84f3bfd..dc060e9 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 22b4dca..d74d939 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 4ae2884..0ee9fdc 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 817a63b..00ea4c0 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 61b98e9..b1c7073 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d9c4657..2d5e7e6 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 5453356..e67cba0 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f5bf177..ed14571 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 10fc687..c69ab9b 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 94ac39c..891de41 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 8fda026..8f9599a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 6f5a5d4..b9a67c8 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 1b1c243..b0c39f9 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 17deca7..3faf2ca 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index f7dd356..6005ae2 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index cbc5291..9062224 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index facb504..2b15f01 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index c5f70e9..8199ce6 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 884b47c..9be092b 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 696f538..3c53e3d 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d4cf0ac..266e678 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 36ca7a8..671b270 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e8c0176..77769ae 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b473194..635ec6b 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fb653a6..e1ac35a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index e0dfc7a..76cf1c2 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 77fe1b6..20ac57a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index b4446c3..48aa2db 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index d388f70..535ac9b 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index fb8f9f6..cc384ab 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9355268..878a49a 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 9ef7eff..c72ac4d 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 2c54ab8..ddb7f0d 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index ef407d5..a8022e3 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 21a73a9..4a7a80c 100755 (executable)
@@ -1,7 +1,7 @@
 
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
index 77a656b..c468222 100755 (executable)
@@ -1,7 +1,7 @@
 <html><head>
 <!--
  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  *