From fda3400fa03d3119cd15d426add184696c3867c0 Mon Sep 17 00:00:00 2001 From: Tom White Date: Mon, 23 Jun 2025 16:51:46 +0100 Subject: [PATCH 1/2] Deprecate plink functions --- docs/api.rst | 4 ++++ sgkit/io/plink/__init__.py | 8 ++++++++ sgkit/io/plink/plink_reader.py | 8 ++++++++ sgkit/io/plink/plink_writer.py | 8 ++++++++ 4 files changed, 28 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 113a0658e..512a3ccda 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -23,6 +23,10 @@ BGEN PLINK ----- +.. deprecated:: 0.11.0 + Functions for reading and writing plink are deprecated, please use the `bio2zarr `_ + and `vcztools `_ packages. + .. currentmodule:: sgkit.io.plink .. autosummary:: :toctree: generated/ diff --git a/sgkit/io/plink/__init__.py b/sgkit/io/plink/__init__.py index ea42b16ca..7e63c7ce1 100644 --- a/sgkit/io/plink/__init__.py +++ b/sgkit/io/plink/__init__.py @@ -1,3 +1,11 @@ +import warnings + +warnings.warn( + "Functions for reading and writing plink are deprecated, please use the bio2zarr and vcztools packages.", + DeprecationWarning, + stacklevel=2, +) + try: from .plink_reader import plink_to_zarr, read_plink from .plink_writer import write_plink, zarr_to_plink diff --git a/sgkit/io/plink/plink_reader.py b/sgkit/io/plink/plink_reader.py index 274d3208c..b6da1c012 100644 --- a/sgkit/io/plink/plink_reader.py +++ b/sgkit/io/plink/plink_reader.py @@ -147,6 +147,10 @@ def read_plink( Loads a single PLINK dataset as dask arrays within a Dataset from bed, bim, and fam files. + .. deprecated:: 0.11.0 + Functions for reading and writing plink are deprecated, please use the `bio2zarr `_ + and `vcztools `_ packages. + Parameters ---------- path @@ -328,6 +332,10 @@ def plink_to_zarr( Refer to :func:`read_plink` for details and limitations. + .. deprecated:: 0.11.0 + Functions for reading and writing plink are deprecated, please use the `bio2zarr `_ + and `vcztools `_ packages. + Parameters ---------- path diff --git a/sgkit/io/plink/plink_writer.py b/sgkit/io/plink/plink_writer.py index 4b5bc9bed..42939b492 100644 --- a/sgkit/io/plink/plink_writer.py +++ b/sgkit/io/plink/plink_writer.py @@ -49,6 +49,10 @@ def write_plink( - ``sample_phenotype``: Phenotype code equal to 1 for control, 2 for case, and -1 for missing + .. deprecated:: 0.11.0 + Functions for reading and writing plink are deprecated, please use the `bio2zarr `_ + and `vcztools `_ packages. + Parameters ---------- ds @@ -146,6 +150,10 @@ def zarr_to_plink( Refer to :func:`write_plink` for details and limitations. + .. deprecated:: 0.11.0 + Functions for reading and writing plink are deprecated, please use the `bio2zarr `_ + and `vcztools `_ packages. + Parameters ---------- input From 72a844444f351d6cc6d4205ec1902e19ce1c4dd0 Mon Sep 17 00:00:00 2001 From: Tom White Date: Tue, 24 Jun 2025 14:18:08 +0100 Subject: [PATCH 2/2] Update changlog --- docs/changelog.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ec104cbbf..ea57b00ff 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -14,8 +14,12 @@ Changelog .. Breaking changes .. ~~~~~~~~~~~~~~~~ -.. Deprecations -.. ~~~~~~~~~~~~ +Deprecations +~~~~~~~~~~~~ + +- Functions for reading and writing plink are deprecated, please use the `bio2zarr `_ + and `vcztools `_ packages. + (:user:`tomwhite`, :pr:`1324`, :issue:`1318`) .. Improvements .. ~~~~~~~~~~~~