-
Notifications
You must be signed in to change notification settings - Fork 49
left join broken with ValueError and TypeError #342
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
Comments
Relevant:
i.e. adding an extra row to f2 with a negative strand fixes any issues. I guess somewhere there is a call to pd.Categorical that should explicitly set "+"/"-" as categories. |
Replacing: pyranges/pyranges/methods/init.py 8000 Line 15 in 4583971
with
and pyranges/pyranges/methods/init.py Line 41 in 4583971
with
is sufficient to produce the desired result:
Happy to create the PR if this is acceptable. |
Thanks. This seems a reasonable solution @endrebak ? |
I'll try to fix this today. Will have to check on different pandas versions :D |
Thanks! |
Your suggestion seems to not work with bad strands like ".". Will try to fix. |
was ruled out? |
https://github.com/pyranges/pyranges/pull/new/342 The tests seem to pass and your example works? Does the commit work for you? Will have to wait for C/I before uploading to PyPI. |
Started the pipeline to push the changes to pypi: https://github.com/pyranges/pyranges/actions/runs/5391831179 |
Sorry, this example still fails with v0.0.128. At this point, changing
to
continues to pass. As suggested by the original error,
we basically need to force the Strand categories to be the same irrespective of Thanks for your help! |
Ah, thanks! I'm working on implementing genomicranges for polars so my pandas knowledge is slipping away. What I do not like about your solution is that the Strand column might have other values besides (., +, -) and your solution seems to make only those three valid. |
Perhaps we should replace all invalid values with What do you think @marco-mariotti ? |
I agree with Endre's proposal.
…On Wed, Jun 28, 2023 at 3:51 PM endrebak.ada ***@***.***> wrote:
Perhaps we should replace all invalid values with . and warn the user?
What do you think @marco-mariotti <https://github.com/marco-mariotti> ?
—
Reply to this email directly, view it on GitHub
<#342 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTXRIHDT2UTSCZZAV56TALXNQZF5ANCNFSM6AAAAAAZGALTKI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Marco Mariotti
Ramón y Cajal Fellow, Group Leader
Department of Genetics, Microbiology and Statistics
Universitat de Barcelona
|
That'd be great, thanks. Already spotted the rust version, looking forward to it! |
Hi , @marco-mariotti Maybe I have the similar problem: when I want to annotate pic2 with pic1, it returns the error:
Can you give me some advice here, thank you? |
@xiucz I think you need pr.PyRanges(..., int64=True) when you initialise both tables. |
@michaelJwilson |
Hi @xiucz, can you provide data to replicate the problem, and specify which version of pyranges are you using? |
Hi, @marco-mariotti , My pyranges version is 0.0.120. Actually, I use the
However, is it possible to collapse (merge and combine the annotation columns, or something like groupby and then combine ) the result?
#groupby and merge by ";"
Best, |
Please test this in the latest pyranges version, 0.0.129, and let us know if the problem persists. |
@marco-mariotti
Best, |
Thanks for the package- and all the hard work that's gone into it. Came across this issue:
I'm trying to annotate
f1
withf2
.works as expected
Fails with an error
TypeError: Cannot set a Categorical with another, without identical categories
Version is
'0.0.125
The text was updated successfully, but these errors were encountered: