From 52880329dfaf719975b5b6f0adf87710cc8e122e Mon Sep 17 00:00:00 2001 From: Toshiki Takeuchi Date: Thu, 20 Apr 2023 19:14:05 +0900 Subject: [PATCH 1/2] Prepare for next development iteration (0.4.7-SNAPSHOT) --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 53654e8..8143b7b 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject clj-hgvs "0.4.6" +(defproject clj-hgvs "0.4.7-SNAPSHOT" :description "Clojure(Script) library for handling HGVS" :url "https://github.com/chrovis/clj-hgvs" :license {:name "Apache License, Version 2.0" From 017fe8512830eef1413fcc047f3ab6705d7db3b1 Mon Sep 17 00:00:00 2001 From: Toshiki Takeuchi Date: Thu, 20 Apr 2023 19:25:43 +0900 Subject: [PATCH 2/2] Fix format of uncertain protein mutation --- src/clj_hgvs/mutation.cljc | 4 ++-- test/clj_hgvs/mutation_test.cljc | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/clj_hgvs/mutation.cljc b/src/clj_hgvs/mutation.cljc index e6311ff..5e2bd76 100644 --- a/src/clj_hgvs/mutation.cljc +++ b/src/clj_hgvs/mutation.cljc @@ -184,8 +184,8 @@ (defrecord UncertainMutation [mutation] Mutation (format [this] (format this nil)) - (format [this _] - (str "(" (format mutation) ")")) + (format [this opts] + (str "(" (format mutation opts) ")")) (plain [this] {:mutation "uncertain-mutation" :content-mutation (plain mutation)}) diff --git a/test/clj_hgvs/mutation_test.cljc b/test/clj_hgvs/mutation_test.cljc index 23a158f..a49a292 100644 --- a/test/clj_hgvs/mutation_test.cljc +++ b/test/clj_hgvs/mutation_test.cljc @@ -39,17 +39,29 @@ (def uncertain-mutation2 (mut/uncertain-mutation (mut/rna-substitution (coord/rna-coordinate 306 nil nil) "g" "u"))) +(def uncertain-mutation3s "(Cys123Gly)") +(def uncertain-mutation3ss "(C123G)") +(def uncertain-mutation3k :protein) +(def uncertain-mutation3 (mut/uncertain-mutation + (mut/protein-substitution "Cys" + (coord/protein-coordinate 123) + "Gly"))) + (deftest format-uncertain-mutation-test (testing "returns a string expression of an uncertain mutation" - (are [m s] (= (mut/format m nil) s) - uncertain-mutation1 uncertain-mutation1s - uncertain-mutation2 uncertain-mutation2s))) + (are [m o s] (= (mut/format m o) s) + uncertain-mutation1 nil uncertain-mutation1s + uncertain-mutation2 nil uncertain-mutation2s + uncertain-mutation3 nil uncertain-mutation3s + uncertain-mutation3 {:amino-acid-format :short} uncertain-mutation3ss))) (deftest parse-uncertain-mutation-test (testing "returns a correct UncertainMutation" (are [s k m] (= (mut/parse-uncertain-mutation s k) m) uncertain-mutation1s uncertain-mutation1k uncertain-mutation1 - uncertain-mutation2s uncertain-mutation2k uncertain-mutation2))) + uncertain-mutation2s uncertain-mutation2k uncertain-mutation2 + uncertain-mutation3s uncertain-mutation3k uncertain-mutation3 + uncertain-mutation3ss uncertain-mutation3k uncertain-mutation3))) (deftest plain-uncertain-mutation-test (testing "returns a plain map representing UncertainMutation"