{"id":19909665,"url":"https://github.com/chrovis/clj-hgvs","last_synced_at":"2026-02-28T05:07:50.247Z","repository":{"id":44894315,"uuid":"86447963","full_name":"chrovis/clj-hgvs","owner":"chrovis","description":"Clojure(Script) library for handling HGVS","archived":false,"fork":false,"pushed_at":"2025-01-09T06:48:07.000Z","size":398,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-23T04:43:47.340Z","etag":null,"topics":["bioinformatics","clojure","clojurescript","hgvs"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrovis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-28T10:40:43.000Z","updated_at":"2025-01-09T06:48:08.000Z","dependencies_parsed_at":"2025-01-10T08:16:16.484Z","dependency_job_id":null,"html_url":"https://github.com/chrovis/clj-hgvs","commit_stats":{"total_commits":232,"total_committers":3,"mean_commits":77.33333333333333,"dds":0.04741379310344829,"last_synced_commit":"ccf6558b3992d23ff4a210869156fcfcb3c529c5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-hgvs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-hgvs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-hgvs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-hgvs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrovis","download_url":"https://codeload.github.com/chrovis/clj-hgvs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252133738,"owners_count":21699589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","clojure","clojurescript","hgvs"],"created_at":"2024-11-12T21:16:18.473Z","updated_at":"2026-02-28T05:07:45.211Z","avatar_url":"https://github.com/chrovis.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-hgvs\n\n[![Clojars Project](https://img.shields.io/clojars/v/clj-hgvs.svg)](https://clojars.org/clj-hgvs)\n[![build](https://github.com/chrovis/clj-hgvs/actions/workflows/build.yml/badge.svg)](https://github.com/chrovis/clj-hgvs/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/chrovis/clj-hgvs/branch/master/graph/badge.svg)](https://codecov.io/gh/chrovis/clj-hgvs)\n\nClojure(Script) library for handling [HGVS](https://hgvs-nomenclature.org/).\n\n## Features\n\nclj-hgvs provides:\n\n* Data structure for HGVS\n* HGVS text parser\n* HGVS text formatter\n\n## Installation\n\nClojure CLI/deps.edn:\n\n```clojure\nclj-hgvs {:mvn/version \"0.5.1\"}\n```\n\nLeiningen/Boot:\n\n```clojure\n[clj-hgvs \"0.5.1\"]\n```\n\nTo use clj-hgvs with Clojure 1.8, you must include a dependency on\n[clojure-future-spec](https://github.com/tonsky/clojure-future-spec).\n\n## Breaking Changes in 0.5.0\n\n- Fix uncertain bases and amino acids format of ins and delins because HGVS nomenclature was updated.\n  - DNA: `ins(10)` -\u003e `insN[10]`\n  - RNA: `ins(10)` -\u003e `insn[10]`\n  - Protein: `ins10` -\u003e `insX[10]`\n\n## Breaking Changes in 0.4.0\n\n- HGVS data structure changes from map to record (`clj-hgvs.core/HGVS`).\n- (n)cdna is renamed to (non-)coding-dna to avoid misunderstanding.\n\nSee [CHANGELOG](CHANGELOG.md) for more information.\n\n## Usage\n\n### Documentation\n\n[API Reference](https://chrovis.github.io/clj-hgvs/)\n\n### Basics\n\n```clojure\n(require '[clj-hgvs.core :as hgvs])\n\n;; `parse` parses a HGVS text, returning a HGVS record.\n(def hgvs1 (hgvs/parse \"NM_005228.3:c.2573T\u003eG\"))\n\nhgvs1\n;;=\u003e #clj_hgvs.core.HGVS\n;;   {:transcript \"NM_005228.3\"\n;;    :kind :coding-dna\n;;    :mutation #clj_hgvs.mutation.DNASubstitution\n;;              {:coord #clj_hgvs.coordinate.CodingDNACoordinate\n;;                      {:position 2573\n;;                       :offset 0\n;;                       :region nil}\n;;               :ref \"T\"\n;;               :type \"\u003e\"\n;;               :alt \"G\"}}\n\n;; `format` returns a HGVS text.\n(hgvs/format hgvs1)\n;;=\u003e \"NM_005228.3:c.2573T\u003eG\"\n```\n\n### Tagged Literal\n\n`#clj-hgvs/hgvs` tagged literal is useful for easy and readable definition of a\nHGVS data.\n\n```clojure\n#clj-hgvs/hgvs \"NM_005228.3:c.2573T\u003eG\"\n```\n\n### Formatter Styles\n\n`clj-hgvs.core/format` has various options for specifying HGVS styles.\n\n```clojure\n(hgvs/format #clj-hgvs/hgvs \"NM_005228.3:c.2307_2308insGCCAGCGTG\"\n             {:ins-format :count})\n;;=\u003e \"NM_005228.3:c.2307_2308ins(9)\"\n\n(hgvs/format #clj-hgvs/hgvs \"p.Leu858Arg\"\n             {:amino-acid-format :short})\n;;=\u003e \"p.L858R\"\n```\n\nSee [API reference](https://chrovis.github.io/clj-hgvs/clj-hgvs.core.html#var-format)\nfor all formatter options.\n\n### Equivalence\n\n`clj-hgvs.core/==` tests the fundamental equivalence of the given HGVS.\n\n```clojure\n(hgvs/== #clj-hgvs/hgvs \"NM_005228:c.2361G\u003eA\"\n         #clj-hgvs/hgvs \"NM_005228.4:c.2361G\u003eA\")\n;;=\u003e true\n\n(hgvs/== #clj-hgvs/hgvs \"p.K53Afs*9\"\n         #clj-hgvs/hgvs \"p.Lys53Alafs\")\n;;=\u003e true\n\n(hgvs/== #clj-hgvs/hgvs \"p.L858R\"\n         #clj-hgvs/hgvs \"p.L858M\")\n;;=\u003e false\n```\n\n### Plain Map Representation\n\n`plain` converts HGVS data to a plain map, and `restore` converts the map back\nto the HGVS data. These functions are useful for sending HGVS data through\nanother codec.\n\n```clojure\n(hgvs/plain #clj-hgvs/hgvs \"NM_005228.3:c.2573T\u003eG\")\n;;=\u003e {:transcript \"NM_005228.3\"\n;;    :kind \"coding-dna\"\n;;    :mutation {:mutation \"dna-substitution\"\n;;               :coord {:coordinate \"coding-dna\"\n;;                       :position 2573\n;;                       :offset 0\n;;                       :region nil}\n;;               :ref \"T\"\n;;               :type \"\u003e\"\n;;               :alt \"G\"}}\n\n(hgvs/restore *1)\n;;=\u003e #clj-hgvs/hgvs \"NM_005228.3:c.2573T\u003eG\"\n```\n\n### HGVS Repair\n\n`repair-hgvs-str` attempts to repair an invalid HGVS text.\n\n```clojure\n(hgvs/repair-hgvs-str \"c.123_124GC\u003eAA\")\n;;=\u003e \"c.123_124delGCinsAA\"\n```\n\nThe repair rules are based on frequent mistakes in popular public-domain\ndatabases such as dbSNP and ClinVar.\n\nYou may supply custom repair rules to the second argument:\n\n```clojure\n(require '[clojure.string :as string]\n         '[clj-hgvs.repairer :as repairer])\n\n(defn lower-case-ext\n  [s kind]\n  (if (= kind :protein)\n    (string/replace s #\"EXT\" \"ext\")\n    s))\n\n(def my-repairers (conj repairer/built-in-repairers\n                        lower-case-ext))\n\n(hgvs/repair-hgvs-str \"p.*833EXT*?\" my-repairers)\n;;=\u003e \"p.*833ext*?\"\n```\n\n## License\n\nCopyright 2017-2024 [Xcoo, Inc.](https://xcoo.jp/)\n\nLicensed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fclj-hgvs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrovis%2Fclj-hgvs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fclj-hgvs/lists"}