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

[MNT] Replaced Cognitive Atlas with SNOMED #397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

[MNT] Replaced Cognitive Atlas with SNOMED #397

wants to merge 2 commits into from

Conversation

rmanaem
Copy link
Collaborator

@rmanaem rmanaem commented Dec 20, 2024

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass
  • If the PR changes the SPARQL query template, the default Neurobagel query file has also been regenerated

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Summary by Sourcery

Switch from using the Cognitive Atlas to SNOMED CT for assessments.

Copy link

sourcery-ai bot commented Dec 20, 2024

Reviewer's Guide by Sourcery

This pull request replaces the Cognitive Atlas vocabulary with SNOMED for assessments. It updates the API endpoint, data fetching logic, and tests to reflect this change. A local copy of the SNOMED vocabulary is now used for lookups.

Class diagram showing updated vocabulary handling

classDiagram
    class VocabHandler {
        +create_snomed_assessment_lookup(output_path)
        +create_snomed_disorder_lookup(output_path)
        -load_json(path)
    }
    note for VocabHandler "Replaced fetch_and_save_cogatlas with SNOMED handlers"

    class Router {
        +get_vocab()
        +get_instances()
    }

    class RouteFactory {
        +create_get_vocab_handler(external_vocab, vocab_name, namespace_prefix)
    }

    Router --> RouteFactory: uses
    Router --> VocabHandler: uses
Loading

File-Level Changes

Change Details Files
Replaced Cognitive Atlas with SNOMED for assessments
  • Updated the test_stored_vocab_lookup_file_created_on_startup test to use the SNOMED vocabulary.
  • Removed functions related to fetching the Cognitive Atlas vocabulary and added functions to create SNOMED lookup files.
  • Updated tests to use SNOMED URIs and labels.
  • Updated the startup event to create SNOMED lookup files instead of Cognitive Atlas.
  • Updated the assessments router to use SNOMED.
  • Updated the diagnoses router to use the correct SNOMED lookup.
  • Updated the route factory to use a namespace prefix for vocabularies.
  • Updated the default Neurobagel query file.
  • Added a local backup copy of the SNOMED assessment vocabulary file.
tests/test_app_events.py
app/api/utility.py
tests/test_attribute_factory_routes.py
app/main.py
app/api/routers/assessments.py
app/api/routers/diagnoses.py
app/api/routers/route_factory.py
docs/default_neurobagel_query.rq
vocab/backup_external/snomed_assessment.json

Assessment against linked issues

Issue Objective Addressed Explanation
#390 Replace Cognitive Atlas vocabulary with SNOMED in the vocab endpoint and saved vocab file
#390 Replace Cognitive Atlas vocabulary with SNOMED in the query template
#390 Replace Cognitive Atlas vocabulary with SNOMED in the /assessments endpoint

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.94%. Comparing base (8e1c289) to head (2e1d4b3).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
- Coverage   97.09%   96.94%   -0.15%     
==========================================
  Files          24       24              
  Lines         861      819      -42     
==========================================
- Hits          836      794      -42     
  Misses         25       25              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Replace Cognitive Atlas vocab with SNOMED
1 participant