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

Annotation Versioning Feature #184

Merged
merged 13 commits into from
Sep 30, 2024
Merged

Conversation

fatimarabab
Copy link
Collaborator

@fatimarabab fatimarabab commented Sep 24, 2024

  • I have performed a self-review of my code.
  • My code follows the style guidelines enforced by static analysis tools.
  • If it is a core feature, I have added thorough tests.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • Will this be part of a product update? If yes, please write one phrase about this update.

Pull Request Details

Wrike ticket - Get latest version of the dataset within the annotation unit

Changes made:

To Review:

  • Static Analysis by Reviewer
  • Annotations are rendering correctly in local deployment of Rosalution.
    To check this run the following commands:
     docker compose down
     docker system prune -a --volumes
     docker compose up --build -d
  • Navigate to https://local.rosalution.cgds/rosalution/login. Login as "developer".

  • Click on any CPAM case, navigate to its Annotation view and ensure annotations are loading.

  • Verify importing a new analysis annotates all of its genomic units & renders them

    • Watch logs for logged messages before importing the duplicated fixture.
          docker logs --follow rosalution-backend-1
    • Import the C-PAM0042.json into Rosalution from ./etc/fixtures/import/
    • Navigate to https://local.rosalution.cgds/rosalution/login. Login using your 'developer.
    • Confirm 'CPAM0042' annotations are rendering
    • Confirm in the Rosalution database that analysis CPAM0042 has a 'manifest'
          docker compose exec -it rosalution-db mongosh rosalution_db
          db.analyses.find({'name': 'CPAM0042'}, {'manifest': 1})

    image
    image

  • Verify importing new analysis that has same genomic units as an existing analysis, doesn't duplicate existing annotations and creates not annotations if there is a different version calculated

    • Import the duplicated analysis 'dev-test-analysis-C-PAM0084-duplicate.jsonfrom./etc/fixtures/import/`
    • Confirm Annotations are rendering correctly and same for both CPAM0084 and CPAM0084duplicate on the Rosalution UI.
      • Confirm Logs:
      • Right after importing the duplicated analysis, see the logs notating that 'Annotations Exists'
      • Version tasks are being created and calculated.
      • Confirm existing annotations are not re-annotated, as this is a duplicated analysis fixture of an existing case. Annotations for datasets using HPO as its datasource will re-annotate as they are versioned according to the date when annotated.
      • The logs will look as follows:

    Screenshot 2024-09-25 at 4 23 42 PM
    Screenshot 2024-09-25 at 4 24 01 PM

    • Confirm genomic units added new annotations for different data sources and versions
          docker compose exec -it rosalution-db mongosh rosalution_db
          db.genomic_units.aggregate([ {$match: {'hgvs_variant': 'NM_001360016.2:c.563C>T'}}, {$unwind: '$transcripts'}, {$project: {_id: 0, 'hgvs_variant': 1, 'transcript': '$transcripts'}}]);

    image

          docker compose exec -it rosalution-db mongosh rosalution_db
          db.genomic_units.find({'gene': 'G6PD'});

    image

    • Confirm the new analysis that has existing genomic units has its own manifest
       docker compose exec -it rosalution-db mongosh rosalution_db
       db.analyses.find({'name': 'CPAM0084duplicate'}, {'manifest': 1, _id: 0})
  • Verify Genomic Units and Analyses migrate successfully to use an annotation manifest for rendering annotations

    • Restore a production backed up database on your local deployment from UAB LTS. Visit Research Compute LTS Instructions for setup instructions so the restore script can use rclone to restore the latest backed up database. Use 'cgdslts' credentials shared in Keeper.
      After rclone config is finished, restore a prod backed up database from LTS.

       # Make sure you are already deployed locally
       cd etc/database
       ./restore-database-lts.sh rosalution-rosalution-db-1 
    • Run the migration script to generate an annotation manifest for each Rosalution analysis and genomic units.

      cd ./etc/
      docker exec -it rosalution-rosalution-db-1 mongosh --file /tmp/fixtures/create-annotation-manifest.js
    • Restart backend service, so logout 'developer' to prevent an infinite auth loop IMPORTANT

      docker compose restart backend
    • Navigate to https://local.rosalution.cgds/rosalution/login. Login using your BlazerID instead of 'developer.

    • Confirm many different Rosalution analyses render their annotations

    • Inspect database to confirm analyses have manifests now

      ```bash
      docker compose exec -it rosalution-db mongosh rosalution_db
      db.analyses.find({'name': 'CPAM0102 (LRRCC1)'}, {'manifest': 1, _id: 0})
      ```
      
  • All Unit Tests pass.

  • All Github Actions checks have passed.

fatimarabab and others added 7 commits July 1, 2024 16:14
…c unit and dataset directly from annotation-unit
… get_dependencies() in AnnotationUnit. Clarified some function names and docstrings. Tests and linting passing locally.
* Pushing up pulled in code changes from the annotation-task refactor, pairing and other work done in the last week, before losing power and wifi.

