JAL-2490 only count sequences where feature overlap is confirmed
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 19 May 2017 07:38:35 +0000 (08:38 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 19 May 2017 07:38:35 +0000 (08:38 +0100)
src/jalview/controller/AlignViewController.java

index 84036ab..d1d61d2 100644 (file)
@@ -244,10 +244,7 @@ public class AlignViewController implements AlignViewControllerI
         int iend = sq.findPosition(sqcol.getEndRes()); // see JAL-2526
         List<SequenceFeature> sfs = sq.getFeatures().findFeatures(ist,
                 iend, featureType);
-        if (!sfs.isEmpty())
-        {
-          nseq++;
-        }
+        boolean overlap = false;
         for (SequenceFeature sf : sfs)
         {
           // future functionality - featureType == null means mark columns
@@ -266,10 +263,12 @@ public class AlignViewController implements AlignViewControllerI
               if (sfStartCol >= startPosition && sfStartCol <= endPosition)
               {
                 bs.set(sfStartCol - 1);
+                overlap = true;
               }
               if (sfEndCol >= startPosition && sfEndCol <= endPosition)
               {
                 bs.set(sfEndCol - 1);
+                overlap = true;
               }
               continue;
             }
@@ -293,9 +292,14 @@ public class AlignViewController implements AlignViewControllerI
             for (; sfStartCol <= sfEndCol; sfStartCol++)
             {
               bs.set(sfStartCol - 1); // convert to base 0
+              overlap = true;
             }
           }
         }
+        if (overlap)
+        {
+          nseq++;
+        }
       }
     }
     return nseq;