org.broad.igv.bbfile
Class BBFileReader

java.lang.Object
  extended by org.broad.igv.bbfile.BBFileReader

public class BBFileReader
extends java.lang.Object

File retrieved from BigWig project at Google code on July 26, 2011, revision 36 http://code.google.com/p/bigwig/ This project provides java readers for the UCSC's BigWig and BigBed formats. It was originally developed by Martin Decautis and Jim Robinson for the Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to Jim Kent and Ann Zweig and from UCSC for their assistance. Modification to work with GenomeView by Thomas Abeel.

Author:
Martin Decautis, Jim Robinson, Thomas Abeel

Field Summary
static long BBFILE_HEADER_OFFSET
           
 
Constructor Summary
BBFileReader(Locator path, net.sf.samtools.util.SeekableStream stream)
           
BBFileReader(java.lang.String path)
           
 
Method Summary
 BBFileHeader getBBFileHeader()
           
 net.sf.samtools.util.SeekableStream getBBFis()
           
 BigBedIterator getBigBedIterator()
          Returns an iterator for BigBed features for all chromosome regions.
 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.
 BigWigIterator getBigWigIterator()
          Returns an iterator for BigWig values for all chromosome regions.
 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.
 RPChromosomeRegion getChromosomeBounds()
           
 RPChromosomeRegion getChromosomeBounds(int startChromID, int endChromID)
           
 RPTree getChromosomeDataTree()
           
 int getChromosomeID(java.lang.String chromosomeKey)
           
 BPTree getChromosomeIDTree()
           
 java.lang.String getChromosomeName(int chromID)
           
 long getChromosomeNameCount()
           
 java.util.ArrayList<java.lang.String> getChromosomeNames()
           
 long getChromosomeRegionCount()
           
 java.util.ArrayList<RPChromosomeRegion> getChromosomeRegions()
           
 int getDataCount()
           
 int getDecompressionBufSize()
           
 Locator getLocator()
           
 BBTotalSummaryBlock getTotalSummaryBlock()
           
 RPChromosomeRegion getZoomLevelBounds(int zoomLevel)
           
 RPChromosomeRegion getZoomLevelBounds(int zoomLevel, int startChromID, int endChromID)
           
 int getZoomLevelCount()
           
 ZoomLevelIterator getZoomLevelIterator(int zoomLevel)
          Returns an iterator for zoom level records for all chromosome regions.
 ZoomLevelIterator getZoomLevelIterator(int zoomLevel, RPChromosomeRegion selectionRegion, boolean contained)
          Returns an iterator for zoom level records for the chromosome selection region.
 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.
 int getZoomLevelRecordCount(int zoomLevel)
           
 java.util.ArrayList<RPChromosomeRegion> getZoomLevelRegions(int zoomLevel)
           
 BBZoomLevels getZoomLevels()
           
 boolean isBigBedFile()
           
 boolean isBigWigFile()
           
 boolean isLowToHigh()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BBFILE_HEADER_OFFSET

public static final long BBFILE_HEADER_OFFSET
See Also:
Constant Field Values
Constructor Detail

BBFileReader

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

BBFileReader

public BBFileReader(Locator path,
                    net.sf.samtools.util.SeekableStream stream)
Method Detail

getBBFis

public net.sf.samtools.util.SeekableStream getBBFis()

getBBFileHeader

public BBFileHeader getBBFileHeader()

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()

getTotalSummaryBlock

public BBTotalSummaryBlock getTotalSummaryBlock()

getChromosomeIDTree

public BPTree getChromosomeIDTree()

getChromosomeDataTree

public RPTree getChromosomeDataTree()

getZoomLevelCount

public int getZoomLevelCount()

getZoomLevels

public BBZoomLevels getZoomLevels()

getZoomLevelBounds

public RPChromosomeRegion getZoomLevelBounds(int zoomLevel,
                                             int startChromID,
                                             int endChromID)

getZoomLevelBounds

public RPChromosomeRegion getZoomLevelBounds(int zoomLevel)

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)

getChromosomeBounds

public RPChromosomeRegion getChromosomeBounds()

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


getLocator

public Locator getLocator()


Copyright © 2007-2011 - Thomas Abeel - All Rights Reserved. SourceForge.netLogo