From: Jim Procter Date: Mon, 16 Sep 2024 14:39:34 +0000 (+0100) Subject: JAL-4392 don't show SS consensus for DNA alignments X-Git-Tag: Release_2_11_4_0~5^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=41e8b795a5d6f6192ff0610b9b438140b27a1137;p=jalview.git JAL-4392 don't show SS consensus for DNA alignments --- diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index ce4473b..f4201c1 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -2036,6 +2036,7 @@ public abstract class AlignmentViewport { initConservation(); initQuality(); + initSSConsensus(); } else { @@ -2045,13 +2046,8 @@ public abstract class AlignmentViewport MessageManager.getString("label.consensus_descr"), new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH); - secondaryStructureConsensus = new AlignmentAnnotation( - MessageManager.getString("label.ssconsensus_label"), - MessageManager.getString("label.ssconsensus_descr"), - new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH); initConsensus(consensus); - initSSConsensus(secondaryStructureConsensus); initGapCounts(); initComplementConsensus(); } @@ -2108,14 +2104,21 @@ public abstract class AlignmentViewport } } - private void initSSConsensus(AlignmentAnnotation aa) + private void initSSConsensus() { - aa.hasText = true; - aa.autoCalculated = true; - - if (showSSConsensus) + if (!alignment.isNucleotide() && showSSConsensus) { - alignment.addAnnotation(aa); + if (secondaryStructureConsensus == null) + { + secondaryStructureConsensus = new AlignmentAnnotation( + MessageManager.getString("label.ssconsensus_label"), + MessageManager.getString("label.ssconsensus_descr"), + new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH); + + secondaryStructureConsensus.hasText = true; + secondaryStructureConsensus.autoCalculated = true; + } + alignment.addAnnotation(secondaryStructureConsensus); } }