From: Renia Correya Date: Fri, 30 Aug 2024 07:32:44 +0000 (+0530) Subject: JAL-4436 Colour by secondary structure conservation X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e340907f86006b014c2f28b8b2054fa908b594ad;p=jalview.git JAL-4436 Colour by secondary structure conservation Corrected the labels as secondary structure conservation increment. Added a check for secondary structure in Colour by Above identity threshold feature. --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 99f3388..156766f 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -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 diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index 5e1935d..0fad467 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -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()); + + } } /** diff --git a/src/jalview/renderer/ResidueShader.java b/src/jalview/renderer/ResidueShader.java index 0b191ec..91f38c5 100644 --- a/src/jalview/renderer/ResidueShader.java +++ b/src/jalview/renderer/ResidueShader.java @@ -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; }