public void splitIndex(String name, String seq) { int start = 0; boolean go = true; while (go) { int end = start + numberOfBases; if (end >= seq.length()) { end = seq.length(); go = false; } String subSeq = seq.substring(start, end); File binarySeq = new File(indexDirectory, name + "_" + start + "-" + (end - 1)); if (binarySeq.exists()) { System.out.println("WARNING, " + binarySeq + " already exists, skipping!"); return; } Seq.writeBinarySequence(subSeq, binarySeq); start = end; } }