X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FConservation.java;h=5bb0b0946b9e2a25a441194bd7befed66b3574e4;hb=9d465da4f21e403c20b835264929906b538c0c9b;hp=279d3096b92dcd8a5919b6951ecf91cfef092a74;hpb=44028f5aa2642bf4be383d7ca48d2551d8a1a536;p=jalview.git diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index 279d309..5bb0b09 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -20,6 +20,8 @@ */ package jalview.analysis; +import java.util.Locale; + import jalview.analysis.scoremodels.ScoreMatrix; import jalview.analysis.scoremodels.ScoreModels; import jalview.datamodel.AlignmentAnnotation; @@ -241,13 +243,13 @@ public class Conservation } else { - System.out.println("SEQUENCE HAS BEEN DELETED!!!"); + jalview.bin.Console.outPrintln("SEQUENCE HAS BEEN DELETED!!!"); } } else { // JBPNote INFO level debug - System.err.println( + jalview.bin.Console.errPrintln( "ERROR: calcSeqNum called with out of range sequence index for Alignment\n"); } } @@ -312,7 +314,7 @@ public class Conservation protected static void recordConservation(Map resultMap, String res) { - res = res.toUpperCase(); + res = res.toUpperCase(Locale.ROOT); for (Entry> property : ResidueProperties.propHash .entrySet()) { @@ -698,7 +700,7 @@ public class Conservation max = Math.max(max, bigtot); - quality.addElement(new Double(bigtot)); + quality.addElement(Double.valueOf(bigtot)); } double newmax = -Double.MAX_VALUE; @@ -709,8 +711,8 @@ public class Conservation // tmp = ((max - tmp) * (size - cons2[j][23])) / size; tmp = ((max - tmp) * (size - cons2GapCounts[j])) / size; - // System.out.println(tmp+ " " + j); - quality.setElementAt(new Double(tmp), j); + // jalview.bin.Console.outPrintln(tmp+ " " + j); + quality.setElementAt(Double.valueOf(tmp), j); if (tmp > newmax) { @@ -724,8 +726,8 @@ public class Conservation /** * Complete the given consensus and quuality annotation rows. Note: currently - * this method will enlarge the given annotation row if it is too small, - * otherwise will leave its length unchanged. + * this method will reallocate the given annotation row if it is different to + * the calculated width, otherwise will leave its length unchanged. * * @param conservation * conservation annotation row @@ -757,7 +759,7 @@ public class Conservation float qmax = 0f; if (conservation != null && conservation.annotations != null - && conservation.annotations.length < alWidth) + && conservation.annotations.length != alWidth) { conservation.annotations = new Annotation[alWidth]; } @@ -766,7 +768,7 @@ public class Conservation { quality2.graphMax = (float) qualityMaximum; if (quality2.annotations != null - && quality2.annotations.length < alWidth) + && quality2.annotations.length != alWidth) { quality2.annotations = new Annotation[alWidth]; } @@ -812,8 +814,8 @@ public class Conservation float vprop = value - qmin; vprop /= qmax; String description = FORMAT_3DP.form(value); - quality2.annotations[i] = new Annotation(" ", description, - ' ', value, new Color(minR + (maxR * vprop), + quality2.annotations[i] = new Annotation(" ", description, ' ', + value, new Color(minR + (maxR * vprop), minG + (maxG * vprop), minB + (maxB * vprop))); } }