`IRanges.to_pandas` fails if there are mcols
balwierz opened this issue · 2 comments
balwierz commented
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.
balwierz commented
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.
jkanche commented
Thank you, Just fixed this in both the packages. let me know if you continue to see this issue after updating.