Fix PaSiMap on selected sequences
authorMorellThomas <morellth@yahoo.co.jp>
Wed, 6 Mar 2024 14:29:15 +0000 (15:29 +0100)
committerMorellThomas <morellth@yahoo.co.jp>
Wed, 6 Mar 2024 14:29:15 +0000 (15:29 +0100)
src/jalview/analysis/Connectivity.java

index 0f849e3..a9cd46c 100644 (file)
@@ -45,7 +45,14 @@ public class Connectivity
    */
   public static Hashtable<SequenceI, Integer> getConnectivity(AlignmentViewport av, float[][] scores, byte dim) throws RuntimeException
   {
-    SequenceI[] sequences = av.getAlignment().getSequencesArray();
+    boolean isSelection = av.getSelectionGroup() != null && av.getSelectionGroup().getSize() > 0;
+    SequenceI[] sequences;
+    if (isSelection)
+    {
+      sequences = (SequenceI[]) av.getAlignmentView(isSelection).getAlignmentAndHiddenColumns(av.getGapCharacter())[0];
+    } else {
+      sequences = av.getAlignment().getSequencesArray();
+    }
 
     Hashtable<SequenceI, Integer> connectivity = new Hashtable<SequenceI, Integer>();
     // for each unique connection