Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 78 additions & 87 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,55 +1,37 @@
[project]
name = "ga4gh.va_spec"
authors = [
{name = "Matt Brush"},
{name = "Javier Lopez"},
]
authors = [{ name = "Matt Brush" }, { name = "Javier Lopez" }]
readme = "README.md"
description = "GA4GH Variant Annotation (VA) reference implementation"
license = {file = "LICENSE"}
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
]
keywords = [
"bioinformatics",
"ga4gh",
"genomics",
"variation"
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
]
keywords = ["bioinformatics", "ga4gh", "genomics", "variation"]
requires-python = ">=3.10"
dynamic = ["version"]
dependencies = [
"ga4gh.vrs~=2.4.0-a1",
"ga4gh.cat_vrs~=0.8.0-a1",
"pydantic>=2.0,<3.0",
"typing_extensions",
"ga4gh.cat_vrs @ git+https://github.com/ga4gh/cat-vrs-python.git@30d6c5035fb7cd000bf637d8f03069633dd10ff1",
"pydantic>=2.0,<3.0",
"typing_extensions",
]

[project.optional-dependencies]
dev = [
"pre-commit",
"ruff==0.4.9",
]
tests = [
"pytest",
"pytest-cov",
"pyyaml"
]
notebooks = [
"jupyter",
]
dev = ["pre-commit", "ruff==0.4.9"]
tests = ["pytest", "pytest-cov", "pyyaml"]
notebooks = ["jupyter"]

[project.urls]
Homepage = "https://github.com/ga4gh/va-spec-python"
Expand All @@ -64,53 +46,52 @@ build-backend = "setuptools.build_meta"

[tool.ruff]
src = ["src"]
exclude = [
"submodules"
]
exclude = ["submodules"]

