From ac07859006686a2c62bcf57b24742eb610bc46f0 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 14 Apr 2005 14:43:25 +0000 Subject: [PATCH] consistent percentage gaps filter for conservation calculation. --- src/jalview/gui/AlignFrame.java | 4 ++-- src/jalview/gui/AlignViewport.java | 11 ++++++----- src/jalview/gui/AlignmentPanel.java | 2 +- src/jalview/gui/PopupMenu.java | 2 +- src/jalview/gui/TreeCanvas.java | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3048b2c..c1a7105 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -783,7 +783,7 @@ public class AlignFrame extends GAlignFrame sg.sequences, sg.getStartRes(), sg.getEndRes()); c.calculate(); - c.verdict(false, 100); + c.verdict(false, viewport.ConsPercGaps); ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs); sg.cs = ccs; @@ -827,7 +827,7 @@ if ( viewport.getConservationSelected() ) al.getWidth()); c.calculate(); - c.verdict(false, 100); + c.verdict(false, viewport.ConsPercGaps); ccs = new ConservationColourScheme(c, cs); diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 5535dbb..89aac5c 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -79,15 +79,16 @@ public class AlignViewport AlignmentAnnotation conservation; AlignmentAnnotation quality; + public int ConsPercGaps = 25; // JBPNote : This should be a scalable property! + public void updateConservation() { - int percGaps = 100; // JBPNote : This should be a scalable property! Conservation cons = new jalview.analysis.Conservation("All", jalview.schemes.ResidueProperties.propHash, 1, alignment.getSequences(), 0, alignment.getWidth()); cons.calculate(); - cons.verdict(false, percGaps); + cons.verdict(false, ConsPercGaps); cons.findQuality(); int alWidth = alignment.getWidth(); Annotation [] annotations = new Annotation[alWidth]; @@ -123,14 +124,14 @@ public class AlignViewport value = ((Double) cons.quality.get(i)).floatValue(); vprop = value - qmin; vprop/=qmax; - qannotations[i] = new Annotation(sequence.charAt(i) + "", - new String().valueOf(value), ' ', value, new Color(minR+maxR*vprop, minG+maxG*vprop, minB+maxB*vprop)); + qannotations[i] = new Annotation(" ", + String.valueOf(value), ' ', value, new Color(minR+maxR*vprop, minG+maxG*vprop, minB+maxB*vprop)); } if(conservation==null) { conservation = new AlignmentAnnotation("Conservation", - "Conservation of total alignment less than "+percGaps+"% gaps", + "Conservation of total alignment less than "+ConsPercGaps+"% gaps", annotations, 0f, // cons.qualityRange[0].floatValue(), 11f, // cons.qualityRange[1].floatValue() diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index e0a1cac..0cbdfbe 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -248,7 +248,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene al.getWidth() ); c.calculate(); - c.verdict(false, 100); + c.verdict(false, av.ConsPercGaps); ConservationColourScheme ccs = new ConservationColourScheme(c, cs); av.setGlobalColourScheme( ccs ); diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 8d747c2..8d505ea 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -458,7 +458,7 @@ else // remove PIDColouring ap.av.alignment.getWidth()); c.calculate(); - c.verdict(false, 100); + c.verdict(false, ap.av.ConsPercGaps); ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs); diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index e4d695d..600683f 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -447,7 +447,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, Print sg.getEndRes()); c.calculate(); - c.verdict(false, 100); + c.verdict(false, av.ConsPercGaps); ccs = new ConservationColourScheme(c, ccs.cs); sg.cs = ccs; -- 1.7.10.2