From e7b24c200d528b6976e50fbbe33d250e8faf7ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20Jer=C5=A1e?= Date: Mon, 18 Mar 2024 10:40:17 +0100 Subject: [PATCH] Add variants related models --- docs/CHANGELOG.rst | 1 + src/resdk/resources/variants.py | 71 +++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 src/resdk/resources/variants.py diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 70dd46b6..1112eb4b 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -12,6 +12,7 @@ Unreleased Added ----- - Add ``restart`` method to the ``Data`` resource +- Add variants related models =================== diff --git a/src/resdk/resources/variants.py b/src/resdk/resources/variants.py new file mode 100644 index 00000000..9585a0fa --- /dev/null +++ b/src/resdk/resources/variants.py @@ -0,0 +1,71 @@ +"""Variant resources.""" + +from .base import BaseResource + + +class Variant(BaseResource): + """ResolweBio Variant resource.""" + + endpoint = "variant" + + READ_ONLY_FIELDS = BaseResource.READ_ONLY_FIELDS + ( + "species", + "genome_assembly", + "chromosome", + "position", + "reference", + "alternative", + ) + + def __repr__(self) -> str: + """Return string representation.""" + return ( + f"Variant " + ) + + +class VariantAnnotation(BaseResource): + """VariantAnnotation resource.""" + + endpoint = "variant_annotation" + + READ_ONLY_FIELDS = BaseResource.READ_ONLY_FIELDS + ( + "variant", + "type", + "annotation", + "annotation_impact", + "gene", + "protein_impact", + "feature_id", + "clinical_diagnosis", + "clinical_significance", + "dbsnp_id", + "clinical_var_id", + "data", + ) + + def __repr__(self) -> str: + """Return string representation.""" + return f"VariantAnnotation " + + +class VariantCall(BaseResource): + """VariantCall resource.""" + + endpoint = "variant_call" + + READ_ONLY_FIELDS = BaseResource.READ_ONLY_FIELDS + ( + "sample", + "variant", + "experiment", + "quality", + "depth", + "filter", + "genotype", + "data", + ) + + def __repr__(self) -> str: + """Return string representation.""" + return f"VariantCall "