From 41e8b795a5d6f6192ff0610b9b438140b27a1137 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 16 Sep 2024 15:39:34 +0100 Subject: [PATCH] JAL-4392 don't show SS consensus for DNA alignments --- src/jalview/viewmodel/AlignmentViewport.java | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) 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); } } -- 1.7.10.2