Fork me on GitHub
#specter
<
2020-05-22
>
Endre Bakken Stovner09:05:41

How do I select multiple things at different levels?

Endre Bakken Stovner09:05:41

Test data:

(def testrules {:plot-quals {:out {:graph "quals.svg" :data "quals.tsv"},},
                :samtools-index {:out "bam/sorted.bam.bai",},
                :samtools-sort {:out "bam/sorted.bam"}})
I want to get the first key and value of out. Was thinking it would start something like
(select [(collect-one KEY) ALL ALL :out] testrules)

Endre Bakken Stovner09:05:13

(select [(collect ALL) ALL :out] testrules)
got me closer.

mmer14:05:04

(select [(collect-one FIRST FIRST) ALL LAST :out] testrules) yields [[:plot-quals {:graph "quals.svg", :data "quals.tsv"}] [:plot-quals "bam/sorted.bam.bai"] [:plot-quals "bam/sorted.bam"]]

Endre Bakken Stovner11:05:57

Working through the tutorials now, but thanks for helping me solve some immediate problems :)