From: TZVanaalten Date: Thu, 24 Aug 2017 13:13:30 +0000 (+0100) Subject: JAL-2629 fix for NPE caused by incorrect initiation of HMM annotation X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6fd5f99f753ae1ce8c09b22fff11de2b6cdb3954;p=jalview.git JAL-2629 fix for NPE caused by incorrect initiation of HMM annotation --- diff --git a/src/jalview/hmmer/HMMERCommands.java b/src/jalview/hmmer/HMMERCommands.java index 913eee8..6b81b65 100644 --- a/src/jalview/hmmer/HMMERCommands.java +++ b/src/jalview/hmmer/HMMERCommands.java @@ -173,7 +173,6 @@ public class HMMERCommands af.alignPanel.adjustAnnotationHeight(); af.getViewport().updateSequenceIdColours(); af.buildSortByAnnotationScoresMenu(); - af.getViewport().initInformation(); } /** diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index b07e125..f3a4a1c 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -29,8 +29,6 @@ import jalview.bin.Jalview; import jalview.datamodel.AlignmentI; import jalview.datamodel.HiddenColumns; import jalview.datamodel.PDBEntry; -import jalview.datamodel.Profile; -import jalview.datamodel.Profiles; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; @@ -428,6 +426,7 @@ public class FileLoader implements Runnable AlignmentI alignment = viewport.getAlignment(); SequenceI seq = alignment .getSequenceAt(alignment.getAbsoluteHeight() - 1); + seq.setIsHMMConsensusSequence(true); alignment.deleteSequence(alignment.getAbsoluteHeight() - 1); SequenceGroup sg = viewport.getSelectionGroup(); if (sg != null) @@ -445,10 +444,6 @@ public class FileLoader implements Runnable { alignment.insertSequenceAt(0, seq); } - viewport.initInformation(); - viewport.setSequenceInformationHash( - new Profiles(new Profile[1]), 0); - viewport.updateInformation(viewport.getAlignPanel()); viewport.getAlignPanel().adjustAnnotationHeight(); viewport.updateSequenceIdColours(); if (viewport.getAlignPanel().alignFrame diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index a4b494a..eeea831 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -779,6 +779,10 @@ public abstract class AlignmentViewport @Override public void setSequenceInformationHash(ProfilesI info, int index) { + if (hinformation.size() < index + 1) + { + return; + } hinformation.set(index, info); } @@ -1997,6 +2001,7 @@ public abstract class AlignmentViewport { updateStrucConsensus(ap); } + initInformation(); updateInformation(ap); List hmmSequences;