biocompute-objects / portal_userdb

1 stars 1 forks source link

Add better validation for `https://biocomputeobject.org/api/objects/validate` #317

Open HadleyKing opened 8 months ago

HadleyKing commented 8 months ago

Validating the following object only returns "Bad request. BCO is not formatted correctly."

More detail should be included.


{
    "bco_id": "https://scihive.fda.gov/dna.cgi?cmdr=propget&ids=843918&mode=json",
    "bco_spec_version": "1.3",
    "provenance_domain": {
        "name": "test",
        "version": "1.0.1",
        "review": [
            {
                "date": "2/20/2024",
                "reviewer": {
                    "name": "hadley",
                    "contribution": [
                        "createdBy"
                    ]
                },
                "status": "unreviewed"
            }
        ],
        "derived_from": "https://scihive.fda.gov/dna.cgi?cmdr=propget&mode=json&ids=undefined",
        "embargo": {
        },
        "created": "",
        "modified": "",
        "contributors": [
            {
                "name": "hadley",
                "contribution": [
                    "createdBy"
                ]
            }
        ],
        "license": "mit"
    },
    "usability_domain": [
        "some stuff"
    ],
    "description_domain": {
        "keywords": [
            "no it is not"
        ],
        "xref": [
            {
                "namespace": "not required",
                "name": "not required",
                "ids": [
                    "not required"
                ],
                "access_time": "2/8/2024"
            }
        ],
        "platform": [
            "HIVE"
        ],
        "pipeline_steps": [
            {
                "step_number": 1,
                "name": "Screen Short Read Against Genome",
                "description": "Random pick sequences to run alignment with specific genome",
                "input_list": [
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=637703"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=637702"
                    }
                ],
                "output_list": [
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843914&filename=dna-alignx_screenResult.csv"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843914&filename=dna-alignx_screenShannon.csv"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843914&filename=dna-alignx_acclist.csv"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843914&filename=coverage_dict"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843914&filename=_.progress.json"
                    }
                ]
            },
            {
                "step_number": 2,
                "name": "HIVE-Hexagon",
                "description": "HIVE hexagon alignment engine optimized for HIVE cloud performance on Next Generation data",
                "input_list": [
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=20607"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=637703"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=637702"
                    }
                ],
                "output_list": [
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=coverage_dict"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=alignment.hiveal"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=histogram.csv"
                    },
                    {
                        "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=_.progress.json"
                    }
                ]
            }
        ]
    },
    "execution_domain": {
        "script": [
            {
                "uri": {
                    "uri": ""
                }
            }
        ],
        "script_driver": "",
        "software_prerequisites": [
            {
                "name": "",
                "version": "",
                "uri": {
                    "uri": ""
                }
            }
        ],
        "external_data_endpoints": [
            {
                "name": "HIVE",
                "url": "https://scihive.fda.gov/dna.cgi?cmd=login"
            }
        ],
        "environment_variables": {
        }
    },
    "parametric_domain": [
        {
            "param": "_type",
            "value": "svc-dna-screening",
            "step": "1"
        },
        {
            "param": "name",
            "value": "Patient_205_R1_fastq",
            "step": "1"
        },
        {
            "param": "CensusIterations",
            "value": "1",
            "step": "1"
        },
        {
            "param": "CensuslimitIterations",
            "value": "50",
            "step": "1"
        },
        {
            "param": "chunk_size",
            "value": "4000",
            "step": "1"
        },
        {
            "param": "cutOffvalue",
            "value": "0.0005",
            "step": "1"
        },
        {
            "param": "filterNs",
            "value": "true",
            "step": "1"
        },
        {
            "param": "random_seed",
            "value": "0",
            "step": "1"
        },
        {
            "param": "Sample",
            "value": "10",
            "step": "1"
        },
        {
            "param": "slice",
            "value": "0",
            "step": "1"
        },
        {
            "param": "alignSelector",
            "value": "svc-align-blast",
            "step": "1"
        },
        {
            "param": "automanual",
            "value": "0",
            "step": "1"
        },
        {
            "param": "taxDepth",
            "value": "species",
            "step": "1"
        },
        {
            "param": "subject",
            "value": "653801",
            "step": "1"
        },
        {
            "param": "resultInQueryDir",
            "value": "0",
            "step": "1"
        },
        {
            "param": "selfStopping",
            "value": "true",
            "step": "1"
        },
        {
            "param": "storeAlignments",
            "value": "false",
            "step": "1"
        },
        {
            "param": "blastparams",
            "value": "{\"blastWordSize\":28,\"blastMegablast\":true,\"blastevalue\":0.000001}",
            "step": "1"
        },
        {
            "param": "censusScope_otherInput",
            "value": "{\"textBasedColumn\":0,\"textBasedFileSeparator\":1}",
            "step": "1"
        },
        {
            "param": "_type",
            "value": "svc-align-hexagon",
            "step": "2"
        },
        {
            "param": "name",
            "value": "Patient_205_R1_fastq versus Human_Genome_Chromosmes_v19_Build37_3.fa",
            "step": "2"
        },
        {
            "param": "alignmentEngine",
            "value": "0",
            "step": "2"
        },
        {
            "param": "alignParam",
            "value": "{\"allowShorterEnds\":0,\"costGapNext\":-4,\"costGapOpen\":-12,\"costMatch\":5,\"costMismatch\":-4,\"costMismatchNext\":-6,\"isglobal\":0,\"seed\":14}",
            "step": "2"
        },
        {
            "param": "basicAlgParam",
            "value": "{\"searchRepeatsAndTrans\":0}",
            "step": "2"
        },
        {
            "param": "complexity",
            "value": "{\"complexityQry\":{\"11.0.0\":{\"complexityEntropy\":0,\"complexityWindow\":0,\"maximumPercentLowQualityAllowed\":0}},\"complexityRef\":{\"11.1.0\":{\"complexityRefEntropy\":0,\"complexityRefWindow\":0,\"acceptNNNQuaTrheshold\":0}}}",
            "step": "2"
        },
        {
            "param": "minMatch",
            "value": "{\"12.0\":{\"minMatchLen\":75,\"minMatchUnit\":0}}",
            "step": "2"
        },
        {
            "param": "mismatches",
            "value": "{\"13.0\":{\"maxMissQueryPercent\":3,\"considerGoodSubalignments\":1}}",
            "step": "2"
        },
        {
            "param": "computeDiagonalWidth",
            "value": "auto",
            "step": "2"
        },
        {
            "param": "doubleHash",
            "value": "false",
            "step": "2"
        },
        {
            "param": "doubleStagePerfect",
            "value": "1",
            "step": "2"
        },
        {
            "param": "hashCompileStp",
            "value": "2",
            "step": "2"
        },
        {
            "param": "hashStp",
            "value": "auto",
            "step": "2"
        },
        {
            "param": "isbackward",
            "value": "1",
            "step": "2"
        },
        {
            "param": "isextendtails",
            "value": "0",
            "step": "2"
        },
        {
            "param": "isoptimize",
            "value": "1",
            "step": "2"
        },
        {
            "param": "keepAllMatches",
            "value": "0",
            "step": "2"
        },
        {
            "param": "looseExtenderMinimumLengthPercent",
            "value": "66",
            "step": "2"
        },
        {
            "param": "looseExtenderMismatchesPercent",
            "value": "15",
            "step": "2"
        },
        {
            "param": "maxExtensionGaps",
            "value": "0",
            "step": "2"
        },
        {
            "param": "maxHashBin",
            "value": "50",
            "step": "2"
        },
        {
            "param": "maxHitsPerRead",
            "value": "50",
            "step": "2"
        },
        {
            "param": "maxNumberQuery",
            "value": "all",
            "step": "2"
        },
        {
            "param": "random_seed",
            "value": "0",
            "step": "2"
        },
        {
            "param": "readconflicts",
            "value": "{\"resolveConfictsUnique\":false}",
            "step": "2"
        },
        {
            "param": "reverseEngine",
            "value": "0",
            "step": "2"
        },
        {
            "param": "scoreFilter",
            "value": "None",
            "step": "2"
        },
        {
            "param": "selfQueryPosJumpInNonPerfectAlignment",
            "value": "1",
            "step": "2"
        },
        {
            "param": "trimLowScoreEnds",
            "value": "{\"44.0\":{\"trimLowScoreEndsWindow\":0}}",
            "step": "2"
        },
        {
            "param": "useRedundSim",
            "value": "1",
            "step": "2"
        },
        {
            "param": "alignSelector",
            "value": "622206",
            "step": "2"
        },
        {
            "param": "force_reindex",
            "value": "false",
            "step": "2"
        }
    ],
    "io_domain": {
        "input_subdomain": [
            {
                "uri": {
                    "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=637703"
                }
            },
            {
                "uri": {
                    "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=637702"
                }
            }
        ],
        "output_subdomain": [
            {
                "mediatype": "application/octet-stream",
                "uri": {
                    "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=coverage_dict"
                }
            },
            {
                "mediatype": "application/octet-stream",
                "uri": {
                    "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=alignment.hiveal"
                }
            },
            {
                "mediatype": "application/octet-stream",
                "uri": {
                    "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=histogram.csv"
                }
            },
            {
                "mediatype": "application/octet-stream",
                "uri": {
                    "uri": "https://scihive.fda.gov/dna.cgi?cmd=objFile&ids=843915&filename=_.progress.json"
                }
            }
        ]
    },
    "error_domain": {
        "algorithmic_error": {
            "text": "v"
        },
        "empirical_error": {
            "text": "not required"
        }
    },
    "checksum": "079470722b296d2ad3bb880f46c444cb72eb8741"
}```