* Was able to process versioning tasks for annotation units. Skipped all other tasks for now, will be working on that next. Updated test fixture's annotation-configuration to match current Rosalution annotation configuration. Paired with Angelina on some of this stuff.

* testing process tasks for datasets without dependencies and datasets with dependencies

* Tests pass for CPAM0002, need to rework CPAM0046

* Paired with Rabab to refactor how we manage skipping a dependency for unit tests when processing annotation unit tasks; agreed upon a base set of datasets to use in configuration; and updated the neccesary code patching

* Missed a file.

* got it working; heck ya

* tests passing, linting & formatting passing

* wip for genomic units;linting; and formatting

* finished cleaning up genomic unit unit tests and added parameterized test methods to have more then one test case peer unit test

* wip

* wip to get annotation by analysis name'

* backend wip for getting annotations by analysis

* rabab & angelina pair for getting version result

* formatted backend files

* Able to retrieve version for 'rest' versioning type. Hardcoded 'rosalution' type version for rosalution's manifest. Paired with Angelina on Wednesday to create a couple of helper functions for testing. Thursday - Rabab worked on combining & testing all 3 versioning types in one test.

* Fixed some of the linting errors

* Retrieve and show annotations (#180)

* Updated backend to include annotation retrieval for dependencies and ui

* Updated unit tests and integration to pass

* finished added the version calcs and fixed version retrieval, checking if transcripts exists is still broken, the case where transcript_id and no transcripts are listed in the variant is the case that needs to be fixed

* fixed creatining multiple genomic units when uploading twice, investigating why transcripts are showing as not existing when they do

* wrapped up cleaning the tests; removed extra logging; linted and formatted; paired with Rabab

---------

Co-authored-by: SeriousHorncat <ange.unoantonison@gmail.com>
* wrapping up first draft of migration script;and tidying up feature

* added a port for local mongodb developer so vscode can connect to mongodb in the container;  fixed documentation in script for the example run command
@fatimarabab fatimarabab added the enhancement New feature or request label Sep 24, 2024
@fatimarabab fatimarabab self-assigned this Sep 24, 2024
…via a force-push; updated initial seed fixtures to use calculated annotation versions; cleaned up the documentation for the create annotation manifest script for migration
@fatimarabab fatimarabab marked this pull request as ready for review September 25, 2024 21:30
@JmScherer
Copy link
Collaborator

Annotations are rendering correctly in local deployment of Rosalution.

Screenshot 2024-09-27 at 11 37 11 AM Screenshot 2024-09-27 at 11 37 18 AM

Verify importing a new analysis annotates all of its genomic units & renders them

Confirming that the logs properly print from the annotation process

Screenshot 2024-09-27 at 12 04 34 PM

Confirm 'CPAM0042' annotations are rendering

Screenshot 2024-09-27 at 12 05 41 PM

Confirm in the Rosalution database that analysis CPAM0042 has a 'manifest'

Screenshot 2024-09-27 at 12 11 44 PM

Verify importing new analysis that has same genomic units as an existing analysis, doesn't duplicate existing annotations and creates not annotations if there is a different version calculated

Confirm Annotations are rendering correctly and same for both CPAM0084 and CPAM0084duplicate on the Rosalution UI.

Screenshot 2024-09-27 at 12 26 36 PM

Right after importing the duplicated analysis, see the logs notating that 'Annotations Exists'

Screenshot 2024-09-27 at 12 23 35 PM

Version tasks are being created and calculated.

Screenshot 2024-09-27 at 12 22 43 PM

Confirm genomic units added new annotations for different data sources and versions

db.genomic_units.aggregate([ {$match: {'hgvs_variant': 'NM_001360016.2:c.563C>T'}}, {$unwind: '$transcripts'}, {$project: {_id: 0, 'hgvs_variant': 1, 'transcript': '$transcripts'}}]);

Screenshot 2024-09-27 at 12 29 33 PM

db.genomic_units.find({'gene': 'G6PD'});

Screenshot 2024-09-27 at 12 31 13 PM

db.analyses.find({'name': 'CPAM0084duplicate'}, {'manifest': 1, _id: 0})

Screenshot 2024-09-27 at 1 25 58 PM

Verify Genomic Units and Analyses migrate successfully to use an annotation manifest for rendering annotations

Run the migration script to generate an annotation manifest for each Rosalution analysis and genomic units.

Screenshot 2024-09-27 at 2 15 14 PM

Confirm many different Rosalution analyses render their annotations

Screenshot 2024-09-27 at 2 18 57 PM

Inspect database to confirm analyses have manifests now

Screenshot 2024-09-27 at 2 19 48 PM

Copy link
Collaborator

@JmScherer JmScherer left a comment

Choose a reason for hiding this comment

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

So much stuff! It all works from my end!

Copy link
Collaborator

@SeriousHorncat SeriousHorncat left a comment

Choose a reason for hiding this comment

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

😸

@fatimarabab fatimarabab merged commit 1be997d into main Sep 30, 2024
8 checks passed
@fatimarabab fatimarabab deleted the feature-annotation-versioning branch September 30, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants