Clojure(Script) library for handling HGVS.
clj-hgvs provides:
Clojure CLI/deps.edn:
clj-hgvs {:mvn/version "0.4.1"}
Leiningen/Boot:
[clj-hgvs "0.4.1"]
To use clj-hgvs with Clojure 1.8, you must include a dependency on clojure-future-spec.
clj-hgvs.core/HGVS
).See CHANGELOG for more information.
(require '[clj-hgvs.core :as hgvs])
;; `parse` parses a HGVS text, returning a HGVS record.
(def hgvs1 (hgvs/parse "NM_005228.3:c.2573T>G"))
hgvs1
;;=> #clj_hgvs.core.HGVS
;; {:transcript "NM_005228.3"
;; :kind :coding-dna
;; :mutation #clj_hgvs.mutation.DNASubstitution
;; {:coord #clj_hgvs.coordinate.CodingDNACoordinate
;; {:position 2573
;; :offset 0
;; :region nil}
;; :ref "T"
;; :type ">"
;; :alt "G"}}
;; `format` returns a HGVS text.
(hgvs/format hgvs1)
;;=> "NM_005228.3:c.2573T>G"
#clj-hgvs/hgvs
tagged literal is useful for easy and readable definition of a
HGVS data.
#clj-hgvs/hgvs "NM_005228.3:c.2573T>G"
clj-hgvs.core/format
has various options for specifying HGVS styles.
(hgvs/format #clj-hgvs/hgvs "NM_005228.3:c.2307_2308insGCCAGCGTG"
{:ins-format :count})
;;=> "NM_005228.3:c.2307_2308ins(9)"
(hgvs/format #clj-hgvs/hgvs "p.Leu858Arg"
{:amino-acid-format :short})
;;=> "p.L858R"
See API reference for all formatter options.
Copyright 2017-2019 Xcoo, Inc.
Licensed under the Apache License, Version 2.0.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close