--- /dev/null
+ Total new objects: 3207143
+
+count exec(ms)
+-------- -------- ------------------------------
+...2100182 ....-24750 undefined[]
+....504006 ......2661 java.lang.StringBuilder
+....436463 ......1022 java.util.HashMap.Node
+....411205 .......708 jalview.datamodel.Annotation
+....232907 .......323 Float
+....215619 .......902 jalview.datamodel.features.FeatureStore$SearchCriterion$3
+....206107 .......370 java.awt.Color
+....206007 .......387 Integer
+....205602 .......863 jalview.datamodel.ResidueCount
+....205602 .......427 jalview.datamodel.Profile
+....172921 ......1119 java.util.ArrayList.Itr
+....170025 .....-2281 Object[]
+....139805 .......151 Long
+....138605 .......377 swingjs.json.JSON.JSONList
+....108563 .......372 java.util.HashMap
+....108553 .....-1316 java.util.HashMap.Node[]
+....107812 ......3263 jalview.datamodel.SequenceFeature
+.....79143 .......375 java.util.ArrayList
+.....61212 .......381 java.util.HashMap.EntryIterator
+.....52231 .......467 java.util.HashMap.EntrySet
+.....47590 .......294 swingjs.json.JSON.JSONMap
+.....46224 ........94 swingjs.json.JSON.JSONList.ListIterator
+......7084 .......187 jalview.datamodel.features.NCNode
+......3870 ........10 jalview.analysis.AlignmentUtils.DnaVariant
+......3051 ........30 java.awt.Dimension
+......2153 ........14 java.beans.PropertyChangeEvent
+......1567 .........4 jalview.datamodel.SequenceCursor
+......1356 .........6 java.util.LinkedHashMap.Entry
+......1329 ........46 jalview.datamodel.features.NCList
+......1290 .......-16 java.util.ArrayList[]
+.......687 .........4 java.util.Hashtable.Entry
+.......684 .........5 jalview.datamodel.DBRefEntry
+.......505 .........6 java.util.TreeMap.ValueIterator
+.......479 .........2 javax.swing.event.EventListenerList
+.......449 .........6 java.util.ArrayList.SubList
+.......449 .........4 java.util.HashSet
+.......449 .........4 java.util.ArrayList$SubList$1
+.......444 .........1 jalview.datamodel.HiddenCursorPosition
+.......402 ........-5 java.lang.Class[]
+.......383 .........4 javajs.util.Lst
+.......346 .........1 java.awt.geom.AffineTransform
+.......346 .........1 java.awt.BasicStroke
+.......290 ........-4 java.beans.PropertyChangeListener[]
+.......287 .........3 java.util.Hashtable.Enumerator
+.......280 .........5 java.awt.Rectangle
+.......276 .........4 java.util.TreeMap.EntryIterator
+.......274 ........-5 java.awt.Component[]
+.......261 .........2 java.beans.PropertyChangeSupport
+.......261 .........1 java.beans.PropertyChangeSupport.PropertyChangeListenerMap
+.......226 .........1 java.util.Collections.UnmodifiableSet
+.......219 .........0 com.stevesoft.pat.StrPos
+.......206 .........1 java.awt.AWTEventMulticaster
+.......200 .........2 java.util.HashMap.KeySet
+.......200 .........2 java.util.HashMap.KeyIterator
+.......198 .........4 javax.swing.plaf.ComponentInputMapUIResource
+.......187 .........2 java.util.Arrays.ArrayList
+.......182 .........2 java.awt.event.ContainerEvent
+.......176 ........-3 java.util.Hashtable.Entry[]
+.......173 .........1 javax.swing.ActionMap
+.......173 ........-2 javax.swing.KeyStroke[]
+.......171 .........2 java.awt.Insets
+.......169 .........2 javax.swing.JMenuItem.MenuItemFocusListener
+.......169 .........2 javax.swing.AbstractButton.Handler
+.......169 .........1 swingjs.plaf.ButtonListener
+.......154 .........1 javax.swing.KeyboardManager.ComponentKeyStrokePair
+.......138 .........1 jalview.datamodel.PDBEntry
+.......136 .........1 java.util.Vector.Itr
+.......130 .........1 javajs.util.SB
+.......120 .........2 java.io.BufferedInputStream
+.......120 .........1 java.io.ByteArrayInputStream
+.......116 .........2 javax.swing.DefaultButtonModel
+.......112 .........2 java.lang.StringBuffer
+.......108 .........3 java.awt.EventDispatchThread$1
+.......100 .........1 jalview.datamodel.features.FeatureStore$SearchCriterion$2
+........99 .........1 javax.swing.event.ChangeEvent
+........94 .......514 javax.swing.JMenuItem
+........91 .........2 java.awt.event.MouseEvent
+........88 .........2 java.util.Hashtable
+........88 .........0 java.util.TreeMap.Entry
+........77 .........0 javax.swing.ArrayTable
+........72 .........2 jalview.datamodel.features.FeatureStore
+........72 .........1 java.util.TreeMap
+........69 ........-1 java.util.concurrent.ConcurrentHashMap.HashEntry[]
+........67 .......277 jalview.datamodel.Sequence
+........67 ........18 jalview.datamodel.features.SequenceFeatures
+........66 .........2 java.net.URL
+........64 .........1 javajs.util.AjaxURLConnection
+........64 .........0 java.util.concurrent.ConcurrentHashMap.Segment
+........63 ........-1 jalview.datamodel.SequenceGroup[]
+........60 .........2 java.util.Collections$UnmodifiableCollection$1
+........60 .........0 javax.swing.SizeRequirements
+........57 .........2 java.awt.EventDispatchThread
+........57 .........1 java.awt.EventDispatchThread.HierarchyEventFilter
+........54 .........3 swingjs.json.JSON.JSONReader
+........53 .........1 javax.swing.JToggleButton.ToggleButtonModel
+........53 .........1 java.util.ArrayList.ListItr
+........53 ........-1 swingjs.api.js.DOMNode[]
+........51 .........0 java.awt.EventQueueItem
+........51 ........-1 jalview.datamodel.SequenceI[]
+........44 .........0 jalview.util.LinkedIdentityHashSet.IdentityWrapper
+........39 .........4 jalview.datamodel.HiddenColumnsCursor
+........38 .........0 java.lang.StackTraceElement
+........35 ........90 javax.swing.JCheckBoxMenuItem
+........34 .........5 jalview.util.MapList
+........33 .........2 jalview.ext.ensembl.EnsemblXref
+........33 .........1 java.util.StringTokenizer
+........33 .........1 jalview.datamodel.Sequence.DBModList
+........33 .........0 jalview.renderer.ScaleRenderer.ScaleMark
+........32 .........0 java.util.Collections.SynchronizedRandomAccessList
+........31 .........0 java.lang.reflect.Constructor
+........31 .........0 java.awt.Point
+........31 .........0 com.stevesoft.pat.oneChar
+........30 .........0 javax.swing.KeyStroke
+........30 .........0 javax.swing.ComponentInputMap
+........28 .........0 com.stevesoft.pat.patInt
+........27 .........0 java.util.Vector
+........24 .........1 javax.swing.DefaultSingleSelectionModel
+........23 .........1 java.util.SubList$1
+........23 .........0 java.util.TreeMap.Values
+........23 .........0 java.util.TreeMap.EntrySet
+........23 .........0 java.util.AbstractList.ListItr
+........23 .........0 jalview.datamodel.Mapping
+........22 .........8 javax.swing.JPopupMenu
+........22 .........5 javax.swing.JPopupMenu.Separator
+........22 .........1 javax.swing.JMenu.MenuChangeListener
+........22 .........1 java.util.TimSort
+........22 .........1 java.util.RandomAccessSubList
+........22 .........0 swingjs.plaf.JSPopupMenuUI.JSMenuKeyListener
+........22 .........0 javax.swing.JMenu.WinListener
+........21 ........16 javax.swing.JMenu
+........21 .........1 jalview.ext.ensembl.EnsemblProtein
+........21 .........1 jalview.ext.ensembl.EnsemblCdna
+........20 .........0 java.awt.FlowLayout
+........18 ........98 javax.swing.JRadioButtonMenuItem
+........18 .........0 java.util.Formatter.Flags
+........18 .........0 java.awt.event.ItemEvent
+........18 .........0 java.awt.event.InvocationEvent
+........18 .........0 java.awt.BorderLayout
+........16 .........0 jalview.datamodel.features.FeatureAttributes.AttributeData
+........15 .........5 javax.swing.JPanel
+........15 .........0 javax.swing.JComponent$2
+........14 .......183 jalview.datamodel.Alignment
+........14 .........8 jalview.datamodel.HiddenColumns
+........14 .........1 java.util.LinkedList.ListItr
+........14 .........1 jalview.schemes.JalviewColourScheme
+........14 .........0 jalview.gui.ColourMenuHelper$3
+........14 .........0 jalview.datamodel.HiddenSequences
+........13 .........1 java.util.LinkedHashMap
+........13 .........1 jalview.util.ReverseListIterator
+........12 .........0 java.awt.AlphaComposite
+........11 .........0 jalview.jbgui.GAlignFrame$1
+........10 .........0 java.util.BitSet
+........10 .........0 java.awt.geom.Rectangle2D.Float
+........10 .........0 java.awt.Color[]
+.........9 .........1 java.util.LinkedHashMap.LinkedEntrySet
+.........9 .........0 java.util.LinkedHashMap.LinkedEntryIterator
+.........8 .........1 java.util.Formatter.FormatSpecifier
+.........8 .........0 java.util.Formatter.FixedString
+.........8 .........0 java.awt.Font
+.........8 .........0 com.stevesoft.pat.Pthings
+.........7 .........0 javax.swing.text.Segment
+.........7 .........0 java.util.concurrent.ConcurrentHashMap.HashEntry
+.........7 .........0 java.awt.event.ComponentEvent
+.........7 .........0 com.stevesoft.pat.Bracket
+.........6 .........0 swingjs.JSFontMetrics
+.........6 .........0 javax.swing.SizeRequirements[]
+.........6 .........0 javax.swing.DefaultBoundedRangeModel
+.........6 .........0 java.util.Formatter.FormatString[]
+.........6 .........0 java.util.AbstractList.Itr
+.........6 .........0 jalview.datamodel.Range
+.........6 .........0 com.stevesoft.pat.SubMark
+.........6 .........0 com.stevesoft.pat.Range
+.........6 .........0 com.stevesoft.pat.OrMark
+.........6 .........0 com.stevesoft.pat.FastMulti
+.........5 .........1 swingjs.JSGraphics2D
+.........5 .........0 sun.java2d.StateTrackableDelegate
+.........5 .........0 javax.swing.event.InternalFrameEvent
+.........5 .........0 java.awt.RenderingHints
+.........5 .........0 jalview.renderer.ResidueShader
+.........5 .........0 Boolean
+.........4 .........2 javax.swing.JLabel
+.........4 .........1 java.util.concurrent.ConcurrentHashMap
+.........4 .........1 jalview.analysis.AnnotationSorter
+.........4 .........0 sun.java2d.StateTrackable.State
+.........4 .........0 javax.swing.JScrollBar.ModelListener
+.........4 .........0 java.util.concurrent.ConcurrentHashMap.Segment[]
+.........4 .........0 java.awt.geom.RectIterator
+.........4 .........0 java.awt.event.AdjustmentEvent
+.........4 .........0 jalview.ext.ensembl.EnsemblSeqProxy.EnsemblSeqType
+.........4 .........0 jalview.analysis.AnnotationSorter$3
+.........4 .........0 jalview.analysis.AnnotationSorter$2
+.........4 .........0 jalview.analysis.AnnotationSorter$1
+.........4 .........0 com.stevesoft.pat.End
+.........4 ........-2 jalview.datamodel.Annotation[]
+.........3 ........81 java.awt.image.BufferedImage
+.........3 .........9 java.awt.image.DataBufferInt
+.........3 .........5 java.awt.image.DirectColorModel
+.........3 .........0 swingjs.JSToolkit$1
+.........3 .........0 sun.font.FontDesignMetrics.KeyReference
+.........3 .........0 sun.font.FontDesignMetrics
+.........3 .........0 javax.swing.ButtonGroup
+.........3 .........0 java.util.regex.Matcher
+.........3 .........0 java.util.Collections.SynchronizedSet
+.........3 .........0 java.awt.image.SinglePixelPackedSampleModel
+.........3 .........0 java.awt.GridLayout
+.........3 .........0 jalview.schemes.NucleotideColourScheme
+.........3 .........0 jalview.renderer.ScaleRenderer
+.........3 .........0 jalview.gui.AnnotationPanel.DragMode
+.........3 .........0 jalview.datamodel.features.FeatureAttributes.Datatype
+.........3 .........0 jalview.datamodel.VisibleContigsIterator
+.........3 .........0 jalview.datamodel.StartRegionIterator
+.........3 .........0 jalview.analysis.AnnotationSorter.SequenceAnnotationOrder
+.........2 .........8 javax.swing.JScrollBar
+.........2 .........7 javax.swing.JScrollPane.ScrollBar
+.........2 .........7 javax.swing.JProgressBar
+.........2 .........2 java.lang.IndexOutOfBoundsException
+.........2 .........2 com.stevesoft.pat.Regex
+.........2 .........1 jalview.datamodel.AlignmentAnnotation
+.........2 .........0 javax.swing.text.AbstractDocument.DefaultDocumentEvent
+.........2 .........0 javax.swing.event.UndoableEditEvent
+.........2 .........0 javax.swing.border.LineBorder
+.........2 .........0 javax.swing.JProgressBar.ModelListener
+.........2 .........0 java.util.LinkedHashMap.LinkedValues
+.........2 .........0 java.util.LinkedHashMap.LinkedValueIterator
+.........2 .........0 java.util.IdentityHashMap.KeyIterator
+.........2 .........0 java.util.Hashtable.KeySet
+.........2 .........0 java.util.Collections.SynchronizedCollection
+.........2 .........0 java.util.Collections.SingletonList
+.........2 .........0 java.util.Collections$1
+.........2 .........0 java.util.ArrayDeque
+.........2 .........0 java.lang.Thread
+.........2 .........0 java.lang.StackTraceElement[]
+.........2 .........0 java.awt.geom.Path2D.Float.CopyIterator
+.........2 .........0 java.awt.geom.Path2D.Float
+.........2 .........0 java.awt.event.ActionEvent
+.........2 .........0 java.awt.Container
+.........2 .........0 jalview.util.IntRangeComparator
+.........2 .........0 jalview.io.SequenceAnnotationReport
+.........2 .........0 jalview.gui.AlignmentPanel[]
+.........2 .........0 jalview.ext.ensembl.EnsemblSequenceFetcher.EnsemblFeatureType[]
+.........2 .........0 jalview.ext.ensembl.EnsemblLookup
+.........2 .........0 jalview.datamodel.features.RangeComparator
+.........2 .........0 jalview.datamodel.SearchResults
+.........2 .........0 jalview.datamodel.AlignmentAnnotation[]
+.........2 .........0 jalview.controller.AlignViewController
+.........2 .........0 com.stevesoft.pat.patInf
+.........2 .........0 com.stevesoft.pat.Rthings
+.........2 .........0 com.stevesoft.pat.Or
+.........2 .........0 com.stevesoft.pat.NullPattern
+.........1 .....14506 jalview.gui.AlignFrame
+.........1 ......1341 jalview.gui.AlignViewport
+.........1 .......249 jalview.gui.AlignmentPanel
+.........1 ........85 jalview.gui.SeqPanel
+.........1 ........84 jalview.schemes.ColourSchemes
+.........1 ........53 jalview.gui.SeqCanvas
+.........1 ........26 jalview.gui.IdPanel
+.........1 ........13 javax.swing.JTabbedPane
+.........1 ........11 jalview.io.FileFormats
+.........1 ........10 jalview.gui.FeatureRenderer
+.........1 .........9 javax.swing.JScrollPane
+.........1 .........9 javax.swing.JInternalFrame.JDesktopIcon
+.........1 .........8 jalview.datamodel.ColumnSelection.IntList
+.........1 .........8 jalview.datamodel.ColumnSelection
+.........1 .........7 sun.awt.image.SunWritableRaster$1
+.........1 .........7 jalview.gui.AnnotationPanel
+.........1 .........5 javax.swing.JToolTip
+.........1 .........4 jalview.jbgui.GAlignFrame$72
+.........1 .........3 jalview.gui.SequenceRenderer
+.........1 .........3 jalview.ext.ensembl.EnsemblLookup$1
+.........1 .........2 javax.swing.JRootPane
+.........1 .........2 jalview.io.gff.SequenceOntologyLite
+.........1 .........2 jalview.gui.ViewSelectionMenu
+.........1 .........1 swingjs.JSKeyEvent
+.........1 .........1 javax.swing.text.GapContent.RemoveUndo
+.........1 .........1 javax.swing.JViewport
+.........1 .........1 javax.swing.JMenuBar
+.........1 .........1 jalview.util.LinkedIdentityHashSet$1
+.........1 .........1 jalview.gui.ScalePanel
+.........1 .........1 jalview.gui.IdwidthAdjuster
+.........1 .........1 jalview.gui.IdCanvas
+.........1 .........1 jalview.gui.AnnotationLabels
+.........1 .........0 swingjs.plaf.Resizer
+.........1 .........0 swingjs.plaf.LazyActionMap
+.........1 .........0 swingjs.plaf.JSTabbedPaneUI.TabbedPaneLayout
+.........1 .........0 swingjs.plaf.JSTabbedPaneUI.Handler
+.........1 .........0 swingjs.plaf.JSScrollPaneUI.Handler
+.........1 .........0 swingjs.plaf.JSMenuBarUI.Handler
+.........1 .........0 swingjs.plaf.JSInternalFrameUI.Handler
+.........1 .........0 swingjs.plaf.DefaultMenuLayout
+.........1 .........0 swingjs.JSMouse
+.........1 .........0 swingjs.JSFrameViewer
+.........1 .........0 sun.java2d.StateTrackable.State[]
+.........1 .........0 javax.swing.text.GapContent.UndoPosRef
+.........1 .........0 javax.swing.text.GapContent.InsertUndo
+.........1 .........0 javax.swing.plaf.basic.BasicBorders.MarginBorder
+.........1 .........0 javax.swing.ScrollPaneLayout.UIResource
+.........1 .........0 javax.swing.JViewport.ViewListener
+.........1 .........0 javax.swing.JTabbedPane.ModelListener
+.........1 .........0 javax.swing.JRootPane.RootLayout
+.........1 .........0 javax.swing.JRootPane$1
+.........1 .........0 javax.swing.JLayeredPane
+.........1 .........0 javax.swing.JComponent.IntVector
+.........1 .........0 javajs.util.AjaxURLStreamHandler
+.........1 .........0 javajs.api.JSFunction[]
+.........1 .........0 java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock
+.........1 .........0 java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock
+.........1 .........0 java.util.concurrent.locks.ReentrantReadWriteLock
+.........1 .........0 java.util.concurrent.ConcurrentHashMap.KeySet
+.........1 .........0 java.util.concurrent.ConcurrentHashMap.KeyIterator
+.........1 .........0 java.util.LinkedHashMap.LinkedKeySet
+.........1 .........0 java.util.LinkedHashMap.LinkedKeyIterator
+.........1 .........0 java.util.Hashtable.ValueCollection
+.........1 .........0 java.util.Hashtable.EntrySet
+.........1 .........0 java.util.Collections.UnmodifiableRandomAccessList
+.........1 .........0 java.util.Collections.SynchronizedMap
+.........1 .........0 java.util.Collections.EmptyIterator
+.........1 .........0 java.util.Collections.EmptyEnumeration
+.........1 .........0 java.lang.Thread[]
+.........1 .........0 java.awt.event.WindowEvent
+.........1 .........0 java.awt.event.FocusEvent
+.........1 .........0 java.awt.dnd.DropTargetContext
+.........1 .........0 java.awt.dnd.DropTarget
+.........1 .........0 java.awt.color.ColorSpace
+.........1 .........0 java.awt.Rectangle[]
+.........1 .........0 java.awt.LightweightDispatcher
+.........1 .........0 jalview.workers.ConsensusThread
+.........1 .........0 jalview.workers.AlignCalcManager
+.........1 .........0 jalview.viewmodel.styles.ViewStyle
+.........1 .........0 jalview.viewmodel.seqfeatures.FeaturesDisplayed
+.........1 .........0 jalview.viewmodel.ViewportRanges
+.........1 .........0 jalview.util.LinkedIdentityHashSet
+.........1 .........0 jalview.schemes.JalviewColourScheme[]
+.........1 .........0 jalview.schemes.Consensus[]
+.........1 .........0 jalview.renderer.ResidueColourFinder
+.........1 .........0 jalview.renderer.AnnotationRenderer
+.........1 .........0 jalview.jbgui.GAlignFrame$99
+.........1 .........0 jalview.jbgui.GAlignFrame$98
+.........1 .........0 jalview.jbgui.GAlignFrame$97
+.........1 .........0 jalview.jbgui.GAlignFrame$96
+.........1 .........0 jalview.jbgui.GAlignFrame$95
+.........1 .........0 jalview.jbgui.GAlignFrame$94
+.........1 .........0 jalview.jbgui.GAlignFrame$93
+.........1 .........0 jalview.jbgui.GAlignFrame$92
+.........1 .........0 jalview.jbgui.GAlignFrame$91
+.........1 .........0 jalview.jbgui.GAlignFrame$90
+.........1 .........0 jalview.jbgui.GAlignFrame$9
+.........1 .........0 jalview.jbgui.GAlignFrame$89
+.........1 .........0 jalview.jbgui.GAlignFrame$88
+.........1 .........0 jalview.jbgui.GAlignFrame$87
+.........1 .........0 jalview.jbgui.GAlignFrame$86
+.........1 .........0 jalview.jbgui.GAlignFrame$85
+.........1 .........0 jalview.jbgui.GAlignFrame$84
+.........1 .........0 jalview.jbgui.GAlignFrame$83
+.........1 .........0 jalview.jbgui.GAlignFrame$82
+.........1 .........0 jalview.jbgui.GAlignFrame$81
+.........1 .........0 jalview.jbgui.GAlignFrame$80
+.........1 .........0 jalview.jbgui.GAlignFrame$8
+.........1 .........0 jalview.jbgui.GAlignFrame$79
+.........1 .........0 jalview.jbgui.GAlignFrame$78
+.........1 .........0 jalview.jbgui.GAlignFrame$77
+.........1 .........0 jalview.jbgui.GAlignFrame$76
+.........1 .........0 jalview.jbgui.GAlignFrame$75
+.........1 .........0 jalview.jbgui.GAlignFrame$74
+.........1 .........0 jalview.jbgui.GAlignFrame$73
+.........1 .........0 jalview.jbgui.GAlignFrame$71
+.........1 .........0 jalview.jbgui.GAlignFrame$70
+.........1 .........0 jalview.jbgui.GAlignFrame$7
+.........1 .........0 jalview.jbgui.GAlignFrame$69
+.........1 .........0 jalview.jbgui.GAlignFrame$68
+.........1 .........0 jalview.jbgui.GAlignFrame$67
+.........1 .........0 jalview.jbgui.GAlignFrame$66
+.........1 .........0 jalview.jbgui.GAlignFrame$65
+.........1 .........0 jalview.jbgui.GAlignFrame$64
+.........1 .........0 jalview.jbgui.GAlignFrame$63
+.........1 .........0 jalview.jbgui.GAlignFrame$62
+.........1 .........0 jalview.jbgui.GAlignFrame$61
+.........1 .........0 jalview.jbgui.GAlignFrame$60
+.........1 .........0 jalview.jbgui.GAlignFrame$6
+.........1 .........0 jalview.jbgui.GAlignFrame$59
+.........1 .........0 jalview.jbgui.GAlignFrame$58
+.........1 .........0 jalview.jbgui.GAlignFrame$57
+.........1 .........0 jalview.jbgui.GAlignFrame$56
+.........1 .........0 jalview.jbgui.GAlignFrame$55
+.........1 .........0 jalview.jbgui.GAlignFrame$54
+.........1 .........0 jalview.jbgui.GAlignFrame$53
+.........1 .........0 jalview.jbgui.GAlignFrame$52
+.........1 .........0 jalview.jbgui.GAlignFrame$51
+.........1 .........0 jalview.jbgui.GAlignFrame$50
+.........1 .........0 jalview.jbgui.GAlignFrame$5
+.........1 .........0 jalview.jbgui.GAlignFrame$49
+.........1 .........0 jalview.jbgui.GAlignFrame$48
+.........1 .........0 jalview.jbgui.GAlignFrame$47
+.........1 .........0 jalview.jbgui.GAlignFrame$46
+.........1 .........0 jalview.jbgui.GAlignFrame$45
+.........1 .........0 jalview.jbgui.GAlignFrame$44
+.........1 .........0 jalview.jbgui.GAlignFrame$43
+.........1 .........0 jalview.jbgui.GAlignFrame$42
+.........1 .........0 jalview.jbgui.GAlignFrame$41
+.........1 .........0 jalview.jbgui.GAlignFrame$40
+.........1 .........0 jalview.jbgui.GAlignFrame$4
+.........1 .........0 jalview.jbgui.GAlignFrame$39
+.........1 .........0 jalview.jbgui.GAlignFrame$38
+.........1 .........0 jalview.jbgui.GAlignFrame$37
+.........1 .........0 jalview.jbgui.GAlignFrame$36
+.........1 .........0 jalview.jbgui.GAlignFrame$35
+.........1 .........0 jalview.jbgui.GAlignFrame$34
+.........1 .........0 jalview.jbgui.GAlignFrame$33
+.........1 .........0 jalview.jbgui.GAlignFrame$32
+.........1 .........0 jalview.jbgui.GAlignFrame$31
+.........1 .........0 jalview.jbgui.GAlignFrame$30
+.........1 .........0 jalview.jbgui.GAlignFrame$3
+.........1 .........0 jalview.jbgui.GAlignFrame$29
+.........1 .........0 jalview.jbgui.GAlignFrame$28
+.........1 .........0 jalview.jbgui.GAlignFrame$27
+.........1 .........0 jalview.jbgui.GAlignFrame$26
+.........1 .........0 jalview.jbgui.GAlignFrame$25
+.........1 .........0 jalview.jbgui.GAlignFrame$24
+.........1 .........0 jalview.jbgui.GAlignFrame$23
+.........1 .........0 jalview.jbgui.GAlignFrame$22
+.........1 .........0 jalview.jbgui.GAlignFrame$21
+.........1 .........0 jalview.jbgui.GAlignFrame$20
+.........1 .........0 jalview.jbgui.GAlignFrame$2
+.........1 .........0 jalview.jbgui.GAlignFrame$19
+.........1 .........0 jalview.jbgui.GAlignFrame$18
+.........1 .........0 jalview.jbgui.GAlignFrame$17
+.........1 .........0 jalview.jbgui.GAlignFrame$16
+.........1 .........0 jalview.jbgui.GAlignFrame$15
+.........1 .........0 jalview.jbgui.GAlignFrame$14
+.........1 .........0 jalview.jbgui.GAlignFrame$13
+.........1 .........0 jalview.jbgui.GAlignFrame$121
+.........1 .........0 jalview.jbgui.GAlignFrame$120
+.........1 .........0 jalview.jbgui.GAlignFrame$12
+.........1 .........0 jalview.jbgui.GAlignFrame$119
+.........1 .........0 jalview.jbgui.GAlignFrame$118
+.........1 .........0 jalview.jbgui.GAlignFrame$117
+.........1 .........0 jalview.jbgui.GAlignFrame$116
+.........1 .........0 jalview.jbgui.GAlignFrame$115
+.........1 .........0 jalview.jbgui.GAlignFrame$114
+.........1 .........0 jalview.jbgui.GAlignFrame$113
+.........1 .........0 jalview.jbgui.GAlignFrame$112
+.........1 .........0 jalview.jbgui.GAlignFrame$111
+.........1 .........0 jalview.jbgui.GAlignFrame$110
+.........1 .........0 jalview.jbgui.GAlignFrame$11
+.........1 .........0 jalview.jbgui.GAlignFrame$109
+.........1 .........0 jalview.jbgui.GAlignFrame$108
+.........1 .........0 jalview.jbgui.GAlignFrame$107
+.........1 .........0 jalview.jbgui.GAlignFrame$106
+.........1 .........0 jalview.jbgui.GAlignFrame$105
+.........1 .........0 jalview.jbgui.GAlignFrame$104
+.........1 .........0 jalview.jbgui.GAlignFrame$103
+.........1 .........0 jalview.jbgui.GAlignFrame$102
+.........1 .........0 jalview.jbgui.GAlignFrame$101
+.........1 .........0 jalview.jbgui.GAlignFrame$100
+.........1 .........0 jalview.jbgui.GAlignFrame$10
+.........1 .........0 jalview.io.SequenceAnnotationReport$1
+.........1 .........0 jalview.io.FileFormat[]
+.........1 .........0 jalview.io.FileFormat$9
+.........1 .........0 jalview.io.FileFormat$8
+.........1 .........0 jalview.io.FileFormat$7
+.........1 .........0 jalview.io.FileFormat$6
+.........1 .........0 jalview.io.FileFormat$5
+.........1 .........0 jalview.io.FileFormat$4
+.........1 .........0 jalview.io.FileFormat$3
+.........1 .........0 jalview.io.FileFormat$2
+.........1 .........0 jalview.io.FileFormat$19
+.........1 .........0 jalview.io.FileFormat$18
+.........1 .........0 jalview.io.FileFormat$17
+.........1 .........0 jalview.io.FileFormat$16
+.........1 .........0 jalview.io.FileFormat$15
+.........1 .........0 jalview.io.FileFormat$14
+.........1 .........0 jalview.io.FileFormat$13
+.........1 .........0 jalview.io.FileFormat$12
+.........1 .........0 jalview.io.FileFormat$11
+.........1 .........0 jalview.io.FileFormat$10
+.........1 .........0 jalview.io.FileFormat$1
+.........1 .........0 jalview.gui.ViewSelectionMenu$1
+.........1 .........0 jalview.gui.ProgressBar
+.........1 .........0 jalview.gui.Desktop$13
+.........1 .........0 jalview.gui.Desktop$12
+.........1 .........0 jalview.gui.Desktop$11
+.........1 .........0 jalview.gui.ColourMenuHelper$4
+.........1 .........0 jalview.gui.ColourMenuHelper$1
+.........1 .........0 jalview.gui.AnnotationPanel.DragMode[]
+.........1 .........0 jalview.gui.AlignmentPanel$2
+.........1 .........0 jalview.gui.AlignmentPanel$1
+.........1 .........0 jalview.gui.AlignFrame$5
+.........1 .........0 jalview.gui.AlignFrame$4
+.........1 .........0 jalview.gui.AlignFrame$3
+.........1 .........0 jalview.gui.AlignFrame$20
+.........1 .........0 jalview.gui.AlignFrame$2
+.........1 .........0 jalview.gui.AlignFrame$1
+.........1 .........0 jalview.ext.ensembl.EnsemblSeqProxy.EnsemblSeqType[]
+.........1 .........0 jalview.ext.ensembl.EnsemblGene$1$2
+.........1 .........0 jalview.ext.ensembl.EnsemblGene$1$1
+.........1 .........0 jalview.ext.ensembl.EnsemblGene$1
+.........1 .........0 jalview.ext.ensembl.EnsemblFeatures
+.........1 .........0 jalview.datamodel.features.SequenceFeatures$2
+.........1 .........0 jalview.datamodel.features.SequenceFeatures$1
+.........1 .........0 jalview.datamodel.features.FeatureAttributes.Datatype[]
+.........1 .........0 jalview.datamodel.features.FeatureAttributes$1
+.........1 .........0 jalview.datamodel.features.FeatureAttributes
+.........1 .........0 jalview.datamodel.Profiles
+.........1 .........0 jalview.analysis.CrossRef
+.........1 .........0 jalview.analysis.CodonComparator
+.........1 .........0 jalview.analysis.AnnotationSorter.SequenceAnnotationOrder[]
+.........1 ........-1 jalview.datamodel.ProfileI[]
+...5993224 .....61225
\ No newline at end of file
--- /dev/null
+"run Clazz.startProfiling() first
+
+ Total new objects: 3208398
+
+count exec(ms)
+-------- -------- ------------------------------
+...2100232 ....-40921 undefined[]
+....504006 .....12402 java.lang.StringBuilder
+....436605 ......3414 java.util.HashMap.Node
+....411205 ......2841 jalview.datamodel.Annotation
+....232907 ......1122 Float
+....215619 ......2440 jalview.datamodel.features.FeatureStore$SearchCriterion$3
+....206107 ......1241 java.awt.Color
+....206007 ......1059 Integer
+....205602 ......3110 jalview.datamodel.ResidueCount
+....205602 ......1697 jalview.datamodel.Profile
+....172921 ......3075 java.util.ArrayList.Itr
+....170314 .....-3144 Object[]
+....139806 .......457 Long
+....138605 ......1033 swingjs.json.JSON.JSONList
+....108563 ......1065 java.util.HashMap
+....108553 .....-2025 java.util.HashMap.Node[]
+....107812 ......9397 jalview.datamodel.SequenceFeature
+.....79143 ......1124 java.util.ArrayList
+.....61212 ......1423 java.util.HashMap.EntryIterator
+.....52231 ......1485 java.util.HashMap.EntrySet
+.....47591 .......876 swingjs.json.JSON.JSONMap
+.....46224 .......266 swingjs.json.JSON.JSONList.ListIterator
+......7084 .......450 jalview.datamodel.features.NCNode
+......3870 ........33 jalview.analysis.AlignmentUtils.DnaVariant
+......3076 ........96 java.awt.Dimension
+......2153 ........43 java.beans.PropertyChangeEvent
+......1561 ........13 jalview.datamodel.SequenceCursor
+......1356 ........18 java.util.LinkedHashMap.Entry
+......1329 .......105 jalview.datamodel.features.NCList
+......1290 .......-22 java.util.ArrayList[]
+.......687 .........9 java.util.Hashtable.Entry
+.......684 ........16 jalview.datamodel.DBRefEntry
+.......526 ........16 javajs.util.Lst
+.......505 ........21 java.util.TreeMap.ValueIterator
+.......479 .........9 javax.swing.event.EventListenerList
+.......449 ........19 java.util.HashSet
+.......449 .........9 java.util.ArrayList$SubList$1
+.......449 .........8 java.util.ArrayList.SubList
+.......440 .........0 jalview.datamodel.HiddenCursorPosition
+.......402 ........-8 java.lang.Class[]
+.......346 .........4 java.awt.geom.AffineTransform
+.......346 .........4 java.awt.BasicStroke
+.......325 ........28 java.awt.EventDispatchThread$1
+.......290 ........-7 java.beans.PropertyChangeListener[]
+.......287 ........11 java.util.Hashtable.Enumerator
+.......280 .........5 java.awt.Rectangle
+.......276 .........7 java.util.TreeMap.EntryIterator
+.......274 ........-7 java.awt.Component[]
+.......261 ........10 java.beans.PropertyChangeSupport
+.......261 .........6 java.beans.PropertyChangeSupport.PropertyChangeListenerMap
+.......226 .........3 java.util.Collections.UnmodifiableSet
+.......219 .........1 com.stevesoft.pat.StrPos
+.......206 .........5 java.awt.AWTEventMulticaster
+.......200 .........5 java.util.HashMap.KeySet
+.......200 .........5 java.util.HashMap.KeyIterator
+.......199 ........35 java.awt.EventDispatchThread
+.......199 ........17 java.awt.EventDispatchThread.HierarchyEventFilter
+.......198 .........2 javax.swing.plaf.ComponentInputMapUIResource
+.......187 .........3 java.util.Arrays.ArrayList
+.......182 ........14 java.awt.event.ContainerEvent
+.......176 ........-7 java.util.Hashtable.Entry[]
+.......173 .........2 javax.swing.ActionMap
+.......173 ........-5 javax.swing.KeyStroke[]
+.......171 .........3 java.awt.Insets
+.......169 .........6 javax.swing.AbstractButton.Handler
+.......169 .........5 javax.swing.JMenuItem.MenuItemFocusListener
+.......169 .........2 swingjs.plaf.ButtonListener
+.......154 .........4 javax.swing.KeyboardManager.ComponentKeyStrokePair
+.......145 ........14 java.awt.event.MouseEvent
+.......138 .........1 jalview.datamodel.PDBEntry
+.......136 .........5 java.util.Vector.Itr
+.......132 .........2 javajs.util.SB
+.......126 .........3 java.awt.EventQueueItem
+.......122 .........6 java.io.ByteArrayInputStream
+.......122 .........6 java.io.BufferedInputStream
+.......116 .........1 javax.swing.DefaultButtonModel
+.......112 .........6 java.lang.StringBuffer
+.......100 .........6 jalview.datamodel.features.FeatureStore$SearchCriterion$2
+........99 .........2 javax.swing.event.ChangeEvent
+........94 .......690 javax.swing.JMenuItem
+........88 .........3 java.util.Hashtable
+........88 .........0 java.util.TreeMap.Entry
+........77 .........1 javax.swing.ArrayTable
+........72 .........8 jalview.datamodel.features.FeatureStore
+........72 .........1 java.util.TreeMap
+........69 ........-1 java.util.concurrent.ConcurrentHashMap.HashEntry[]
+........67 .......176 jalview.datamodel.Sequence
+........67 ........15 jalview.datamodel.features.SequenceFeatures
+........67 .........7 java.net.URL
+........65 .........1 javajs.util.AjaxURLConnection
+........64 .........1 java.util.concurrent.ConcurrentHashMap.Segment
+........63 ........-2 jalview.datamodel.SequenceGroup[]
+........60 .........4 java.util.Collections$UnmodifiableCollection$1
+........60 .........0 javax.swing.SizeRequirements
+........55 .......163 swingjs.json.JSON.JSONReader
+........53 .........5 java.util.ArrayList.ListItr
+........53 .........4 javax.swing.JToggleButton.ToggleButtonModel
+........53 ........-2 swingjs.api.js.DOMNode[]
+........51 ........-2 jalview.datamodel.SequenceI[]
+........44 .........2 jalview.util.LinkedIdentityHashSet.IdentityWrapper
+........39 .........5 jalview.datamodel.HiddenColumnsCursor
+........38 .........1 java.lang.StackTraceElement
+........35 .......169 javax.swing.JCheckBoxMenuItem
+........34 ........11 jalview.util.MapList
+........33 .........5 java.util.StringTokenizer
+........33 .........5 jalview.datamodel.Sequence.DBModList
+........33 .........2 jalview.renderer.ScaleRenderer.ScaleMark
+........33 .........2 jalview.ext.ensembl.EnsemblXref
+........32 .........1 java.util.Collections.SynchronizedRandomAccessList
+........31 .........3 java.awt.event.ComponentEvent
+........31 .........2 com.stevesoft.pat.oneChar
+........31 .........1 java.lang.reflect.Constructor
+........31 .........0 java.awt.Point
+........30 .........0 javax.swing.KeyStroke
+........30 .........0 javax.swing.ComponentInputMap
+........28 .........1 com.stevesoft.pat.patInt
+........27 .........1 java.util.Vector
+........24 .........1 javax.swing.DefaultSingleSelectionModel
+........23 .........5 java.util.SubList$1
+........23 .........3 java.util.AbstractList.ListItr
+........23 .........3 jalview.datamodel.Mapping
+........23 .........2 java.util.TreeMap.EntrySet
+........23 .........1 java.util.TreeMap.Values
+........22 ........21 javax.swing.JPopupMenu
+........22 ........14 javax.swing.JPopupMenu.Separator
+........22 .........2 javax.swing.JMenu.WinListener
+........22 .........2 javax.swing.JMenu.MenuChangeListener
+........22 .........2 java.util.TimSort
+........22 .........1 java.util.RandomAccessSubList
+........22 .........0 swingjs.plaf.JSPopupMenuUI.JSMenuKeyListener
+........21 ........41 javax.swing.JMenu
+........21 .........2 jalview.ext.ensembl.EnsemblProtein
+........21 .........0 jalview.ext.ensembl.EnsemblCdna
+........20 .........0 java.awt.FlowLayout
+........18 .......143 javax.swing.JRadioButtonMenuItem
+........18 .........3 java.util.Formatter.Flags
+........18 .........1 java.awt.event.InvocationEvent
+........18 .........0 java.awt.event.ItemEvent
+........18 .........0 java.awt.BorderLayout
+........16 .........0 jalview.datamodel.features.FeatureAttributes.AttributeData
+........15 ........11 javax.swing.JPanel
+........15 .........1 javax.swing.JComponent$2
+........14 .......406 jalview.datamodel.Alignment
+........14 .........7 jalview.datamodel.HiddenColumns
+........14 .........1 jalview.gui.ColourMenuHelper$3
+........14 .........0 java.util.LinkedList.ListItr
+........14 .........0 jalview.schemes.JalviewColourScheme
+........14 .........0 jalview.datamodel.HiddenSequences
+........13 .........2 jalview.util.ReverseListIterator
+........13 .........1 java.util.LinkedHashMap
+........12 .........1 java.awt.AlphaComposite
+........11 .........0 jalview.jbgui.GAlignFrame$1
+........10 .........0 java.util.BitSet
+........10 .........0 java.awt.geom.Rectangle2D.Float
+........10 .........0 java.awt.Color[]
+.........9 .........1 java.util.LinkedHashMap.LinkedEntrySet
+.........9 .........1 java.util.LinkedHashMap.LinkedEntryIterator
+.........8 .........5 java.util.Formatter.FormatSpecifier
+.........8 .........0 java.util.Formatter.FixedString
+.........8 .........0 java.awt.Font
+.........8 .........0 com.stevesoft.pat.Pthings
+.........7 .........2 com.stevesoft.pat.Bracket
+.........7 .........1 java.util.concurrent.ConcurrentHashMap.HashEntry
+.........7 .........0 javax.swing.text.Segment
+.........6 .........1 java.util.AbstractList.Itr
+.........6 .........1 com.stevesoft.pat.SubMark
+.........6 .........1 com.stevesoft.pat.OrMark
+.........6 .........1 com.stevesoft.pat.FastMulti
+.........6 .........0 swingjs.JSFontMetrics
+.........6 .........0 javax.swing.SizeRequirements[]
+.........6 .........0 javax.swing.DefaultBoundedRangeModel
+.........6 .........0 java.util.Formatter.FormatString[]
+.........6 .........0 jalview.datamodel.Range
+.........6 .........0 com.stevesoft.pat.Range
+.........5 .........1 swingjs.JSGraphics2D
+.........5 .........0 sun.java2d.StateTrackableDelegate
+.........5 .........0 javax.swing.event.InternalFrameEvent
+.........5 .........0 java.awt.RenderingHints
+.........5 .........0 jalview.renderer.ResidueShader
+.........5 .........0 Boolean
+.........4 .........3 javax.swing.JLabel
+.........4 .........3 jalview.analysis.AnnotationSorter
+.........4 .........2 java.util.concurrent.ConcurrentHashMap
+.........4 .........1 jalview.analysis.AnnotationSorter$2
+.........4 .........0 sun.java2d.StateTrackable.State
+.........4 .........0 javax.swing.JScrollBar.ModelListener
+.........4 .........0 java.util.concurrent.ConcurrentHashMap.Segment[]
+.........4 .........0 java.awt.geom.RectIterator
+.........4 .........0 java.awt.event.AdjustmentEvent
+.........4 .........0 jalview.ext.ensembl.EnsemblSeqProxy.EnsemblSeqType
+.........4 .........0 jalview.analysis.AnnotationSorter$3
+.........4 .........0 jalview.analysis.AnnotationSorter$1
+.........4 .........0 com.stevesoft.pat.End
+.........4 ........-1 jalview.datamodel.Annotation[]
+.........3 ........46 java.awt.image.BufferedImage
+.........3 .........4 java.awt.image.DataBufferInt
+.........3 .........3 java.awt.image.DirectColorModel
+.........3 .........1 java.awt.GridLayout
+.........3 .........1 jalview.datamodel.StartRegionIterator
+.........3 .........0 swingjs.JSToolkit$1
+.........3 .........0 sun.font.FontDesignMetrics.KeyReference
+.........3 .........0 sun.font.FontDesignMetrics
+.........3 .........0 javax.swing.ButtonGroup
+.........3 .........0 java.util.regex.Matcher
+.........3 .........0 java.util.Collections.SynchronizedSet
+.........3 .........0 java.awt.image.SinglePixelPackedSampleModel
+.........3 .........0 jalview.schemes.NucleotideColourScheme
+.........3 .........0 jalview.renderer.ScaleRenderer
+.........3 .........0 jalview.gui.AnnotationPanel.DragMode
+.........3 .........0 jalview.datamodel.features.FeatureAttributes.Datatype
+.........3 .........0 jalview.datamodel.VisibleContigsIterator
+.........3 .........0 jalview.analysis.AnnotationSorter.SequenceAnnotationOrder
+.........2 .......190 javax.swing.JScrollBar
+.........2 ........16 javax.swing.JScrollPane.ScrollBar
+.........2 ........13 com.stevesoft.pat.Regex
+.........2 ........10 javax.swing.JProgressBar
+.........2 .........2 java.awt.Container
+.........2 .........1 java.util.Hashtable.KeySet
+.........2 .........1 java.lang.IndexOutOfBoundsException
+.........2 .........1 java.awt.geom.Path2D.Float.CopyIterator
+.........2 .........1 java.awt.geom.Path2D.Float
+.........2 .........0 javax.swing.text.AbstractDocument.DefaultDocumentEvent
+.........2 .........0 javax.swing.event.UndoableEditEvent
+.........2 .........0 javax.swing.border.LineBorder
+.........2 .........0 javax.swing.JProgressBar.ModelListener
+.........2 .........0 java.util.LinkedHashMap.LinkedValues
+.........2 .........0 java.util.LinkedHashMap.LinkedValueIterator
+.........2 .........0 java.util.IdentityHashMap.KeyIterator
+.........2 .........0 java.util.Collections.SynchronizedCollection
+.........2 .........0 java.util.Collections.SingletonList
+.........2 .........0 java.util.Collections$1
+.........2 .........0 java.util.ArrayDeque
+.........2 .........0 java.lang.Thread
+.........2 .........0 java.lang.StackTraceElement[]
+.........2 .........0 java.awt.event.ActionEvent
+.........2 .........0 jalview.util.IntRangeComparator
+.........2 .........0 jalview.io.SequenceAnnotationReport
+.........2 .........0 jalview.gui.AlignmentPanel[]
+.........2 .........0 jalview.ext.ensembl.EnsemblSequenceFetcher.EnsemblFeatureType[]
+.........2 .........0 jalview.ext.ensembl.EnsemblLookup
+.........2 .........0 jalview.datamodel.features.RangeComparator
+.........2 .........0 jalview.datamodel.SearchResults
+.........2 .........0 jalview.datamodel.AlignmentAnnotation[]
+.........2 .........0 jalview.datamodel.AlignmentAnnotation
+.........2 .........0 jalview.controller.AlignViewController
+.........2 .........0 com.stevesoft.pat.patInf
+.........2 .........0 com.stevesoft.pat.Rthings
+.........2 .........0 com.stevesoft.pat.Or
+.........2 .........0 com.stevesoft.pat.NullPattern
+.........1 .....11161 jalview.gui.AlignFrame
+.........1 .......561 jalview.gui.AlignViewport
+.........1 .......441 jalview.gui.AlignmentPanel
+.........1 ........65 jalview.schemes.ColourSchemes
+.........1 ........57 jalview.gui.SeqPanel
+.........1 ........33 jalview.gui.SeqCanvas
+.........1 ........19 javax.swing.JScrollPane
+.........1 ........11 javax.swing.JTabbedPane
+.........1 ........11 jalview.io.FileFormats
+.........1 .........9 jalview.gui.FeatureRenderer
+.........1 .........8 javax.swing.JRootPane
+.........1 .........8 javax.swing.JInternalFrame.JDesktopIcon
+.........1 .........8 jalview.gui.IdPanel
+.........1 .........7 jalview.gui.AnnotationPanel
+.........1 .........6 jalview.datamodel.ColumnSelection.IntList
+.........1 .........6 jalview.datamodel.ColumnSelection
+.........1 .........5 javax.swing.JToolTip
+.........1 .........5 jalview.jbgui.GAlignFrame$79
+.........1 .........4 jalview.io.gff.SequenceOntologyLite
+.........1 .........3 sun.awt.image.SunWritableRaster$1
+.........1 .........3 jalview.jbgui.GAlignFrame$72
+.........1 .........3 jalview.gui.ViewSelectionMenu
+.........1 .........2 javax.swing.text.GapContent.RemoveUndo
+.........1 .........2 javax.swing.JLayeredPane
+.........1 .........2 jalview.util.LinkedIdentityHashSet$1
+.........1 .........2 jalview.jbgui.GAlignFrame$83
+.........1 .........2 jalview.gui.SequenceRenderer
+.........1 .........2 jalview.gui.IdCanvas
+.........1 .........2 jalview.ext.ensembl.EnsemblLookup$1
+.........1 .........1 swingjs.JSKeyEvent
+.........1 .........1 javax.swing.JViewport
+.........1 .........1 javax.swing.JMenuBar
+.........1 .........1 java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock
+.........1 .........1 java.util.concurrent.locks.ReentrantReadWriteLock
+.........1 .........1 jalview.viewmodel.seqfeatures.FeaturesDisplayed
+.........1 .........1 jalview.jbgui.GAlignFrame$99
+.........1 .........1 jalview.jbgui.GAlignFrame$8
+.........1 .........1 jalview.jbgui.GAlignFrame$59
+.........1 .........1 jalview.jbgui.GAlignFrame$57
+.........1 .........1 jalview.jbgui.GAlignFrame$54
+.........1 .........1 jalview.jbgui.GAlignFrame$50
+.........1 .........1 jalview.jbgui.GAlignFrame$49
+.........1 .........1 jalview.jbgui.GAlignFrame$46
+.........1 .........1 jalview.jbgui.GAlignFrame$41
+.........1 .........1 jalview.jbgui.GAlignFrame$40
+.........1 .........1 jalview.jbgui.GAlignFrame$29
+.........1 .........1 jalview.jbgui.GAlignFrame$23
+.........1 .........1 jalview.jbgui.GAlignFrame$21
+.........1 .........1 jalview.jbgui.GAlignFrame$14
+.........1 .........1 jalview.jbgui.GAlignFrame$13
+.........1 .........1 jalview.jbgui.GAlignFrame$116
+.........1 .........1 jalview.jbgui.GAlignFrame$102
+.........1 .........1 jalview.io.SequenceAnnotationReport$1
+.........1 .........1 jalview.io.FileFormat$3
+.........1 .........1 jalview.io.FileFormat$13
+.........1 .........1 jalview.gui.ScalePanel
+.........1 .........1 jalview.gui.ProgressBar
+.........1 .........1 jalview.gui.IdwidthAdjuster
+.........1 .........1 jalview.gui.ColourMenuHelper$1
+.........1 .........1 jalview.gui.AnnotationLabels
+.........1 .........1 jalview.gui.AlignFrame$3
+.........1 .........1 jalview.datamodel.features.FeatureAttributes$1
+.........1 .........1 jalview.datamodel.features.FeatureAttributes
+.........1 .........0 swingjs.plaf.Resizer
+.........1 .........0 swingjs.plaf.LazyActionMap
+.........1 .........0 swingjs.plaf.JSTabbedPaneUI.TabbedPaneLayout
+.........1 .........0 swingjs.plaf.JSTabbedPaneUI.Handler
+.........1 .........0 swingjs.plaf.JSScrollPaneUI.Handler
+.........1 .........0 swingjs.plaf.JSMenuBarUI.Handler
+.........1 .........0 swingjs.plaf.JSInternalFrameUI.Handler
+.........1 .........0 swingjs.plaf.DefaultMenuLayout
+.........1 .........0 swingjs.JSMouse
+.........1 .........0 swingjs.JSFrameViewer
+.........1 .........0 sun.java2d.StateTrackable.State[]
+.........1 .........0 javax.swing.text.GapContent.UndoPosRef
+.........1 .........0 javax.swing.text.GapContent.InsertUndo
+.........1 .........0 javax.swing.plaf.basic.BasicBorders.MarginBorder
+.........1 .........0 javax.swing.ScrollPaneLayout.UIResource
+.........1 .........0 javax.swing.JViewport.ViewListener
+.........1 .........0 javax.swing.JTabbedPane.ModelListener
+.........1 .........0 javax.swing.JRootPane.RootLayout
+.........1 .........0 javax.swing.JRootPane$1
+.........1 .........0 javax.swing.JComponent.IntVector
+.........1 .........0 javajs.util.AjaxURLStreamHandler
+.........1 .........0 javajs.api.JSFunction[]
+.........1 .........0 java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock
+.........1 .........0 java.util.concurrent.ConcurrentHashMap.KeySet
+.........1 .........0 java.util.concurrent.ConcurrentHashMap.KeyIterator
+.........1 .........0 java.util.LinkedHashMap.LinkedKeySet
+.........1 .........0 java.util.LinkedHashMap.LinkedKeyIterator
+.........1 .........0 java.util.Hashtable.ValueCollection
+.........1 .........0 java.util.Hashtable.EntrySet
+.........1 .........0 java.util.Collections.UnmodifiableRandomAccessList
+.........1 .........0 java.util.Collections.SynchronizedMap
+.........1 .........0 java.util.Collections.EmptyIterator
+.........1 .........0 java.util.Collections.EmptyEnumeration
+.........1 .........0 java.lang.Thread[]
+.........1 .........0 java.awt.event.WindowEvent
+.........1 .........0 java.awt.event.FocusEvent
+.........1 .........0 java.awt.dnd.DropTargetContext
+.........1 .........0 java.awt.dnd.DropTarget
+.........1 .........0 java.awt.color.ColorSpace
+.........1 .........0 java.awt.Rectangle[]
+.........1 .........0 java.awt.LightweightDispatcher
+.........1 .........0 java.awt.EventQueueItem[]
+.........1 .........0 jalview.workers.ConsensusThread
+.........1 .........0 jalview.workers.AlignCalcManager
+.........1 .........0 jalview.viewmodel.styles.ViewStyle
+.........1 .........0 jalview.viewmodel.ViewportRanges
+.........1 .........0 jalview.util.LinkedIdentityHashSet
+.........1 .........0 jalview.schemes.JalviewColourScheme[]
+.........1 .........0 jalview.renderer.ResidueColourFinder
+.........1 .........0 jalview.renderer.AnnotationRenderer
+.........1 .........0 jalview.jbgui.GAlignFrame$98
+.........1 .........0 jalview.jbgui.GAlignFrame$97
+.........1 .........0 jalview.jbgui.GAlignFrame$96
+.........1 .........0 jalview.jbgui.GAlignFrame$95
+.........1 .........0 jalview.jbgui.GAlignFrame$94
+.........1 .........0 jalview.jbgui.GAlignFrame$93
+.........1 .........0 jalview.jbgui.GAlignFrame$92
+.........1 .........0 jalview.jbgui.GAlignFrame$91
+.........1 .........0 jalview.jbgui.GAlignFrame$90
+.........1 .........0 jalview.jbgui.GAlignFrame$9
+.........1 .........0 jalview.jbgui.GAlignFrame$89
+.........1 .........0 jalview.jbgui.GAlignFrame$88
+.........1 .........0 jalview.jbgui.GAlignFrame$87
+.........1 .........0 jalview.jbgui.GAlignFrame$86
+.........1 .........0 jalview.jbgui.GAlignFrame$85
+.........1 .........0 jalview.jbgui.GAlignFrame$84
+.........1 .........0 jalview.jbgui.GAlignFrame$82
+.........1 .........0 jalview.jbgui.GAlignFrame$81
+.........1 .........0 jalview.jbgui.GAlignFrame$80
+.........1 .........0 jalview.jbgui.GAlignFrame$78
+.........1 .........0 jalview.jbgui.GAlignFrame$77
+.........1 .........0 jalview.jbgui.GAlignFrame$76
+.........1 .........0 jalview.jbgui.GAlignFrame$75
+.........1 .........0 jalview.jbgui.GAlignFrame$74
+.........1 .........0 jalview.jbgui.GAlignFrame$73
+.........1 .........0 jalview.jbgui.GAlignFrame$71
+.........1 .........0 jalview.jbgui.GAlignFrame$70
+.........1 .........0 jalview.jbgui.GAlignFrame$7
+.........1 .........0 jalview.jbgui.GAlignFrame$69
+.........1 .........0 jalview.jbgui.GAlignFrame$68
+.........1 .........0 jalview.jbgui.GAlignFrame$67
+.........1 .........0 jalview.jbgui.GAlignFrame$66
+.........1 .........0 jalview.jbgui.GAlignFrame$65
+.........1 .........0 jalview.jbgui.GAlignFrame$64
+.........1 .........0 jalview.jbgui.GAlignFrame$63
+.........1 .........0 jalview.jbgui.GAlignFrame$62
+.........1 .........0 jalview.jbgui.GAlignFrame$61
+.........1 .........0 jalview.jbgui.GAlignFrame$60
+.........1 .........0 jalview.jbgui.GAlignFrame$6
+.........1 .........0 jalview.jbgui.GAlignFrame$58
+.........1 .........0 jalview.jbgui.GAlignFrame$56
+.........1 .........0 jalview.jbgui.GAlignFrame$55
+.........1 .........0 jalview.jbgui.GAlignFrame$53
+.........1 .........0 jalview.jbgui.GAlignFrame$52
+.........1 .........0 jalview.jbgui.GAlignFrame$51
+.........1 .........0 jalview.jbgui.GAlignFrame$5
+.........1 .........0 jalview.jbgui.GAlignFrame$48
+.........1 .........0 jalview.jbgui.GAlignFrame$47
+.........1 .........0 jalview.jbgui.GAlignFrame$45
+.........1 .........0 jalview.jbgui.GAlignFrame$44
+.........1 .........0 jalview.jbgui.GAlignFrame$43
+.........1 .........0 jalview.jbgui.GAlignFrame$42
+.........1 .........0 jalview.jbgui.GAlignFrame$4
+.........1 .........0 jalview.jbgui.GAlignFrame$39
+.........1 .........0 jalview.jbgui.GAlignFrame$38
+.........1 .........0 jalview.jbgui.GAlignFrame$37
+.........1 .........0 jalview.jbgui.GAlignFrame$36
+.........1 .........0 jalview.jbgui.GAlignFrame$35
+.........1 .........0 jalview.jbgui.GAlignFrame$34
+.........1 .........0 jalview.jbgui.GAlignFrame$33
+.........1 .........0 jalview.jbgui.GAlignFrame$32
+.........1 .........0 jalview.jbgui.GAlignFrame$31
+.........1 .........0 jalview.jbgui.GAlignFrame$30
+.........1 .........0 jalview.jbgui.GAlignFrame$3
+.........1 .........0 jalview.jbgui.GAlignFrame$28
+.........1 .........0 jalview.jbgui.GAlignFrame$27
+.........1 .........0 jalview.jbgui.GAlignFrame$26
+.........1 .........0 jalview.jbgui.GAlignFrame$25
+.........1 .........0 jalview.jbgui.GAlignFrame$24
+.........1 .........0 jalview.jbgui.GAlignFrame$22
+.........1 .........0 jalview.jbgui.GAlignFrame$20
+.........1 .........0 jalview.jbgui.GAlignFrame$2
+.........1 .........0 jalview.jbgui.GAlignFrame$19
+.........1 .........0 jalview.jbgui.GAlignFrame$18
+.........1 .........0 jalview.jbgui.GAlignFrame$17
+.........1 .........0 jalview.jbgui.GAlignFrame$16
+.........1 .........0 jalview.jbgui.GAlignFrame$15
+.........1 .........0 jalview.jbgui.GAlignFrame$121
+.........1 .........0 jalview.jbgui.GAlignFrame$120
+.........1 .........0 jalview.jbgui.GAlignFrame$12
+.........1 .........0 jalview.jbgui.GAlignFrame$119
+.........1 .........0 jalview.jbgui.GAlignFrame$118
+.........1 .........0 jalview.jbgui.GAlignFrame$117
+.........1 .........0 jalview.jbgui.GAlignFrame$115
+.........1 .........0 jalview.jbgui.GAlignFrame$114
+.........1 .........0 jalview.jbgui.GAlignFrame$113
+.........1 .........0 jalview.jbgui.GAlignFrame$112
+.........1 .........0 jalview.jbgui.GAlignFrame$111
+.........1 .........0 jalview.jbgui.GAlignFrame$110
+.........1 .........0 jalview.jbgui.GAlignFrame$11
+.........1 .........0 jalview.jbgui.GAlignFrame$109
+.........1 .........0 jalview.jbgui.GAlignFrame$108
+.........1 .........0 jalview.jbgui.GAlignFrame$107
+.........1 .........0 jalview.jbgui.GAlignFrame$106
+.........1 .........0 jalview.jbgui.GAlignFrame$105
+.........1 .........0 jalview.jbgui.GAlignFrame$104
+.........1 .........0 jalview.jbgui.GAlignFrame$103
+.........1 .........0 jalview.jbgui.GAlignFrame$101
+.........1 .........0 jalview.jbgui.GAlignFrame$100
+.........1 .........0 jalview.jbgui.GAlignFrame$10
+.........1 .........0 jalview.io.FileFormat[]
+.........1 .........0 jalview.io.FileFormat$9
+.........1 .........0 jalview.io.FileFormat$8
+.........1 .........0 jalview.io.FileFormat$7
+.........1 .........0 jalview.io.FileFormat$6
+.........1 .........0 jalview.io.FileFormat$5
+.........1 .........0 jalview.io.FileFormat$4
+.........1 .........0 jalview.io.FileFormat$2
+.........1 .........0 jalview.io.FileFormat$19
+.........1 .........0 jalview.io.FileFormat$18
+.........1 .........0 jalview.io.FileFormat$17
+.........1 .........0 jalview.io.FileFormat$16
+.........1 .........0 jalview.io.FileFormat$15
+.........1 .........0 jalview.io.FileFormat$14
+.........1 .........0 jalview.io.FileFormat$12
+.........1 .........0 jalview.io.FileFormat$11
+.........1 .........0 jalview.io.FileFormat$10
+.........1 .........0 jalview.io.FileFormat$1
+.........1 .........0 jalview.gui.ViewSelectionMenu$1
+.........1 .........0 jalview.gui.Desktop$13
+.........1 .........0 jalview.gui.Desktop$12
+.........1 .........0 jalview.gui.Desktop$11
+.........1 .........0 jalview.gui.ColourMenuHelper$4
+.........1 .........0 jalview.gui.AnnotationPanel.DragMode[]
+.........1 .........0 jalview.gui.AlignmentPanel$2
+.........1 .........0 jalview.gui.AlignmentPanel$1
+.........1 .........0 jalview.gui.AlignFrame$5
+.........1 .........0 jalview.gui.AlignFrame$4
+.........1 .........0 jalview.gui.AlignFrame$20
+.........1 .........0 jalview.gui.AlignFrame$2
+.........1 .........0 jalview.gui.AlignFrame$1
+.........1 .........0 jalview.ext.ensembl.EnsemblSeqProxy.EnsemblSeqType[]
+.........1 .........0 jalview.ext.ensembl.EnsemblGene$1$2
+.........1 .........0 jalview.ext.ensembl.EnsemblGene$1$1
+.........1 .........0 jalview.ext.ensembl.EnsemblGene$1
+.........1 .........0 jalview.ext.ensembl.EnsemblFeatures
+.........1 .........0 jalview.datamodel.features.SequenceFeatures$2
+.........1 .........0 jalview.datamodel.features.SequenceFeatures$1
+.........1 .........0 jalview.datamodel.features.FeatureAttributes.Datatype[]
+.........1 .........0 jalview.datamodel.Profiles
+.........1 .........0 jalview.datamodel.ProfileI[]
+.........1 .........0 jalview.analysis.CrossRef
+.........1 .........0 jalview.analysis.CodonComparator
+.........1 .........0 jalview.analysis.AnnotationSorter.SequenceAnnotationOrder[]
+.........1 ........-1 jalview.schemes.Consensus[]
+...5994529 ....111547
\ No newline at end of file
--- /dev/null
+J2SApplet exec testApplet start applet null
+swingjs.api.Interface creating instance of javajs.util.AjaxURLStreamHandlerFactory
+get parameter: language = null
+get parameter: name = testApplet
+get parameter: syncId = 2491377188955504
+JSApp initialized
+JSAppletViewer initializing2
+JSToolkit initialized
+JSGraphicsConfiguration initialized
+swingjs.api.Interface creating instance of swingjs.JSGraphicsEnvironment
+JSGraphicsEnvironment initialized
+swingjs.api.Interface creating instance of swingjs.JSScreenDevice
+JSScreenDevice initialized
+JSAppletViewer thread run1 mode=0 status=0
+JSAppletViewer thread run1 mode=1 status=1
+JSAppletViewer runloader
+get parameter: main = jalview.bin.Jalview
+swingjs.api.Interface creating instance of swingjs.JSApplet
+swingjs.api.Interface creating instance of swingjs.plaf.HTML5LookAndFeel
+testApplet loaded
+JSAppletViewer thread run1 mode=1 status=76
+testApplet running jalview.bin.Jalview
+Running main(args) in class jalview.bin.Jalview
+Java version: 1.6-1.8
+null Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
+JSUtil getting Java resource sun/util/resources/CalendarData.properties
+Processing swingjs/j2s/sun/util/resources/CalendarData.properties [1780]
+swingjs.api.Interface creating instance of java.util.PropertyResourceBundle
+JSUtil getting Java resource sun/util/resources/CalendarData_en.properties
+Processing swingjs/j2s/sun/util/resources/CalendarData_en.properties [1937]
+swingjs.api.Interface creating instance of sun.util.calendar.Gregorian
+swingjs.api.Interface creating instance of sun.text.resources.FormatData
+swingjs.api.Interface creating instance of sun.text.resources.FormatData_en
+Loading jalview properties from : https://./.jalview_properties
+Disabling Jalview writing to user's local properties file.
+Jalview Version: Test
+Jalview Debugging Output Follows.
+Getting messages for lang: en_US
+JSUtil getting Java resource lang/Messages.properties
+Processing swingjs/j2s/lang/Messages.properties [82729]
+JSUtil getting Java resource lang/Messages_en.properties
+Processing swingjs/j2s/lang/Messages_en.properties [5]
+JSUtil getting Java resource lang/Messages_en_US.properties
+Processing swingjs/j2s/lang/Messages_en_US.properties [5]
+JSUtil getting Java resource swingjs/jquery/j2sMenu.js
+Processing swingjs/j2s/swingjs/jquery/j2sMenu.js [27197]
+JSWIndowUI ????
+JSFrameViewer creating new canvas testApplet_canvas2: 900 613
+JSWindowUI windowOpened true
+JSFrameUI windowActivated true
+swingjs.api.Interface creating instance of swingjs.JSGraphicsConfiguration
+JSGraphicsConfiguration initialized
+JSPopupMenuUI processing 0 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 1 _hide for testApplet_PopupMenuUI_46_46
+noclickout 0 1548730342022
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+click added 0
+JSPopupMenuUI processing 2 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 3 onover3 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 4 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 5 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 6 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 7 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 8 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 9 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 10 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 11 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 12 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 13 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 14 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 15 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 16 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 17 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 18 onover3 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 19 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 20 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 21 onover3 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 22 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 23 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 24 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 25 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 26 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 27 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 28 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 29 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 30 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 31 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 32 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 33 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 34 onover3 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 35 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 36 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 37 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 38 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 39 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 40 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 41 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 42 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 43 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 44 onover3 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 45 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 46 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 47 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 48 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 49 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 50 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 51 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 52 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 53 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 54 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 55 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 56 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 57 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 58 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 59 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 60 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 61 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 62 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 63 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 64 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 65 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 66 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 67 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 68 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 69 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 70 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 71 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 72 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 73 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 74 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 75 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 76 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 77 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 78 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 79 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 80 onpress for testApplet_PopupMenuUI_46_46
+JSUtil getting Java resource swingjs/jquery/jquery-ui-j2sslider.css
+Processing swingjs/j2s/swingjs/jquery/jquery-ui-j2sslider.css [24188]
+JSUtil getting Java resource swingjs/jquery/jquery-ui-j2sslider.js
+Processing swingjs/j2s/swingjs/jquery/jquery-ui-j2sslider.js [22356]
+JSDesktopIconUI SURRAGATE -- NOT IMPLEMENTED YET!
+JSWIndowUI ????
+collapseAll 0
+JSPopupMenuUI processing 81 collapseAll for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 82 select for testApplet_PopupMenuUI_46_46
+collapseAll 0
+JSPopupMenuUI processing 83 collapseAll for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 84 onclick for testApplet_PopupMenuUI_46_46
+click removed 0
+JSFrameViewer creating new canvas testApplet_canvas3: 400 230
+JSWindowUI windowOpened true
+click removed 0
+JSFrameUI windowActivated true
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+Platform: timer mark 0.0 0.0 Desktop Fetching 1 sequence queries from ENSEMBL
+Platform: timer mark 0.708 0.676 EnsembleRestClient.getJSON https://rest.ensembl.org/lookup/id/ENSG00000157764?content-type=application/json
+Platform: timer mark 0.861 0.145 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 0.997 0.135 EnsembleRestClient.getJSON https://rest.ensembl.org/info/rest?content-type=application/json
+EnsemblRestClient expected ENSEMBL REST version 7.0 but found 9.0, see https://github.com/Ensembl/ensembl-rest/wiki/Change-log
+Platform: timer mark 1.151 0.136 EnsembleRestClient.getJSON https://rest.ensembl.org/info/data?content-type=application/json
+Platform: timer mark 1.153 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 1.153 0.0 ENS seqproxy
+Platform: timer mark 2.374 1.22 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENSG00000157764?type=genomic&Accept=application/json&content-type=application/json&object_type=Gene
+Platform: timer mark 2.468 0.094 ENS seqproxy2
+Platform: timer mark 2.564 0.096 ESP.getsequencerec1
+Platform: timer mark 14.377 11.8 EnsembleRestClient.getJSON https://rest.ensembl.org/overlap/id/ENSG00000157764?content-type=application/json&object_type=Gene&feature=gene&feature=transcript&feature=exon&feature=cds&feature=variation
+Platform: timer mark 19.553 5.176 ESP.getsequencerec2
+Platform: timer mark 19.579 0.026 ESP. xfer 46594
+Platform: timer mark 25.302 5.723 ESP.transferFeatures
+Platform: timer mark 25.302 0.0 ESP.addfeat done
+Platform: timer mark 25.303 0.001 ESP. getdataseq
+Platform: timer mark 25.303 0.0 ESP. getxref
+Platform: timer mark 26.69 1.382 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSG00000157764?content-type=application/json&all_levels=1
+Platform: timer mark 26.712 0.022 ESP. seqprox done
+Platform: timer mark 26.862 0.148 EnsembleRestClient.getJSON https://rest.ensembl.org/lookup/id/ENSG00000157764?content-type=application/json&object_type=Gene
+Platform: timer mark 27.648 0.786 ESP. getdataseq
+Platform: timer mark 27.65 0.002 ESP. getxref
+Platform: timer mark 28.252 0.602 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646891?content-type=application/json&all_levels=1
+Platform: timer mark 28.257 0.005 ESP. seqprox done
+Adding protein product for ENST00000646891
+Platform: timer mark 28.541 0.279 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 28.541 0.0 EnsemblSeqProx.fetchSeq
+Platform: timer mark 28.542 0.001 ENS seqproxy
+Platform: timer mark 28.726 0.183 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646891?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 28.727 0.001 ENS seqproxy2
+Platform: timer mark 28.728 0.001 ESP. getdataseq
+Platform: timer mark 28.729 0.001 ESP. getxref
+Platform: timer mark 29.058 0.327 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000493543?content-type=application/json&all_levels=1
+Platform: timer mark 29.061 0.003 ESP. seqprox done
+Platform: timer mark 29.742 0.681 ESP. getdataseq
+Platform: timer mark 29.742 0.0 ESP. getxref
+Platform: timer mark 30.018 0.275 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000496384?content-type=application/json&all_levels=1
+Platform: timer mark 30.019 0.001 ESP. seqprox done
+Adding protein product for ENST00000496384
+Platform: timer mark 30.02 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 30.02 0.0 ENS seqproxy
+Platform: timer mark 30.199 0.178 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000496384?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 30.2 0.001 ENS seqproxy2
+Platform: timer mark 30.201 0.001 ESP. getdataseq
+Platform: timer mark 30.201 0.0 ESP. getxref
+Platform: timer mark 30.362 0.16 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000419060?content-type=application/json&all_levels=1
+Platform: timer mark 30.364 0.002 ESP. seqprox done
+Platform: timer mark 30.807 0.443 ESP. getdataseq
+Platform: timer mark 30.808 0.001 ESP. getxref
+Platform: timer mark 30.982 0.174 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000469930?content-type=application/json&all_levels=1
+Platform: timer mark 30.983 0.001 ESP. seqprox done
+Adding protein product for ENST00000469930
+Platform: timer mark 30.984 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 30.985 0.001 ENS seqproxy
+Platform: timer mark 31.148 0.163 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000469930?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 31.149 0.001 ENS seqproxy2
+Platform: timer mark 31.149 0.0 ESP. getdataseq
+Platform: timer mark 31.15 0.001 ESP. getxref
+Platform: timer mark 31.297 0.146 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000495858?content-type=application/json&all_levels=1
+Platform: timer mark 31.299 0.002 ESP. seqprox done
+Platform: timer mark 31.777 0.478 ESP. getdataseq
+Platform: timer mark 31.777 0.0 ESP. getxref
+Platform: timer mark 31.959 0.181 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000288602?content-type=application/json&all_levels=1
+Platform: timer mark 31.961 0.002 ESP. seqprox done
+Adding protein product for ENST00000288602
+Platform: timer mark 31.961 0.0 EnsemblSeqProx.fetchSeq
+Platform: timer mark 31.962 0.001 ENS seqproxy
+Platform: timer mark 32.171 0.208 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000288602?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 32.173 0.002 ENS seqproxy2
+Platform: timer mark 32.173 0.0 ESP. getdataseq
+Platform: timer mark 32.175 0.002 ESP. getxref
+Platform: timer mark 32.324 0.149 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000288602?content-type=application/json&all_levels=1
+Platform: timer mark 32.326 0.002 ESP. seqprox done
+Platform: timer mark 32.775 0.449 ESP. getdataseq
+Platform: timer mark 32.775 0.0 ESP. getxref
+Platform: timer mark 32.929 0.152 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642272?content-type=application/json&all_levels=1
+Platform: timer mark 32.93 0.001 ESP. seqprox done
+Adding protein product for ENST00000642272
+Platform: timer mark 32.932 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 32.932 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 33.086 0.153 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642272?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000642272
+Platform: timer mark 33.48 0.394 ESP. getdataseq
+Platform: timer mark 33.481 0.001 ESP. getxref
+Platform: timer mark 33.883 0.402 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000643790?content-type=application/json&all_levels=1
+Platform: timer mark 33.884 0.001 ESP. seqprox done
+Adding protein product for ENST00000643790
+Platform: timer mark 33.885 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 33.885 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 34.069 0.183 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000643790?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000643790
+Platform: timer mark 34.476 0.407 ESP. getdataseq
+Platform: timer mark 34.478 0.002 ESP. getxref
+Platform: timer mark 34.866 0.388 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646427?content-type=application/json&all_levels=1
+Platform: timer mark 34.867 0.001 ESP. seqprox done
+Adding protein product for ENST00000646427
+Platform: timer mark 34.869 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 34.869 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 35.056 0.186 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646427?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000646427
+Platform: timer mark 35.448 0.392 ESP. getdataseq
+Platform: timer mark 35.449 0.001 ESP. getxref
+Platform: timer mark 35.836 0.386 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642808?content-type=application/json&all_levels=1
+Platform: timer mark 35.836 0.0 ESP. seqprox done
+Adding protein product for ENST00000642808
+Platform: timer mark 35.838 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 35.838 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 35.986 0.147 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642808?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000642808
+Platform: timer mark 36.376 0.39 ESP. getdataseq
+Platform: timer mark 36.377 0.001 ESP. getxref
+Platform: timer mark 36.76 0.383 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000643356?content-type=application/json&all_levels=1
+Platform: timer mark 36.761 0.001 ESP. seqprox done
+Adding protein product for ENST00000643356
+Platform: timer mark 36.762 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 36.763 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 36.931 0.167 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000643356?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000643356
+Platform: timer mark 37.389 0.458 ESP. getdataseq
+Platform: timer mark 37.39 0.001 ESP. getxref
+Platform: timer mark 37.783 0.393 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000497784?content-type=application/json&all_levels=1
+Platform: timer mark 37.785 0.002 ESP. seqprox done
+Adding protein product for ENST00000497784
+Platform: timer mark 37.786 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 37.787 0.001 ENS seqproxy
+Platform: timer mark 37.963 0.175 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000497784?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 37.965 0.002 ENS seqproxy2
+Platform: timer mark 37.966 0.001 ESP. getdataseq
+Platform: timer mark 37.966 0.0 ESP. getxref
+Platform: timer mark 38.133 0.166 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000420119?content-type=application/json&all_levels=1
+Platform: timer mark 38.134 0.001 ESP. seqprox done
+Platform: timer mark 38.548 0.414 ESP. getdataseq
+Platform: timer mark 38.549 0.001 ESP. getxref
+Platform: timer mark 38.688 0.138 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646334?content-type=application/json&all_levels=1
+Platform: timer mark 38.689 0.001 ESP. seqprox done
+Adding protein product for ENST00000646334
+Platform: timer mark 38.829 0.139 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 38.83 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 38.831 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 39.007 0.175 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646334?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000646334
+Platform: timer mark 39.468 0.461 ESP. getdataseq
+Platform: timer mark 39.469 0.001 ESP. getxref
+Platform: timer mark 39.876 0.406 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646730?content-type=application/json&all_levels=1
+Platform: timer mark 39.877 0.001 ESP. seqprox done
+Adding protein product for ENST00000646730
+Platform: timer mark 39.878 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 39.879 0.001 ENS seqproxy
+Platform: timer mark 40.062 0.182 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646730?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 40.063 0.001 ENS seqproxy2
+Platform: timer mark 40.064 0.001 ESP. getdataseq
+Platform: timer mark 40.065 0.001 ESP. getxref
+Platform: timer mark 40.233 0.167 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000494784?content-type=application/json&all_levels=1
+Platform: timer mark 40.234 0.001 ESP. seqprox done
+Platform: timer mark 40.685 0.451 ESP. getdataseq
+Platform: timer mark 40.686 0.001 ESP. getxref
+Platform: timer mark 40.861 0.174 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644650?content-type=application/json&all_levels=1
+Platform: timer mark 40.862 0.001 ESP. seqprox done
+Adding protein product for ENST00000644650
+Platform: timer mark 40.864 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 40.865 0.001 ENS seqproxy
+Platform: timer mark 41.022 0.156 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644650?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 41.024 0.002 ENS seqproxy2
+Platform: timer mark 41.025 0.001 ESP. getdataseq
+Platform: timer mark 41.025 0.0 ESP. getxref
+Platform: timer mark 41.288 0.262 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000493783?content-type=application/json&all_levels=1
+Platform: timer mark 41.29 0.002 ESP. seqprox done
+Error retrieving protein for ENST00000644650: Index: -1, Size: 1
+Platform: timer mark 41.854 0.564 ESP. getdataseq
+Platform: timer mark 41.855 0.001 ESP. getxref
+Platform: timer mark 42.028 0.172 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000647434?content-type=application/json&all_levels=1
+Platform: timer mark 42.03 0.002 ESP. seqprox done
+Adding protein product for ENST00000647434
+Platform: timer mark 42.032 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 42.033 0.001 ENS seqproxy
+Platform: timer mark 42.214 0.18 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000647434?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 42.215 0.001 ENS seqproxy2
+Platform: timer mark 42.216 0.001 ESP. getdataseq
+Platform: timer mark 42.218 0.002 ESP. getxref
+Platform: timer mark 42.386 0.168 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000495132?content-type=application/json&all_levels=1
+Platform: timer mark 42.387 0.001 ESP. seqprox done
+Platform: timer mark 43.127 0.74 ESP. getdataseq
+Platform: timer mark 43.128 0.001 ESP. getxref
+Platform: timer mark 43.301 0.172 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000479537?content-type=application/json&all_levels=1
+Platform: timer mark 43.302 0.001 ESP. seqprox done
+Adding protein product for ENST00000479537
+Platform: timer mark 43.305 0.003 EnsemblSeqProx.fetchSeq
+Platform: timer mark 43.305 0.0 ENS seqproxy
+Platform: timer mark 43.517 0.211 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000479537?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 43.518 0.001 ENS seqproxy2
+Platform: timer mark 43.52 0.002 ESP. getdataseq
+Platform: timer mark 43.521 0.001 ESP. getxref
+Platform: timer mark 43.682 0.161 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000418033?content-type=application/json&all_levels=1
+Platform: timer mark 43.683 0.001 ESP. seqprox done
+Error retrieving protein for ENST00000479537: Index: -1, Size: 1
+Platform: timer mark 44.125 0.442 ESP. getdataseq
+Platform: timer mark 44.126 0.001 ESP. getxref
+Platform: timer mark 44.274 0.147 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000645443?content-type=application/json&all_levels=1
+Platform: timer mark 44.276 0.002 ESP. seqprox done
+Adding protein product for ENST00000645443
+Platform: timer mark 44.277 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 44.278 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 44.425 0.146 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000645443?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000645443
+Platform: timer mark 44.955 0.53 ESP. getdataseq
+Platform: timer mark 44.955 0.0 ESP. getxref
+Platform: timer mark 45.389 0.432 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644905?content-type=application/json&all_levels=1
+Platform: timer mark 45.39 0.001 ESP. seqprox done
+Adding protein product for ENST00000644905
+Platform: timer mark 45.393 0.003 EnsemblSeqProx.fetchSeq
+Platform: timer mark 45.393 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 45.541 0.146 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644905?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000644905
+Platform: timer mark 46.111 0.57 ESP. getdataseq
+Platform: timer mark 46.112 0.001 ESP. getxref
+Platform: timer mark 46.535 0.422 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642228?content-type=application/json&all_levels=1
+Platform: timer mark 46.537 0.002 ESP. seqprox done
+Adding protein product for ENST00000642228
+Platform: timer mark 46.539 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 46.54 0.001 ENS seqproxy
+Platform: timer mark 46.708 0.168 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642228?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 46.71 0.002 ENS seqproxy2
+Platform: timer mark 46.711 0.001 ESP. getdataseq
+Platform: timer mark 46.712 0.001 ESP. getxref
+Platform: timer mark 46.883 0.171 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000493678?content-type=application/json&all_levels=1
+Platform: timer mark 46.884 0.001 ESP. seqprox done
+Platform: timer mark 47.421 0.537 ESP. getdataseq
+Platform: timer mark 47.421 0.0 ESP. getxref
+Platform: timer mark 47.599 0.176 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644969?content-type=application/json&all_levels=1
+Platform: timer mark 47.6 0.001 ESP. seqprox done
+Adding protein product for ENST00000644969
+Platform: timer mark 47.602 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 47.603 0.001 ENS seqproxy
+Platform: timer mark 47.781 0.176 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644969?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 47.782 0.001 ENS seqproxy2
+Platform: timer mark 47.785 0.003 ESP. getdataseq
+Platform: timer mark 47.786 0.001 ESP. getxref
+Platform: timer mark 47.94 0.154 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000496776?content-type=application/json&all_levels=1
+Platform: timer mark 47.941 0.001 ESP. seqprox done
+Platform: timer mark 48.435 0.494 ESP. getdataseq
+Platform: timer mark 48.436 0.001 ESP. getxref
+Platform: timer mark 48.577 0.14 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644120?content-type=application/json&all_levels=1
+Platform: timer mark 48.579 0.002 ESP. seqprox done
+Adding protein product for ENST00000644120
+Platform: timer mark 48.58 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 48.581 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 48.755 0.173 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644120?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000644120
+Platform: timer mark 49.205 0.45 ESP. getdataseq
+Platform: timer mark 49.206 0.001 ESP. getxref
+Platform: timer mark 49.588 0.38 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642875?content-type=application/json&all_levels=1
+Platform: timer mark 49.589 0.001 ESP. seqprox done
+Adding protein product for ENST00000642875
+Platform: timer mark 49.74 0.149 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 49.741 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 49.742 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 49.894 0.15 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642875?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000642875
+Platform: timer mark 50.194 0.3 Desktop Finished querying
+Platform: timer mark 50.199 0.005 Desktop Parsing results.
+JSDesktopIconUI SURRAGATE -- NOT IMPLEMENTED YET!
+JSWIndowUI ????
+Platform: timer mark 63.835 13.636 Desktop null
+JSFrameViewer creating new canvas testApplet_canvas4: 700 465
+JSWindowUI windowOpened true
+JSFrameUI windowActivated true
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+JSWIndowUI ????
+JSFrameViewer creating new canvas testApplet_canvas5: 173 18
+JSWIndowUI ????
+JSFrameViewer creating new canvas testApplet_canvas6: 138 18
+This is System.out. clear it
+Add ?j2snocore to URL to see full class list; ?j2sdebug to use uncompressed j2s/core files
+get _j2sClassList.txt Jalview TestX
+New Sequence FetcherX
+ExampleClearOKCancel
+
+ENSG00000157764
+Example query: ENSG00000157764
+Enter one or more accession IDs separated by a semi-colon ";"
+Replace commas with semi-colons
+Retrieved from ENSEMBLX
+Sequence 1 ID: ENSG00000157764 Nucleotide: Cytosine (32)
+File
+Edit
+Select
+View
+Annotations
+Format
+Colour
+Calculate
+File
+Tools
+Help
+Window
\ No newline at end of file
--- /dev/null
+firefox back to Java's StringBuilder - 100 sec
+J2SApplet exec testApplet start applet null
+swingjs.api.Interface creating instance of javajs.util.AjaxURLStreamHandlerFactory
+get parameter: language = null
+get parameter: name = testApplet
+get parameter: syncId = 30614127558744375
+JSApp initialized
+JSAppletViewer initializing2
+JSToolkit initialized
+JSGraphicsConfiguration initialized
+swingjs.api.Interface creating instance of swingjs.JSGraphicsEnvironment
+JSGraphicsEnvironment initialized
+swingjs.api.Interface creating instance of swingjs.JSScreenDevice
+JSScreenDevice initialized
+JSAppletViewer thread run1 mode=0 status=0
+JSAppletViewer thread run1 mode=1 status=1
+JSAppletViewer runloader
+get parameter: main = jalview.bin.Jalview
+swingjs.api.Interface creating instance of swingjs.JSApplet
+swingjs.api.Interface creating instance of swingjs.plaf.HTML5LookAndFeel
+testApplet loaded
+JSAppletViewer thread run1 mode=1 status=76
+testApplet running jalview.bin.Jalview
+Running main(args) in class jalview.bin.Jalview
+Java version: 1.6-1.8
+null Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
+JSUtil getting Java resource sun/util/resources/CalendarData.properties
+Processing swingjs/j2s/sun/util/resources/CalendarData.properties [1780]
+swingjs.api.Interface creating instance of java.util.PropertyResourceBundle
+JSUtil getting Java resource sun/util/resources/CalendarData_en.properties
+Processing swingjs/j2s/sun/util/resources/CalendarData_en.properties [1937]
+swingjs.api.Interface creating instance of sun.util.calendar.Gregorian
+swingjs.api.Interface creating instance of sun.text.resources.FormatData
+swingjs.api.Interface creating instance of sun.text.resources.FormatData_en
+Loading jalview properties from : https://./.jalview_properties
+Disabling Jalview writing to user's local properties file.
+Jalview Version: Test
+Jalview Debugging Output Follows.
+Getting messages for lang: en_US
+JSUtil getting Java resource lang/Messages.properties
+Processing swingjs/j2s/lang/Messages.properties [82729]
+JSUtil getting Java resource lang/Messages_en.properties
+Processing swingjs/j2s/lang/Messages_en.properties [39]
+JSUtil getting Java resource lang/Messages_en_US.properties
+Processing swingjs/j2s/lang/Messages_en_US.properties [39]
+JSUtil getting Java resource swingjs/jquery/j2sMenu.js
+Processing swingjs/j2s/swingjs/jquery/j2sMenu.js [27197]
+JSWIndowUI ????
+JSFrameViewer creating new canvas testApplet_canvas2: 900 613
+JSWindowUI windowOpened true
+JSFrameUI windowActivated true
+swingjs.api.Interface creating instance of swingjs.JSGraphicsConfiguration
+JSGraphicsConfiguration initialized
+JSPopupMenuUI processing 0 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 1 _hide for testApplet_PopupMenuUI_46_46
+noclickout 0 1548730538973
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+click added 0
+JSPopupMenuUI processing 2 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 3 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 4 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 5 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 6 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 7 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 8 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 9 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 10 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 11 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 12 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 13 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 14 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 15 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 16 onover3 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 17 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 18 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 19 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 20 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 21 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 22 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 23 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 24 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 25 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 26 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 27 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 28 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 29 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 30 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 31 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 32 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 33 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 34 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 35 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 36 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 37 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 38 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 39 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 40 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 41 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 42 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 43 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 44 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 45 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 46 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 47 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 48 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 49 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 50 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 51 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 52 _hide for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 53 _closeSubmenus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 54 blur for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 55 focus for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 56 onover1 for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 57 onpress for testApplet_PopupMenuUI_46_46
+JSUtil getting Java resource swingjs/jquery/jquery-ui-j2sslider.css
+Processing swingjs/j2s/swingjs/jquery/jquery-ui-j2sslider.css [24188]
+JSUtil getting Java resource swingjs/jquery/jquery-ui-j2sslider.js
+Processing swingjs/j2s/swingjs/jquery/jquery-ui-j2sslider.js [22356]
+JSDesktopIconUI SURRAGATE -- NOT IMPLEMENTED YET!
+JSWIndowUI ????
+collapseAll 0
+JSPopupMenuUI processing 58 collapseAll for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 59 select for testApplet_PopupMenuUI_46_46
+collapseAll 0
+JSPopupMenuUI processing 60 collapseAll for testApplet_PopupMenuUI_46_46
+JSPopupMenuUI processing 61 onclick for testApplet_PopupMenuUI_46_46
+click removed 0
+JSFrameViewer creating new canvas testApplet_canvas3: 400 230
+JSWindowUI windowOpened true
+click removed 0
+JSFrameUI windowActivated true
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+PostEventQueue posting tempEvent java.awt.SentEvent[] on [swingjs.JSToolkit object]
+Platform: timer mark 0.0 0.0 Desktop Fetching 1 sequence queries from ENSEMBL
+Platform: timer mark 0.491 0.432 EnsembleRestClient.getJSON https://rest.ensembl.org/lookup/id/ENSG00000157764?content-type=application/json
+Platform: timer mark 0.655 0.157 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 0.816 0.159 EnsembleRestClient.getJSON https://rest.ensembl.org/info/rest?content-type=application/json
+EnsemblRestClient expected ENSEMBL REST version 7.0 but found 9.0, see https://github.com/Ensembl/ensembl-rest/wiki/Change-log
+Platform: timer mark 0.967 0.134 EnsembleRestClient.getJSON https://rest.ensembl.org/info/data?content-type=application/json
+Platform: timer mark 0.968 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 0.969 0.001 ENS seqproxy
+Platform: timer mark 1.946 0.975 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENSG00000157764?type=genomic&Accept=application/json&content-type=application/json&object_type=Gene
+Platform: timer mark 1.994 0.048 ENS seqproxy2
+Platform: timer mark 2.173 0.179 ESP.getsequencerec1
+Platform: timer mark 13.687 11.512 EnsembleRestClient.getJSON https://rest.ensembl.org/overlap/id/ENSG00000157764?content-type=application/json&object_type=Gene&feature=gene&feature=transcript&feature=exon&feature=cds&feature=variation
+Platform: timer mark 26.028 12.341 ESP.getsequencerec2
+Platform: timer mark 26.069 0.041 ESP. xfer 46594
+Platform: timer mark 43.878 17.809 ESP.transferFeatures
+Platform: timer mark 43.878 0.0 ESP.addfeat done
+Platform: timer mark 43.879 0.001 ESP. getdataseq
+Platform: timer mark 43.88 0.001 ESP. getxref
+Platform: timer mark 45.354 1.467 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSG00000157764?content-type=application/json&all_levels=1
+Platform: timer mark 45.388 0.034 ESP. seqprox done
+Platform: timer mark 45.556 0.166 EnsembleRestClient.getJSON https://rest.ensembl.org/lookup/id/ENSG00000157764?content-type=application/json&object_type=Gene
+Platform: timer mark 47.029 1.473 ESP. getdataseq
+Platform: timer mark 47.029 0.0 ESP. getxref
+Platform: timer mark 47.63 0.599 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646891?content-type=application/json&all_levels=1
+Platform: timer mark 47.642 0.012 ESP. seqprox done
+Adding protein product for ENST00000646891
+Platform: timer mark 47.822 0.171 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 47.823 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 47.823 0.0 ENS seqproxy
+Platform: timer mark 47.998 0.174 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646891?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 48.0 0.002 ENS seqproxy2
+Platform: timer mark 48.002 0.002 ESP. getdataseq
+Platform: timer mark 48.002 0.0 ESP. getxref
+Platform: timer mark 48.383 0.38 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000493543?content-type=application/json&all_levels=1
+Platform: timer mark 48.39 0.007 ESP. seqprox done
+Platform: timer mark 50.109 1.719 ESP. getdataseq
+Platform: timer mark 50.11 0.001 ESP. getxref
+Platform: timer mark 50.324 0.213 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000496384?content-type=application/json&all_levels=1
+Platform: timer mark 50.326 0.002 ESP. seqprox done
+Adding protein product for ENST00000496384
+Platform: timer mark 50.328 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 50.328 0.0 ENS seqproxy
+Platform: timer mark 50.599 0.271 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000496384?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 50.6 0.001 ENS seqproxy2
+Platform: timer mark 50.603 0.003 ESP. getdataseq
+Platform: timer mark 50.603 0.0 ESP. getxref
+Platform: timer mark 50.779 0.174 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000419060?content-type=application/json&all_levels=1
+Platform: timer mark 50.78 0.001 ESP. seqprox done
+Platform: timer mark 51.955 1.175 ESP. getdataseq
+Platform: timer mark 51.956 0.001 ESP. getxref
+Platform: timer mark 52.112 0.156 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000469930?content-type=application/json&all_levels=1
+Platform: timer mark 52.114 0.002 ESP. seqprox done
+Adding protein product for ENST00000469930
+Platform: timer mark 52.114 0.0 EnsemblSeqProx.fetchSeq
+Platform: timer mark 52.115 0.001 ENS seqproxy
+Platform: timer mark 52.286 0.17 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000469930?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 52.287 0.001 ENS seqproxy2
+Platform: timer mark 52.288 0.001 ESP. getdataseq
+Platform: timer mark 52.29 0.002 ESP. getxref
+Platform: timer mark 52.443 0.153 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000495858?content-type=application/json&all_levels=1
+Platform: timer mark 52.444 0.001 ESP. seqprox done
+Platform: timer mark 53.65 1.206 ESP. getdataseq
+Platform: timer mark 53.651 0.001 ESP. getxref
+Platform: timer mark 53.827 0.175 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000288602?content-type=application/json&all_levels=1
+Platform: timer mark 53.828 0.001 ESP. seqprox done
+Adding protein product for ENST00000288602
+Platform: timer mark 53.829 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 53.829 0.0 ENS seqproxy
+Platform: timer mark 54.0 0.17 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000288602?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 54.001 0.001 ENS seqproxy2
+Platform: timer mark 54.003 0.002 ESP. getdataseq
+Platform: timer mark 54.003 0.0 ESP. getxref
+Platform: timer mark 54.163 0.159 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000288602?content-type=application/json&all_levels=1
+Platform: timer mark 54.165 0.002 ESP. seqprox done
+Platform: timer mark 55.476 1.311 ESP. getdataseq
+Platform: timer mark 55.476 0.0 ESP. getxref
+Platform: timer mark 55.624 0.146 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642272?content-type=application/json&all_levels=1
+Platform: timer mark 55.625 0.001 ESP. seqprox done
+Adding protein product for ENST00000642272
+Platform: timer mark 55.626 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 55.627 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 55.783 0.156 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642272?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000642272
+Platform: timer mark 56.888 1.105 ESP. getdataseq
+Platform: timer mark 56.888 0.0 ESP. getxref
+Platform: timer mark 57.272 0.383 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000643790?content-type=application/json&all_levels=1
+Platform: timer mark 57.273 0.001 ESP. seqprox done
+Adding protein product for ENST00000643790
+Platform: timer mark 57.274 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 57.275 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 57.492 0.217 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000643790?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000643790
+Platform: timer mark 58.611 1.119 ESP. getdataseq
+Platform: timer mark 58.611 0.0 ESP. getxref
+Platform: timer mark 59.016 0.404 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646427?content-type=application/json&all_levels=1
+Platform: timer mark 59.017 0.001 ESP. seqprox done
+Adding protein product for ENST00000646427
+Platform: timer mark 59.163 0.145 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 59.164 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 59.164 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 59.313 0.149 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646427?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000646427
+Platform: timer mark 60.364 1.051 ESP. getdataseq
+Platform: timer mark 60.364 0.0 ESP. getxref
+Platform: timer mark 60.773 0.408 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642808?content-type=application/json&all_levels=1
+Platform: timer mark 60.774 0.001 ESP. seqprox done
+Adding protein product for ENST00000642808
+Platform: timer mark 60.775 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 60.775 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 60.925 0.149 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642808?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000642808
+Platform: timer mark 61.993 1.068 ESP. getdataseq
+Platform: timer mark 61.993 0.0 ESP. getxref
+Platform: timer mark 62.389 0.394 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000643356?content-type=application/json&all_levels=1
+Platform: timer mark 62.39 0.001 ESP. seqprox done
+Adding protein product for ENST00000643356
+Platform: timer mark 62.392 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 62.392 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 62.569 0.176 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000643356?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000643356
+Platform: timer mark 63.782 1.213 ESP. getdataseq
+Platform: timer mark 63.782 0.0 ESP. getxref
+Platform: timer mark 64.172 0.389 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000497784?content-type=application/json&all_levels=1
+Platform: timer mark 64.173 0.001 ESP. seqprox done
+Adding protein product for ENST00000497784
+Platform: timer mark 64.175 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 64.176 0.001 ENS seqproxy
+Platform: timer mark 64.375 0.199 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000497784?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 64.376 0.001 ENS seqproxy2
+Platform: timer mark 64.378 0.002 ESP. getdataseq
+Platform: timer mark 64.379 0.001 ESP. getxref
+Platform: timer mark 64.606 0.227 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000420119?content-type=application/json&all_levels=1
+Platform: timer mark 64.607 0.001 ESP. seqprox done
+Platform: timer mark 65.783 1.176 ESP. getdataseq
+Platform: timer mark 65.784 0.001 ESP. getxref
+Platform: timer mark 65.932 0.147 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646334?content-type=application/json&all_levels=1
+Platform: timer mark 65.933 0.001 ESP. seqprox done
+Adding protein product for ENST00000646334
+Platform: timer mark 65.934 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 65.935 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 66.087 0.152 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646334?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000646334
+Platform: timer mark 67.322 1.235 ESP. getdataseq
+Platform: timer mark 67.323 0.001 ESP. getxref
+Platform: timer mark 67.738 0.415 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000646730?content-type=application/json&all_levels=1
+Platform: timer mark 67.74 0.002 ESP. seqprox done
+Adding protein product for ENST00000646730
+Platform: timer mark 67.741 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 67.741 0.0 ENS seqproxy
+Platform: timer mark 67.915 0.173 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000646730?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 67.915 0.0 ENS seqproxy2
+Platform: timer mark 67.917 0.002 ESP. getdataseq
+Platform: timer mark 67.917 0.0 ESP. getxref
+Platform: timer mark 68.073 0.155 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000494784?content-type=application/json&all_levels=1
+Platform: timer mark 68.074 0.001 ESP. seqprox done
+Platform: timer mark 69.304 1.23 ESP. getdataseq
+Platform: timer mark 69.305 0.001 ESP. getxref
+Platform: timer mark 69.478 0.173 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644650?content-type=application/json&all_levels=1
+Platform: timer mark 69.479 0.001 ESP. seqprox done
+Adding protein product for ENST00000644650
+Platform: timer mark 69.628 0.148 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 69.628 0.0 EnsemblSeqProx.fetchSeq
+Platform: timer mark 69.629 0.001 ENS seqproxy
+Platform: timer mark 69.825 0.196 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644650?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 69.826 0.001 ENS seqproxy2
+Platform: timer mark 69.827 0.001 ESP. getdataseq
+Platform: timer mark 69.828 0.001 ESP. getxref
+Platform: timer mark 69.974 0.145 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000493783?content-type=application/json&all_levels=1
+Platform: timer mark 69.976 0.002 ESP. seqprox done
+Error retrieving protein for ENST00000644650: Index: -1, Size: 1
+Platform: timer mark 71.231 1.255 ESP. getdataseq
+Platform: timer mark 71.233 0.002 ESP. getxref
+Platform: timer mark 71.398 0.165 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000647434?content-type=application/json&all_levels=1
+Platform: timer mark 71.4 0.002 ESP. seqprox done
+Adding protein product for ENST00000647434
+Platform: timer mark 71.4 0.0 EnsemblSeqProx.fetchSeq
+Platform: timer mark 71.402 0.002 ENS seqproxy
+Platform: timer mark 71.581 0.179 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000647434?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 71.582 0.001 ENS seqproxy2
+Platform: timer mark 71.584 0.002 ESP. getdataseq
+Platform: timer mark 71.585 0.001 ESP. getxref
+Platform: timer mark 71.745 0.159 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000495132?content-type=application/json&all_levels=1
+Platform: timer mark 71.747 0.002 ESP. seqprox done
+Platform: timer mark 73.744 1.997 ESP. getdataseq
+Platform: timer mark 73.744 0.0 ESP. getxref
+Platform: timer mark 73.91 0.164 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000479537?content-type=application/json&all_levels=1
+Platform: timer mark 73.911 0.001 ESP. seqprox done
+Adding protein product for ENST00000479537
+Platform: timer mark 73.912 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 73.912 0.0 ENS seqproxy
+Platform: timer mark 74.088 0.175 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000479537?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 74.09 0.002 ENS seqproxy2
+Platform: timer mark 74.091 0.001 ESP. getdataseq
+Platform: timer mark 74.092 0.001 ESP. getxref
+Platform: timer mark 74.24 0.148 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000418033?content-type=application/json&all_levels=1
+Platform: timer mark 74.241 0.001 ESP. seqprox done
+Error retrieving protein for ENST00000479537: Index: -1, Size: 1
+Platform: timer mark 75.433 1.192 ESP. getdataseq
+Platform: timer mark 75.433 0.0 ESP. getxref
+Platform: timer mark 75.603 0.169 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000645443?content-type=application/json&all_levels=1
+Platform: timer mark 75.604 0.001 ESP. seqprox done
+Adding protein product for ENST00000645443
+Platform: timer mark 75.606 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 75.606 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 75.753 0.147 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000645443?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000645443
+Platform: timer mark 77.126 1.373 ESP. getdataseq
+Platform: timer mark 77.126 0.0 ESP. getxref
+Platform: timer mark 77.538 0.412 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644905?content-type=application/json&all_levels=1
+Platform: timer mark 77.54 0.002 ESP. seqprox done
+Adding protein product for ENST00000644905
+Platform: timer mark 77.54 0.0 EnsemblSeqProx.fetchSeq
+Platform: timer mark 77.541 0.001 ENS seqproxy
+Response code 400
+Platform: timer mark 77.708 0.166 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644905?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000644905
+Platform: timer mark 78.958 1.25 ESP. getdataseq
+Platform: timer mark 78.958 0.0 ESP. getxref
+Platform: timer mark 79.409 0.45 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642228?content-type=application/json&all_levels=1
+Platform: timer mark 79.411 0.002 ESP. seqprox done
+Adding protein product for ENST00000642228
+Platform: timer mark 79.412 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 79.412 0.0 ENS seqproxy
+Platform: timer mark 79.571 0.159 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642228?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 79.573 0.002 ENS seqproxy2
+Platform: timer mark 79.574 0.001 ESP. getdataseq
+Platform: timer mark 79.574 0.0 ESP. getxref
+Platform: timer mark 79.736 0.161 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000493678?content-type=application/json&all_levels=1
+Platform: timer mark 79.737 0.001 ESP. seqprox done
+Platform: timer mark 81.189 1.452 ESP. getdataseq
+Platform: timer mark 81.19 0.001 ESP. getxref
+Platform: timer mark 81.389 0.198 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644969?content-type=application/json&all_levels=1
+Platform: timer mark 81.391 0.002 ESP. seqprox done
+Adding protein product for ENST00000644969
+Platform: timer mark 81.563 0.171 EnsembleRestClient.getJSON https://rest.ensembl.org/info/ping?content-type=application/json
+Platform: timer mark 81.564 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 81.565 0.001 ENS seqproxy
+Platform: timer mark 81.739 0.174 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644969?type=protein&Accept=application/json&content-type=application/json
+Platform: timer mark 81.739 0.0 ENS seqproxy2
+Platform: timer mark 81.741 0.002 ESP. getdataseq
+Platform: timer mark 81.741 0.0 ESP. getxref
+Platform: timer mark 81.905 0.162 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENSP00000496776?content-type=application/json&all_levels=1
+Platform: timer mark 81.907 0.002 ESP. seqprox done
+Platform: timer mark 83.297 1.39 ESP. getdataseq
+Platform: timer mark 83.297 0.0 ESP. getxref
+Platform: timer mark 83.441 0.143 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000644120?content-type=application/json&all_levels=1
+Platform: timer mark 83.442 0.001 ESP. seqprox done
+Adding protein product for ENST00000644120
+Platform: timer mark 83.444 0.002 EnsemblSeqProx.fetchSeq
+Platform: timer mark 83.444 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 83.601 0.156 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000644120?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000644120
+Platform: timer mark 84.848 1.247 ESP. getdataseq
+Platform: timer mark 84.849 0.001 ESP. getxref
+Platform: timer mark 85.248 0.398 EnsembleRestClient.getJSON https://rest.ensembl.org/xrefs/id/ENST00000642875?content-type=application/json&all_levels=1
+Platform: timer mark 85.249 0.001 ESP. seqprox done
+Adding protein product for ENST00000642875
+Platform: timer mark 85.25 0.001 EnsemblSeqProx.fetchSeq
+Platform: timer mark 85.25 0.0 ENS seqproxy
+Response code 400
+Platform: timer mark 85.401 0.15 EnsembleRestClient.getJSON https://rest.ensembl.org/sequence/id/ENST00000642875?type=protein&Accept=application/json&content-type=application/json
+No protein product found for ENST00000642875
+Platform: timer mark 86.467 1.066 Desktop Finished querying
+Platform: timer mark 86.479 0.012 Desktop Parsing results.
+JSDesktopIconUI SURRAGATE -- NOT IMPLEMENTED YET!
+JSWIndowUI ????
+Platform: timer mark 100.466 13.987 Desktop null
+JSFrameViewer creating new canvas testApplet_canvas4: 700 465
+JSWindowUI windowOpened true
+swingjs.api.Interface creating instance of java.awt.datatransfer.Clipboard
+This is System.out. clear it
+Add ?j2snocore to URL to see full class list; ?j2sdebug to use uncompressed j2s/core files
+get _j2sClassList.txt
+Jalview Test
+X
+Retrieved from ENSEMBL
+X
+Copied 22 sequences to clipboard.
+File
+Edit
+Select
+View
+Annotations
+Format
+Colour
+Calculate
+New Sequence Fetcher
+X
+ENSG00000157764
+Example query: ENSG00000157764
+Enter one or more accession IDs separated by a semi-colon ";"
+Replace commas with semi-colons
+File
+Tools
+Help
+Window
\ No newline at end of file
{
synchronized (sequences)
{
+
if (i > -1 && i < sequences.size())
{
return sequences.get(i);
int i = 0;
SequenceI sq = null;
String sqname = null;
+ int nseq = sequences.size();
if (startAfter != null)
{
// try to find the sequence in the alignment
boolean matched = false;
- while (i < sequences.size())
+ while (i < nseq)
{
if (getSequenceAt(i++) == startAfter)
{
i = 0;
}
}
- while (i < sequences.size())
+ while (i < nseq)
{
sq = getSequenceAt(i);
sqname = sq.getName();
if (url == null)
url = getUrl(ids);
-// Platform.timeCheck("EnsembleRestClient.getJSON0 " + url, Platform.TIME_MARK);
-
Reader br = null;
try {
+
+ Platform.timeCheck(null, Platform.TIME_MARK);
+
br = (url == null ? null : getHttpResponse(url, ids, msDelay));
-// Platform.timeCheck("EnsembleRestClient.getJSON1 parsing... ", Platform.TIME_MARK);
-
Object ret = (br == null ? null : JSONUtils.parse(br));
-// Platform.timeCheck("EnsembleRestClient.getJSON2 ...done ", Platform.TIME_MARK);
+ Platform.timeCheck("EnsembleRestClient.getJSON " + url, Platform.TIME_MARK);
+
if (ret != null && mapKey != null)
ret = ((Map<String, Object>) ret).get(mapKey);
* fetch and transfer genomic sequence features,
* fetch protein product and add as cross-reference
*/
- for (String accId : allIds)
+ for (int i = 0, n = allIds.size(); i < n; i++)
{
- addFeaturesAndProduct(accId, alignment);
+ addFeaturesAndProduct(allIds.get(i), alignment);
}
- for (SequenceI seq : alignment.getSequences())
+ List<SequenceI> seqs = alignment.getSequences();
+ for (int i = 0, n = seqs.size(); i < n; i++)
{
- getCrossReferences(seq);
+ getCrossReferences(seqs.get(i));
}
return alignment;
SequenceI genomicSequence = null;
EnsemblFeatures gffFetcher = new EnsemblFeatures(getDomain());
EnsemblFeatureType[] features = getFeaturesToFetch();
+
+ Platform.timeCheck("ESP.getsequencerec1", Platform.TIME_MARK);
+
+
AlignmentI geneFeatures = gffFetcher.getSequenceRecords(accId,
features);
if (geneFeatures != null && geneFeatures.getHeight() > 0)
{
genomicSequence = geneFeatures.getSequenceAt(0);
}
+
+ Platform.timeCheck("ESP.getsequencerec2", Platform.TIME_MARK);
+
if (genomicSequence != null)
{
/*
* fetch and map protein product, and add it as a cross-reference
* of the retrieved sequence
*/
+ Platform.timeCheck("ESP.transferFeatures", Platform.TIME_MARK);
addProteinProduct(querySeq);
}
}
System.err.println(
"Error transferring Ensembl features: " + e.getMessage());
}
+ Platform.timeCheck("ESP.addfeat done", Platform.TIME_MARK);
}
/**
*/
protected void getCrossReferences(SequenceI seq)
{
+
+ Platform.timeCheck("ESP. getdataseq ", Platform.TIME_MARK);
+
+
while (seq.getDatasetSequence() != null)
{
seq = seq.getDatasetSequence();
}
+
+ Platform.timeCheck("ESP. getxref ", Platform.TIME_MARK);
+
EnsemblXref xrefFetcher = new EnsemblXref(getDomain(), getDbSource(),
getEnsemblDataVersion());
List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName());
for (int i = 0, n = xrefs.size(); i < n; i++)
{
+// Platform.timeCheck("ESP. getxref + " + (i) + "/" + n, Platform.TIME_MARK);
// BH 2019.01.25 this next method was taking 174 ms PER addition for a 266-reference example.
// DBRefUtils.ensurePrimaries(seq)
// was at the end of seq.addDBRef, so executed after ever addition!
// This method was moved to seq.getPrimaryDBRefs()
seq.addDBRef(xrefs.get(i));
}
+
+// System.out.println("primaries are " + seq.getPrimaryDBRefs().toString());
/*
* and add a reference to itself
*/
+
+// Platform.timeCheck("ESP. getxref self ", Platform.TIME_MARK);
+
DBRefEntry self = new DBRefEntry(getDbSource(), getEnsemblDataVersion(),
seq.getName());
+
+// Platform.timeCheck("ESP. getxref self add ", Platform.TIME_MARK);
+
seq.addDBRef(self);
+
+ Platform.timeCheck("ESP. seqprox done ", Platform.TIME_MARK);
+
}
/**
inProgress = false;
throw new JalviewException("ENSEMBL Rest API not available.");
}
+ Platform.timeCheck("EnsemblSeqProx.fetchSeq ", Platform.TIME_MARK);
+
List<SequenceI> seqs = parseSequenceJson(ids);
if (seqs == null)
return alignment;
* for now, assumes only one sequence returned; refactor if needed
* in future to handle a JSONArray with more than one
*/
+
+ Platform.timeCheck("ENS seqproxy", Platform.TIME_MARK);
Map<String, Object> val = (Map<String, Object>) getJSON(null, ids, -1, MODE_MAP, null);
if (val == null)
return null;
System.err.println("Error processing JSON response: " + e.toString());
// ignore
}
+ Platform.timeCheck("ENS seqproxy2", Platform.TIME_MARK);
return result;
}
*/
protected abstract List<SequenceFeature> getIdentifyingFeatures(
SequenceI seq, String accId);
-
+
+ int bhtest = 0;
+
/**
* Transfers the sequence feature to the target sequence, locating its start
* and end range based on the mapping. Features which do not overlap the
if (mappedRange != null)
{
+// Platform.timeCheck(null, Platform.TIME_SET);
String group = sf.getFeatureGroup();
if (".".equals(group))
{
}
int newBegin = Math.min(mappedRange[0], mappedRange[1]);
int newEnd = Math.max(mappedRange[0], mappedRange[1]);
- SequenceFeature copy = new SequenceFeature(sf, newBegin, newEnd,
- group, sf.getScore());
+// Platform.timeCheck(null, Platform.TIME_MARK);
+ bhtest++;
+ // 280 ms/1000 here:
+ SequenceFeature copy = new SequenceFeature(sf, newBegin, newEnd, group, sf.getScore());
+ // 0.175 ms here:
targetSequence.addSequenceFeature(copy);
/*
MapList mapping = getGenomicRangesFromFeatures(sourceSequence,
accessionId, targetSequence.getStart());
if (mapping == null)
- {
+ {
return false;
}
+
+ Platform.timeCheck("ESP. xfer " + sfs.size(), Platform.TIME_MARK);
+
+
boolean result = transferFeatures(sfs, targetSequence, mapping,
accessionId);
// System.out.println("transferFeatures (" + (sfs.size()) + " --> "
SequenceFeatures.sortFeatures(sfs, forwardStrand);
boolean transferred = false;
- for (SequenceFeature sf : sfs)
+
+ for (int i = 0, n = sfs.size(); i < n; i++)
{
+
+// if ((i%1000) == 0) {
+//// Platform.timeCheck("Feature " + bhtest, Platform.TIME_GET);
+// Platform.timeCheck("ESP. xferFeature + " + (i) + "/" + n, Platform.TIME_MARK);
+// }
+
+ SequenceFeature sf = sfs.get(i);
if (retainFeature(sf, parentId))
{
transferFeature(sf, targetSequence, mapping, forwardStrand);
transferred = true;
}
}
+
return transferred;
}
@Override
public void setProgressBar(String message, long id)
{
+ Platform.timeCheck("Desktop " + message, Platform.TIME_MARK);
+
if (progressBars == null)
{
progressBars = new Hashtable<>();
public class JSON {
/**
- * A privately initialized class that allows us to do the object
- * conversion from JavaScript to "Java" on the fly.
- *
- * @author hansonr
- *
- */
- @SuppressWarnings("serial")
- public static class JSONList extends ArrayList<Object> {
-
-
- static ListIterator iter;
-
- JSONList(Object[] a) {
- super();
- /**
- * @j2sNative
- *
- * this.elementData = a;
- * this.size = a.length;
- */
- }
-
- public Object get(int i) {
- Object o = null;
- /**
- * @j2sNative
- *
- * o = this.elementData[i];
- *
- */
- return JSON.toObject(o);
- }
-
-
- @Override
- public Iterator<Object> iterator() {
- if (iter == null)
- iter = new ListIterator();
- iter.pt = 0;
- iter.list = this;
- return iter;
- }
-
-
- /**
- *
- * @author hansonr
- *
- */
- public static class ListIterator implements Iterator<Object> {
-
- ListIterator() {/* restricted */}
-
- public JSONList list;
- int pt = -1;
-
- @Override
- public boolean hasNext() {
- @SuppressWarnings("unused")
- boolean more;
- /**
- * @j2sNative
- *
- * more = this.list && (this.pt < this.list.size);
- * if (!more) {
- * this.list = null;
- * this.pt = -1;
- * }
- * return more;
- */
- {
- return pt < list.size();
- }
- }
-
- @Override
- public Object next() {
- Object o = null;
- /**
- * @j2sNative o = this.list.elementData[this.pt++];
- *
- */
-
- return toObject(o);
- }
- }
- }
-
- /**
* A simple encoding of sequential key/value pairs for a jQuery.ajax call. If
* the first key is "url" and the second is an object, then the ajax object is
* attached to that url as well, just for transport purposes within the system.
* @param keyValues assumed to be simple String,Object pairs. String objects
* will be surrounded by double quotes.
*/
+ @SuppressWarnings("static-access")
public static Object setAjax(Object... keyValues) {
- Object ajax = null;
- /**
- * @j2sNative ajax = {}; if (keyValues[0] == "url" && typeof keyValues[1] ==
- * "object") { ajax = keyValues[1].ajax || (keyValues[1].ajax = ajax); }
- *
- * for (var i = 0; i < keyValues.length;) { var key = keyValues[i++];
- * var val = keyValues[i++]; ajax[key] = val; }
- */
- return ajax;
+ return /** @j2sNative swingjs.JSUtil.setAjax$OA(keyValues) || */null;
}
public static void setAjax(URL url) {
- setAjax("url", url, "dataType", "json", "async", Boolean.FALSE);
+ /** @j2sNative swingjs.JSUtil.setAjax$O(url) */;
}
public static BufferedReader getJSONReader(InputStream is) {
- return new JSONReader(is);
- }
-
- public static class JSONReader extends BufferedReader {
- Object data;
-
- public JSONReader(InputStream in) {
- super((Reader) (Object) in);
- // could be buffered
- data = toObject(/** @j2sNative $in._ajaxData || $in.$in && $in.$in._ajaxData || */ null);
-
- }
-
- public JSONReader(Reader in) {
- super(in);
- // could be buffered
- data = toObject(/** @j2sNative $in._ajaxData || $in.$in && $in.$in._ajaxData || */ null);
- }
-
- public JSONReader(String json) {
- super((Reader) (Object) "");
- data = toObject(/** @j2sNative swingjs.JSUtil.parseJSON$S(json)|| */null);
- }
-
- @Override
- public void close() {
- data = null;
- try {
- super.close();
- } catch (IOException e) {
- // ignore, especially if we set $in to a string!
- }
- }
+ return /** @j2sNative swingjs.JSUtil.getJSONReader$O(is) || */null;
}
@SuppressWarnings("resource")
- public static Object parse(String json) {
- return new JSONReader(json).data;
+ public static Object parse(String json) {
+ return /** @j2sNative swingjs.JSUtil.parseJSON$O(json) || */null;
}
public static Object parse(Reader br) {
- return ((JSONReader) br).data;
- }
-
- /**
- * Get an object in the JSON associative array.
- * @param br
- * @param key
- * @return
- */
- @SuppressWarnings("unused")
- public static Object toObject(Object o) {
- if (o == null)
- return null;
- String type = /** @j2sNative (typeof o) + */"";
- switch (type) {
- case "string":
- return o;
- case "number":
- double n = 0;
- if (/** @j2sNative (n = o) == (n|0) || */false)
- return Long.valueOf((long) n);
- return Double.valueOf(n);
- case "boolean":
- return Boolean.valueOf(/** @j2sNative !!o || */false);
- case "object":
- boolean isArray = /** @j2sNative o instanceof Array || */false;
- if (isArray) {
- return toList((Object[]) o);
- }
- return toMap(o);
- default:
- return o;
- }
- }
-
- Object get(String key) {
- /**
- * @j2sNative
- *
- * return C$.toObject$O(this[key]);
- */
- {
- return null;
- }
- }
- boolean contains(String key) {
- /**
- * @j2sNative
- *
- * return typeof this[key] != "undefined"
- */
- {
- return false;
- }
- }
-
- @SuppressWarnings("unchecked")
- private static Hashtable<String, Object> toMap(Object map) {
- /**
- * @j2sNative
- * map.get$O = C$.prototype.get$S;
- * map.contains$O = C$.prototype.contains$S;
- */
- return (Hashtable<String, Object>) map;
- }
-
- private static List<Object> toList(Object[] a) {
- return new JSONList(a);
+ return /** @j2sNative swingjs.JSUtil.parseJSON$O(br) || */null;
}
}
public final static int TIME_RESET = 0;
public final static int TIME_MARK = 1;
+ public static final int TIME_SET = 2;
+ public static final int TIME_GET = 3;
- public static long time, mark;
+ public static long time, mark, set, duration;
public static void timeCheck(String msg, int mode) {
+ long t = System.currentTimeMillis();
switch (mode) {
case TIME_RESET:
- time = mark = System.currentTimeMillis();
- System.err.println("Platform: timer reset\t\t\t" + msg);
+ time = mark = t;
+ if (msg != null)
+ System.err.println("Platform: timer reset\t\t\t" + msg);
break;
case TIME_MARK:
- long t = System.currentTimeMillis();
- if (time == 0)
- time = mark = t;
- System.err.println("Platform: timer mark\t" + ((t - time)/1000f) + "\t" + ((t - mark)/1000f) + "\t" + msg);
- mark = t;
+ if (set > 0) {
+ duration += (t - set);
+ } else {
+ if (time == 0)
+ time = mark = t;
+ if (msg != null)
+ System.err.println("Platform: timer mark\t" + ((t - time)/1000f) + "\t" + ((t - mark)/1000f) + "\t" + msg);
+ mark = t;
+ }
+ break;
+ case TIME_SET:
+ set = t;
+ break;
+ case TIME_GET:
+ if (msg != null)
+ System.err.println("Platform: timer dur\t" + ((t - time)/1000f) + "\t" + ((duration)/1000f) + "\t" + msg);
+ set = 0;
break;
}
}
-20190125104925
+20190129013326
-20190125031511
+20190129013326
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.datamodel;
+
+import jalview.analysis.Rna;
+import jalview.analysis.SecStrConsensus.SimpleBP;
+import jalview.analysis.WUSSParseException;
+import jalview.util.MapList;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * DOCUMENT ME!
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class AlignmentAnnotation
+{
+ private static final String ANNOTATION_ID_PREFIX = "ann";
+
+ /*
+ * Identifers for different types of profile data
+ */
+ public static final int SEQUENCE_PROFILE = 0;
+
+ public static final int STRUCTURE_PROFILE = 1;
+
+ public static final int CDNA_PROFILE = 2;
+
+ private static long counter = 0;
+
+ /**
+ * If true, this annotations is calculated every edit, eg consensus, quality
+ * or conservation graphs
+ */
+ public boolean autoCalculated = false;
+
+ /**
+ * unique ID for this annotation, used to match up the same annotation row
+ * shown in multiple views and alignments
+ */
+ public String annotationId;
+
+ /**
+ * the sequence this annotation is associated with (or null)
+ */
+ public SequenceI sequenceRef;
+
+ /** label shown in dropdown menus and in the annotation label area */
+ public String label;
+
+ /** longer description text shown as a tooltip */
+ public String description;
+
+ /** Array of annotations placed in the current coordinate system */
+ public Annotation[] annotations;
+
+ public List<SimpleBP> bps = null;
+
+ /**
+ * RNA secondary structure contact positions
+ */
+ public SequenceFeature[] _rnasecstr = null;
+
+ /**
+ * position of annotation resulting in invalid WUSS parsing or -1. -2 means
+ * there was no RNA structure in this annotation
+ */
+ private long invalidrnastruc = -2;
+
+ /**
+ * Updates the _rnasecstr field Determines the positions that base pair and
+ * the positions of helices based on secondary structure from a Stockholm file
+ *
+ * @param rnaAnnotation
+ */
+ private void _updateRnaSecStr(CharSequence rnaAnnotation)
+ {
+ try
+ {
+ _rnasecstr = Rna.getHelixMap(rnaAnnotation);
+ invalidrnastruc = -1;
+ } catch (WUSSParseException px)
+ {
+ // DEBUG System.out.println(px);
+ invalidrnastruc = px.getProblemPos();
+ }
+ if (invalidrnastruc > -1)
+ {
+ return;
+ }
+
+ if (_rnasecstr != null && _rnasecstr.length > 0)
+ {
+ // show all the RNA secondary structure annotation symbols.
+ isrna = true;
+ showAllColLabels = true;
+ scaleColLabel = true;
+ _markRnaHelices();
+ }
+ // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+
+ }
+
+ private void _markRnaHelices()
+ {
+ int mxval = 0;
+ // 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 < _rnasecstr.length; x++)
+ {
+
+ /*
+ * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+ * this.annotation._rnasecstr[x].getBegin());
+ */
+ // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+ int val = 0;
+ try
+ {
+ val = Integer.valueOf(_rnasecstr[x].getFeatureGroup());
+ if (mxval < val)
+ {
+ mxval = val;
+ }
+ } catch (NumberFormatException q)
+ {
+ }
+ ;
+
+ annotations[_rnasecstr[x].getBegin()].value = val;
+ annotations[_rnasecstr[x].getEnd()].value = val;
+
+ // annotations[_rnasecstr[x].getBegin()].displayCharacter = "" + val;
+ // annotations[_rnasecstr[x].getEnd()].displayCharacter = "" + val;
+ }
+ setScore(mxval);
+ }
+
+ /**
+ * Get the RNA Secondary Structure SequenceFeature Array if present
+ */
+ public SequenceFeature[] getRnaSecondaryStructure()
+ {
+ return this._rnasecstr;
+ }
+
+ /**
+ * Check the RNA Secondary Structure is equivalent to one in given
+ * AlignmentAnnotation param
+ */
+ public boolean rnaSecondaryStructureEquivalent(AlignmentAnnotation that)
+ {
+ return rnaSecondaryStructureEquivalent(that, true);
+ }
+
+ public boolean rnaSecondaryStructureEquivalent(AlignmentAnnotation that, boolean compareType)
+ {
+ SequenceFeature[] thisSfArray = this.getRnaSecondaryStructure();
+ SequenceFeature[] thatSfArray = that.getRnaSecondaryStructure();
+ if (thisSfArray == null || thatSfArray == null)
+ {
+ return thisSfArray == null && thatSfArray == null;
+ }
+ if (thisSfArray.length != thatSfArray.length)
+ {
+ return false;
+ }
+ Arrays.sort(thisSfArray, new SFSortByEnd()); // probably already sorted
+ // like this
+ Arrays.sort(thatSfArray, new SFSortByEnd()); // probably already sorted
+ // like this
+ for (int i=0; i < thisSfArray.length; i++) {
+ SequenceFeature thisSf = thisSfArray[i];
+ SequenceFeature thatSf = thatSfArray[i];
+ if (compareType) {
+ if (thisSf.getType() == null || thatSf.getType() == null) {
+ if (thisSf.getType() == null && thatSf.getType() == null) {
+ continue;
+ } else {
+ return false;
+ }
+ }
+ if (! thisSf.getType().equals(thatSf.getType())) {
+ return false;
+ }
+ }
+ if (!(thisSf.getBegin() == thatSf.getBegin()
+ && thisSf.getEnd() == thatSf.getEnd()))
+ {
+ return false;
+ }
+ }
+ return true;
+
+ }
+
+ /**
+ * map of positions in the associated annotation
+ */
+ private Map<Integer, Annotation> sequenceMapping;
+
+ /**
+ * lower range for quantitative data
+ */
+ public float graphMin;
+
+ /**
+ * Upper range for quantitative data
+ */
+ public float graphMax;
+
+ /**
+ * Score associated with label and description.
+ */
+ public double score = Double.NaN;
+
+ /**
+ * flag indicating if annotation has a score.
+ */
+ public boolean hasScore = false;
+
+ public GraphLine threshold;
+
+ // Graphical hints and tips
+
+ /** Can this row be edited by the user ? */
+ public boolean editable = false;
+
+ /** Indicates if annotation has a graphical symbol track */
+ public boolean hasIcons; //
+
+ /** Indicates if annotation has a text character label */
+ public boolean hasText;
+
+ /** is the row visible */
+ public boolean visible = true;
+
+ public int graphGroup = -1;
+
+ /** Displayed height of row in pixels */
+ public int height = 0;
+
+ public int graph = 0;
+
+ public int graphHeight = 40;
+
+ public boolean padGaps = false;
+
+ public static final int NO_GRAPH = 0;
+
+ public static final int BAR_GRAPH = 1;
+
+ public static final int LINE_GRAPH = 2;
+
+ public boolean belowAlignment = true;
+
+ public SequenceGroup groupRef = null;
+
+ /**
+ * display every column label, even if there is a row of identical labels
+ */
+ public boolean showAllColLabels = false;
+
+ /**
+ * scale the column label to fit within the alignment column.
+ */
+ public boolean scaleColLabel = false;
+
+ /**
+ * centre the column labels relative to the alignment column
+ */
+ public boolean centreColLabels = false;
+
+ private boolean isrna;
+
+ public static int getGraphValueFromString(String string)
+ {
+ if (string.equalsIgnoreCase("BAR_GRAPH"))
+ {
+ return BAR_GRAPH;
+ }
+ else if (string.equalsIgnoreCase("LINE_GRAPH"))
+ {
+ return LINE_GRAPH;
+ }
+ else
+ {
+ return NO_GRAPH;
+ }
+ }
+
+ /**
+ * Creates a new AlignmentAnnotation object.
+ *
+ * @param label
+ * short label shown under sequence labels
+ * @param description
+ * text displayed on mouseover
+ * @param annotations
+ * set of positional annotation elements
+ */
+ public AlignmentAnnotation(String label, String description,
+ Annotation[] annotations)
+ {
+ setAnnotationId();
+ // always editable?
+ editable = true;
+ this.label = label;
+ this.description = description;
+ this.annotations = annotations;
+
+ 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++)
+ {
+ // DEBUG System.out.println(i + ": " + annotations[i]);
+ if (annotations[i] == null)
+ {
+ continue;
+ }
+ if (annotations[i].secondaryStructure == 'H'
+ || annotations[i].secondaryStructure == 'E')
+ {
+ // DEBUG System.out.println( "/H|E/ '" +
+ // annotations[i].secondaryStructure + "'");
+ hasIcons |= true;
+ }
+ else
+ // Check for RNA secondary structure
+ {
+ // DEBUG System.out.println( "/else/ '" +
+ // annotations[i].secondaryStructure + "'");
+ // TODO: 2.8.2 should this ss symbol validation check be a function in
+ // RNA/ResidueProperties ?
+ if (annotations[i].secondaryStructure == '('
+ || annotations[i].secondaryStructure == '['
+ || annotations[i].secondaryStructure == '<'
+ || annotations[i].secondaryStructure == '{'
+ || annotations[i].secondaryStructure == 'A'
+ || annotations[i].secondaryStructure == 'B'
+ || annotations[i].secondaryStructure == 'C'
+ || annotations[i].secondaryStructure == 'D'
+ // || annotations[i].secondaryStructure == 'E' // ambiguous on
+ // its own -- already checked above
+ || annotations[i].secondaryStructure == 'F'
+ || annotations[i].secondaryStructure == 'G'
+ // || annotations[i].secondaryStructure == 'H' // ambiguous on
+ // its own -- already checked above
+ || annotations[i].secondaryStructure == 'I'
+ || annotations[i].secondaryStructure == 'J'
+ || annotations[i].secondaryStructure == 'K'
+ || annotations[i].secondaryStructure == 'L'
+ || annotations[i].secondaryStructure == 'M'
+ || annotations[i].secondaryStructure == 'N'
+ || annotations[i].secondaryStructure == 'O'
+ || annotations[i].secondaryStructure == 'P'
+ || annotations[i].secondaryStructure == 'Q'
+ || annotations[i].secondaryStructure == 'R'
+ || annotations[i].secondaryStructure == 'S'
+ || annotations[i].secondaryStructure == 'T'
+ || annotations[i].secondaryStructure == 'U'
+ || annotations[i].secondaryStructure == 'V'
+ || annotations[i].secondaryStructure == 'W'
+ || annotations[i].secondaryStructure == 'X'
+ || annotations[i].secondaryStructure == 'Y'
+ || annotations[i].secondaryStructure == 'Z')
+ {
+ hasIcons |= true;
+ isrna |= true;
+ }
+ }
+
+ // System.out.println("displaychar " + annotations[i].displayCharacter);
+
+ if (annotations[i].displayCharacter == null
+ || annotations[i].displayCharacter.length() == 0)
+ {
+ rnastring.append('.');
+ continue;
+ }
+ if (annotations[i].displayCharacter.length() == 1)
+ {
+ firstChar = annotations[i].displayCharacter.charAt(0);
+ // check to see if it looks like a sequence or is secondary structure
+ // labelling.
+ if (annotations[i].secondaryStructure != ' ' && !hasIcons &&
+ // Uncomment to only catch case where
+ // displayCharacter==secondary
+ // Structure
+ // to correctly redisplay SS annotation imported from Stockholm,
+ // exported to JalviewXML and read back in again.
+ // &&
+ // annotations[i].displayCharacter.charAt(0)==annotations[i].secondaryStructure
+ firstChar != ' ' && firstChar != '$' && firstChar != 0xCE
+ && firstChar != '(' && firstChar != '[' && firstChar != '<'
+ && firstChar != '{' && firstChar != 'A' && firstChar != 'B'
+ && firstChar != 'C' && firstChar != 'D' && firstChar != 'E'
+ && firstChar != 'F' && firstChar != 'G' && firstChar != 'H'
+ && firstChar != 'I' && firstChar != 'J' && firstChar != 'K'
+ && firstChar != 'L' && firstChar != 'M' && firstChar != 'N'
+ && firstChar != 'O' && firstChar != 'P' && firstChar != 'Q'
+ && firstChar != 'R' && firstChar != 'S' && firstChar != 'T'
+ && firstChar != 'U' && firstChar != 'V' && firstChar != 'W'
+ && firstChar != 'X' && firstChar != 'Y' && firstChar != 'Z'
+ && firstChar != '-'
+ && firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
+ {
+ if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23) // TODO:
+ // parameterise
+ // to
+ // gap
+ // symbol
+ // number
+ {
+ nonSSLabel = true;
+ }
+ }
+ }
+ else
+ {
+ rnastring.append(annotations[i].displayCharacter.charAt(1));
+ }
+
+ if (annotations[i].displayCharacter.length() > 0)
+ {
+ hasText = true;
+ }
+ }
+
+ if (nonSSLabel)
+ {
+ hasIcons = false;
+ for (int j = 0; j < annotations.length; j++)
+ {
+ if (annotations[j] != null
+ && annotations[j].secondaryStructure != ' ')
+ {
+ annotations[j].displayCharacter = String
+ .valueOf(annotations[j].secondaryStructure);
+ annotations[j].secondaryStructure = ' ';
+ }
+
+ }
+ }
+ else
+ {
+ if (isrna)
+ {
+ _updateRnaSecStr(new AnnotCharSequence());
+ }
+ }
+ }
+
+ /**
+ * 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);
+ }
+
+ 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)
+ {
+ return ((index + offset < 0) || (index + offset) >= max
+ || annotations[index + offset] == null
+ || (annotations[index + offset].secondaryStructure <= ' ')
+ ? ' '
+ : annotations[index + offset].displayCharacter == null
+ || annotations[index
+ + offset].displayCharacter
+ .length() == 0
+ ? annotations[index
+ + offset].secondaryStructure
+ : annotations[index
+ + offset].displayCharacter
+ .charAt(0));
+ }
+
+ @Override
+ public String toString()
+ {
+ char[] string = new char[max - offset];
+ int mx = annotations.length;
+
+ for (int i = offset; i < mx; i++)
+ {
+ string[i] = (annotations[i] == null
+ || (annotations[i].secondaryStructure <= 32))
+ ? ' '
+ : (annotations[i].displayCharacter == null
+ || annotations[i].displayCharacter
+ .length() == 0
+ ? annotations[i].secondaryStructure
+ : annotations[i].displayCharacter
+ .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
+ * DOCUMENT ME!
+ * @param description
+ * DOCUMENT ME!
+ * @param annotations
+ * DOCUMENT ME!
+ * @param min
+ * DOCUMENT ME!
+ * @param max
+ * DOCUMENT ME!
+ * @param winLength
+ * DOCUMENT ME!
+ */
+ public AlignmentAnnotation(String label, String description,
+ Annotation[] annotations, float min, float max, int graphType)
+ {
+ setAnnotationId();
+ // graphs are not editable
+ editable = graphType == 0;
+
+ this.label = label;
+ this.description = description;
+ this.annotations = annotations;
+ graph = graphType;
+ graphMin = min;
+ graphMax = max;
+ validateRangeAndDisplay();
+ }
+
+ /**
+ * checks graphMin and graphMax, secondary structure symbols, sets graphType
+ * appropriately, sets null labels to the empty string if appropriate.
+ */
+ public void validateRangeAndDisplay()
+ {
+
+ if (annotations == null)
+ {
+ visible = false; // try to prevent renderer from displaying.
+ invalidrnastruc = -1;
+ return; // this is a non-annotation row annotation - ie a sequence score.
+ }
+
+ int graphType = graph;
+ float min = graphMin;
+ float max = graphMax;
+ boolean drawValues = true;
+ _linecolour = null;
+ if (min == max)
+ {
+ min = 999999999;
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] == null)
+ {
+ continue;
+ }
+
+ if (drawValues && annotations[i].displayCharacter != null
+ && annotations[i].displayCharacter.length() > 1)
+ {
+ drawValues = false;
+ }
+
+ if (annotations[i].value > max)
+ {
+ max = annotations[i].value;
+ }
+
+ if (annotations[i].value < min)
+ {
+ min = annotations[i].value;
+ }
+ if (_linecolour == null && annotations[i].colour != null)
+ {
+ _linecolour = annotations[i].colour;
+ }
+ }
+ // ensure zero is origin for min/max ranges on only one side of zero
+ if (min > 0)
+ {
+ min = 0;
+ }
+ else
+ {
+ if (max < 0)
+ {
+ max = 0;
+ }
+ }
+ }
+
+ graphMin = min;
+ graphMax = max;
+
+ areLabelsSecondaryStructure();
+
+ if (!drawValues && graphType != NO_GRAPH)
+ {
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] != null)
+ {
+ annotations[i].displayCharacter = "";
+ }
+ }
+ }
+ }
+
+ /**
+ * Copy constructor creates a new independent annotation row with the same
+ * associated sequenceRef
+ *
+ * @param annotation
+ */
+ public AlignmentAnnotation(AlignmentAnnotation annotation)
+ {
+ setAnnotationId();
+ this.label = new String(annotation.label);
+ if (annotation.description != null)
+ {
+ this.description = new String(annotation.description);
+ }
+ this.graphMin = annotation.graphMin;
+ this.graphMax = annotation.graphMax;
+ this.graph = annotation.graph;
+ this.graphHeight = annotation.graphHeight;
+ this.graphGroup = annotation.graphGroup;
+ this.groupRef = annotation.groupRef;
+ this.editable = annotation.editable;
+ this.autoCalculated = annotation.autoCalculated;
+ this.hasIcons = annotation.hasIcons;
+ this.hasText = annotation.hasText;
+ this.height = annotation.height;
+ this.label = annotation.label;
+ this.padGaps = annotation.padGaps;
+ this.visible = annotation.visible;
+ this.centreColLabels = annotation.centreColLabels;
+ this.scaleColLabel = annotation.scaleColLabel;
+ this.showAllColLabels = annotation.showAllColLabels;
+ this.calcId = annotation.calcId;
+ if (annotation.properties != null)
+ {
+ properties = new HashMap<>();
+ for (Map.Entry<String, String> val : annotation.properties.entrySet())
+ {
+ properties.put(val.getKey(), val.getValue());
+ }
+ }
+ if (this.hasScore = annotation.hasScore)
+ {
+ this.score = annotation.score;
+ }
+ if (annotation.threshold != null)
+ {
+ threshold = new GraphLine(annotation.threshold);
+ }
+ Annotation[] ann = annotation.annotations;
+ if (annotation.annotations != null)
+ {
+ this.annotations = new Annotation[ann.length];
+ for (int i = 0; i < ann.length; i++)
+ {
+ if (ann[i] != null)
+ {
+ annotations[i] = new Annotation(ann[i]);
+ if (_linecolour != null)
+ {
+ _linecolour = annotations[i].colour;
+ }
+ }
+ }
+ }
+ if (annotation.sequenceRef != null)
+ {
+ this.sequenceRef = annotation.sequenceRef;
+ if (annotation.sequenceMapping != null)
+ {
+ Integer p = null;
+ sequenceMapping = new HashMap<>();
+ Iterator<Integer> pos = annotation.sequenceMapping.keySet()
+ .iterator();
+ while (pos.hasNext())
+ {
+ // could optimise this!
+ p = pos.next();
+ Annotation a = annotation.sequenceMapping.get(p);
+ if (a == null)
+ {
+ continue;
+ }
+ if (ann != null)
+ {
+ for (int i = 0; i < ann.length; i++)
+ {
+ if (ann[i] == a)
+ {
+ sequenceMapping.put(p, annotations[i]);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ this.sequenceMapping = null;
+ }
+ }
+ // TODO: check if we need to do this: JAL-952
+ // if (this.isrna=annotation.isrna)
+ {
+ // _rnasecstr=new SequenceFeature[annotation._rnasecstr];
+ }
+ validateRangeAndDisplay(); // construct hashcodes, etc.
+ }
+
+ /**
+ * clip the annotation to the columns given by startRes and endRes (inclusive)
+ * and prune any existing sequenceMapping to just those columns.
+ *
+ * @param startRes
+ * @param endRes
+ */
+ public void restrict(int startRes, int endRes)
+ {
+ if (annotations == null)
+ {
+ // non-positional
+ return;
+ }
+ if (startRes < 0)
+ {
+ startRes = 0;
+ }
+ if (startRes >= annotations.length)
+ {
+ startRes = annotations.length - 1;
+ }
+ if (endRes >= annotations.length)
+ {
+ endRes = annotations.length - 1;
+ }
+ if (annotations == null)
+ {
+ return;
+ }
+ Annotation[] temp = new Annotation[endRes - startRes + 1];
+ if (startRes < annotations.length)
+ {
+ System.arraycopy(annotations, startRes, temp, 0,
+ endRes - startRes + 1);
+ }
+ if (sequenceRef != null)
+ {
+ // Clip the mapping, if it exists.
+ int spos = sequenceRef.findPosition(startRes);
+ int epos = sequenceRef.findPosition(endRes);
+ if (sequenceMapping != null)
+ {
+ Map<Integer, Annotation> newmapping = new HashMap<>();
+ Iterator<Integer> e = sequenceMapping.keySet().iterator();
+ while (e.hasNext())
+ {
+ Integer pos = e.next();
+ if (pos.intValue() >= spos && pos.intValue() <= epos)
+ {
+ newmapping.put(pos, sequenceMapping.get(pos));
+ }
+ }
+ sequenceMapping.clear();
+ sequenceMapping = newmapping;
+ }
+ }
+ annotations = temp;
+ }
+
+ /**
+ * set the annotation row to be at least length Annotations
+ *
+ * @param length
+ * minimum number of columns required in the annotation row
+ * @return false if the annotation row is greater than length
+ */
+ public boolean padAnnotation(int length)
+ {
+ if (annotations == null)
+ {
+ return true; // annotation row is correct - null == not visible and
+ // undefined length
+ }
+ if (annotations.length < length)
+ {
+ Annotation[] na = new Annotation[length];
+ System.arraycopy(annotations, 0, na, 0, annotations.length);
+ annotations = na;
+ return true;
+ }
+ return annotations.length > length;
+
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public String toString()
+ {
+ if (annotations == null)
+ {
+ return "";
+ }
+ StringBuilder buffer = new StringBuilder(256);
+
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] != null)
+ {
+ if (graph != 0)
+ {
+ buffer.append(annotations[i].value);
+ }
+ else if (hasIcons)
+ {
+ buffer.append(annotations[i].secondaryStructure);
+ }
+ else
+ {
+ buffer.append(annotations[i].displayCharacter);
+ }
+ }
+
+ buffer.append(", ");
+ }
+ // TODO: remove disgusting hack for 'special' treatment of consensus line.
+ if (label.indexOf("Consensus") == 0)
+ {
+ buffer.append("\n");
+
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] != null)
+ {
+ buffer.append(annotations[i].description);
+ }
+
+ buffer.append(", ");
+ }
+ }
+
+ return buffer.toString();
+ }
+
+ public void setThreshold(GraphLine line)
+ {
+ threshold = line;
+ }
+
+ public GraphLine getThreshold()
+ {
+ return threshold;
+ }
+
+ /**
+ * Attach the annotation to seqRef, starting from startRes position. If
+ * alreadyMapped is true then the indices of the annotation[] array are
+ * sequence positions rather than alignment column positions.
+ *
+ * @param seqRef
+ * @param startRes
+ * @param alreadyMapped
+ */
+ public void createSequenceMapping(SequenceI seqRef, int startRes,
+ boolean alreadyMapped)
+ {
+
+ if (seqRef == null)
+ {
+ return;
+ }
+ sequenceRef = seqRef;
+ if (annotations == null)
+ {
+ return;
+ }
+ sequenceMapping = new HashMap<>();
+
+ int seqPos;
+
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] != null)
+ {
+ if (alreadyMapped)
+ {
+ seqPos = seqRef.findPosition(i);
+ }
+ else
+ {
+ seqPos = i + startRes;
+ }
+
+ sequenceMapping.put(new Integer(seqPos), annotations[i]);
+ }
+ }
+
+ }
+
+ /**
+ * When positional annotation and a sequence reference is present, clears and
+ * resizes the annotations array to the current alignment width, and adds
+ * annotation according to aligned positions of the sequenceRef given by
+ * sequenceMapping.
+ */
+ public void adjustForAlignment()
+ {
+ if (sequenceRef == null)
+ {
+ return;
+ }
+
+ if (annotations == null)
+ {
+ return;
+ }
+
+ int a = 0, aSize = sequenceRef.getLength();
+
+ if (aSize == 0)
+ {
+ // Its been deleted
+ return;
+ }
+
+ int position;
+ Annotation[] temp = new Annotation[aSize];
+ Integer index;
+ if (sequenceMapping != null)
+ {
+ for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)
+ {
+ index = new Integer(a);
+ Annotation annot = sequenceMapping.get(index);
+ if (annot != null)
+ {
+ position = sequenceRef.findIndex(a) - 1;
+
+ temp[position] = annot;
+ }
+ }
+ }
+ annotations = temp;
+ }
+
+ /**
+ * remove any null entries in annotation row and return the number of non-null
+ * annotation elements.
+ *
+ * @return
+ */
+ public int compactAnnotationArray()
+ {
+ int i = 0, iSize = annotations.length;
+ while (i < iSize)
+ {
+ if (annotations[i] == null)
+ {
+ if (i + 1 < iSize)
+ {
+ System.arraycopy(annotations, i + 1, annotations, i,
+ iSize - i - 1);
+ }
+ iSize--;
+ }
+ else
+ {
+ i++;
+ }
+ }
+ Annotation[] ann = annotations;
+ annotations = new Annotation[i];
+ System.arraycopy(ann, 0, annotations, 0, i);
+ ann = null;
+ return iSize;
+ }
+
+ /**
+ * Associate this annotation with the aligned residues of a particular
+ * sequence. sequenceMapping will be updated in the following way: null
+ * sequenceI - existing mapping will be discarded but annotations left in
+ * mapped positions. valid sequenceI not equal to current sequenceRef: mapping
+ * is discarded and rebuilt assuming 1:1 correspondence TODO: overload with
+ * parameter to specify correspondence between current and new sequenceRef
+ *
+ * @param sequenceI
+ */
+ public void setSequenceRef(SequenceI sequenceI)
+ {
+ if (sequenceI != null)
+ {
+ if (sequenceRef != null)
+ {
+ boolean rIsDs = sequenceRef.getDatasetSequence() == null,
+ tIsDs = sequenceI.getDatasetSequence() == null;
+ if (sequenceRef != sequenceI
+ && (rIsDs && !tIsDs
+ && sequenceRef != sequenceI.getDatasetSequence())
+ && (!rIsDs && tIsDs
+ && sequenceRef.getDatasetSequence() != sequenceI)
+ && (!rIsDs && !tIsDs
+ && sequenceRef.getDatasetSequence() != sequenceI
+ .getDatasetSequence())
+ && !sequenceRef.equals(sequenceI))
+ {
+ // if sequenceRef isn't intersecting with sequenceI
+ // throw away old mapping and reconstruct.
+ sequenceRef = null;
+ if (sequenceMapping != null)
+ {
+ sequenceMapping = null;
+ // compactAnnotationArray();
+ }
+ createSequenceMapping(sequenceI, 1, true);
+ adjustForAlignment();
+ }
+ else
+ {
+ // Mapping carried over
+ sequenceRef = sequenceI;
+ }
+ }
+ else
+ {
+ // No mapping exists
+ createSequenceMapping(sequenceI, 1, true);
+ adjustForAlignment();
+ }
+ }
+ else
+ {
+ // throw away the mapping without compacting.
+ sequenceMapping = null;
+ sequenceRef = null;
+ }
+ }
+
+ /**
+ * @return the score
+ */
+ public double getScore()
+ {
+ return score;
+ }
+
+ /**
+ * @param score
+ * the score to set
+ */
+ public void setScore(double score)
+ {
+ hasScore = true;
+ this.score = score;
+ }
+
+ /**
+ *
+ * @return true if annotation has an associated score
+ */
+ public boolean hasScore()
+ {
+ return hasScore || !Double.isNaN(score);
+ }
+
+ /**
+ * Score only annotation
+ *
+ * @param label
+ * @param description
+ * @param score
+ */
+ public AlignmentAnnotation(String label, String description, double score)
+ {
+ this(label, description, null);
+ setScore(score);
+ }
+
+ /**
+ * copy constructor with edit based on the hidden columns marked in colSel
+ *
+ * @param alignmentAnnotation
+ * @param colSel
+ */
+ public AlignmentAnnotation(AlignmentAnnotation alignmentAnnotation,
+ HiddenColumns hidden)
+ {
+ this(alignmentAnnotation);
+ if (annotations == null)
+ {
+ return;
+ }
+ makeVisibleAnnotation(hidden);
+ }
+
+ public void setPadGaps(boolean padgaps, char gapchar)
+ {
+ this.padGaps = padgaps;
+ if (padgaps)
+ {
+ hasText = true;
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] == null)
+ {
+ annotations[i] = new Annotation(String.valueOf(gapchar), null,
+ ' ', 0f, null);
+ }
+ else if (annotations[i].displayCharacter == null
+ || annotations[i].displayCharacter.equals(" "))
+ {
+ annotations[i].displayCharacter = String.valueOf(gapchar);
+ }
+ }
+ }
+ }
+
+ /**
+ * format description string for display
+ *
+ * @param seqname
+ * @return Get the annotation description string optionally prefixed by
+ * associated sequence name (if any)
+ */
+ public String getDescription(boolean seqname)
+ {
+ if (seqname && this.sequenceRef != null)
+ {
+ int i = description.toLowerCase().indexOf("<html>");
+ if (i > -1)
+ {
+ // move the html tag to before the sequence reference.
+ return "<html>" + sequenceRef.getName() + " : "
+ + description.substring(i + 6);
+ }
+ return sequenceRef.getName() + " : " + description;
+ }
+ 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 = "";
+
+ /**
+ * properties associated with the calcId
+ */
+ protected Map<String, String> properties = new HashMap<>();
+
+ /**
+ * base colour for line graphs. If null, will be set automatically by
+ * searching the alignment annotation
+ */
+ public java.awt.Color _linecolour;
+
+ public String getCalcId()
+ {
+ return calcId;
+ }
+
+ public void setCalcId(String calcId)
+ {
+ this.calcId = calcId;
+ }
+
+ public boolean isRNA()
+ {
+ return isrna;
+ }
+
+ /**
+ * transfer annotation to the given sequence using the given mapping from the
+ * current positions or an existing sequence mapping
+ *
+ * @param sq
+ * @param sp2sq
+ * map involving sq as To or From
+ */
+ public void liftOver(SequenceI sq, Mapping sp2sq)
+ {
+ if (sp2sq.getMappedWidth() != sp2sq.getWidth())
+ {
+ // TODO: employ getWord/MappedWord to transfer annotation between cDNA and
+ // Protein reference frames
+ throw new Error(
+ "liftOver currently not implemented for transfer of annotation between different types of seqeunce");
+ }
+ boolean mapIsTo = (sp2sq != null)
+ ? (sp2sq.getTo() == sq
+ || sp2sq.getTo() == sq.getDatasetSequence())
+ : false;
+
+ // TODO build a better annotation element map and get rid of annotations[]
+ Map<Integer, Annotation> mapForsq = new HashMap<>();
+ if (sequenceMapping != null)
+ {
+ if (sp2sq != null)
+ {
+ int[] reg = new int[MapList.LEN];
+ for (Entry<Integer, Annotation> ie : sequenceMapping.entrySet())
+ {
+ reg[MapList.POS] = ie.getKey();
+ int mpos = sp2sq.getPosition(reg, mapIsTo);
+ if (mpos >= sq.getStart() && mpos <= sq.getEnd())
+ {
+ mapForsq.put(mpos, ie.getValue());
+ }
+ }
+ sequenceMapping = mapForsq;
+ sequenceRef = sq;
+ adjustForAlignment();
+ }
+ else
+ {
+ // trim positions
+ }
+ }
+ }
+
+ /**
+ * like liftOver but more general.
+ *
+ * Takes an array of int pairs that will be used to update the internal
+ * sequenceMapping and so shuffle the annotated positions
+ *
+ * @param newref
+ * - new sequence reference for the annotation row - if null,
+ * sequenceRef is left unchanged
+ * @param mapping
+ * array of ints containing corresponding positions
+ * @param from
+ * - column for current coordinate system (-1 for index+1)
+ * @param to
+ * - column for destination coordinate system (-1 for index+1)
+ * @param idxoffset
+ * - offset added to index when referencing either coordinate system
+ * @note no checks are made as to whether from and/or to are sensible
+ * @note caller should add the remapped annotation to newref if they have not
+ * already
+ */
+ public void remap(SequenceI newref, HashMap<Integer, int[]> mapping,
+ int from, int to, int idxoffset)
+ {
+ if (mapping != null)
+ {
+ Map<Integer, Annotation> old = sequenceMapping;
+ Map<Integer, Annotation> remap = new HashMap<>();
+ int index = -1;
+ for (int mp[] : mapping.values())
+ {
+ if (index++ < 0)
+ {
+ continue;
+ }
+ Annotation ann = null;
+ if (from == -1)
+ {
+ ann = sequenceMapping.get(Integer.valueOf(idxoffset + index));
+ }
+ else
+ {
+ if (mp != null && mp.length > from)
+ {
+ ann = sequenceMapping.get(Integer.valueOf(mp[from]));
+ }
+ }
+ if (ann != null)
+ {
+ if (to == -1)
+ {
+ remap.put(Integer.valueOf(idxoffset + index), ann);
+ }
+ else
+ {
+ if (to > -1 && to < mp.length)
+ {
+ remap.put(Integer.valueOf(mp[to]), ann);
+ }
+ }
+ }
+ }
+ sequenceMapping = remap;
+ old.clear();
+ if (newref != null)
+ {
+ sequenceRef = newref;
+ }
+ adjustForAlignment();
+ }
+ }
+
+ public String getProperty(String property)
+ {
+ if (properties == null)
+ {
+ return null;
+ }
+ return properties.get(property);
+ }
+
+ public void setProperty(String property, String value)
+ {
+ if (properties == null)
+ {
+ properties = new HashMap<>();
+ }
+ properties.put(property, value);
+ }
+
+ public boolean hasProperties()
+ {
+ return properties != null && properties.size() > 0;
+ }
+
+ public Collection<String> getProperties()
+ {
+ if (properties == null)
+ {
+ return Collections.emptyList();
+ }
+ return properties.keySet();
+ }
+
+ /**
+ * Returns the Annotation for the given sequence position (base 1) if any,
+ * else null
+ *
+ * @param position
+ * @return
+ */
+ public Annotation getAnnotationForPosition(int position)
+ {
+ return sequenceMapping == null ? null : sequenceMapping.get(position);
+
+ }
+
+ /**
+ * Set the id to "ann" followed by a counter that increments so as to be
+ * unique for the lifetime of the JVM
+ */
+ protected final void setAnnotationId()
+ {
+ this.annotationId = ANNOTATION_ID_PREFIX + Long.toString(nextId());
+ }
+
+ /**
+ * Returns the match for the last unmatched opening RNA helix pair symbol
+ * preceding the given column, or '(' if nothing found to match.
+ *
+ * @param column
+ * @return
+ */
+ public String getDefaultRnaHelixSymbol(int column)
+ {
+ String result = "(";
+ if (annotations == null)
+ {
+ return result;
+ }
+
+ /*
+ * for each preceding column, if it contains an open bracket,
+ * count whether it is still unmatched at column, if so return its pair
+ * (likely faster than the fancy alternative using stacks)
+ */
+ for (int col = column - 1; col >= 0; col--)
+ {
+ Annotation annotation = annotations[col];
+ if (annotation == null)
+ {
+ continue;
+ }
+ String displayed = annotation.displayCharacter;
+ if (displayed == null || displayed.length() != 1)
+ {
+ continue;
+ }
+ char symbol = displayed.charAt(0);
+ if (!Rna.isOpeningParenthesis(symbol))
+ {
+ continue;
+ }
+
+ /*
+ * found an opening bracket symbol
+ * count (closing-opening) symbols of this type that follow it,
+ * up to and excluding the target column; if the count is less
+ * than 1, the opening bracket is unmatched, so return its match
+ */
+ String closer = String
+ .valueOf(Rna.getMatchingClosingParenthesis(symbol));
+ String opener = String.valueOf(symbol);
+ int count = 0;
+ for (int j = col + 1; j < column; j++)
+ {
+ if (annotations[j] != null)
+ {
+ String s = annotations[j].displayCharacter;
+ if (closer.equals(s))
+ {
+ count++;
+ }
+ else if (opener.equals(s))
+ {
+ count--;
+ }
+ }
+ }
+ if (count < 1)
+ {
+ return closer;
+ }
+ }
+ return result;
+ }
+
+ protected static synchronized long nextId()
+ {
+ return counter++;
+ }
+
+ /**
+ *
+ * @return true for rows that have a range of values in their annotation set
+ */
+ public boolean isQuantitative()
+ {
+ return graphMin < graphMax;
+ }
+
+ /**
+ * delete any columns in alignmentAnnotation that are hidden (including
+ * sequence associated annotation).
+ *
+ * @param hiddenColumns
+ * the set of hidden columns
+ */
+ public void makeVisibleAnnotation(HiddenColumns hiddenColumns)
+ {
+ if (annotations != null)
+ {
+ makeVisibleAnnotation(0, annotations.length, hiddenColumns);
+ }
+ }
+
+ /**
+ * delete any columns in alignmentAnnotation that are hidden (including
+ * sequence associated annotation).
+ *
+ * @param start
+ * remove any annotation to the right of this column
+ * @param end
+ * remove any annotation to the left of this column
+ * @param hiddenColumns
+ * the set of hidden columns
+ */
+ public void makeVisibleAnnotation(int start, int end,
+ HiddenColumns hiddenColumns)
+ {
+ if (annotations != null)
+ {
+ if (hiddenColumns.hasHiddenColumns())
+ {
+ removeHiddenAnnotation(start, end, hiddenColumns);
+ }
+ else
+ {
+ restrict(start, end);
+ }
+ }
+ }
+
+ /**
+ * The actual implementation of deleting hidden annotation columns
+ *
+ * @param start
+ * remove any annotation to the right of this column
+ * @param end
+ * remove any annotation to the left of this column
+ * @param hiddenColumns
+ * the set of hidden columns
+ */
+ private void removeHiddenAnnotation(int start, int end,
+ HiddenColumns hiddenColumns)
+ {
+ // mangle the alignmentAnnotation annotation array
+ ArrayList<Annotation[]> annels = new ArrayList<>();
+ Annotation[] els = null;
+
+ int w = 0;
+
+ Iterator<int[]> blocks = hiddenColumns.getVisContigsIterator(start,
+ end + 1, false);
+
+ int copylength;
+ int annotationLength;
+ while (blocks.hasNext())
+ {
+ int[] block = blocks.next();
+ annotationLength = block[1] - block[0] + 1;
+
+ if (blocks.hasNext())
+ {
+ // copy just the visible segment of the annotation row
+ copylength = annotationLength;
+ }
+ else
+ {
+ if (annotationLength + block[0] <= annotations.length)
+ {
+ // copy just the visible segment of the annotation row
+ copylength = annotationLength;
+ }
+ else
+ {
+ // copy to the end of the annotation row
+ copylength = annotations.length - block[0];
+ }
+ }
+
+ els = new Annotation[annotationLength];
+ annels.add(els);
+ System.arraycopy(annotations, block[0], els, 0, copylength);
+ w += annotationLength;
+ }
+
+ if (w != 0)
+ {
+ annotations = new Annotation[w];
+
+ w = 0;
+ for (Annotation[] chnk : annels)
+ {
+ System.arraycopy(chnk, 0, annotations, w, chnk.length);
+ w += chnk.length;
+ }
+ }
+ }
+
+ public static Iterable<AlignmentAnnotation> findAnnotations(
+ Iterable<AlignmentAnnotation> list, SequenceI seq, String calcId,
+ String label)
+ {
+
+ ArrayList<AlignmentAnnotation> aa = new ArrayList<>();
+ for (AlignmentAnnotation ann : list)
+ {
+ if ((calcId == null || (ann.getCalcId() != null
+ && ann.getCalcId().equals(calcId)))
+ && (seq == null || (ann.sequenceRef != null
+ && ann.sequenceRef == seq))
+ && (label == null
+ || (ann.label != null && ann.label.equals(label))))
+ {
+ aa.add(ann);
+ }
+ }
+ return aa;
+ }
+
+ /**
+ * Answer true if any annotation matches the calcId passed in (if not null).
+ *
+ * @param list
+ * annotation to search
+ * @param calcId
+ * @return
+ */
+ public static boolean hasAnnotation(List<AlignmentAnnotation> list,
+ String calcId)
+ {
+
+ if (calcId != null && !"".equals(calcId))
+ {
+ for (AlignmentAnnotation a : list)
+ {
+ if (a.getCalcId() == calcId)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static Iterable<AlignmentAnnotation> findAnnotation(
+ List<AlignmentAnnotation> list, String calcId)
+ {
+
+ List<AlignmentAnnotation> aa = new ArrayList<>();
+ if (calcId == null)
+ {
+ return aa;
+ }
+ for (AlignmentAnnotation a : list)
+ {
+
+ if (a.getCalcId() == calcId || (a.getCalcId() != null
+ && calcId != null && a.getCalcId().equals(calcId)))
+ {
+ aa.add(a);
+ }
+ }
+ return aa;
+ }
+
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A simple way of bijectively mapping a non-contiguous linear range to another
+ * non-contiguous linear range.
+ *
+ * Use at your own risk!
+ *
+ * TODO: efficient implementation of private posMap method
+ *
+ * TODO: test/ensure that sense of from and to ratio start position is conserved
+ * (codon start position recovery)
+ */
+public class MapList
+{
+
+ public static final int POS = 0;
+ public static final int POS_FROM = 1; // for countPos
+ public static final int DIR_FROM = 2; // for countPos
+ public static final int POS_TO = 3; // for countToPos
+ public static final int DIR_TO = 4; // for countToPos
+ private static final int FROM_REMAINDER = 5;
+ public static final int LEN = 6;
+/*
+ * Subregions (base 1) described as { [start1, end1], [start2, end2], ...}
+ */
+ private List<int[]> fromShifts;
+
+ /*
+ * Same format as fromShifts, for the 'mapped to' sequence
+ */
+ private List<int[]> toShifts;
+
+ /*
+ * number of steps in fromShifts to one toRatio unit
+ */
+ private int fromRatio;
+
+ /*
+ * number of steps in toShifts to one fromRatio
+ */
+ private int toRatio;
+
+ /*
+ * lowest and highest value in the from Map
+ */
+ private int fromLowest;
+
+ private int fromHighest;
+
+ /*
+ * lowest and highest value in the to Map
+ */
+ private int toLowest;
+
+ private int toHighest;
+
+ /**
+ * Constructor
+ */
+ public MapList()
+ {
+ fromShifts = new ArrayList<>();
+ toShifts = new ArrayList<>();
+ }
+
+ /**
+ * Two MapList objects are equal if they are the same object, or they both
+ * have populated shift ranges and all values are the same.
+ */
+ @Override
+ public boolean equals(Object o)
+ {
+ if (o == null || !(o instanceof MapList))
+ {
+ return false;
+ }
+
+ MapList obj = (MapList) o;
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj.fromRatio != fromRatio || obj.toRatio != toRatio
+ || obj.fromShifts == null || obj.toShifts == null)
+ {
+ return false;
+ }
+ return Arrays.deepEquals(fromShifts.toArray(), obj.fromShifts.toArray())
+ && Arrays.deepEquals(toShifts.toArray(),
+ obj.toShifts.toArray());
+ }
+
+ /**
+ * Returns a hashcode made from the fromRatio, toRatio, and from/to ranges
+ */
+ @Override
+ public int hashCode()
+ {
+ int hashCode = 31 * fromRatio;
+ hashCode = 31 * hashCode + toRatio;
+ for (int[] shift : fromShifts)
+ {
+ hashCode = 31 * hashCode + shift[0];
+ hashCode = 31 * hashCode + shift[1];
+ }
+ for (int[] shift : toShifts)
+ {
+ hashCode = 31 * hashCode + shift[0];
+ hashCode = 31 * hashCode + shift[1];
+ }
+
+ return hashCode;
+ }
+
+ /**
+ * Returns the 'from' ranges as {[start1, end1], [start2, end2], ...}
+ *
+ * @return
+ */
+ public List<int[]> getFromRanges()
+ {
+ return fromShifts;
+ }
+
+ /**
+ * Returns the 'to' ranges as {[start1, end1], [start2, end2], ...}
+ *
+ * @return
+ */
+ public List<int[]> getToRanges()
+ {
+ return toShifts;
+ }
+
+ /**
+ * Flattens a list of [start, end] into a single [start1, end1, start2,
+ * end2,...] array.
+ *
+ * @param shifts
+ * @return
+ */
+ protected static int[] getRanges(List<int[]> shifts)
+ {
+ int[] rnges = new int[2 * shifts.size()];
+ int i = 0;
+ for (int[] r : shifts)
+ {
+ rnges[i++] = r[0];
+ rnges[i++] = r[1];
+ }
+ return rnges;
+ }
+
+ /**
+ *
+ * @return length of mapped phrase in from
+ */
+ public int getFromRatio()
+ {
+ return fromRatio;
+ }
+
+ /**
+ *
+ * @return length of mapped phrase in to
+ */
+ public int getToRatio()
+ {
+ return toRatio;
+ }
+
+ public int getFromLowest()
+ {
+ return fromLowest;
+ }
+
+ public int getFromHighest()
+ {
+ return fromHighest;
+ }
+
+ public int getToLowest()
+ {
+ return toLowest;
+ }
+
+ public int getToHighest()
+ {
+ return toHighest;
+ }
+
+ /**
+ * Constructor given from and to ranges as [start1, end1, start2, end2,...].
+ * If any end is equal to the next start, the ranges will be merged. There is
+ * no validation check that the ranges do not overlap each other.
+ *
+ * @param from
+ * contiguous regions as [start1, end1, start2, end2, ...]
+ * @param to
+ * same format as 'from'
+ * @param fromRatio
+ * phrase length in 'from' (e.g. 3 for dna)
+ * @param toRatio
+ * phrase length in 'to' (e.g. 1 for protein)
+ */
+ public MapList(int from[], int to[], int fromRatio, int toRatio)
+ {
+ this();
+ this.fromRatio = fromRatio;
+ this.toRatio = toRatio;
+ fromLowest = Integer.MAX_VALUE;
+ fromHighest = Integer.MIN_VALUE;
+ int added = 0;
+
+ for (int i = 0; i < from.length; i += 2)
+ {
+ /*
+ * note lowest and highest values - bearing in mind the
+ * direction may be reversed
+ */
+ fromLowest = Math.min(fromLowest, Math.min(from[i], from[i + 1]));
+ fromHighest = Math.max(fromHighest, Math.max(from[i], from[i + 1]));
+ if (added > 0 && from[i] == fromShifts.get(added - 1)[1])
+ {
+ /*
+ * this range starts where the last ended - just extend it
+ */
+ fromShifts.get(added - 1)[1] = from[i + 1];
+ }
+ else
+ {
+ fromShifts.add(new int[] { from[i], from[i + 1] });
+ added++;
+ }
+ }
+
+ toLowest = Integer.MAX_VALUE;
+ toHighest = Integer.MIN_VALUE;
+ added = 0;
+ for (int i = 0; i < to.length; i += 2)
+ {
+ toLowest = Math.min(toLowest, Math.min(to[i], to[i + 1]));
+ toHighest = Math.max(toHighest, Math.max(to[i], to[i + 1]));
+ if (added > 0 && to[i] == toShifts.get(added - 1)[1])
+ {
+ toShifts.get(added - 1)[1] = to[i + 1];
+ }
+ else
+ {
+ toShifts.add(new int[] { to[i], to[i + 1] });
+ added++;
+ }
+ }
+ }
+
+ /**
+ * Copy constructor. Creates an identical mapping.
+ *
+ * @param map
+ */
+ public MapList(MapList map)
+ {
+ this();
+ // TODO not used - remove?
+ this.fromLowest = map.fromLowest;
+ this.fromHighest = map.fromHighest;
+ this.toLowest = map.toLowest;
+ this.toHighest = map.toHighest;
+
+ this.fromRatio = map.fromRatio;
+ this.toRatio = map.toRatio;
+ if (map.fromShifts != null)
+ {
+ for (int[] r : map.fromShifts)
+ {
+ fromShifts.add(new int[] { r[0], r[1] });
+ }
+ }
+ if (map.toShifts != null)
+ {
+ for (int[] r : map.toShifts)
+ {
+ toShifts.add(new int[] { r[0], r[1] });
+ }
+ }
+ }
+
+ /**
+ * Constructor given ranges as lists of [start, end] positions. There is no
+ * validation check that the ranges do not overlap each other.
+ *
+ * @param fromRange
+ * @param toRange
+ * @param fromRatio
+ * @param toRatio
+ */
+ public MapList(List<int[]> fromRange, List<int[]> toRange, int fromRatio,
+ int toRatio)
+ {
+ this();
+ fromRange = coalesceRanges(fromRange);
+ toRange = coalesceRanges(toRange);
+ this.fromShifts = fromRange;
+ this.toShifts = toRange;
+ this.fromRatio = fromRatio;
+ this.toRatio = toRatio;
+
+ fromLowest = Integer.MAX_VALUE;
+ fromHighest = Integer.MIN_VALUE;
+ for (int[] range : fromRange)
+ {
+ if (range.length != 2)
+ {
+ // throw new IllegalArgumentException(range);
+ System.err.println(
+ "Invalid format for fromRange " + Arrays.toString(range)
+ + " may cause errors");
+ }
+ fromLowest = Math.min(fromLowest, Math.min(range[0], range[1]));
+ fromHighest = Math.max(fromHighest, Math.max(range[0], range[1]));
+ }
+
+ toLowest = Integer.MAX_VALUE;
+ toHighest = Integer.MIN_VALUE;
+ for (int[] range : toRange)
+ {
+ if (range.length != 2)
+ {
+ // throw new IllegalArgumentException(range);
+ System.err.println("Invalid format for toRange "
+ + Arrays.toString(range)
+ + " may cause errors");
+ }
+ toLowest = Math.min(toLowest, Math.min(range[0], range[1]));
+ toHighest = Math.max(toHighest, Math.max(range[0], range[1]));
+ }
+ }
+
+ /**
+ * Consolidates a list of ranges so that any contiguous ranges are merged.
+ * This assumes the ranges are already in start order (does not sort them).
+ *
+ * @param ranges
+ * @return the same list (if unchanged), else a new merged list, leaving the
+ * input list unchanged
+ */
+ public static List<int[]> coalesceRanges(final List<int[]> ranges)
+ {
+ if (ranges == null || ranges.size() < 2)
+ {
+ return ranges;
+ }
+
+ boolean changed = false;
+ List<int[]> merged = new ArrayList<>();
+ int[] lastRange = ranges.get(0);
+ int lastDirection = lastRange[1] >= lastRange[0] ? 1 : -1;
+ lastRange = new int[] { lastRange[0], lastRange[1] };
+ merged.add(lastRange);
+ boolean first = true;
+
+ for (final int[] range : ranges)
+ {
+ if (first)
+ {
+ first = false;
+ continue;
+ }
+ if (range[0] == lastRange[0] && range[1] == lastRange[1])
+ {
+ // drop duplicate range
+ changed = true;
+ continue;
+ }
+
+ /*
+ * drop this range if it lies within the last range
+ */
+ if ((lastDirection == 1 && range[0] >= lastRange[0]
+ && range[0] <= lastRange[1] && range[1] >= lastRange[0]
+ && range[1] <= lastRange[1])
+ || (lastDirection == -1 && range[0] <= lastRange[0]
+ && range[0] >= lastRange[1]
+ && range[1] <= lastRange[0]
+ && range[1] >= lastRange[1]))
+ {
+ changed = true;
+ continue;
+ }
+
+ int direction = range[1] >= range[0] ? 1 : -1;
+
+ /*
+ * if next range is in the same direction as last and contiguous,
+ * just update the end position of the last range
+ */
+ boolean sameDirection = range[1] == range[0]
+ || direction == lastDirection;
+ boolean extending = range[0] == lastRange[1] + lastDirection;
+ boolean overlapping = (lastDirection == 1 && range[0] >= lastRange[0]
+ && range[0] <= lastRange[1])
+ || (lastDirection == -1 && range[0] <= lastRange[0]
+ && range[0] >= lastRange[1]);
+ if (sameDirection && (overlapping || extending))
+ {
+ lastRange[1] = range[1];
+ changed = true;
+ }
+ else
+ {
+ lastRange = new int[] { range[0], range[1] };
+ merged.add(lastRange);
+ // careful: merging [5, 5] after [7, 6] should keep negative direction
+ lastDirection = (range[1] == range[0]) ? lastDirection : direction;
+ }
+ }
+
+ return changed ? merged : ranges;
+ }
+
+// /**
+// * get all mapped positions from 'from' to 'to'
+// *
+// * @return int[][] { int[] { fromStart, fromFinish, toStart, toFinish }, int
+// * [fromFinish-fromStart+2] { toStart..toFinish mappings}}
+// */
+// protected int[][] makeFromMap()
+// {
+// // TODO not used - remove??
+// return posMap(fromShifts, fromRatio, toShifts, toRatio);
+// }
+//
+// /**
+// * get all mapped positions from 'to' to 'from'
+// *
+// * @return int[to position]=position mapped in from
+// */
+// protected int[][] makeToMap()
+// {
+// // TODO not used - remove??
+// return posMap(toShifts, toRatio, fromShifts, fromRatio);
+// }
+
+// /**
+// * construct an int map for intervals in intVals
+// *
+// * @param shiftTo
+// * @return int[] { from, to pos in range }, int[range.to-range.from+1]
+// * returning mapped position
+// */
+// private int[][] posMap(List<int[]> shiftTo, int ratio,
+// List<int[]> shiftFrom, int toRatio)
+// {
+// // TODO not used - remove??
+//
+// int[] reg = new int[LEN];
+//
+// int iv = 0, ivSize = shiftTo.size();
+// if (iv >= ivSize)
+// {
+// return null;
+// }
+// int[] intv = shiftTo.get(iv++);
+// int from = intv[0], to = intv[1];
+// if (from > to)
+// {
+// from = intv[1];
+// to = intv[0];
+// }
+// while (iv < ivSize)
+// {
+// intv = shiftTo.get(iv++);
+// if (intv[0] < from)
+// {
+// from = intv[0];
+// }
+// if (intv[1] < from)
+// {
+// from = intv[1];
+// }
+// if (intv[0] > to)
+// {
+// to = intv[0];
+// }
+// if (intv[1] > to)
+// {
+// to = intv[1];
+// }
+// }
+// int tF = 0, tT = 0;
+// int mp[][] = new int[to - from + 2][];
+// for (int i = 0; i < mp.length; i++)
+// {
+// reg[POS] = i + from;
+// int[] m = shift(reg, shiftTo, ratio, shiftFrom, toRatio);
+// if (m != null)
+// {
+// if (i == 0)
+// {
+// tF = tT = m[0];
+// }
+// else
+// {
+// if (m[0] < tF)
+// {
+// tF = m[0];
+// }
+// if (m[0] > tT)
+// {
+// tT = m[0];
+// }
+// }
+// }
+// mp[i] = m;
+// }
+// int[][] map = new int[][] { new int[] { from, to, tF, tT },
+// new int[to - from + 2] };
+//
+// map[0][2] = tF;
+// map[0][3] = tT;
+//
+// for (int i = 0; i < mp.length; i++)
+// {
+// if (mp[i] != null)
+// {
+// map[1][i] = mp[i][0] - tF;
+// }
+// else
+// {
+// map[1][i] = -1; // indicates an out of range mapping
+// }
+// }
+// return map;
+// }
+
+ /**
+ * addShift
+ *
+ * @param pos
+ * start position for shift (in original reference frame)
+ * @param shift
+ * length of shift
+ *
+ * public void addShift(int pos, int shift) { int sidx = 0; int[]
+ * rshift=null; while (sidx<shifts.size() && (rshift=(int[])
+ * shifts.elementAt(sidx))[0]<pos) sidx++; if (sidx==shifts.size())
+ * shifts.insertElementAt(new int[] { pos, shift}, sidx); else
+ * rshift[1]+=shift; }
+ */
+
+ /**
+ * shift from pos to To(pos)
+ *
+ * @param reg[POS]
+ *
+ * @return int[] reg[POS_TO:shifted position in To,
+ * FROM_REMAINDER: frameshift in From,
+ * DIR_TO: direction of mapped symbol in To]
+ */
+ public int[] shiftFrom(int[] reg)
+ {
+ return shift(reg, fromShifts, fromRatio, toShifts, toRatio);
+ }
+
+ /**
+ * inverse of shiftFrom - maps pos in To to a position in From
+ *
+ * @param pos
+ * (in To)
+ * @return shifted position in From, frameshift in To, direction of mapped
+ * symbol in From
+ */
+ public int[] shiftTo(int[] reg)
+ {
+ return shift(reg, toShifts, toRatio, fromShifts, fromRatio);
+ }
+
+ /**
+ *
+ * @param reg[POS]
+ * @param shiftTo
+ * @param fromRatio
+ * @param shiftFrom
+ * @param toRatio
+ * @return reg[COUNT_TO, FROM_REMAINDER, DIR_TO]
+ */
+ protected static int[] shift(int[] reg, List<int[]> shiftTo, int fromRatio,
+ List<int[]> shiftFrom, int toRatio)
+ {
+ // TODO: javadoc; tests
+ reg = countPos(shiftTo, reg);
+ if (reg == null)
+ {
+ return null;
+ }
+ reg[FROM_REMAINDER] = (reg[POS_FROM] - 1) % fromRatio;
+ reg[POS] = 1 + (((reg[POS_FROM] - 1) / fromRatio) * toRatio); // toCount
+ reg = countToPos(shiftFrom, reg);
+ if (reg == null)
+ {
+ return null; // throw new Error("Bad Mapping!");
+ }
+ // reg is now filled
+ // System.out.println(fromCount[0]+" "+fromCount[1]+" "+toCount);
+// ret3[0] = toPos[0];
+// ret3[1] = fromRemainder;
+// ret3[2] = toPos[1];
+ return reg;
+ }
+
+ /**
+ * count how many positions pos is along the series of intervals.
+ *
+ * @param shiftTo
+ * @param pos
+ * @return number of positions or null if pos is not within intervals
+ */
+ protected static int[] countPos(List<int[]> shiftTo, int[] reg)
+ {
+ int pos = reg[POS];
+ int count = 0, iv = 0, ivSize = shiftTo.size();
+ while (iv < ivSize)
+ {
+ int[] intv = shiftTo.get(iv++);
+ if (intv[0] <= intv[1])
+ {
+ if (pos >= intv[0] && pos <= intv[1])
+ {
+ reg[POS_FROM] = count + pos - intv[0] + 1;
+ reg[DIR_FROM] = 1;
+ return reg;
+ }
+ else
+ {
+ count += intv[1] - intv[0] + 1;
+ }
+ }
+ else
+ {
+ if (pos >= intv[1] && pos <= intv[0])
+ {
+ reg[POS_FROM] = count - pos + intv[0] + 1;
+ reg[DIR_FROM] = -1;
+ return reg;
+ }
+ else
+ {
+ count += intv[0] - intv[1] + 1;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * count out pos positions into a series of intervals and return the position
+ *
+ * @param shiftFrom
+ * @param pos
+ * @return position pos in interval set
+ */
+ protected static int[] countToPos(List<int[]> shiftFrom, int[] reg)
+ {
+ int count = 0, diff = 0, iv = 0, ivSize = shiftFrom.size();
+ int pos = reg[POS];
+ while (iv < ivSize)
+ {
+ int[] intv = shiftFrom.get(iv++);
+ diff = intv[1] - intv[0];
+ if (diff >= 0)
+ {
+ if (pos <= count + 1 + diff)
+ {
+ reg[POS_TO] = intv[0] + pos - count - 1;
+ reg[DIR_TO] = 1;
+ return reg;
+ }
+ else
+ {
+ count += 1 + diff;
+ }
+ }
+ else
+ {
+ if (pos <= count + 1 - diff)
+ {
+ reg[POS_TO] = intv[0] - (pos - count - 1);
+ reg[DIR_TO] = -1;
+ return reg;
+ }
+ else
+ {
+ count += 1 - diff;
+ }
+ }
+ }
+ return null;// (diff<0) ? (intv[1]-1) : (intv[0]+1);
+ }
+
+ /**
+ * find series of intervals mapping from start-end in the From map.
+ *
+ * @param start
+ * position mapped 'to'
+ * @param end
+ * position mapped 'to'
+ * @return series of [start, end] ranges in sequence mapped 'from'
+ */
+ public int[] locateInFrom(int start, int end)
+ {
+ int[] reg = new int[LEN];
+ // inefficient implementation
+ reg[POS] = start;
+ reg = shiftTo(reg);
+ if (reg == null)
+ return null;
+ // needs to be inclusive of end of symbol position
+ start = reg[POS_TO];
+ reg[POS] = end;
+ reg = shiftTo(reg);
+ if (reg == null)
+ return null;
+ end = reg[POS_TO];
+ return getIntervals(fromShifts, start, end, fromRatio);
+ }
+
+ /**
+ * find series of intervals mapping from start-end in the to map.
+ *
+ * @param start
+ * position mapped 'from'
+ * @param end
+ * position mapped 'from'
+ * @return series of [start, end] ranges in sequence mapped 'to'
+ */
+ public int[] locateInTo(int start, int end)
+ {
+ int[] reg = new int[LEN];
+ reg[POS] = start;
+ reg = shiftFrom(reg);
+ if (reg == null)
+ return null;
+ start = reg[POS_FROM];
+ reg[POS] = end;
+ reg = shiftFrom(reg);
+ if (reg == null)
+ return null;
+ end = reg[POS_FROM];
+ return getIntervals(toShifts, start, end, toRatio);
+ }
+
+ /**
+ * like shift - except returns the intervals in the given vector of shifts
+ * which were spanned in traversing fromStart to fromEnd
+ *
+ * @param shiftFrom
+ * @param fromStart
+ * @param fromEnd
+ * @param fromRatio2
+ * @return series of from,to intervals from from first position of starting
+ * region to final position of ending region inclusive
+ */
+ protected static int[] getIntervals(List<int[]> shiftFrom,
+ int startpos, int endpos, int fromRatio2)
+ {
+// if (fromStart == null || fromEnd == null)
+// {
+// return null;
+// }
+// int startpos, endpos;
+// startpos = fromStart[0]; // first position in fromStart
+// endpos = fromEnd[0]; // last position in fromEnd
+ int endindx = (fromRatio2 - 1); // additional positions to get to last
+ // position from endpos
+ int intv = 0, intvSize = shiftFrom.size();
+ int iv[], i = 0, fs = -1, fe_s = -1, fe = -1; // containing intervals
+ // search intervals to locate ones containing startpos and count endindx
+ // positions on from endpos
+ while (intv < intvSize && (fs == -1 || fe == -1))
+ {
+ iv = shiftFrom.get(intv++);
+ if (fe_s > -1)
+ {
+ endpos = iv[0]; // start counting from beginning of interval
+ endindx--; // inclusive of endpos
+ }
+ if (iv[0] <= iv[1])
+ {
+ if (fs == -1 && startpos >= iv[0] && startpos <= iv[1])
+ {
+ fs = i;
+ }
+ if (endpos >= iv[0] && endpos <= iv[1])
+ {
+ if (fe_s == -1)
+ {
+ fe_s = i;
+ }
+ if (fe_s != -1)
+ {
+ if (endpos + endindx <= iv[1])
+ {
+ fe = i;
+ endpos = endpos + endindx; // end of end token is within this
+ // interval
+ }
+ else
+ {
+ endindx -= iv[1] - endpos; // skip all this interval too
+ }
+ }
+ }
+ }
+ else
+ {
+ if (fs == -1 && startpos <= iv[0] && startpos >= iv[1])
+ {
+ fs = i;
+ }
+ if (endpos <= iv[0] && endpos >= iv[1])
+ {
+ if (fe_s == -1)
+ {
+ fe_s = i;
+ }
+ if (fe_s != -1)
+ {
+ if (endpos - endindx >= iv[1])
+ {
+ fe = i;
+ endpos = endpos - endindx; // end of end token is within this
+ // interval
+ }
+ else
+ {
+ endindx -= endpos - iv[1]; // skip all this interval too
+ }
+ }
+ }
+ }
+ i++;
+ }
+ if (fs == fe && fe == -1)
+ {
+ return null;
+ }
+ List<int[]> ranges = new ArrayList<>();
+ if (fs <= fe)
+ {
+ intv = fs;
+ i = fs;
+ // truncate initial interval
+ iv = shiftFrom.get(intv++);
+ iv = new int[] { iv[0], iv[1] };// clone
+ if (i == fs)
+ {
+ iv[0] = startpos;
+ }
+ while (i != fe)
+ {
+ ranges.add(iv); // add initial range
+ iv = shiftFrom.get(intv++); // get next interval
+ iv = new int[] { iv[0], iv[1] };// clone
+ i++;
+ }
+ if (i == fe)
+ {
+ iv[1] = endpos;
+ }
+ ranges.add(iv); // add only - or final range
+ }
+ else
+ {
+ // walk from end of interval.
+ i = shiftFrom.size() - 1;
+ while (i > fs)
+ {
+ i--;
+ }
+ iv = shiftFrom.get(i);
+ iv = new int[] { iv[1], iv[0] };// reverse and clone
+ // truncate initial interval
+ if (i == fs)
+ {
+ iv[0] = startpos;
+ }
+ while (--i != fe)
+ { // fix apparent logic bug when fe==-1
+ ranges.add(iv); // add (truncated) reversed interval
+ iv = shiftFrom.get(i);
+ iv = new int[] { iv[1], iv[0] }; // reverse and clone
+ }
+ if (i == fe)
+ {
+ // interval is already reversed
+ iv[1] = endpos;
+ }
+ ranges.add(iv); // add only - or final range
+ }
+ // create array of start end intervals.
+ int[] range = null;
+ if (ranges != null && ranges.size() > 0)
+ {
+ range = new int[ranges.size() * 2];
+ intv = 0;
+ intvSize = ranges.size();
+ i = 0;
+ while (intv < intvSize)
+ {
+ iv = ranges.get(intv);
+ range[i++] = iv[0];
+ range[i++] = iv[1];
+ ranges.set(intv++, null); // remove
+ }
+ }
+ return range;
+ }
+
+// /**
+// * get the 'initial' position of mpos in To
+// *
+// * @param mpos
+// * position in from
+// * @return position of first word in to reference frame
+// */
+// public int getToPosition(int[])
+// {
+// // TODO not used - remove??
+// int[] mp = shiftTo(mpos);
+// if (mp != null)
+// {
+// return mp[0];
+// }
+// return mpos;
+// }
+//
+// /**
+// * get range of positions in To frame for the mpos word in From
+// *
+// * @param mpos
+// * position in From
+// * @return null or int[] first position in To for mpos, last position in to
+// * for Mpos
+// */
+// public int[] getToWord(int mpos)
+// {
+// // never called
+// int[] mp = shiftTo(mpos);
+// if (mp != null)
+// {
+// return new int[] { mp[0], mp[0] + mp[2] * (getFromRatio() - 1) };
+// }
+// return null;
+// }
+
+ /**
+ * get From position in the associated reference frame for position pos in the
+ * associated sequence.
+ *
+ * @param pos
+ * @return
+ */
+ public int getMappedPosition(int[] reg)
+ {
+ // TODO not used - remove??
+ int pos = reg[POS];
+ reg = shiftFrom(reg);
+ if (reg != null)
+ {
+ return reg[POS_TO];
+ }
+ return pos;
+ }
+
+// public int[] getMappedWord(int[] reg)
+// {
+// // TODO not used - remove??
+// reg = shiftFrom(reg);
+// if (reg != null)
+// {
+// return new int[] { mp[0], mp[0] + mp[2] * (getToRatio() - 1) };
+// }
+// return null;
+// }
+
+ /**
+ *
+ * @return a MapList whose From range is this maplist's To Range, and vice
+ * versa
+ */
+ public MapList getInverse()
+ {
+ return new MapList(getToRanges(), getFromRanges(), getToRatio(),
+ getFromRatio());
+ }
+
+ /**
+ * test for containment rather than equivalence to another mapping
+ *
+ * @param map
+ * to be tested for containment
+ * @return true if local or mapped range map contains or is contained by this
+ * mapping
+ */
+ public boolean containsEither(boolean local, MapList map)
+ {
+ // TODO not used - remove?
+ if (local)
+ {
+ return ((getFromLowest() >= map.getFromLowest()
+ && getFromHighest() <= map.getFromHighest())
+ || (getFromLowest() <= map.getFromLowest()
+ && getFromHighest() >= map.getFromHighest()));
+ }
+ else
+ {
+ return ((getToLowest() >= map.getToLowest()
+ && getToHighest() <= map.getToHighest())
+ || (getToLowest() <= map.getToLowest()
+ && getToHighest() >= map.getToHighest()));
+ }
+ }
+
+ /**
+ * String representation - for debugging, not guaranteed not to change
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder(64);
+ sb.append("[");
+ for (int[] shift : fromShifts)
+ {
+ sb.append(" ").append(Arrays.toString(shift));
+ }
+ sb.append(" ] ");
+ sb.append(fromRatio).append(":").append(toRatio);
+ sb.append(" to [");
+ for (int[] shift : toShifts)
+ {
+ sb.append(" ").append(Arrays.toString(shift));
+ }
+ sb.append(" ]");
+ return sb.toString();
+ }
+
+ /**
+ * Extend this map list by adding the given map's ranges. There is no
+ * validation check that the ranges do not overlap existing ranges (or each
+ * other), but contiguous ranges are merged.
+ *
+ * @param map
+ */
+ public void addMapList(MapList map)
+ {
+ if (this.equals(map))
+ {
+ return;
+ }
+ this.fromLowest = Math.min(fromLowest, map.fromLowest);
+ this.toLowest = Math.min(toLowest, map.toLowest);
+ this.fromHighest = Math.max(fromHighest, map.fromHighest);
+ this.toHighest = Math.max(toHighest, map.toHighest);
+
+ for (int[] range : map.getFromRanges())
+ {
+ addRange(range, fromShifts);
+ }
+ for (int[] range : map.getToRanges())
+ {
+ addRange(range, toShifts);
+ }
+ }
+
+ /**
+ * Adds the given range to a list of ranges. If the new range just extends
+ * existing ranges, the current endpoint is updated instead.
+ *
+ * @param range
+ * @param addTo
+ */
+ static void addRange(int[] range, List<int[]> addTo)
+ {
+ /*
+ * list is empty - add to it!
+ */
+ if (addTo.size() == 0)
+ {
+ addTo.add(range);
+ return;
+ }
+
+ int[] last = addTo.get(addTo.size() - 1);
+ boolean lastForward = last[1] >= last[0];
+ boolean newForward = range[1] >= range[0];
+
+ /*
+ * contiguous range in the same direction - just update endpoint
+ */
+ if (lastForward == newForward && last[1] == range[0])
+ {
+ last[1] = range[1];
+ return;
+ }
+
+ /*
+ * next range starts at +1 in forward sense - update endpoint
+ */
+ if (lastForward && newForward && range[0] == last[1] + 1)
+ {
+ last[1] = range[1];
+ return;
+ }
+
+ /*
+ * next range starts at -1 in reverse sense - update endpoint
+ */
+ if (!lastForward && !newForward && range[0] == last[1] - 1)
+ {
+ last[1] = range[1];
+ return;
+ }
+
+ /*
+ * just add the new range
+ */
+ addTo.add(range);
+ }
+
+ /**
+ * Returns true if mapping is from forward strand, false if from reverse
+ * strand. Result is just based on the first 'from' range that is not a single
+ * position. Default is true unless proven to be false. Behaviour is not well
+ * defined if the mapping has a mixture of forward and reverse ranges.
+ *
+ * @return
+ */
+ public boolean isFromForwardStrand()
+ {
+ return isForwardStrand(getFromRanges());
+ }
+
+ /**
+ * Returns true if mapping is to forward strand, false if to reverse strand.
+ * Result is just based on the first 'to' range that is not a single position.
+ * Default is true unless proven to be false. Behaviour is not well defined if
+ * the mapping has a mixture of forward and reverse ranges.
+ *
+ * @return
+ */
+ public boolean isToForwardStrand()
+ {
+ return isForwardStrand(getToRanges());
+ }
+
+ /**
+ * A helper method that returns true unless at least one range has start > end.
+ * Behaviour is undefined for a mixture of forward and reverse ranges.
+ *
+ * @param ranges
+ * @return
+ */
+ private boolean isForwardStrand(List<int[]> ranges)
+ {
+ boolean forwardStrand = true;
+ for (int[] range : ranges)
+ {
+ if (range[1] > range[0])
+ {
+ break; // forward strand confirmed
+ }
+ else if (range[1] < range[0])
+ {
+ forwardStrand = false;
+ break; // reverse strand confirmed
+ }
+ }
+ return forwardStrand;
+ }
+
+ /**
+ *
+ * @return true if from, or to is a three to 1 mapping
+ */
+ public boolean isTripletMap()
+ {
+ return (toRatio == 3 && fromRatio == 1)
+ || (fromRatio == 3 && toRatio == 1);
+ }
+
+ /**
+ * Returns a map which is the composite of this one and the input map. That
+ * is, the output map has the fromRanges of this map, and its toRanges are the
+ * toRanges of this map as transformed by the input map.
+ * <p>
+ * Returns null if the mappings cannot be traversed (not all toRanges of this
+ * map correspond to fromRanges of the input), or if this.toRatio does not
+ * match map.fromRatio.
+ *
+ * <pre>
+ * Example 1:
+ * this: from [1-100] to [501-600]
+ * input: from [10-40] to [60-90]
+ * output: from [10-40] to [560-590]
+ * Example 2 ('reverse strand exons'):
+ * this: from [1-100] to [2000-1951], [1000-951] // transcript to loci
+ * input: from [1-50] to [41-90] // CDS to transcript
+ * output: from [10-40] to [1960-1951], [1000-971] // CDS to gene loci
+ * </pre>
+ *
+ * @param map
+ * @return
+ */
+ public MapList traverse(MapList map)
+ {
+ if (map == null)
+ {
+ return null;
+ }
+
+ /*
+ * compound the ratios by this rule:
+ * A:B with M:N gives A*M:B*N
+ * reduced by greatest common divisor
+ * so 1:3 with 3:3 is 3:9 or 1:3
+ * 1:3 with 3:1 is 3:3 or 1:1
+ * 1:3 with 1:3 is 1:9
+ * 2:5 with 3:7 is 6:35
+ */
+ int outFromRatio = getFromRatio() * map.getFromRatio();
+ int outToRatio = getToRatio() * map.getToRatio();
+ int gcd = MathUtils.gcd(outFromRatio, outToRatio);
+ outFromRatio /= gcd;
+ outToRatio /= gcd;
+
+ List<int[]> toRanges = new ArrayList<>();
+ List<int[]> ranges = getToRanges();
+
+ for (int ir = 0, nr = ranges.size(); ir < nr; ir++)
+ {
+ int[] range = ranges.get(ir);
+ int[] transferred = map.locateInTo(range[0], range[1]);
+ if (transferred == null || transferred.length % 2 != 0)
+ {
+ return null;
+ }
+
+ /*
+ * convert [start1, end1, start2, end2, ...]
+ * to [[start1, end1], [start2, end2], ...]
+ */
+ for (int i = 0, n = transferred.length; i < n; i += 2)
+ {
+ toRanges.add(new int[] { transferred[i], transferred[i + 1] });
+ }
+ }
+
+ return new MapList(getFromRanges(), toRanges, outFromRatio, outToRatio);
+ }
+
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.datamodel;
+
+import jalview.util.Comparison;
+import jalview.util.MapList;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+
+public class Mapping
+{
+ /**
+ * An iterator that serves the aligned codon positions (with their protein
+ * products).
+ *
+ * @author gmcarstairs
+ *
+ */
+ public class AlignedCodonIterator implements Iterator<AlignedCodon>
+ {
+ /*
+ * The gap character used in the aligned sequence
+ */
+ private final char gap;
+
+ /*
+ * The characters of the aligned sequence e.g. "-cGT-ACgTG-"
+ */
+ private final SequenceI alignedSeq;
+
+ /*
+ * the sequence start residue
+ */
+ private int start;
+
+ /*
+ * Next position (base 0) in the aligned sequence
+ */
+ private int alignedColumn = 0;
+
+ /*
+ * Count of bases up to and including alignedColumn position
+ */
+ private int alignedBases = 0;
+
+ /*
+ * [start, end] from ranges (base 1)
+ */
+ private Iterator<int[]> fromRanges;
+
+ /*
+ * [start, end] to ranges (base 1)
+ */
+ private Iterator<int[]> toRanges;
+
+ /*
+ * The current [start, end] (base 1) from range
+ */
+ private int[] currentFromRange = null;
+
+ /*
+ * The current [start, end] (base 1) to range
+ */
+ private int[] currentToRange = null;
+
+ /*
+ * The next 'from' position (base 1) to process
+ */
+ private int fromPosition = 0;
+
+ /*
+ * The next 'to' position (base 1) to process
+ */
+ private int toPosition = 0;
+
+ /**
+ * Constructor
+ *
+ * @param seq
+ * the aligned sequence
+ * @param gapChar
+ */
+ public AlignedCodonIterator(SequenceI seq, char gapChar)
+ {
+ this.alignedSeq = seq;
+ this.start = seq.getStart();
+ this.gap = gapChar;
+ fromRanges = map.getFromRanges().iterator();
+ toRanges = map.getToRanges().iterator();
+ if (fromRanges.hasNext())
+ {
+ currentFromRange = fromRanges.next();
+ fromPosition = currentFromRange[0];
+ }
+ if (toRanges.hasNext())
+ {
+ currentToRange = toRanges.next();
+ toPosition = currentToRange[0];
+ }
+ }
+
+ /**
+ * Returns true unless we have already traversed the whole mapping.
+ */
+ @Override
+ public boolean hasNext()
+ {
+ if (fromRanges.hasNext())
+ {
+ return true;
+ }
+ if (currentFromRange == null || fromPosition >= currentFromRange[1])
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns the next codon's aligned positions, and translated value.
+ *
+ * @throws NoSuchElementException
+ * if hasNext() would have returned false
+ * @throws IncompleteCodonException
+ * if not enough mapped bases are left to make up a codon
+ */
+ @Override
+ public AlignedCodon next() throws IncompleteCodonException
+ {
+ if (!hasNext())
+ {
+ throw new NoSuchElementException();
+ }
+
+ int[] codon = getNextCodon();
+ int[] alignedCodon = getAlignedCodon(codon);
+
+ String peptide = getPeptide();
+ int peptideCol = toPosition - 1 - Mapping.this.to.getStart();
+ return new AlignedCodon(alignedCodon[0], alignedCodon[1],
+ alignedCodon[2], peptide, peptideCol);
+ }
+
+ /**
+ * Retrieve the translation as the 'mapped to' position in the mapped to
+ * sequence.
+ *
+ * @return
+ * @throws NoSuchElementException
+ * if the 'toRange' is exhausted (nothing to map to)
+ */
+ private String getPeptide()
+ {
+ // TODO should ideally handle toRatio other than 1 as well...
+ // i.e. code like getNextCodon()
+ if (toPosition <= currentToRange[1])
+ {
+ SequenceI seq = Mapping.this.to;
+ char pep = seq.getCharAt(toPosition - seq.getStart());
+ toPosition++;
+ return String.valueOf(pep);
+ }
+ if (!toRanges.hasNext())
+ {
+ throw new NoSuchElementException(
+ "Ran out of peptide at position " + toPosition);
+ }
+ currentToRange = toRanges.next();
+ toPosition = currentToRange[0];
+ return getPeptide();
+ }
+
+ /**
+ * Get the (base 1) dataset positions for the next codon in the mapping.
+ *
+ * @throws IncompleteCodonException
+ * if less than 3 remaining bases are mapped
+ */
+ private int[] getNextCodon()
+ {
+ int[] codon = new int[3];
+ int codonbase = 0;
+
+ while (codonbase < 3)
+ {
+ if (fromPosition <= currentFromRange[1])
+ {
+ /*
+ * Add next position from the current start-end range
+ */
+ codon[codonbase++] = fromPosition++;
+ }
+ else
+ {
+ /*
+ * Move to the next range - if there is one
+ */
+ if (!fromRanges.hasNext())
+ {
+ throw new IncompleteCodonException();
+ }
+ currentFromRange = fromRanges.next();
+ fromPosition = currentFromRange[0];
+ }
+ }
+ return codon;
+ }
+
+ /**
+ * Get the aligned column positions (base 0) for the given sequence
+ * positions (base 1), by counting ungapped characters in the aligned
+ * sequence.
+ *
+ * @param codon
+ * @return
+ */
+ private int[] getAlignedCodon(int[] codon)
+ {
+ int[] aligned = new int[codon.length];
+ for (int i = 0; i < codon.length; i++)
+ {
+ aligned[i] = getAlignedColumn(codon[i]);
+ }
+ return aligned;
+ }
+
+ /**
+ * Get the aligned column position (base 0) for the given sequence position
+ * (base 1).
+ *
+ * @param sequencePos
+ * @return
+ */
+ private int getAlignedColumn(int sequencePos)
+ {
+ /*
+ * allow for offset e.g. treat pos 8 as 2 if sequence starts at 7
+ */
+ int truePos = sequencePos - (start - 1);
+ int length = alignedSeq.getLength();
+ while (alignedBases < truePos && alignedColumn < length)
+ {
+ char c = alignedSeq.getCharAt(alignedColumn++);
+ if (c != gap && !Comparison.isGap(c))
+ {
+ alignedBases++;
+ }
+ }
+ return alignedColumn - 1;
+ }
+
+ @Override
+ public void remove()
+ {
+ // ignore
+ }
+
+ }
+
+ /*
+ * Contains the start-end pairs mapping from the associated sequence to the
+ * sequence in the database coordinate system. It also takes care of step
+ * difference between coordinate systems.
+ */
+ MapList map = null;
+
+ /*
+ * The sequence that map maps the associated sequence to (if any).
+ */
+ SequenceI to = null;
+
+ /*
+ * optional sequence id for the 'from' ranges
+ */
+ private String mappedFromId;
+
+ public Mapping(MapList map)
+ {
+ super();
+ this.map = map;
+ }
+
+ public Mapping(SequenceI to, MapList map)
+ {
+ this(map);
+ this.to = to;
+ }
+
+ /**
+ * create a new mapping from
+ *
+ * @param to
+ * the sequence being mapped
+ * @param exon
+ * int[] {start,end,start,end} series on associated sequence
+ * @param is
+ * int[] {start,end,...} ranges on the reference frame being mapped
+ * to
+ * @param i
+ * step size on associated sequence
+ * @param j
+ * step size on mapped frame
+ */
+ public Mapping(SequenceI to, int[] exon, int[] is, int i, int j)
+ {
+ this(to, new MapList(exon, is, i, j));
+ }
+
+ /**
+ * create a duplicate (and independent) mapping object with the same reference
+ * to any SequenceI being mapped to.
+ *
+ * @param map2
+ */
+ public Mapping(Mapping map2)
+ {
+ if (map2 != this && map2 != null)
+ {
+ if (map2.map != null)
+ {
+ map = new MapList(map2.map);
+ }
+ to = map2.to;
+ mappedFromId = map2.mappedFromId;
+ }
+ }
+
+ /**
+ * @return the map
+ */
+ public MapList getMap()
+ {
+ return map;
+ }
+
+ /**
+ * @param map
+ * the map to set
+ */
+ public void setMap(MapList map)
+ {
+ this.map = map;
+ }
+
+ /**
+ * Equals that compares both the to references and MapList mappings.
+ *
+ * @param o
+ * @return
+ * @see MapList#equals
+ */
+ @Override
+ public boolean equals(Object o)
+ {
+ if (o == null || !(o instanceof Mapping))
+ {
+ return false;
+ }
+ Mapping other = (Mapping) o;
+ if (other == this)
+ {
+ return true;
+ }
+ if (other.to != to)
+ {
+ return false;
+ }
+ if ((map != null && other.map == null)
+ || (map == null && other.map != null))
+ {
+ return false;
+ }
+ if ((map == null && other.map == null) || map.equals(other.map))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns a hashCode made from the sequence and maplist
+ */
+ @Override
+ public int hashCode()
+ {
+ int hashCode = (this.to == null ? 1 : this.to.hashCode());
+ if (this.map != null)
+ {
+ hashCode = hashCode * 31 + this.map.hashCode();
+ }
+
+ return hashCode;
+ }
+
+// /**
+// * gets boundary in direction of mapping
+// *
+// * @param position
+// * in mapped reference frame
+// * @return int{start, end} positions in associated sequence (in direction of
+// * mapped word)
+// */
+// public int[] getWord(int mpos)
+// {
+// // BH never called
+// if (map != null)
+// {
+// return map.getToWord(mpos);
+// }
+// return null;
+// }
+
+ /**
+ * width of mapped unit in associated sequence
+ *
+ */
+ public int getWidth()
+ {
+ if (map != null)
+ {
+ return map.getFromRatio();
+ }
+ return 1;
+ }
+
+ /**
+ * width of unit in mapped reference frame
+ *
+ * @return
+ */
+ public int getMappedWidth()
+ {
+ if (map != null)
+ {
+ return map.getToRatio();
+ }
+ return 1;
+ }
+
+ /**
+ * get the 'initial' position in the associated sequence for a position in the
+ * mapped reference frame
+ *
+ * or the mapped position in the associated reference frame for position pos in
+ * the associated sequence.
+ *
+ *
+ * @param reg reg[POS]
+ * @param isMapped
+ *
+ * @return position or mapped position
+ */
+ public int getPosition(int[] reg, boolean isMapped)
+ {
+ int pos = reg[MapList.POS];
+ if (map != null)
+ {
+ reg = (isMapped ? map.shiftFrom(reg) : map.shiftTo(reg));
+ if (reg != null)
+ {
+ return reg[MapList.POS_TO]; // was newArray[0], but shift puts the result in COUNT_TO
+ }
+ }
+ return pos;
+ }
+
+// /**
+//* get mapped position in the associated reference frame for position pos in
+//* the associated sequence.
+// *
+// * @param pos
+// * @return
+// */
+// public int getMappedPosition(int[] reg)
+// {
+// int mpos = reg[MapList.POS];
+// if (map != null)
+// {
+// reg = map.shiftFrom(reg);
+// if (reg != null)
+// {
+// return reg[MapList.POS_TO]; // was newArray[0], but shift puts the result in COUNT_TO
+// }
+// }
+// return mpos;
+// }
+
+// public int[] getMappedWord(int pos)
+// {
+// // BH Not used?
+// if (map != null)
+// {
+// reg = map.shiftFrom(reg);
+// if (reg != null)
+// {
+// reg[MP_0] =
+// return new int[] { mp[0], mp[0] + mp[2] * (map.getToRatio() - 1) };
+// }
+// }
+// return null;
+// }
+
+ /**
+ * locates the region of feature f in the associated sequence's reference
+ * frame
+ *
+ * @param f
+ * @return one or more features corresponding to f
+ */
+ public SequenceFeature[] locateFeature(SequenceFeature f)
+ {
+ if (true)
+ { // f.getBegin()!=f.getEnd()) {
+ if (map != null)
+ {
+ int[] frange = map.locateInFrom(f.getBegin(), f.getEnd());
+ if (frange == null)
+ {
+ // JBPNote - this isprobably not the right thing to doJBPHack
+ return null;
+ }
+ SequenceFeature[] vf = new SequenceFeature[frange.length / 2];
+ for (int i = 0, v = 0; i < frange.length; i += 2, v++)
+ {
+ vf[v] = new SequenceFeature(f, frange[i], frange[i + 1],
+ f.getFeatureGroup(), f.getScore());
+ if (frange.length > 2)
+ {
+ vf[v].setDescription(f.getDescription() + "\nPart " + (v + 1));
+ }
+ }
+ return vf;
+ }
+ }
+
+ // give up and just return the feature.
+ return new SequenceFeature[] { f };
+ }
+
+ /**
+ * return a series of contigs on the associated sequence corresponding to the
+ * from,to interval on the mapped reference frame
+ *
+ * @param from
+ * @param to
+ * @return int[] { from_i, to_i for i=1 to n contiguous regions in the
+ * associated sequence}
+ */
+ public int[] locateRange(int from, int to)
+ {
+ if (map != null)
+ {
+ if (from <= to)
+ {
+ from = (map.getToLowest() < from) ? from : map.getToLowest();
+ to = (map.getToHighest() > to) ? to : map.getToHighest();
+ if (from > to)
+ {
+ return null;
+ }
+ }
+ else
+ {
+ from = (map.getToHighest() > from) ? from : map.getToHighest();
+ to = (map.getToLowest() < to) ? to : map.getToLowest();
+ if (from < to)
+ {
+ return null;
+ }
+ }
+ return map.locateInFrom(from, to);
+ }
+ return new int[] { from, to };
+ }
+
+ /**
+ * return a series of mapped contigs mapped from a range on the associated
+ * sequence
+ *
+ * @param from
+ * @param to
+ * @return
+ */
+ public int[] locateMappedRange(int from, int to)
+ {
+ if (map != null)
+ {
+
+ if (from <= to)
+ {
+ from = (map.getFromLowest() < from) ? from : map.getFromLowest();
+ to = (map.getFromHighest() > to) ? to : map.getFromHighest();
+ if (from > to)
+ {
+ return null;
+ }
+ }
+ else
+ {
+ from = (map.getFromHighest() > from) ? from : map.getFromHighest();
+ to = (map.getFromLowest() < to) ? to : map.getFromLowest();
+ if (from < to)
+ {
+ return null;
+ }
+ }
+ return map.locateInTo(from, to);
+ }
+ return new int[] { from, to };
+ }
+
+ /**
+ * return a new mapping object with a maplist modifed to only map the visible
+ * regions defined by viscontigs.
+ *
+ * @param viscontigs
+ * @return
+ */
+ public Mapping intersectVisContigs(int[] viscontigs)
+ {
+ Mapping copy = new Mapping(this);
+ if (map != null)
+ {
+// int vpos = 0;
+// int apos = 0;
+ List<int[]> toRange = new ArrayList<int[]>();
+ List<int[]> fromRange = new ArrayList<int[]>();
+ for (int vc = 0; vc < viscontigs.length; vc += 2)
+ {
+ // find a mapped range in this visible region
+ int[] mpr = locateMappedRange(1 + viscontigs[vc],
+ viscontigs[vc + 1] - 1);
+ if (mpr != null)
+ {
+ for (int m = 0; m < mpr.length; m += 2)
+ {
+ toRange.add(new int[] { mpr[m], mpr[m + 1] });
+ int[] xpos = locateRange(mpr[m], mpr[m + 1]);
+ for (int x = 0; x < xpos.length; x += 2)
+ {
+ fromRange.add(new int[] { xpos[x], xpos[x + 1] });
+ }
+ }
+ }
+ }
+ int[] from = new int[fromRange.size() * 2];
+ int[] to = new int[toRange.size() * 2];
+ int[] r;
+ for (int f = 0, fSize = fromRange.size(); f < fSize; f++)
+ {
+ r = fromRange.get(f);
+ from[f * 2] = r[0];
+ from[f * 2 + 1] = r[1];
+ }
+ for (int f = 0, fSize = toRange.size(); f < fSize; f++)
+ {
+ r = toRange.get(f);
+ to[f * 2] = r[0];
+ to[f * 2 + 1] = r[1];
+ }
+ copy.setMap(
+ new MapList(from, to, map.getFromRatio(), map.getToRatio()));
+ }
+ return copy;
+ }
+
+ /**
+ * get the sequence being mapped to - if any
+ *
+ * @return null or a dataset sequence
+ */
+ public SequenceI getTo()
+ {
+ return to;
+ }
+
+ /**
+ * set the dataset sequence being mapped to if any
+ *
+ * @param tto
+ */
+ public void setTo(SequenceI tto)
+ {
+ to = tto;
+ }
+
+ /**
+ * Returns an iterator which can serve up the aligned codon column positions
+ * and their corresponding peptide products
+ *
+ * @param seq
+ * an aligned (i.e. possibly gapped) sequence
+ * @param gapChar
+ * @return
+ */
+ public Iterator<AlignedCodon> getCodonIterator(SequenceI seq,
+ char gapChar)
+ {
+ return new AlignedCodonIterator(seq, gapChar);
+ }
+
+ /**
+ * Readable representation for debugging only, not guaranteed not to change
+ */
+ @Override
+ public String toString()
+ {
+ return String.format("%s %s", this.map.toString(),
+ this.to == null ? "" : this.to.getName());
+ }
+
+ /**
+ * Returns the identifier for the 'from' range sequence, or null if not set
+ *
+ * @return
+ */
+ public String getMappedFromId()
+ {
+ return mappedFromId;
+ }
+
+ /**
+ * Sets the identifier for the 'from' range sequence
+ */
+ public void setMappedFromId(String mappedFromId)
+ {
+ this.mappedFromId = mappedFromId;
+ }
+
+}