va-big-data-genomics / trellis-mvp-data-modelling

Resources uses for interacting and updating the Trellis MVP graph database model.
MIT License
0 stars 0 forks source link

Add study node to represent telomere length pilot #2

Closed pbilling closed 1 year ago

pbilling commented 1 year ago
pbilling commented 1 year ago

Cypher query to create Study node:

CREATE (s:Study {name:"WgsTelomereLengthPilot", studyLead:"Prathima Vembu", participantCount:1000})
RETURN s
pbilling commented 1 year ago

Query elements

Cypher query to add participants to study:

MATCH (s:Study), (p:Person)-[:HAS_BIOLOGICAL_OME]->(g:Genome)-[:HAS_SEQUENCING_READS]->(cram:Cram)-[:HAS_INDEX]->(crai:Crai)
WHERE s.name = "WgsTelomereLengthPilot"
AND EXISTS(p.aaaDiagnosis)
WITH DISTINCT p, s
LIMIT 1000
MERGE (s)-[:HAS_PARTICIPANT {study:"WgsTelomereLengthPilot"}]->(:Participant)-[:IS]->(p)
RETURN COUNT(p)
pbilling commented 1 year ago

Validation query:

MATCH (s:Study)-[:HAS_PARTICIPANT]->(:Participant)-[:IS]->(p:Person)
WHERE s.name = "WgsTelomereLengthPilot"
RETURN COUNT(p)

COUNT(p)
1000
pbilling commented 1 year ago

Get phenotype information:

MATCH (s:Study)-[:HAS_PARTICIPANT]->(:Participant)-[:IS]->(p:Person)-[:HAS_BIOLOGICAL_OME]->(:Genome)-[:HAS_SEQUENCING_READS]->(cram:Cram)-[:HAS_INDEX]->(crai:Crai)
WHERE s.name = "WgsTelomereLengthPilot"
RETURN cram.sample, p.ageAtEnrollment, p.vaReportedGender, p.hareEthnicity, p.aaaDiagnosis, cram.uri, crai.uri