This is a test version of Biostars. For the public version, visit https://www.biostars.org.
pybedtools intersect using additional options

Hi, I'm trying to learn pybedtools using the intersect and am very new to it.

I want to use the -wb option but can't quite work out how to do this with pybedtools.

At the moment I have:

import pybedtools

a = pybedtools.BedTool(en.bed)
b = pybedtools.BedTool('annot.bed')


a.intersect(b)

If I do:

a.intersect(b, -wb )

I get the error

'NameError: name 'wb' is not defined'

pybedtools

I guess it must be :

a.intersect(b, '-wb')

Take care of the quotation marks, otherwise python interpret wb as a variable.

fin swimmer

1 answer

I got an answer from the developer https://github.com/daler/pybedtools/issues/266

Log in to answer this question.