BiocPy/GenomicRanges

`IRanges.to_pandas` fails if there are mcols

balwierz opened this issue · 2 comments

The following code fails

import genomicranges as gr
gr.GenomicRanges(seqnames=["A"], ranges=IRanges(start=[0], width=[10])).reduce().to_pandas()

Without reduce() it works.

I found the problem and a solution
reduce adds a rev_map column to mcols.
IRanges.to_pandas is buggy, concatenation with nonempty mcols fails. It should read:
output = pd.concat([output, self._mcols.to_pandas()], axis=1)
Without axis=1 it concatenates vertically.

Thank you, Just fixed this in both the packages. let me know if you continue to see this issue after updating.