BedTool.bgzip(in_place=True, force=False, is_sorted=False)[source]

Helper function for more control over “tabixed” BedTools.

Checks to see if we already have a BGZIP file; if not then prepare one. Always leaves the original file alone. You can always just make a BedTool out of an already sorted and BGZIPed file to avoid this step.

in_place will put the BGZIPed file in the same dir (possibly after sorting to tempfile).

If is_sorted, then assume the file is already sorted. Otherwise call bedtools sort with the -header option.

force will overwrite without asking.