if (outputExt.equals("tdf")) {
TDFReader reader = TDFReader.getReader(fullout);
assertTrue(reader.getDatasetNames().size() > 0);
if (query) {
for (String name : reader.getDatasetNames()) {
TDFDataset ds = reader.getDataset(name);
List<TDFTile> tiles = ds.getTiles();
for (TDFTile tile : tiles) {
assertTrue(tile.getTileStart() >= start);
assertTrue(tile.getTileStart() < end);
}
}
}
} else {
File outFile = new File(fullout);
assertTrue(outFile.exists());
assertTrue(outFile.canRead());
ResourceLocator locator = new ResourceLocator(fullout);
WiggleDataset ds = (new WiggleParser(locator, IgvTools.loadGenome(hg18id))).parse();
//We miss a few alignments with this option sometimes,
//so it doesn't total up the same
if (!opt.contains("strands=first")) {
float[] linetotals = getLineTotals(fullout);
rowTotals.put(opt, linetotals);
}
if (query) {
assertEquals(1, ds.getChromosomes().length);
assertEquals(chr, ds.getChromosomes()[0]);
int[] starts = ds.getStartLocations(chr);
for (Integer act_start : starts) {
assertTrue(act_start + " is outside range", act_start >= start - winsize && act_start < end + winsize);
}
}
}