Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Initial Query API #138

Closed
computationdoc opened this issue Sep 18, 2019 · 10 comments
Closed

Initial Query API #138

computationdoc opened this issue Sep 18, 2019 · 10 comments
Assignees
Labels
Projects

Comments

@computationdoc
Copy link

computationdoc commented Sep 18, 2019

Create the initial HuBMAP query API endpoint. At a minimum we need an endpoint running in a Docker container that serves a single service such as GET /entity/....
-All entity types
-All entities of a type (returns uuids)
-Detailed info of an entity given uuid

@computationdoc computationdoc created this issue from a note in HIVE (Backlog) Sep 18, 2019
@computationdoc computationdoc moved this from Backlog to In Progress in HIVE Sep 20, 2019
@ngehlenborg
Copy link
Member

@cborromeo @shirey @mruffalo: @mccalluc and I need some input on which entity types are currently implemented in the database and which ones will be available once this issue has been addressed. That is a dependency for #136 and #133.

@mccalluc
Copy link
Contributor

mccalluc commented Oct 1, 2019

Will the API be some separate application, or will it use the existing api end point in the existing Django app?

@computationdoc
Copy link
Author

computationdoc commented Oct 1, 2019 via email

@shirey
Copy link
Member

shirey commented Oct 1, 2019

@ngehlenborg @mccalluc At the top level our entity types are Donor, Sample, Dataset. Where the "sample" is tissue and has sub-types like: organ, block, biopsy, fresh frozen tissue, etc...

WRT: APIs to reiterate what Jonathan said, APIs don't need to exist within Django, we'll follow a micro-services architecture where WS endpoints can exist in multiple locations and can be implemented in multiple technologies.

@frdougal
Copy link

frdougal commented Oct 1, 2019

This represents an initial draft of the REST API calls. In the future, we can expand on these and return more data as we develop more use cases.

/entities/ - lists the entity types within the Neo4j system
example JSON response: {"entity_types" : ["Sample", "Donor", "Dataset"]}

/entities/<type> - returns a list of all the UUIDs in the system
example URL: /entities/donors - returns a list of all the donor UUIDs in the system
example JSON response: {"uuids" : ["11866f9586fdac34c95ac8a2737a83dd", "b2b59b227e0dfd7ddd4799f909bc3f01", "c3323cecca52e99113a56946a2bcdd5f", "44e00b44dda813cd39da6934c8954d71", "c0bfcf32a6da83c37a5ed7b2eeabdefe", "c83b24f93af72ffcee0dd94ad1d61d7a", "a41210275f08ec8b8b973a4f10a73e5f"]}

/entities/<uuid> - returns all the provenance and metadata associated with a particular entity
example URL: /entities/11866f9586fdac34c95ac8a2737a83dd
example JSON response: {
"provenance_create_timestamp": 1567520904428,
"provenance_user_email": "shirey@pitt.edu",
"provenance_group_name": "hubmap-testing",
"user_group_uuid": "5bd084c8-edc2-11e8-802f-0e368f3075e8",
"description": "Test Donor 1",
"label": "Bill Test 1",
"uuid": "11866f9586fdac34c95ac8a2737a83dd",
"provenance_user_displayname": "William Shirey",
"provenance_group_uuid": "5bd084c8-edc2-11e8-802f-0e368f3075e8",
"provenance_user_sub": "e19adbbb-73c3-43a7-b05e-0eead04f5ff8",
"provenance_modified_timestamp": 1567520904428
}

/entities/samples?sample-type=<sample-type> - returns a list of all sample UUIDs where tissue type is sample-type
example URL: /entities/samples?sample-type=organ
example JSON response: {"uuids" : ["ae6bf50908a4a2089d2eacd8e464fe86", "45ad98de3c9b5983a274d801969ae464", "37ef1d1d79c1e2a50ea6d18cdbb3762c", "f7c3c6a3ded8876226a673249b4a8423"]}
options for sample-type (case-insensitive):
Organ
Blood
Biopsy
Cell lysate
FFPE block
PFA Fixed frozen OCT block
Fixed tissue piece
Flash frozen, liquid nitrogen
Formalin fixed OCT block
Fresh frozen tissue
Fresh frozen oct block
Fresh tissue
Frozen cell pellet (Buffy coat)
Module
PBMC
Plasma
Nuclei RNAlater
Organ Piece
RNAlater treated and stored
Segment
Serum
Single cell cryopreserved
CLARITY hydrogel
Cryosections/curls from fresh frozen OCT
Cryosections/curls RNAlater
FFPE slide
Fixed Frozen section slide
Fresh Frozen section slide
gDNA
Nuclei
Protein
RNA, total
ATACseq
CODEX
RNAseq
scATACseq
scRNAseq
seqFISH
snATACseq
snRNAseq
WES

/entities/samples?organ-type=<organ-type> - returns a list of all sample UUIDs where tissue type is organ-type
example URL: /entities/samples?organ-type=liver
example JSON response: {"uuids" : ["ae6bf50908a4a2089d2eacd8e464fe86", "37ef1d1d79c1e2a50ea6d18cdbb3762c"]}
options for organ-type (case-insensitive):
Bladder
Brain
Kidney (Right)
Kidney (Left)
Heart
Large Intestine
Small Intestine
Left Lung
Right Lung
Lymph Node
Spleen
Thymus
Ureter
Liver
Other

/entities/donors?created-by=<user-email> - returns a list of all donor UUIDs that were registered by the user-email address
example URL: /entities/donors?created-by=shirey@pitt.edu
example JSON response: {"uuids" : ["11866f9586fdac34c95ac8a2737a83dd", "b2b59b227e0dfd7ddd4799f909bc3f01", "c3323cecca52e99113a56946a2bcdd5f", "44e00b44dda813cd39da6934c8954d71", "c0bfcf32a6da83c37a5ed7b2eeabdefe", "c83b24f93af72ffcee0dd94ad1d61d7a", "a41210275f08ec8b8b973a4f10a73e5f"]}

@ngehlenborg
Copy link
Member

Thanks @cborromeo, that is helpful. Obviously not for now, but something that we will need in the future is to replace the organ options and the sample options with ontology terms.

@mccalluc
Copy link
Contributor

mccalluc commented Oct 2, 2019

Thank you! This is what I've wanted to see.

@mruffalo
Copy link
Collaborator

mruffalo commented Oct 2, 2019

I agree with @shirey that APIs don't need to be implemented in this Django application, but the API-centric Django app at hubmap/dataportal is a reasonable place. There is a nonzero cost to spinning up an entirely new project for a service, tracking another set of dependencies for security issues, adding new containers to any runtime configuration in development and production, etc.

I'd propose implementing APIs in this project if they're going to be written in Python, unless there's a very good reason not to.

@computationdoc
Copy link
Author

computationdoc commented Oct 2, 2019 via email

@mccalluc
Copy link
Contributor

"Done" -- Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
HIVE
  
Done
Development

No branches or pull requests

6 participants