Closed wbvguo closed 1 year ago
The expected output of the command
bedtools groupby -i pybedtools.bed -g 1 -c 5 -o sum
would be:
chr1 11
Which is not in any genomics data format (e.g., a minimal BED needs at least chrom, start, stop).
In this example you can save a temp file from the output, which will then be available as b.fn
, and then work with it any way you would otherwise work with TSV files. E.g.,
import pybedtools
a = pybedtools.BedTool("xxx/pybedtools.bed")
b = a.groupby(g = 1, c=5, o =['sum']).saveas()
import pandas
df = pandas.read_table(b.fn, names=['chrom', 'sum'])
Hi,
I tried to run the
pybedtools.bedtool.Bedtool.groupby
methodbut encounter the following error:
here is the test data I used, hope this issue can be fixed soon
Best,