Class BBFileReader


  • public class BBFileReader
    extends java.lang.Object
    • Constructor Detail

      • BBFileReader

        public BBFileReader​(java.lang.String path)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • BBFileReader

        public BBFileReader​(java.lang.String path,
                            SeekableStream stream)
    • Method Detail

      • getBBFilePath

        public java.lang.String getBBFilePath()
      • isBigBedFile

        public boolean isBigBedFile()
      • isBigWigFile

        public boolean isBigWigFile()
      • getDataCount

        public int getDataCount()
      • getChromosomeNameCount

        public long getChromosomeNameCount()
      • getChromosomeRegionCount

        public long getChromosomeRegionCount()
      • getDecompressionBufSize

        public int getDecompressionBufSize()
      • isLowToHigh

        public boolean isLowToHigh()
      • getChromosomeIDTree

        public BPTree getChromosomeIDTree()
      • getChromosomeDataTree

        public RPTree getChromosomeDataTree()
      • getZoomLevelCount

        public int getZoomLevelCount()
      • getZoomLevelBounds

        public RPChromosomeRegion getZoomLevelBounds​(int zoomLevel,
                                                     int startChromID,
                                                     int endChromID)
      • getZoomLevelRecordCount

        public int getZoomLevelRecordCount​(int zoomLevel)
      • getChromosomeName

        public java.lang.String getChromosomeName​(int chromID)
      • getChromosomeNames

        public java.util.ArrayList<java.lang.String> getChromosomeNames()
      • getChromosomeID

        public int getChromosomeID​(java.lang.String chromosomeKey)
      • getChromosomeBounds

        public RPChromosomeRegion getChromosomeBounds​(int startChromID,
                                                      int endChromID)
      • getChromosomeRegions

        public java.util.ArrayList<RPChromosomeRegion> getChromosomeRegions()
      • getZoomLevelRegions

        public java.util.ArrayList<RPChromosomeRegion> getZoomLevelRegions​(int zoomLevel)
      • getBigBedIterator

        public BigBedIterator getBigBedIterator​(java.lang.String startChromosome,
                                                int startBase,
                                                java.lang.String endChromosome,
                                                int endBase,
                                                boolean contained)
        Returns an iterator for BigBed features which occupy a chromosome selection region.

        Note: the BBFile type should be BigBed; else a null iterator is returned.

        Parameters: startChromosome - name of start chromosome startBase - starting base position for features endChromosome - name of end chromosome endBase - ending base position for feature contained - flag specifies bed features must be contained in the specified base region if true; else can intersect the region if false

        Returns: Iterator to provide BedFeature(s) for the requested chromosome region. Error conditions: 1) An empty iterator is returned if region has no data available 2) A null object is returned if the file is not BigBed.(see isBigBedFile method)

      • getBigBedIterator

        public BigBedIterator getBigBedIterator()
        Returns an iterator for BigBed features for all chromosome regions.

        Note: the BBFile type should be BigBed; else a null iterator is returned.

        Returns: Iterator to provide BedFeature(s) for all chromosome regions. Error conditions: 1) An empty iterator is returned if region has no data available 2) A null object is returned if the file is not BigBed.(see isBigBedFile method)

      • getBigWigIterator

        public BigWigIterator getBigWigIterator​(java.lang.String startChromosome,
                                                int startBase,
                                                java.lang.String endChromosome,
                                                int endBase,
                                                boolean contained)
        Returns an iterator for BigWig values which occupy the specified startChromosome region.

        Note: the BBFile type should be BigWig; else a null iterator is returned.

        Parameters: startChromosome - name of start chromosome startBase - starting base position for features endChromosome - name of end chromosome endBase - ending base position for feature contained - flag specifies bed features must be contained in the specified base region if true; else can intersect the region if false

        Returns: Iterator to provide BedFeature(s) for the requested chromosome region. Error conditions: 1) An empty iterator is returned if region has no data available 2) A null object is returned if the file is not BigWig.(see isBigWigFile method)

      • getBigWigIterator

        public BigWigIterator getBigWigIterator()
        Returns an iterator for BigWig values for all chromosome regions.

        Note: the BBFile type should be BigWig; else a null iterator is returned.

        Returns: Iterator to provide BedFeature(s) for all chromosome regions. Error conditions: 1) An empty iterator is returned if region has no data available 2) A null object is returned if the file is not BigWig.(see isBigWigFile method)

      • getZoomLevelIterator

        public ZoomLevelIterator getZoomLevelIterator​(int zoomLevel,
                                                      java.lang.String startChromosome,
                                                      int startBase,
                                                      java.lang.String endChromosome,
                                                      int endBase,
                                                      boolean contained)
        Returns an iterator for zoom level records for the chromosome selection region.

        Note: the BBFile can be BigBed or BigWig.

        Parameters: zoomLevel - zoom level for data extraction; levels start at 1 startChromosome - start chromosome name startBase - staring base position for features endChromosome - end chromosome name endBase - ending base position for feature contained - flag specifies bed features must be contained in the specified base region if true; else can intersect the region if false

        Returns: Iterator to provide BedFeature(s) for the requested chromosome region. Error conditions: 1) An empty iterator is returned if region has no data available

      • getZoomLevelIterator

        public ZoomLevelIterator getZoomLevelIterator​(int zoomLevel)
        Returns an iterator for zoom level records for all chromosome regions.

        Note: the BBFile can be BigBed or BigWig.

        Parameters: zoomLevel - zoom level for data extraction; levels start at 1

        Returns: Iterator to provide BedFeature(s) for the requested chromosome region. Error conditions: 1) An empty iterator is returned if region has no data available

      • getZoomLevelIterator

        public ZoomLevelIterator getZoomLevelIterator​(int zoomLevel,
                                                      RPChromosomeRegion selectionRegion,
                                                      boolean contained)
        Returns an iterator for zoom level records for the chromosome selection region.

        Note: the BBFile can be BigBed or BigWig.

        Parameters: zoomLevel - zoom level for data extraction; levels start at 1 selectionRegion - chromosome selection region consists of: startChromID - ID of starting chromosome startBase - staring base position for features endChromID - ID of endind chromosome endBase - ending base position for feature contained - flag specifies bed features must be contained in the specified base region if true; else can intersect the region if false

        Returns: Iterator to provide BedFeature(s) for the requested chromosome region. Error conditions: 1) An empty iterator is returned if region has no data available