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

New method for semsim ingestion #215

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

souzadevinicius
Copy link
Member

Fixes #214

Copy link
Member

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

Very, very nice looking code. I would prefer if you could get a @yaseminbridges review as well!

I have no concerns, just a few questions for my own learnings

Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of this file?

Copy link
Member Author

Choose a reason for hiding this comment

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

These .bkp files are used during the test execution. After ingesting data into the H2 database, we need to copy this backup and restore the database's state after the tests are over.

tests/test_exomiser_db_ingestion.py Show resolved Hide resolved
Copy link
Contributor

@yaseminbridges yaseminbridges left a comment

Choose a reason for hiding this comment

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

It generally looks good, I just have some comments

tests/test_exomiser_db_ingestion.py Show resolved Hide resolved
src/pheval/cli_pheval_utils.py Outdated Show resolved Hide resolved
src/pheval/cli_pheval_utils.py Outdated Show resolved Hide resolved
src/pheval/infra/exomiserdb.py Show resolved Hide resolved
src/pheval/infra/exomiserdb.py Outdated Show resolved Hide resolved
src/pheval/infra/exomiserdb.py Show resolved Hide resolved
src/pheval/infra/exomiserdb.py Outdated Show resolved Hide resolved
src/pheval/utils/exomiser.py Outdated Show resolved Hide resolved
@souzadevinicius souzadevinicius marked this pull request as ready for review January 19, 2024 14:50
Copy link
Contributor

@yaseminbridges yaseminbridges left a comment

Choose a reason for hiding this comment

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

LGTM, I just had one comment on your _format_row() method. There was a TODO note but I'm not sure if this is something you planned to change in a future PR

data (_type_): row data
"""
# TODO:Improve string escaping. Replace this code with parametrised query
return f"""({mapping_id}, '{data['subject_id']}', '{data['subject_label'].replace("'", "")}', '{data['object_id']}', '{data['object_label'].replace("'", "")}', {data['jaccard_similarity']}, {data['ancestor_information_content']}, {data['phenodigm_score']}, '{data['ancestor_id'].split(",")[0]}', '{data['ancestor_label'].replace("'", "")}')""" # noqa
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be changed so that the code looks a bit neater, this is a bit confusing to read

Copy link
Member Author

Choose a reason for hiding this comment

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

Could this be changed so that the code looks a bit neater, this is a bit confusing to read

Yes, I'd like to use an ORM for escaping SQL, but it will be implemented in a future PR…

@souzadevinicius souzadevinicius merged commit d17074e into main Jan 23, 2024
5 checks passed
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.

New method for semsim ingestion
3 participants