JAL-4386 - Implementation of retrieving secondary structure
[jalview.git] / src / jalview / analysis / scoremodels / SecondaryStructureDistanceModel.java
index 5b0f242..6cce5b4 100644 (file)
@@ -218,18 +218,20 @@ public class SecondaryStructureDistanceModel extends DistanceScoreModel
             if(!gap1 && !undefinedSS1) {  
               //fetch the position in sequence for the column and finds the
               //corresponding secondary structure annotation
-              //TO DO - consider based on priority
+              //TO DO - consider based on priority and displayed
               int seqPosition = seqs[i].findPosition(cpos);
               AlignmentAnnotation[] aa = seqs[i].getRefSeq().getAnnotation(selectedSSSource);
+              if(aa!=null)
               ss1 = 
-                  AlignmentUtils.findSSAnnotationForGivenSeqposition(aa, seqPosition);              
+                  AlignmentUtils.findSSAnnotationForGivenSeqposition(aa[0], seqPosition);              
             }
             
             if(!gap2 && !undefinedSS2) {              
               int seqPosition = seqs[j].findPosition(cpos);
               AlignmentAnnotation[] aa = seqs[j].getRefSeq().getAnnotation(selectedSSSource);
-              ss2 = 
-                  AlignmentUtils.findSSAnnotationForGivenSeqposition(aa, seqPosition);               
+              if(aa!=null)
+                ss2 = 
+                  AlignmentUtils.findSSAnnotationForGivenSeqposition(aa[0], seqPosition);               
             }           
 
             if ((!gap1 && !gap2) || params.includeGaps())