DataBiosphere / azul

Metadata indexer and query service used for AnVIL, HCA, LungMAP, and CGP
Apache License 2.0
5 stars 2 forks source link

Merge `protocol` inner entities for service response #2183

Open dsotirho-ucsc opened 3 years ago

dsotirho-ucsc commented 3 years ago

In #2043 the service response was modified to keep individual protocols separated as list items inside the protocols inner-entity, and each list item only contains the protocol fields related to each protocol (eg. workflow if an AnalysisProtocol, assay_type if an ImagingProtocol).

The protocols inner entity should be changed from this new format:

{
    "protocols": [
        {
            "workflow": [
                "optimus_v1.3.1"
            ]
        },
        {
            "libraryConstructionApproach": [
                "10X v2 sequencing"
            ]
        },
        {
            "instrumentManufacturerModel": [
                "Illumina HiSeq 2500"
            ],
            "pairedEnd": [
                true
            ],
        },
    ],
}

to a singleton containing the combined result such as this:

{
    "protocols": [
        {
            "protocolEntityType": [
                "sequencing_protocol",
                "library_preparation_protocol",
                "analysis_protocol"
            ],
            "instrumentManufacturerModel": [
                "Illumina HiSeq 2500"
            ],
            "libraryConstructionApproach": [
                "10X v2 sequencing"
            ],
            "pairedEnd": [
                true
            ],
            "workflow": [
                "optimus_v1.3.1"
            ],
        },
    ],
}

This new response will be similar in structure to how it was prior to #2043 however without the nulls being added to each field.

theathorn commented 3 years ago

Do we really need this for DCP/1? Perhaps remove the "HCA" label?

hannes-ucsc commented 3 years ago

To be discussed after stand-up.

melainalegaspi commented 3 years ago

@hannes-ucsc :"Won't need to port to DCP 1."