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.3.0.tar.gz (14.1 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.3.0-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for controlled_vocabulary_utils-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e64375262637652b93c8b2209f63ad419682277d28a4a56c9aee1e68638314ff
MD5 5e7c7935da9314835d861c14febeed05
BLAKE2b-256 0df9fe71c2f2808b7506e2bf1f550ee3f504ec0485fbd2ab3a84fa9464830a76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for controlled_vocabulary_utils-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f9e715597eef84656a12b157004a9cd684de2b4870f79694d874d9c1bff100cd
MD5 877076b2a78c5810c55346a0b7ba6b7b
BLAKE2b-256 d46811065c5bf2b38e911d5afd62523ad15dcd8d82f9fbef9215705d1a8c36c5

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