pybedtools.bedtool.BedTool.total_coverage

BedTool.total_coverage()[source]

Return the total number of bases covered by this interval file.

Does a self.merge() first to remove potentially multiple-counting bases.

Example usage:

>>> a = pybedtools.example_bedtool('a.bed')

This does a merge() first, so this is what the total coverage is counting:

>>> print(a.merge()) 
chr1    1       500
chr1    900     950
>>> print(a.total_coverage())
549