JAL-1705 include dummy sequences in returned alignment
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 21 Jan 2016 15:17:12 +0000 (15:17 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 21 Jan 2016 15:17:12 +0000 (15:17 +0000)
src/jalview/io/FeaturesFile.java

index 22b0601..2d91a08 100755 (executable)
@@ -271,6 +271,17 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI
       return false;
     }
 
+    /*
+     * experimental - add any dummy sequences with features to the alignment
+     * - we need them for Ensembl feature extraction - though maybe not otherwise
+     */
+    for (SequenceI newseq : newseqs)
+    {
+      if (newseq.getSequenceFeatures() != null)
+      {
+        align.addSequence(newseq);
+      }
+    }
     return true;
   }
 
@@ -1319,6 +1330,11 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI
          * replace parsed sequence with the realised forward reference
          */
         includedseqs.set(p, dummyseq);
+
+        /*
+         * and remove from the newseqs list
+         */
+        newseqs.remove(dummyseq);
       }
     }