From 471a99eebdcb33c3a977abc3e2fb228286590fc3 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 28 Oct 2011 15:45:53 +0100 Subject: [PATCH] (JAL-885,JAL-580) structure consensus should only be calculated for valid RNA structure annotation --- src/jalview/workers/StrucConsensusThread.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/jalview/workers/StrucConsensusThread.java b/src/jalview/workers/StrucConsensusThread.java index eda64b5..9143ad7 100644 --- a/src/jalview/workers/StrucConsensusThread.java +++ b/src/jalview/workers/StrucConsensusThread.java @@ -61,6 +61,7 @@ public class StrucConsensusThread extends AlignCalcWorker implements AlignCalcWo AlignmentAnnotation[] aa = alignViewport.getAlignment() .getAlignmentAnnotation(); AlignmentAnnotation rnaStruc = null; + // select rna struct to use for calculation for (int i = 0; i < aa.length; i++) { if (aa[i].getRNAStruc() != null) @@ -69,7 +70,14 @@ public class StrucConsensusThread extends AlignCalcWorker implements AlignCalcWo break; } } - + // check to see if its valid + + if (rnaStruc==null || !rnaStruc.isValidStruc()) + { + calcMan.workerComplete(this); + return; + } + jalview.analysis.StructureFrequency.calculate(alignment.getSequencesArray(), 0, alignment.getWidth(), hStrucConsensus, true, rnaStruc); alignViewport.setRnaStructureConsensusHash(hStrucConsensus); -- 1.7.10.2