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

Coerce PMID column into string not integer #212

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

sgsutcliffe
Copy link
Collaborator

In older versions of pandas (e.g. 2.1.0) the PMID column of Pointfinder Database was being converted to integer not the expected string. For example Klebsiella, was causing an error

File "lib/python3.11/site-packages/staramr/blast/pointfinder/PointfinderBlastDatabase.py", line 128, in get_cge_pmid
    return self._pointfinder_info.get_value(gene, mutation, "PMID")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/staramr/blast/pointfinder/PointfinderDatabaseInfo.py", line 206, in get_value
    results = ';'.join(matches[attribute])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found

@sgsutcliffe
Copy link
Collaborator Author

We will fix the error by coercing the PMID column into a string to avoid this error.

@sgsutcliffe sgsutcliffe requested a review from apetkau July 8, 2024 23:14
Copy link
Member

@apetkau apetkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this @sgsutcliffe and thanks for fixing up conflicts from your changes @emarinier. This is all working so I will merge in.

@apetkau apetkau merged commit 26770da into development Dec 10, 2024
3 checks passed
@apetkau apetkau deleted the fix-pointfinderdatabase-PMID-column branch December 10, 2024 15:36
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 this pull request may close these issues.

3 participants