X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAAFrequency.java;h=16754a18bbe5e71ca1eb0680b17fc0943f847cd5;hb=be415b56e8ce1bc00f5004c64793ce5d0cb17be8;hp=8fd60c4eaca193dfad670d8426fed3f26733c6ec;hpb=9d31636d87ba5d3243625a1e1b77db45d4fc9584;p=jalview.git diff --git a/src/jalview/analysis/AAFrequency.java b/src/jalview/analysis/AAFrequency.java index 8fd60c4..16754a1 100755 --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. @@ -85,6 +85,7 @@ public class AAFrequency public static final void calculate(SequenceI[] sequences, int start, int end, Hashtable[] result, boolean profile) { + System.out.println("AAFrequence.calculate"); Hashtable residueHash; int maxCount, nongap, i, j, v, jSize = sequences.length; String maxResidue; @@ -105,6 +106,11 @@ public class AAFrequency for (j = 0; j < jSize; j++) { + if (sequences[j]==null) + { + System.err.println("WARNING: Consensus skipping null sequence - possible race condition."); + continue; + } seq = sequences[j].getSequence(); if (seq.length > i) { @@ -204,16 +210,20 @@ public class AAFrequency boolean includeAllConsSymbols, char[] alphabet) { float tval, value; - if (consensus==null || consensus.annotations==null || consensus.annotations.length=hconsensus.length) { - // happens if sequences calculated over were shorter than alignment width - consensus.annotations[i]=null; + if (i >= hconsensus.length) + { + // happens if sequences calculated over were shorter than alignment + // width + consensus.annotations[i] = null; continue; } value = 0;