JAL-4392 Consensus secondary structure: Display Secondary structure consensus for...
[jalview.git] / src / jalview / analysis / AlignmentUtils.java
index be5133f..0772d54 100644 (file)
@@ -37,6 +37,7 @@ import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
+import jalview.api.AlignCalcWorkerI;
 import jalview.bin.Console;
 import jalview.commands.RemoveGapColCommand;
 import jalview.datamodel.AlignedCodon;
@@ -55,6 +56,7 @@ import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.features.SequenceFeatures;
+import jalview.gui.AlignmentPanel;
 import jalview.io.gff.SequenceOntologyI;
 import jalview.schemes.ResidueProperties;
 import jalview.util.Comparison;
@@ -62,6 +64,7 @@ import jalview.util.DBRefUtils;
 import jalview.util.IntRangeComparator;
 import jalview.util.MapList;
 import jalview.util.MappingUtils;
+import jalview.workers.SecondaryStructureConsensusThread;
 
 /**
  * grab bag of useful alignment manipulation operations Expect these to be
@@ -74,7 +77,9 @@ public class AlignmentUtils
 {
   private static final int CODON_LENGTH = 3;
 
-  private static final String SEQUENCE_VARIANT = "sequence_variant:";
+  private static final String SEQUENCE_VARIANT = "sequence_variant:";  
+
+  private static final String SS_ANNOTATION_LABEL = "Secondary Structure";
 
   /*
    * the 'id' attribute is provided for variant features fetched from
@@ -1532,6 +1537,21 @@ public class AlignmentUtils
       }
     }
   }
+  
+  
+  public static boolean isSSAnnotationPresent( Map<SequenceI, List<AlignmentAnnotation>> annotations) {
+    
+    for (SequenceI seq : annotations.keySet())
+    {
+      for (AlignmentAnnotation ann : annotations.get(seq))
+      {
+        if(ann.getDescription(false).startsWith(SS_ANNOTATION_LABEL)) {                    
+          return true;
+        }       
+      }
+    }
+    return false;
+  }
 
   /**
    * Make a copy of a reference annotation {@code ann} and add it to an