[tool.ruff.lint]
select = [
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"E",
"W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
fixable = [
"I",
"F401",
"D",
"UP",
"ANN",
"B",
"C4",
"G",
"PIE",
"PT",
"RSE",
"SIM",
"RUF"
"I",
"F401",
"D",
"UP",
"ANN",
"B",
"C4",
"G",
"PIE",
"PT",
"RSE",
"SIM",
"RUF",
]
# ANN101 - missing-type-self
# ANN003 - missing-type-kwargs
Expand All @@ -129,11 +110,21 @@ fixable = [
# S321 - suspicious-ftp-lib-usage
# *ignored for compatibility with formatter
ignore = [
"ANN101", "ANN003",
"D203", "D205", "D206", "D213", "D300", "D400", "D415",
"E111", "E114", "E117", "E501",
"W191",
"S321",
"ANN101",
"ANN003",
"D203",
"D205",
"D206",
"D213",
"D300",
"D400",
"D415",
"E111",
"E114",
"E117",
"E501",
"W191",
"S321",
]

[tool.ruff.lint.per-file-ignores]
Expand Down
12 changes: 7 additions & 5 deletions src/ga4gh/va_spec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"""Package for VA-Spec Python implementation"""

from importlib.metadata import PackageNotFoundError, version
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as package_version

from ga4gh.va_spec.version import VASPEC_VERSION

try:
__version__ = version(__name__)
__version__ = package_version(__name__)
except PackageNotFoundError: # pragma: nocover
__version__ = "unknown"
finally:
del version, PackageNotFoundError

del package_version, PackageNotFoundError

VASPEC_VERSION = "1.1.0-snapshot.2026-06.1"
__all__ = ["VASPEC_VERSION", "__version__"]
9 changes: 9 additions & 0 deletions src/ga4gh/va_spec/aac_2017/metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Provide metadata for AAC 2017 VA-Spec models."""

from ga4gh.va_spec.metadata import VASpecMetadataMixin


class AAC2017MetadataMixin(VASpecMetadataMixin):
"""Provide metadata shared by models in the AAC 2017 namespace."""

_schema_namespace = "aac-2017"
31 changes: 26 additions & 5 deletions src/ga4gh/va_spec/aac_2017/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@

from enum import Enum
from types import MappingProxyType
from typing import ClassVar

from pydantic import Field, RootModel, field_validator, model_validator
from pydantic.dataclasses import dataclass
from typing_extensions import Self

from ga4gh.core.metadata import Maturity
from ga4gh.core.models import BaseModelForbidExtra, MappableConcept, iriReference
from ga4gh.va_spec.aac_2017.metadata import AAC2017MetadataMixin
from ga4gh.va_spec.base.core import (
Direction,
Document,
Expand Down Expand Up @@ -58,9 +61,11 @@ class AmpAscoCapEvidenceLineStrength(str, Enum):
]


class AmpAscoCapEvidenceLine(EvidenceLine):
class AmpAscoCapEvidenceLine(AAC2017MetadataMixin, EvidenceLine):
"""Evidence line for AMP/ASCO/CAP"""

_maturity: ClassVar[Maturity] = Maturity.DRAFT

targetProposition: (
VariantPrognosticProposition
| VariantDiagnosticProposition
Expand Down Expand Up @@ -88,29 +93,41 @@ class _PrognosticEvidenceLineObject(AmpAscoCapEvidenceLine):
targetProposition: VariantPrognosticProposition


class PrognosticEvidenceLine(RootModel[_PrognosticEvidenceLineObject | iriReference]):
class PrognosticEvidenceLine(
AAC2017MetadataMixin, RootModel[_PrognosticEvidenceLineObject | iriReference]
):
"""Prognostic evidence line for AMP/ASCO/CAP"""

_maturity: ClassVar[Maturity] = Maturity.DRAFT


class _DiagnosticEvidenceLineObject(AmpAscoCapEvidenceLine):
"""Internal diagnostic evidence line for AMP/ASCO/CAP"""

targetProposition: VariantDiagnosticProposition


class DiagnosticEvidenceLine(RootModel[_DiagnosticEvidenceLineObject | iriReference]):
class DiagnosticEvidenceLine(
AAC2017MetadataMixin, RootModel[_DiagnosticEvidenceLineObject | iriReference]
):
"""Diagnostic evidence line for AMP/ASCO/CAP"""

_maturity: ClassVar[Maturity] = Maturity.DRAFT


class _TherapeuticEvidenceLineObject(AmpAscoCapEvidenceLine):
"""Internal therapeutic evidence line for AMP/ASCO/CAP"""

targetProposition: VariantTherapeuticResponseProposition


class TherapeuticEvidenceLine(RootModel[_TherapeuticEvidenceLineObject | iriReference]):
class TherapeuticEvidenceLine(
AAC2017MetadataMixin, RootModel[_TherapeuticEvidenceLineObject | iriReference]
):
"""Therapeutic evidence line for AMP/ASCO/CAP"""

_maturity: ClassVar[Maturity] = Maturity.DRAFT


class AmpAscoCapStrengthCode(str, Enum):
"""Define constraints for AMP/ASCO/CAP strength coding"""
Expand Down Expand Up @@ -177,12 +194,16 @@ class AmpAscoCapConfig:
)


class VariantClinicalSignificanceStatement(Statement, BaseModelForbidExtra):
class VariantClinicalSignificanceStatement(
AAC2017MetadataMixin, Statement, BaseModelForbidExtra
):
"""A statement reporting a conclusion from a single study about the clinical
significance of a variant with respect to a condition, based on interpretation of
the study's results.
"""

_maturity: ClassVar[Maturity] = Maturity.DRAFT

proposition: VariantClinicalSignificanceProposition
strength: MappableConcept | None = Field(
default=None,
Expand Down
9 changes: 9 additions & 0 deletions src/ga4gh/va_spec/acmg_2015/metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Provide metadata for ACMG 2015 VA-Spec models."""

from ga4gh.va_spec.metadata import VASpecMetadataMixin


class ACMG2015MetadataMixin(VASpecMetadataMixin):
"""Provide metadata shared by models in the ACMG 2015 namespace."""

_schema_namespace = "acmg-2015"
10 changes: 8 additions & 2 deletions src/ga4gh/va_spec/acmg_2015/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
from pydantic import Field, field_validator, model_validator
from typing_extensions import Self

from ga4gh.core.metadata import Maturity
from ga4gh.core.models import MappableConcept, iriReference
from ga4gh.va_spec.acmg_2015.metadata import ACMG2015MetadataMixin
from ga4gh.va_spec.base.core import (
Direction,
Document,
Expand Down Expand Up @@ -62,7 +64,7 @@ class AcmgClassification(str, Enum):


class VariantPathogenicityEvidenceLine(
EvidenceLine, MethodTypeCriterionValidationMixin
ACMG2015MetadataMixin, EvidenceLine, MethodTypeCriterionValidationMixin
):
"""An Evidence Line that describes how a specific type of information was
interpreted as evidence for or against a variant's pathogenicity. In the ACMG
Expand All @@ -71,6 +73,8 @@ class VariantPathogenicityEvidenceLine(
adjusting the default strength based on the quality and abundance of evidence.
"""

_maturity: ClassVar[Maturity] = Maturity.DRAFT

targetProposition: VariantPathogenicityProposition | None = Field(
default=None,
description="A Variant Pathogenicity Proposition against which a specific type of evidence was assessed, to determine the strength and direction of support this evidence provides for or against the proposition's validity.",
Expand Down Expand Up @@ -320,9 +324,11 @@ def validate_model(self) -> Self:
return self


class VariantPathogenicityStatement(Statement):
class VariantPathogenicityStatement(ACMG2015MetadataMixin, Statement):
"""A Statement describing the role of a variant in causing an inherited condition."""

_maturity: ClassVar[Maturity] = Maturity.DRAFT

proposition: VariantPathogenicityProposition = Field(
...,
description="A proposition about the pathogenicity of a variant, the validity of which is assessed and reported by the Statement. A Statement can put forth the proposition as being true, false, or uncertain, and may provide an assessment of the level of confidence/evidence supporting this claim.",
Expand Down
Loading
Loading