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

Enable pheno level session for response and query #78

Closed
7 tasks done
Tracked by #83
alyssadai opened this issue Jan 25, 2024 · 8 comments · Fixed by #112
Closed
7 tasks done
Tracked by #83

Enable pheno level session for response and query #78

alyssadai opened this issue Jan 25, 2024 · 8 comments · Fixed by #112
Assignees
Labels
flag:detail needed Issue requires additional clarification before a decision can be made or it can be implemented. released This issue/pull request has been released.

Comments

@alyssadai
Copy link
Contributor

alyssadai commented Jan 25, 2024

This issue is to address two things:

  • The query tool can send requests for # of pheno and imaging sessions according to the new query variables:

https://github.com/neurobagel/federation-api/blob/771b1a2fd21030ee3a6fe1a8bc6c37db401a8fd1/app/api/models.py#L20-L21

  • Query tool can understand the new response model from the API:

https://github.com/neurobagel/api/blob/c5c6222f77995e1b723e5ac24f7041151556b458/app/api/models.py#L13-L24

Steps:

  • update query UI for # of imaging sessions
  • add query UI for # of pheno sessions
  • add tests to check that this is correctly mapped to new query parameters
  • add test to ensure the tool creates the correct participant.tsv files when given the new API response with session_type:
[
  {
    "dataset_uuid": "http://neurobagel.org/vocab/e0c7d08c-edcc-4c2a-816a-306878ed7be2",
    "dataset_name": "BIDS synthetic",
    "dataset_portal_uri": "https://github.com/bids-standard/bids-examples",
    "dataset_total_subjects": 5,
    "records_protected": false,
    "num_matching_subjects": 5,
    "subject_data": [
      {
        "sub_id": "sub-01",
        "session_id": "ses-01",
        "num_matching_phenotypic_sessions": 2,
        "num_matching_imaging_sessions": 2,
        "session_type": "http://neurobagel.org/vocab/ImagingSession",
        "age": null,
        "sex": null,
        "diagnosis": [
          null
        ],
        "subject_group": null,
        "assessment": [
          null
        ],
        "image_modal": [
          "http://purl.org/nidash/nidm#T1Weighted",
          "http://purl.org/nidash/nidm#FlowWeighted"
        ],
        "session_file_path": "/data/neurobagel/bagel-cli/bids-examples/synthetic/sub-01/ses-01"
      },
      {
        "sub_id": "sub-01",
        "session_id": "ses-01",
        "num_matching_phenotypic_sessions": 2,
        "num_matching_imaging_sessions": 2,
        "session_type": "http://neurobagel.org/vocab/PhenotypicSession",
        "age": 34.1,
        "sex": "http://purl.bioontology.org/ontology/SNOMEDCT/248152002",
        "diagnosis": [
          null
        ],
        "subject_group": "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C94342",
        "assessment": [
          "https://www.cognitiveatlas.org/task/id/trm_57964b8a66aed",
          "https://www.cognitiveatlas.org/task/id/tsk_4a57abb949ece"
        ],
        "image_modal": [
          null
        ],
        "session_file_path": null
      },
      ...
]
  • add capacity to receive response with new session_type parameter / make that test pass
@rmanaem
Copy link
Contributor

rmanaem commented Jan 26, 2024

Blocked by neurobagel/planning#96

@surchs surchs added the flag:detail needed Issue requires additional clarification before a decision can be made or it can be implemented. label Mar 9, 2024
@surchs surchs transferred this issue from neurobagel/old-query-tool Mar 9, 2024
@rmanaem
Copy link
Contributor

rmanaem commented Mar 13, 2024

Unblocked since neurobagel/planning#96 has been addressed

@rmanaem rmanaem moved this from Implement - Track to Backlog in Neurobagel Mar 13, 2024
@surchs surchs moved this from Backlog to Specify - Active in Neurobagel Mar 21, 2024
@surchs
Copy link
Contributor

surchs commented Mar 21, 2024

@alyssadai do you have an example response from the API that includes session_type? mainly for testing purposes

@alyssadai
Copy link
Contributor Author

alyssadai commented Mar 22, 2024

Here you go @surchs:

[
  {
    "dataset_uuid": "http://neurobagel.org/vocab/e0c7d08c-edcc-4c2a-816a-306878ed7be2",
    "dataset_name": "BIDS synthetic",
    "dataset_portal_uri": "https://github.com/bids-standard/bids-examples",
    "dataset_total_subjects": 5,
    "records_protected": false,
    "num_matching_subjects": 5,
    "subject_data": [
      {
        "sub_id": "sub-01",
        "session_id": "ses-01",
        "num_matching_phenotypic_sessions": 2,
        "num_matching_imaging_sessions": 2,
        "session_type": "http://neurobagel.org/vocab/ImagingSession",
        "age": null,
        "sex": null,
        "diagnosis": [
          null
        ],
        "subject_group": null,
        "assessment": [
          null
        ],
        "image_modal": [
          "http://purl.org/nidash/nidm#T1Weighted",
          "http://purl.org/nidash/nidm#FlowWeighted"
        ],
        "session_file_path": "/data/neurobagel/bagel-cli/bids-examples/synthetic/sub-01/ses-01"
      },
      {
        "sub_id": "sub-01",
        "session_id": "ses-01",
        "num_matching_phenotypic_sessions": 2,
        "num_matching_imaging_sessions": 2,
        "session_type": "http://neurobagel.org/vocab/PhenotypicSession",
        "age": 34.1,
        "sex": "http://purl.bioontology.org/ontology/SNOMEDCT/248152002",
        "diagnosis": [
          null
        ],
        "subject_group": "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C94342",
        "assessment": [
          "https://www.cognitiveatlas.org/task/id/trm_57964b8a66aed",
          "https://www.cognitiveatlas.org/task/id/tsk_4a57abb949ece"
        ],
        "image_modal": [
          null
        ],
        "session_file_path": null
      },
      ...
]

@surchs
Copy link
Contributor

surchs commented Mar 22, 2024

Thanks a lot @alyssadai !

@surchs surchs moved this from Specify - Active to Specify - Done in Neurobagel Mar 22, 2024
@surchs surchs moved this from Specify - Done to Implement - Active in Neurobagel Mar 26, 2024
@surchs surchs changed the title Parse new session_type key from node API for disaggregating phenotypic + imaging session results Enable pheno level session for response and query Mar 26, 2024
@surchs surchs self-assigned this Mar 26, 2024
@alyssadai alyssadai moved this from Implement - Active to Implement - Track in Neurobagel Mar 27, 2024
@alyssadai
Copy link
Contributor Author

Blocked until #97 is reviewed to avoid messy rebasing

@surchs surchs removed their assignment Apr 9, 2024
@rmanaem rmanaem moved this from Implement - Track to Implement - Active in Neurobagel Apr 10, 2024
@rmanaem rmanaem self-assigned this Apr 10, 2024
@rmanaem
Copy link
Contributor

rmanaem commented Apr 10, 2024

DatasetID SubjectID SessionID SessionType Age Sex Diagnosis Assessment SessionFilePath NumPhenotypicSessions NumImagingSessions Modality
http://neurobagel.org/vocab/e0c7d08c-edcc-4c2a-816a-306878ed7be2 sub-01 ses-01 http://neurobagel.org/vocab/ImagingSession null null null null /data/neurobagel/bagel-cli/bids-examples/synthetic/sub-01/ses-01 1 1 [http://purl.org/nidash/nidm#T1Weighted, http://purl.org/nidash/nidm#FlowWeighted]
http://neurobagel.org/vocab/e0c7d08c-edcc-4c2a-816a-306878ed7be2 sub-01 ses-01 http://neurobagel.org/vocab/PhenotypicSession 34.1 http://purl.bioontology.org/ontology/SNOMEDCT/248152002 null [https://www.cognitiveatlas.org/task/id/trm_57964b8a66aed, https://www.cognitiveatlas.org/task/id/tsk_4a57abb949ece] null 1 1 null

@rmanaem rmanaem moved this from Implement - Active to Implement - Done in Neurobagel Apr 10, 2024
@surchs surchs moved this from Implement - Done to Review - Active in Neurobagel Apr 10, 2024
@github-project-automation github-project-automation bot moved this from Review - Active to Review - Done in Neurobagel Apr 11, 2024
@surchs
Copy link
Contributor

surchs commented Apr 11, 2024

🚀 Issue was released in v0.2.0 🚀

@surchs surchs added the released This issue/pull request has been released. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag:detail needed Issue requires additional clarification before a decision can be made or it can be implemented. released This issue/pull request has been released.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants