-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi_intersect confused when using header=True #239
Comments
Thanks for reporting. The issue here is that multiinter does not output an actual BED file, it's a report of the various intersections. import pybedtools as bt
import pandas
bedfiles = ["a.bed", "b.bed"]
x = bt.BedTool()
bfl = []
for bf in bedfiles:
bfl.append(bt.example_bedtool(bf))
intsect = x.multi_intersect(i=[b.fn for b in bfl], header=True)
df = pandas.read_table(intsect.fn) See also #113; I'll add a note to the docs for |
To clarify, multiiner does not spit out a valid BED file when import pybedtools as bt
import pandas
bedfiles = ["a.bed", "b.bed"]
x = bt.BedTool()
bfl = []
for bf in bedfiles:
bfl.append(bt.example_bedtool(bf))
intsect = x.multi_intersect(i=[b.fn for b in bfl])
intsect.head() gives
|
Thanks for the quick response and fix! |
I want to use the header argument for multi intersect command. The issue is that any subsequent command fails using the code gives the error below:
MalformedBedLineError: Unable to detect format from ['chrom', 'start', 'end', 'num', 'list', '/home/user/.virtualenvs/default/lib/python3.5/site-packages/pybedtools/test/data/a.bed', '/home/user/.virtualenvs/default/lib/python3.5/site-packages/pybedtools/test/data/b.bed']
The text was updated successfully, but these errors were encountered: