From 2a0a8e4ab5979b280720d630d512fa493c620874 Mon Sep 17 00:00:00 2001 From: Sibyl Date: Tue, 16 Apr 2019 20:59:45 +0000 Subject: [PATCH] add production_method to engineered allele WormBase/website#6878 --- .../classes/variation/widgets/overview.clj | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/rest_api/classes/variation/widgets/overview.clj b/src/rest_api/classes/variation/widgets/overview.clj index 05302d21..9c298013 100644 --- a/src/rest_api/classes/variation/widgets/overview.clj +++ b/src/rest_api/classes/variation/widgets/overview.clj @@ -61,6 +61,21 @@ (pack-obj new-var)) :description (str "the variation " (:variation/id v) " was merged into, if it was")}) +(defn production-method [variation] + {:data (if-let [method (-> (:variation/production-method variation) + (first))] + (case (name method) + "crispr-cas9" "CRISPR-Cas9" + "homologous-recombination" "Homologous recombination" + "mosdel" "MosDEL" + "mossci" "MosSci" + "nhej" "NHEJ" + "talens" "TALENs" + "zfnhr-repair" "ZFNHR repair" + "zfnnhej-repair" "ZFNNHEJ repair" + (obj/humanize-ident method))) + :description "the production method of the engineered allele"}) + (def widget {:name generic/name-field :status generic/status @@ -70,4 +85,5 @@ :variation_type variation-type :remarks generic/remarks :merged_into merged-into - :other_names generic/other-names}) + :other_names generic/other-names + :production_method production-method})