X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fworkers%2FConsensusThread.java;h=f5cad71c11579ca7b436a1c49e5ac01e4176fd86;hb=bfdbaf7f1a8c1e4cad9af35075ffbe55f7f5683e;hp=d6a4488ad25a637db7c9e8271f47929609ba2ba2;hpb=4389a166735bf1203894abdf3cf7dd57c4856dbc;p=jalview.git diff --git a/src/jalview/workers/ConsensusThread.java b/src/jalview/workers/ConsensusThread.java index d6a4488..f5cad71 100644 --- a/src/jalview/workers/ConsensusThread.java +++ b/src/jalview/workers/ConsensusThread.java @@ -50,7 +50,7 @@ public class ConsensusThread extends AlignCalcWorker try { AlignmentAnnotation consensus = getConsensusAnnotation(); - AlignmentAnnotation gap = getOccupancyAnnotation(); + AlignmentAnnotation gap = getGapAnnotation(); if ((consensus == null && gap == null) || calcMan.isPending(this)) { calcMan.workerComplete(this); @@ -118,8 +118,11 @@ public class ConsensusThread extends AlignCalcWorker protected void eraseConsensus(int aWidth) { AlignmentAnnotation consensus = getConsensusAnnotation(); - consensus.annotations = new Annotation[aWidth]; - AlignmentAnnotation gap = getOccupancyAnnotation(); + if (consensus != null) + { + consensus.annotations = new Annotation[aWidth]; + } + AlignmentAnnotation gap = getGapAnnotation(); if (gap != null) { gap.annotations = new Annotation[aWidth]; @@ -137,7 +140,7 @@ public class ConsensusThread extends AlignCalcWorker ProfilesI hconsensus = AAFrequency.calculate(aseqs, width, 0, width, true); - alignViewport.setConsensusProfiles(hconsensus); + alignViewport.setSequenceConsensusHash(hconsensus); setColourSchemeConsensus(hconsensus); } @@ -176,9 +179,9 @@ public class ConsensusThread extends AlignCalcWorker * * @return */ - protected AlignmentAnnotation getOccupancyAnnotation() + protected AlignmentAnnotation getGapAnnotation() { - return alignViewport.getOccupancyAnnotation(); + return alignViewport.getAlignmentGapAnnotation(); } /** @@ -199,10 +202,10 @@ public class ConsensusThread extends AlignCalcWorker && hconsensus != null) { deriveConsensus(consensus, hconsensus); - AlignmentAnnotation occupancy = getOccupancyAnnotation(); - if (occupancy != null) + AlignmentAnnotation gap = getGapAnnotation(); + if (gap != null) { - deriveOccupancy(occupancy, hconsensus); + deriveOccupancy(gap, hconsensus); } } } @@ -234,11 +237,11 @@ public class ConsensusThread extends AlignCalcWorker * @param hconsensus * the computed consensus data */ - protected void deriveOccupancy(AlignmentAnnotation gapAnnotation, + protected void deriveGap(AlignmentAnnotation gapAnnotation, ProfilesI hconsensus) { long nseq = getSequences().length; - AAFrequency.completeOccupancyAnnot(gapAnnotation, hconsensus, + AAFrequency.completeGapAnnot(gapAnnotation, hconsensus, hconsensus.getStartColumn(), hconsensus.getEndColumn() + 1, nseq); } @@ -251,6 +254,6 @@ public class ConsensusThread extends AlignCalcWorker protected Object getViewportConsensus() { // TODO convert ComplementConsensusThread to use Profile - return alignViewport.getConsensusProfiles(); + return alignViewport.getSequenceConsensusHash(); } }