JAL-2055 prototype alternate feature colouring based on
[jalview.git] / src / jalview / analysis / AlignmentUtils.java
index 42a1201..2090207 100644 (file)
@@ -1529,6 +1529,8 @@ public class AlignmentUtils
   public static int transferFeatures(SequenceI fromSeq, SequenceI toSeq,
           MapList mapping, String select, String... omitting)
   {
+    Map<String, Integer> featureCounts = new HashMap<String, Integer>();
+
     SequenceI copyTo = toSeq;
     while (copyTo.getDatasetSequence() != null)
     {
@@ -1601,6 +1603,11 @@ public class AlignmentUtils
           copy.setBegin(Math.min(mappedTo[0], mappedTo[1]));
           copy.setEnd(Math.max(mappedTo[0], mappedTo[1]));
           copyTo.addSequenceFeature(copy);
+          int featureNumber = featureCounts.containsKey(type) ? featureCounts
+                  .get(type) : -1;
+          featureNumber++;
+          featureCounts.put(type, featureNumber);
+          copy.setFeatureNumber(featureNumber);
           count++;
         }
       }