X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAAFrequency.java;h=7e77b0fb8985a61fa965fd097df14beab3e5a0fd;hb=3f734555193e56f46b07d5bc12df77d26e180ec0;hp=375504d8c8c2e9306f0895a92a7bab4f0f9b5885;hpb=75893911f6680a41bc4f1e5a3c6db5957263dec4;p=jalview.git diff --git a/src/jalview/analysis/AAFrequency.java b/src/jalview/analysis/AAFrequency.java index 375504d..7e77b0f 100755 --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@ -219,33 +219,40 @@ public class AAFrequency } for (int i = iStart; i < width; i++) { - if (i >= hconsensus.length) + Hashtable hci; + if (i >= hconsensus.length || ((hci=hconsensus[i])==null)) { // happens if sequences calculated over were shorter than alignment // width consensus.annotations[i] = null; continue; } + value = 0; + Float fv; if (ignoreGapsInConsensusCalculation) { - value = ((Float) hconsensus[i].get(AAFrequency.PID_NOGAPS)) - .floatValue(); + fv = (Float) hci.get(AAFrequency.PID_NOGAPS); } else { - value = ((Float) hconsensus[i].get(AAFrequency.PID_GAPS)) - .floatValue(); + fv = (Float) hci.get(AAFrequency.PID_GAPS); } - - String maxRes = hconsensus[i].get(AAFrequency.MAXRESIDUE).toString(); - String mouseOver = hconsensus[i].get(AAFrequency.MAXRESIDUE) + " "; + if (fv==null) + { + consensus.annotations[i] = null; + // data has changed below us .. give up and + continue; + } + value = fv.floatValue(); + String maxRes = hci.get(AAFrequency.MAXRESIDUE).toString(); + String mouseOver = hci.get(AAFrequency.MAXRESIDUE) + " "; if (maxRes.length() > 1) { mouseOver = "[" + maxRes + "] "; maxRes = "+"; } - int[][] profile = (int[][]) hconsensus[i].get(AAFrequency.PROFILE); + int[][] profile = (int[][]) hci.get(AAFrequency.PROFILE); if (profile != null && includeAllConsSymbols) { mouseOver = "";