I noticed there is a conda version of bedops bedmap function available. I've been struggling to use it though. Could someone refer me to any documentation of it's usage in a python script please. Have a great day. Thanks in advance.
I noticed there is a conda version of bedops bedmap function available. I've been struggling to use it though. Could someone refer me to any documentation of it's usage in a python script please. Have a great day. Thanks in advance.
Hi- I'm not sure if there is a python API for bedops (similar to pybedtools, if this is what you mean). However, in a python script you can use the subprocess library to execute external commands. E.g. something like (see also check_call):
import subprocess
p= subprocess.Popen("bedmap ... > out.bed", shell= True, stdout= subprocess.PIPE, stderr= subprocess.PIPE)
stdout, stderr= p.communicate()
if p.returncode != 0:
print(stderr)
print('Exit code %s' %(p.returncode))
sys.exit(1)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Uday Rangaswamy
Please do not delete posts that have received feedback/been solved. This one has an accepted answer, and is a valuable resource that should not be deleted.