pybedtools assumes that bedtools is in your path and bedtools itself will return the version with bedtools --version. So: import subprocess subprocess.check_output(['bedtools', '--version'], text=True).strip().split()[1] For me that returns 'v2.30.0'.


As mentioned by OP, another option is to use pybedtools, which in my opinion is pretty convenient for people already familiar with BedTools. Let's even say df1's format is slightly different than df2: import pandas as pd dict1 = {0: ['chr1', 'chr1', 'chr1', 'chr1', 'chr2'], 1: [1, 100, 150, 900, 1], 2: [100, 200, 500, 950, 100], 3: ['...

Only top voted, non community-wiki answers of a minimum length are eligible