// TODO Auto-generated method stub\r
return firstCol;\r
}\r
+\r
+ /**\r
+ * compute a deletion map for the current view according to the given\r
+ * gap/match map\r
+ * \r
+ * @param gapMap (as returned from SequenceI.gapMap())\r
+ * @return int[] {intersection of visible regions with gapMap)\r
+ */\r
+ public int[] getVisibleContigMapFor(int[] gapMap)\r
+ {\r
+ int[] delMap = null;\r
+ int[] viscontigs = getVisibleContigs();\r
+ int spos = 0;\r
+ int i = 0;\r
+ if (viscontigs != null)\r
+ {\r
+ // viscontigs maps from a subset of the gapMap to the gapMap, so it will\r
+ // always be equal to or shorter than gapMap\r
+ delMap = new int[gapMap.length];\r
+ for (int contig = 0; contig < viscontigs.length; contig += 2)\r
+ {\r
+\r
+ while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])\r
+ {\r
+ spos++;\r
+ }\r
+ while (spos < gapMap.length\r
+ && gapMap[spos] <= viscontigs[contig + 1])\r
+ {\r
+ delMap[i++] = spos++;\r
+ }\r
+ }\r
+ int tmap[] = new int[i];\r
+ System.arraycopy(delMap, 0, tmap, 0, i);\r
+ delMap = tmap;\r
+ }\r
+ return delMap;\r
+ }\r
}\r
if (viewonly)
{
- int[] viscontigs = alview.getVisibleContigs();
- int spos = 0;
- int i = 0;
- if (viscontigs != null)
- {
- // Construct the delMap - mapping from the positions within the input to
- // Jnet to the contigs in the original sequence
-
- delMap = new int[seq.getEnd() - seq.getStart() + 1];
- int gapMap[] = seq.gapMap();
- for (int contig = 0; contig < viscontigs.length; contig += 2)
- {
-
- while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
- {
- spos++;
- }
- while (spos < gapMap.length
- && gapMap[spos] <= viscontigs[contig + 1])
- {
- delMap[i++] = spos++;
- }
- }
- int tmap[] = new int[i];
- System.arraycopy(delMap, 0, tmap, 0, i);
- delMap = tmap;
- }
+ delMap = alview.getVisibleContigMapFor(seq.gapMap());
}
if (msa && msf.length > 1)
{