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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

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
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.

1 participant