JAL-4436 Colour by secondary structure conservation spike/JAL-4386_merge_multiple_leaves
authorRenia Correya <rcorreya001@dundee.ac.uk>
Fri, 30 Aug 2024 07:32:44 +0000 (13:02 +0530)
committerRenia Correya <rcorreya001@dundee.ac.uk>
Fri, 30 Aug 2024 07:32:44 +0000 (13:02 +0530)
Corrected the labels as secondary structure conservation increment.
Added a check for secondary structure in Colour by Above identity
threshold feature.

resources/lang/Messages.properties
src/jalview/gui/SliderPanel.java
src/jalview/renderer/ResidueShader.java

index 99f3388..156766f 100644 (file)
@@ -265,7 +265,7 @@ label.to_this_alignment = Add To This Alignment
 label.apply_colour_to_all_groups = Apply Colour To All Groups
 label.modify_identity_threshold = Modify Identity Threshold...
 label.modify_conservation_threshold = Modify Conservation Threshold...
-label.modify_secondary_structure_conservation_threshold = Modify Secondary Structure Conservation Threshold...
+label.modify_secondary_structure_conservation_threshold = Modify Secondary Structure Conservation Increment...
 label.input_from_textbox = Input from textbox
 label.centre_column_labels = Centre column labels
 label.automatic_scrolling = Automatic Scrolling
@@ -911,7 +911,7 @@ label.copied_sequences = Copied sequences
 label.cut_sequences = Cut Sequences
 label.conservation_colour_increment = Conservation Colour Increment ({0})
 label.percentage_identity_threshold = Percentage Identity Threshold ({0})
-label.secondary_structure_conservation_threshold = Secondary Structure Conservation Threshold ({0})
+label.secondary_structure_conservation_threshold = Secondary Structure Conservation Increment ({0})
 label.error_unsupported_owwner_user_colour_scheme = Unsupported owner for User Colour scheme dialog
 label.save_alignment_to_file = Save Alignment to file
 label.save_features_to_file = Save Features to File
index 5e1935d..0fad467 100755 (executable)
@@ -482,15 +482,16 @@ public class SliderPanel extends GSliderPanel
       scheme.setConservationApplied(true);
       scheme.setConservationInc(percent);
     }
-    else
-    {
-      scheme.setThreshold(percent, ap.av.isIgnoreGapsConsensus());
-    }
-    if(forConsensusSecondaryStructure)
+    else if(forConsensusSecondaryStructure)
     {
       scheme.setConsensusSecondaryStructureColouring(true);
       scheme.setConsensusSecondaryStructureThreshold(percent);
     }
+    else
+    {
+      scheme.setThreshold(percent, ap.av.isIgnoreGapsConsensus());
+
+    }
   }
 
   /**
index 0b191ec..91f38c5 100644 (file)
@@ -298,7 +298,7 @@ public class ResidueShader implements ResidueShaderI
      */
     if (!Comparison.isGap(symbol))
     {
-      colour = adjustColour(symbol, position, colour);
+      colour = adjustColour(symbol, position, colour, false);
     }
 
     return colour;
@@ -312,14 +312,14 @@ public class ResidueShader implements ResidueShaderI
       return Color.white; // Colour is 'None'
     }
 
-    Color colour = AlignmentUtils.getSecondaryStructureAnnotationColour(symbol);
-        
+   Color colour = AlignmentUtils.getSecondaryStructureAnnotationColour(symbol);
+
     /*
      * apply PID threshold and consensus fading if in force
      */
     if (!Comparison.isGap(symbol))
     {
-      colour = adjustColour(symbol, position, colour);
+      colour = adjustColour(symbol, position, colour, true);
     }
 
     return colour;
@@ -342,9 +342,9 @@ public class ResidueShader implements ResidueShaderI
    * @param colour
    * @return
    */
-  protected Color adjustColour(char symbol, int column, Color colour)
+  protected Color adjustColour(char symbol, int column, Color colour, boolean isSecondaryStructure)
   {
-    if (!aboveThreshold(symbol, column))
+    if (!isSecondaryStructure && !aboveThreshold(symbol, column))
     {
       colour = Color.white;
     }