Skip to content

Commit

Permalink
return counts instead of data when # variations is large WormBase/web…
Browse files Browse the repository at this point in the history
…site#7690
  • Loading branch information
Sibyl committed May 5, 2020
1 parent 613978c commit c33e01e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/rest_api/classes/strain/widgets/contains.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
:description "clones contained in the strain"})

(defn alleles [s]
{:data (when-let [vhs (:variation.strain/_strain s)]
(for [vh vhs
:let [variation (:variation/_strain vh)]]
(variation-core/process-variation variation (set []))))
:description "alleles contained in the strain"})
(let [vhs (:variation.strain/_strain s)]
{:data (if (< (count vhs) 3000)
(for [vh vhs
:let [variation (:variation/_strain vh)]]
(variation-core/process-variation variation (set []))))
:count (count vhs)
:description "alleles contained in the strain"}
))

(defn genes [s]
{:data (when-let [genes (:gene/_strain s)]
Expand Down

0 comments on commit c33e01e

Please sign in to comment.