public RPTree(SeekableStream fis, long fileOffset, boolean isLowToHigh, int uncompressBuffSize, boolean forceDescend) { // save the seekable file handle and B+ Tree file offset // Note: the offset is the file position just after the B+ Tree Header // mBBFis = fis; rpTreeOffset = fileOffset; this.uncompressBuffSize = uncompressBuffSize; this.isLowToHigh = isLowToHigh; // read in R+ tree header - verify the R+ tree info exits rpTreeHeader = new RPTreeHeader(fis, rpTreeOffset, isLowToHigh); // log error if header not found and throw exception if (!rpTreeHeader.isHeaderOK()) { int badMagic = rpTreeHeader.getMagic(); log.error("Error reading R+ tree header: bad magic = " + badMagic); throw new RuntimeException("Error reading R+ tree header: bad magic = " + badMagic); } // assigns R+ tree organization from the header order = rpTreeHeader.getBlockSize(); chromosomeBounds = new RPChromosomeRegion(rpTreeHeader.getStartChromID(), rpTreeHeader.getStartBase(), rpTreeHeader.getEndChromID(), rpTreeHeader.getEndBase()); // populate the tree - read in the nodes long nodeOffset = rpTreeOffset + rpTreeHeader.getHeaderSize(); RPTreeNode parentNode = null; // parent node of the root is itself, or null // start constructing the R+ tree - get the root node rootNode = readRPTreeNode(fis, nodeOffset, isLowToHigh, forceDescend); }
public RPTree(SeekableStream fis, long fileOffset, boolean isLowToHigh, int uncompressBuffSize, boolean forceDescend) { // save the seekable file handle and B+ Tree file offset // Note: the offset is the file position just after the B+ Tree Header // mBBFis = fis; rpTreeOffset = fileOffset; this.uncompressBuffSize = uncompressBuffSize; this.isLowToHigh = isLowToHigh; // read in R+ tree header - verify the R+ tree info exits rpTreeHeader = new RPTreeHeader(fis, rpTreeOffset, isLowToHigh); // log error if header not found and throw exception if (!rpTreeHeader.isHeaderOK()) { int badMagic = rpTreeHeader.getMagic(); log.error("Error reading R+ tree header: bad magic = " + badMagic); throw new RuntimeException("Error reading R+ tree header: bad magic = " + badMagic); } // assigns R+ tree organization from the header order = rpTreeHeader.getBlockSize(); chromosomeBounds = new RPChromosomeRegion(rpTreeHeader.getStartChromID(), rpTreeHeader.getStartBase(), rpTreeHeader.getEndChromID(), rpTreeHeader.getEndBase()); // populate the tree - read in the nodes long nodeOffset = rpTreeOffset + rpTreeHeader.getHeaderSize(); RPTreeNode parentNode = null; // parent node of the root is itself, or null // start constructing the R+ tree - get the root node rootNode = readRPTreeNode(fis, nodeOffset, isLowToHigh, forceDescend); }
public RPTree(SeekableStream fis, long fileOffset, boolean isLowToHigh, int uncompressBuffSize, boolean forceDescend) { // save the seekable file handle and B+ Tree file offset // Note: the offset is the file position just after the B+ Tree Header // mBBFis = fis; rpTreeOffset = fileOffset; this.uncompressBuffSize = uncompressBuffSize; this.isLowToHigh = isLowToHigh; // read in R+ tree header - verify the R+ tree info exits rpTreeHeader = new RPTreeHeader(fis, rpTreeOffset, isLowToHigh); // log error if header not found and throw exception if (!rpTreeHeader.isHeaderOK()) { int badMagic = rpTreeHeader.getMagic(); log.error("Error reading R+ tree header: bad magic = " + badMagic); throw new RuntimeException("Error reading R+ tree header: bad magic = " + badMagic); } // assigns R+ tree organization from the header order = rpTreeHeader.getBlockSize(); chromosomeBounds = new RPChromosomeRegion(rpTreeHeader.getStartChromID(), rpTreeHeader.getStartBase(), rpTreeHeader.getEndChromID(), rpTreeHeader.getEndBase()); // populate the tree - read in the nodes long nodeOffset = rpTreeOffset + rpTreeHeader.getHeaderSize(); RPTreeNode parentNode = null; // parent node of the root is itself, or null // start constructing the R+ tree - get the root node rootNode = readRPTreeNode(fis, nodeOffset, isLowToHigh, forceDescend); }