I want to use pybedtools
in a python program that I am compiling into an executable with pyinstaller
. The intent is that this executable will contain all of the necessary files to run the program, including shipping BEDtools
as a binary. However, when I try to run pybedtools using the code below, I get a NotImplementedError, implying that pybedtools doesn't work with this approach. Is it possible to run pybedtools wrapping a binary like this? Is set_bedtools_path
not the right tool to use for this problem?
Example code:
import os
import pybedtools
pybedtools.helpers.set_bedtools_path(os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'bedtools.static.binary'))
a = pybedtools.example_bedtool('a.bed')
b = pybedtools.example_bedtool('b.bed')
print(a.intersect(b))