Skip to content
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

IRanges.to_pandas fails if there are mcols #125

Closed
balwierz opened this issue Oct 14, 2024 · 2 comments · Fixed by #128
Closed

IRanges.to_pandas fails if there are mcols #125

balwierz opened this issue Oct 14, 2024 · 2 comments · Fixed by #128
Assignees

Comments

@balwierz
Copy link

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
Copy link
Author

balwierz commented Oct 14, 2024

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.

@balwierz balwierz changed the title GenomicRanges.reduce().to_pandas() fail IRanges.to_pandas fails if there are mcols Oct 14, 2024
@jkanche
Copy link
Member

jkanche commented Oct 15, 2024

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

@jkanche jkanche self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants