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

DB cleanup #1371

Closed
2 tasks done
ao508 opened this issue Jan 9, 2025 · 1 comment
Closed
2 tasks done

DB cleanup #1371

ao508 opened this issue Jan 9, 2025 · 1 comment

Comments

@ao508
Copy link
Collaborator

ao508 commented Jan 9, 2025

TODO

  • purge patient nodes that do not have any samples attached
  • consolidate patient nodes that share the same CMO patient ID (ex: C-X56L8F exists on 2 distinct patient nodes)
@qu8n
Copy link
Collaborator

qu8n commented Jan 16, 2025

For reference, query for purging patient nodes with no samples attached:

MATCH (p:Patient)<-[:IS_ALIAS]-(pa:PatientAlias)
OPTIONAL MATCH (p)-[:HAS_SAMPLE]->(s:Sample) // using OPTIONAL MATCH so patients without samples are included
WITH p, pa, COUNT(s) AS sampleCount
WHERE sampleCount = 0
DETACH DELETE p, pa // using DETACH to delete p-pa edges as well

@ao508 ao508 closed this as completed Jan 29, 2025
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

No branches or pull requests

2 participants