Package htsjdk.samtools
Class GenomicIndexUtil
- java.lang.Object
-
- htsjdk.samtools.GenomicIndexUtil
-
public class GenomicIndexUtil extends Object
Constants and methods used by BAM and Tribble indices
-
-
Field Summary
Fields Modifier and Type Field Description static int
BIN_GENOMIC_SPAN
Reports the total amount of genomic data that any bin can index.static int[]
LEVEL_STARTS
What is the starting bin for each level?static int
MAX_BINS
Reports the maximum number of bins that can appear in a binning index.static int
MAX_LINEAR_INDEX_SIZE
static int
UNSET_GENOMIC_LOCATION
E.g.
-
Constructor Summary
Constructors Constructor Description GenomicIndexUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
binTolevel(int bin)
Return the binning index level for the given bin.static String
getBinSummaryString(int bin)
Return a summary string describing the bin level, level size, and genomic territory covered by the bin.static int
levelToSize(int level)
Return the binning index bin size for bins in the given bin.static int
regionToBin(int beg, int end)
calculate the bin given an alignment in [beg,end) Described in "The Human Genome Browser at UCSC.static int
regionToBin(int beg, int end, int minShift, int binDepth)
calculate the bin given an alignment in [beg,end) Described in "The Human Genome Browser at UCSC.static BitSet
regionToBins(int startPos, int endPos)
Get candidate bins for the specified regionstatic BitSet
regionToBins(int startPos, int endPos, int minShift, int binDepth)
Get candidate bins for the specified region
-
-
-
Field Detail
-
BIN_GENOMIC_SPAN
public static final int BIN_GENOMIC_SPAN
Reports the total amount of genomic data that any bin can index.- See Also:
- Constant Field Values
-
LEVEL_STARTS
public static final int[] LEVEL_STARTS
What is the starting bin for each level?
-
MAX_BINS
public static final int MAX_BINS
Reports the maximum number of bins that can appear in a binning index.- See Also:
- Constant Field Values
-
MAX_LINEAR_INDEX_SIZE
public static final int MAX_LINEAR_INDEX_SIZE
-
UNSET_GENOMIC_LOCATION
public static final int UNSET_GENOMIC_LOCATION
E.g. for a SAMRecord with no genomic coordinate.- See Also:
- Constant Field Values
-
-
Method Detail
-
binTolevel
public static int binTolevel(int bin)
Return the binning index level for the given bin. Assumes a .bai/.tbi binning scheme (not for use with .csi).- Parameters:
bin
- the bin to analyze- Returns:
- the binning index level for the given bin
-
levelToSize
public static int levelToSize(int level)
Return the binning index bin size for bins in the given bin. Assumes a .bai/.tbi binning scheme (not for use with .csi).- Parameters:
level
- the level to analyze- Returns:
- the size for a bin at the given level
-
getBinSummaryString
public static String getBinSummaryString(int bin)
Return a summary string describing the bin level, level size, and genomic territory covered by the bin. For use as debug output.- Parameters:
bin
- input bin- Returns:
- A summary string describing the bin. The intended use is for debug output - the string is not intended to be machine readable/parsed and is subject to change.
-
regionToBin
public static int regionToBin(int beg, int end)
calculate the bin given an alignment in [beg,end) Described in "The Human Genome Browser at UCSC. Kent & al. doi: 10.1101/gr.229102 "- Parameters:
beg
- 0-based start of read (inclusive)end
- 0-based end of read (exclusive)
-
regionToBin
public static int regionToBin(int beg, int end, int minShift, int binDepth)
calculate the bin given an alignment in [beg,end) Described in "The Human Genome Browser at UCSC. Kent & al. doi: 10.1101/gr.229102 "- Parameters:
beg
- 0-based start of read (inclusive)end
- 0-based end of read (exclusive)minShift
- minimum bin width (2^minShift)binDepth
- number of levels in the binning scheme (including bin 0)
-
regionToBins
public static BitSet regionToBins(int startPos, int endPos)
Get candidate bins for the specified region- Parameters:
startPos
- 1-based start of target region, inclusive.endPos
- 1-based end of target region, inclusive.- Returns:
- bit set for each bin that may contain SAMRecords in the target region.
-
regionToBins
public static BitSet regionToBins(int startPos, int endPos, int minShift, int binDepth)
Get candidate bins for the specified region- Parameters:
startPos
- 1-based start of target region, inclusive.endPos
- 1-based end of target region, inclusive.minShift
- minimum bin width (2^minShift).binDepth
- number of levels in the binning scheme (including bin 0).- Returns:
- bit set for each bin that may contain SAMRecords in the target region.
-
-