Metadata-Version: 2.4
Name: mutalyzer_spdi_parser
Version: 1.0.0
Summary: Mutalyzer SPDI variant description parser.
Author-email: "LUMC, Mihai Lefter" <M.Lefter@lumc.nl>
License-Expression: MIT
Project-URL: Homepage, https://github.com/mutalyzer/spdi-parser
Keywords: Mutalyzer,HGVS,SPDI,description,parser,genomic
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: lark>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=4.0.1; extra == "dev"
Requires-Dist: ruff>=0.17.0; extra == "dev"
Provides-Extra: release
Requires-Dist: build>=1.6.1; extra == "release"
Requires-Dist: twine>=7.0.0; extra == "release"
Dynamic: license-file

Mutalyzer HGVS Parser
=====================

.. image:: https://img.shields.io/github/last-commit/mutalyzer/spdi-parser.svg
   :target: https://github.com/mutalyzer/spdi-parser/graphs/commit-activity
.. image:: https://readthedocs.org/projects/mutalyzer-spdi-parser/badge/?version=latest
   :target: https://mutalyzer-spdi-parser.readthedocs.io/en/latest
.. image:: https://img.shields.io/github/release-date/mutalyzer/spdi-parser.svg
   :target: https://github.com/mutalyzer/spdi-parser/releases
.. image:: https://img.shields.io/github/release/mutalyzer/spdi-parser.svg
   :target: https://github.com/mutalyzer/spdi-parser/releases
.. image:: https://img.shields.io/pypi/v/mutalyzer-spdi-parser.svg
   :target: https://pypi.org/project/mutalyzer-spdi-parser/
.. image:: https://img.shields.io/github/languages/code-size/mutalyzer/spdi-parser.svg
   :target: https://github.com/mutalyzer/spdi-parser
.. image:: https://img.shields.io/github/languages/count/mutalyzer/spdi-parser.svg
   :target: https://github.com/mutalyzer/spdi-parser
.. image:: https://img.shields.io/github/languages/top/mutalyzer/spdi-parser.svg
   :target: https://github.com/mutalyzer/spdi-parser
.. image:: https://img.shields.io/github/license/mutalyzer/spdi-parser.svg
   :target: https://raw.githubusercontent.com/mutalyzer/spdi-parser/master/LICENSE

----

Package to syntax check and convert SPDI descriptions into a dictionary model.


Quick start
-----------

Parse and convert a description from the command line:

.. code-block:: console

    $ mutalyzer_spdi_parser -cs "NG_012337.3:10:C:T"
    {
      "seq_id": "NG_012337.3",
      "position": 10,
      "deleted_sequence": "C",
      "inserted_sequence": "T"
    }

    $ mutalyzer_spdi_parser -ch "NG_012337.3:10:C:T"
    {
      "type": "description_dna",
      "reference": {
        "id": "NG_012337.3"
      },
      "variants": [
        {
          "type": "deletion_insertion",
          "location": {
            "type": "range",
            "start": {
              "type": "point",
              "position": 10
            },
            "end": {
              "type": "point",
              "position": 11
            }
          },
          "deleted": [
            {
              "sequence": "C",
              "source": "description"
            }
          ],
          "inserted": [
            {
              "sequence": "T",
              "source": "description"
            }
          ]
        }
      ]
    }


The ``to_hgvs_internal_model()`` function can be used to obtain the equivalent
HGVS dictionary model (deletion insertion variants with internal locations and
indexing):

.. code:: python

    >>> from mutalyzer_spdi_parser import to_hgvs_internal_model
    >>> model = to_hgvs_internal_model("NG_012337.3:10:C:T")
    >>> model['reference']
    {'id': 'NG_012337.3'}
