+ /**\r
+ * Add gaps into the sequences aligned to profileseq under the given\r
+ * AlignmentView\r
+ * \r
+ * @param profileseq\r
+ * @param al - alignment to have gaps inserted into it\r
+ * @param input - alignment view where sequence corresponding to profileseq is first entry\r
+ * @return new Column selection for new alignment view, with insertions into profileseq marked as hidden.\r
+ */\r
+ public static ColumnSelection propagateInsertions(SequenceI profileseq,\r
+ Alignment al, AlignmentView input)\r
+ {\r
+ int profsqpos=0;\r
+ \r
+// return propagateInsertions(profileseq, al, )\r
+ char gc = al.getGapCharacter();\r
+ Object[] alandcolsel = input.getAlignmentAndColumnSelection(gc);\r
+ ColumnSelection nview = (ColumnSelection) alandcolsel[1];\r
+ SequenceI origseq = ((SequenceI[]) alandcolsel[0])[profsqpos];\r
+ nview.propagateInsertions(profileseq,\r
+ al, origseq);\r
+ return nview;\r
+ }\r
+ /**\r
+ * \r
+ * @param profileseq - sequence in al which corresponds to origseq \r
+ * @param al - alignment which is to have gaps inserted into it\r
+ * @param origseq - sequence corresponding to profileseq which defines gap map for modifying al\r
+ */\r
+ public void propagateInsertions(SequenceI profileseq, AlignmentI al, SequenceI origseq)\r
+ {\r
+ char gc = al.getGapCharacter();\r
+ // recover mapping between sequence's non-gap positions and positions \r
+ // mapping to view.\r
+ pruneDeletions(ShiftList\r
+ .parseMap(origseq\r
+ .gapMap())); \r
+ int[] viscontigs = getVisibleContigs(0, profileseq.getLength());\r
+ int spos = 0;\r
+ int offset = 0;\r
+ // input.pruneDeletions(ShiftList.parseMap(((SequenceI[])\r
+ // alandcolsel[0])[0].gapMap()))\r
+ // add profile to visible contigs\r
+ for (int v = 0; v < viscontigs.length; v += 2)\r