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.1.1.tar.gz (13.8 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.1.1-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for controlled_vocabulary_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b27acd71e147dbcde0b6a16f926db540894cd7473fc99966303775e688d99588
MD5 5457c8f233db8e4be8dd28ec39785a68
BLAKE2b-256 be2a6cc16993bb6fe5a199cfee4b9175ca0f1400b662e89c4caa98e338476296

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for controlled_vocabulary_utils-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9f98f1fffc5c2b2c34fda0db49bd0b986b571a163efec9ebe159a1e6c88d5b05
MD5 b0af19c3c20051ae7f0b39446268daca
BLAKE2b-256 3506e18671231994932d34f83fb5700c646189701308bac97ecb591152534e9e

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