public List<TDFTile> getTiles() { List<TDFTile> tiles = new ArrayList<TDFTile>(); for (int t = 0; t < nTiles; t++) { TDFTile tile = getTile(t); if (tile != null) { tiles.add(tile); } } return tiles; }
public List<TDFTile> getTiles(int startLocation, int endLocation) { List<TDFTile> tiles = new ArrayList(); int startTile = (int) (startLocation / tileWidth); int endTile = (int) (endLocation / tileWidth); for (int t = startTile; t <= endTile; t++) { TDFTile tile = getTile(t); if (tile != null && tile.getSize() > 0) { tiles.add(tile); } } return tiles; }
public List<TDFTile> getTiles(int startLocation, int endLocation) { List<TDFTile> tiles = new ArrayList(); int startTile = (int) (startLocation / tileWidth); int endTile = (int) (endLocation / tileWidth); for (int t = startTile; t <= endTile; t++) { TDFTile tile = getTile(t); if (tile != null && tile.getSize() > 0) { tiles.add(tile); } } return tiles; }
public static void dumpAllTiles(String ibfFile) { TDFReader reader = TDFReader.getReader(ibfFile); System.out.println("DATASETS"); for (String dsName : reader.getDatasetNames()) { System.out.println(dsName); TDFDataset ds = reader.getDataset(dsName); for (int i = 0; i < ds.nTiles; i++) { TDFTile tile = ds.getTile(i); if (tile != null) { System.out.println("Tile: " + i); dumpTileData(reader, "", tile, System.out); } } } }
public static void tdfToBedgraph(String tdfFile, String bedGraphFile) throws FileNotFoundException { TDFReader reader = null; PrintStream ps = null; try { reader = TDFReader.getReader(tdfFile); ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(bedGraphFile))); String trackLine = reader.getTrackLine(); if (trackLine != null && trackLine.length() > 0) { ps.println(trackLine); } for (String dsName : reader.getDatasetNames()) { String[] tokens = dsName.split("/"); String chrName = tokens[1]; if (!chrName.equals(Globals.CHR_ALL) && dsName.contains("raw")) { TDFDataset ds = reader.getDataset(dsName); for (int i = 0; i < ds.nTiles; i++) { TDFTile tile = ds.getTile(i); if (tile != null) { dumpTileData(reader, chrName, tile, ps); } } } } } finally { if (reader != null) reader.close(); if (ps != null) ps.close(); } }