This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | |
"data": {"url": "data/cars.json"}, | |
"transform": [ | |
{ | |
"aggregate": [{"op": "count", "as": "num_cars"}], | |
"groupby": ["Origin", "Cylinders"] | |
} | |
], | |
"resolve": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | |
"height": {"step": 30}, | |
"width": 300, | |
"description": "Shows the relationship between horsepower and the numbver of cylinders using tick marks.", | |
"data": {"url": "data/cars.json"}, | |
"mark": { | |
"type": "boxplot", | |
"extent": "min-max" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; you can just take the first two ?b's because they come into | |
; bufferop sorted | |
(defbufferop top-2 [tuples] | |
(take 2 tuples)) | |
; let cascalog do the sorting (grouped by ?a) for you | |
(??<- [?a ?b-out] | |
(data ?a ?b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; instead of having to call this function all the time | |
(defn top-n-seq [sample-name n] | |
(let [fields ["?id" "?aa" "?v" "?j" "?name" "?nc"] | |
sample-name-seqs (<- fields | |
(tcr-seqs :>> fields) | |
(= ?name sample-name))] | |
(c/first-n sample-name-seqs n :sort ["?nc"] :reverse true))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; actually makes the call to c/first-n to create the limited sorted | |
;; sample | |
(defn top-n-seq [sample-name n] | |
(let [fields ["?aa" "?v" "?j" "?name" "?nc"] | |
sample-name-seqs (<- fields | |
(tcr-seqs :>> fields) | |
(= ?name sample-name))] | |
(c/first-n sample-name-seqs n :sort ["?nc"] :reverse true))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn top-n-seq [sample-name n] | |
(let [aa-seq-fields ["?aa" "?v" "?j" "?sn" "?nc" "?c" "?nf" "?rf" "?cdr3"] | |
sample-name-seqs (<- aa-seq-fields | |
(aa-seqs :>> aa-seq-fields) | |
(= ?sn sample-name))] | |
(<- aa-seq-fields ((c/first-n sample-name-seqs n :sort ["?nc"] :reverse true) | |
:>> aa-seq-fields)))) | |
(let [aa-seq-fields ["?aa" "?v" "?j" "?sn" "?nc" "?c" "?nf" "?rf" "?cdr3"]] | |
(?<- (stdout) aa-seq-fields |