VariantEffect / mavedb-api

MaveDB API
GNU Affero General Public License v3.0
8 stars 2 forks source link

Updating a score set fails due to an error involving target genes. #190

Closed jstone-uw closed 1 month ago

jstone-uw commented 2 months ago

Some score sets cannot be updated without removing and re-adding their target genes.

This is the case, for instance, with a score set that includes a target gene copied from one of the existing TEM-15 β-lactamase genes. My unpublished score set https://mavedb.org/#/score-sets/tmp:b66936ec-979b-4187-a02c-383d86b88b98 is an example.

Updating this score set yields validation errors:

{
    "detail": [
        {
            "loc": [
                "body",
                "targetGenes",
                0,
                "targetSequence",
                "label"
            ],
            "msg": "Target sequence label `TEM-15 β-lactamase` can contain only letters, numbers, and underscores.",
            "type": "assertion_error",
            "ctx": {
                "custom_loc": null,
                "triggering_exceptions": null
            }
        },
        {
            "loc": [
                "body",
                "targetGenes",
                0,
                "__root__"
            ],
            "msg": "Expected either a `target_sequence` or a `target_accession`, not neither.",
            "type": "value_error"
        }
    ]
}

It seems like the second error may be a result of the first, since score sets without special characters in their target names can be updated.

bencap commented 2 months ago

I think the only thing we need to enforce in target labels is that they don't contain a colon, since that is what separates the label from the variant string.

bencap commented 1 month ago

Released in https://github.com/VariantEffect/mavedb-api/releases/tag/v2024.1.0