Skip to main content

A package for evaluating values for terms in a controlled vocabulary.

Project description

Controlled Vocabulary Utils

A package for evaluating values for terms in a controlled vocabulary.

Usage

Contents of the controlled vocabulary configuration file:

---
format_version: 0.1.0
name: Controlled Vocabulary for Bioinformatics
description: TBD
terms:
  - name: variant_effect_on_function
    def: The effect that the variant has on the function of the gene.
    datatype: string
    accepted_values:
      "loss": The variant has caused a loss of function.
      "gain": The variant has caused a gain of function.
  - name: region_of_transcript_affected
    def: The region of the transcript that the variant affects.
    datatype: string
    accepted_values:
      "start": The variant affects the start of the transcript.
      "end": The variant affects the end of the transcript.
      "whole transcript": The variant affects the whole transcript.
      "overlapping end": The variant overlaps one end of the ends of the transcript.
  - name: variant_status
    def: TBD
    alt_names:
      - variant_qc_status
    datatype: string
    accepted_values:
  - name: score
    def: TBD
    datatype: integer
    accepted_values:
      "10": "very low score"
      "20": "low score"
      "40": "mid-level score"
  - name: zygosity
    def: TBD
    alt_names:
      - zyg
    datatype: string
    accepted_values:
      "heterozygous": "heterozygous"
      "homozygous": "homozygous"
      "mosaic": "mosaic"
from controlled_vocabulary_utils import CVValidationManager

config_file = "conf/controlled_vocabulary.yaml"

vm = ValidationManager(
    config_file=config_file,
    verbose=verbose,
)

term = "zygosity"
val = "mosaic"
if vm.is_valid(term, val):
    print(f"'{val}' is a valid value for term '{term}'")
else:
    print(f"'{val}' is NOT a valid value for term '{term}'")

History

0.1.0 (2025-02-22)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

controlled_vocabulary_utils-0.2.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

controlled_vocabulary_utils-0.2.0-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file controlled_vocabulary_utils-0.2.0.tar.gz.

File metadata

File hashes

Hashes for controlled_vocabulary_utils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fd8d88566494a4f82fe9a6ccbf36edb4b4b7c16a5ab2d3d9b2e2dd97055fd8f8
MD5 1dad250b7c9c99d27cf248b19e899cfc
BLAKE2b-256 a034232514a2f7ec70fc84eb4259b77644935fcc75740bc311510144e73f3e14

See more details on using hashes here.

File details

Details for the file controlled_vocabulary_utils-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for controlled_vocabulary_utils-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6a3d741e7c3d1b5f7def7a8c768e28092090fee71a32cd59d241f02e4566bfc2
MD5 e5e96234c5e894be9b9b593b8e1d8ff0
BLAKE2b-256 834e88be33449f17dcca04d7afd545fd02519aa98d98244b81891f90249128b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page