(JAL-885,JAL-580) structure consensus should only be calculated for valid RNA structu...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 28 Oct 2011 14:45:53 +0000 (15:45 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 28 Oct 2011 14:45:53 +0000 (15:45 +0100)
src/jalview/workers/StrucConsensusThread.java

index eda64b5..9143ad7 100644 (file)
@@ -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);