@Override public List<Block> getBlocks(final String chr, final int start, final int end) { return getChrIndex(chr).getBlocks(start, end); }
@Override public void write(final LittleEndianOutputStream stream) throws IOException { writeHeader(stream); //# of chromosomes stream.writeInt(chrIndices.size()); for (final ChrIndex chrIdx : chrIndices.values()) { chrIdx.write(stream); } }
public void read(final LittleEndianInputStream dis) throws IOException { try { readHeader(dis); int nChromosomes = dis.readInt(); chrIndices = new LinkedHashMap<String, ChrIndex>(nChromosomes); while (nChromosomes-- > 0) { final ChrIndex chrIdx = (ChrIndex) getChrIndexClass().newInstance(); chrIdx.read(dis); chrIndices.put(chrIdx.getName(), chrIdx); } } catch (final InstantiationException e) { throw new TribbleException.UnableToCreateCorrectIndexType("Unable to create class " + getChrIndexClass(), e); } catch (final IllegalAccessException e) { throw new TribbleException.UnableToCreateCorrectIndexType("Unable to create class " + getChrIndexClass(), e); } finally { dis.close(); } //printIndexInfo(); }
public void read(final LittleEndianInputStream dis) throws IOException { try { readHeader(dis); int nChromosomes = dis.readInt(); chrIndices = new LinkedHashMap<String, ChrIndex>(nChromosomes); while (nChromosomes-- > 0) { final ChrIndex chrIdx = (ChrIndex) getChrIndexClass().newInstance(); chrIdx.read(dis); chrIndices.put(chrIdx.getName(), chrIdx); } } catch (final InstantiationException e) { throw new TribbleException.UnableToCreateCorrectIndexType("Unable to create class " + getChrIndexClass(), e); } catch (final IllegalAccessException e) { throw new TribbleException.UnableToCreateCorrectIndexType("Unable to create class " + getChrIndexClass(), e); } finally { dis.close(); } //printIndexInfo(); }
public void read(final LittleEndianInputStream dis) throws IOException { try { readHeader(dis); int nChromosomes = dis.readInt(); chrIndices = new LinkedHashMap<String, ChrIndex>(nChromosomes); while (nChromosomes-- > 0) { final ChrIndex chrIdx = (ChrIndex) getChrIndexClass().newInstance(); chrIdx.read(dis); chrIndices.put(chrIdx.getName(), chrIdx); } } catch (final InstantiationException e) { throw new TribbleException.UnableToCreateCorrectIndexType("Unable to create class " + getChrIndexClass(), e); } catch (final IllegalAccessException e) { throw new TribbleException.UnableToCreateCorrectIndexType("Unable to create class " + getChrIndexClass(), e); } finally { dis.close(); } //printIndexInfo(); }
@Override public List<Block> getBlocks(final String chr, final int start, final int end) { return getChrIndex(chr).getBlocks(start, end); }
@Override public void write(final LittleEndianOutputStream stream) throws IOException { writeHeader(stream); //# of chromosomes stream.writeInt(chrIndices.size()); for (final ChrIndex chrIdx : chrIndices.values()) { chrIdx.write(stream); } }
public List<Block> getBlocks(final String chr, final int start, final int end) { return getChrIndex(chr).getBlocks(start, end); }
public void write(final LittleEndianOutputStream stream) throws IOException { writeHeader(stream); //# of chromosomes stream.writeInt(chrIndices.size()); for (final ChrIndex chrIdx : chrIndices.values()) { chrIdx.write(stream); } }
public List<Block> getBlocks(final String chr) { return getChrIndex(chr).getBlocks(); }
public List<Block> getBlocks(final String chr) { return getChrIndex(chr).getBlocks(); }
public List<Block> getBlocks(final String chr) { return getChrIndex(chr).getBlocks(); }
protected BlockStats getBlockStats(final boolean logDetails) { final BlockStats stats = new BlockStats(); for (final Map.Entry<String, ChrIndex> elt : chrIndices.entrySet()) { final List<Block> blocks = elt.getValue().getBlocks(); if (blocks != null) { final int nBlocks = blocks.size(); int nEmptyBlocks = 0; for (final Block b : elt.getValue().getBlocks()) { if (b.getSize() == 0) nEmptyBlocks++; } stats.empty += nEmptyBlocks; stats.total += nBlocks; if (logDetails) System.out.println(String.format(" %s => %d blocks, %d empty, %.2f", elt.getKey(), nBlocks, nEmptyBlocks, (100.0 * nEmptyBlocks) / nBlocks)); } } return stats; }
protected BlockStats getBlockStats(final boolean logDetails) { final BlockStats stats = new BlockStats(); for (final Map.Entry<String, ChrIndex> elt : chrIndices.entrySet()) { final List<Block> blocks = elt.getValue().getBlocks(); if (blocks != null) { final int nBlocks = blocks.size(); int nEmptyBlocks = 0; for (final Block b : elt.getValue().getBlocks()) { if (b.getSize() == 0) nEmptyBlocks++; } stats.empty += nEmptyBlocks; stats.total += nBlocks; if (logDetails) System.out.println(String.format(" %s => %d blocks, %d empty, %.2f", elt.getKey(), nBlocks, nEmptyBlocks, (100.0 * nEmptyBlocks) / nBlocks)); } } return stats; }
protected BlockStats getBlockStats(final boolean logDetails) { final BlockStats stats = new BlockStats(); for (final Map.Entry<String, ChrIndex> elt : chrIndices.entrySet()) { final List<Block> blocks = elt.getValue().getBlocks(); if (blocks != null) { final int nBlocks = blocks.size(); int nEmptyBlocks = 0; for (final Block b : elt.getValue().getBlocks()) { if (b.getSize() == 0) nEmptyBlocks++; } stats.empty += nEmptyBlocks; stats.total += nBlocks; if (logDetails) System.out.println(String.format(" %s => %d blocks, %d empty, %.2f", elt.getKey(), nBlocks, nEmptyBlocks, (100.0 * nEmptyBlocks) / nBlocks)); } } return stats; }