/** Inserts tag count values into the RandomAccessFile created by @link{createMergeOutfile}. */ public static final void fillMergeOutfile(String[] infiles, String outfile) { TagsByTaxa tbtOut = newTBT(outfile); tbtOut.setMethodByRows(true); int count = 0; int filesRead = 0; for (String inName : infiles) { filesRead++; myLogger.info("Scanning " + inName + " (file " + filesRead + " of " + infiles.length + ")."); TagsByTaxa tbtFM = newTBT(inName); if (combineSynonymousTaxa) { tbtFM.truncateTaxonNames(); } int[] theTR = taxaRedirect(tbtFM.getTaxaNames(), tbtOut.getTaxaNames()); for (int i = 0; i < tbtFM.getTagCount(); i++) { int toTag = tbtOut.getTagIndex(tbtFM.getTag(i)); if (toTag < 0) { continue; } for (int t = 0; t < tbtFM.getTaxaCount(); t++) { if (theTR[t] < 0) { continue; } int tagCount = tbtOut.getReadCountForTagTaxon(toTag, theTR[t]) + tbtFM.getReadCountForTagTaxon(i, t); if (tagCount > 0) { tbtOut.setReadCountForTagTaxon(toTag, theTR[t], tagCount); count++; } } if (count % 100000 == 0) { System.out.printf("Tag:%d BitSet:%d %n", i, count); } } } tbtOut.getFileReadyForClosing(); }