Skip to content

mutalyzer/spdi-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mutalyzer HGVS Parser

https://readthedocs.org/projects/mutalyzer-spdi-parser/badge/?version=latest

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

Quick start

Parse and convert a description from the command line:

$ 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):

>>> 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'}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published