pybedtools.bedtool.BedTool.count_hits¶
- BedTool.count_hits(interval: Interval, same_strand: bool = False, overlap: float = 0.0) int[source]¶
Return the number of intervals that overlap
interval.Calls the
count_hitsmethod of an IntervalFile. Returns the number of valid hits in this BedTool that overlapinterval.Require that overlaps have the same strand with same_strand=True.
- Notes:
If this current BedTool is generator-based, it will be converted into a file first.
If this current BedTool refers to a BAM file, it will be converted to a BED file first using default arguments. If you don’t want this to happen, please convert to BED first before using this method.