Skip to content

Commit

Permalink
Phil's IRI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tnavatar committed Nov 1, 2024
1 parent 7e70e33 commit f1cd07f
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 5 deletions.
3 changes: 1 addition & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
io.github.nextjournal/clerk {:mvn/version "0.15.957"}
generateme/fastmath {:mvn/version "2.4.0"
:exclusions [com.github.haifengl/smile-mkl]}}
:jvm-opts ["-agentpath:/Applications/YourKit-Java-Profiler-2024.3.app/Contents/Resources/bin/mac/libyjpagent.dylib=disablestacktelemetry,exceptions=disable,delay=10000"
"-XX:+UseZGC" "-XX:+ZGenerational" "-XX:MaxRAMPercentage=50"]}}
:jvm-opts ["-XX:+UseZGC" "-XX:+ZGenerational" "-XX:MaxRAMPercentage=50"]}}

:jvm-opts ["-XX:+UseZGC" "-XX:+ZGenerational" "-XX:MaxRAMPercentage=75"]

Expand Down
2 changes: 1 addition & 1 deletion resources/base.edn
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
:target "mondo.owl",
:format :genegraph.framework.storage.rdf/rdf-xml}
{:name "https://www.genenames.org/"
:source "https://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/json/hgnc_complete_set.json"
:source "https://storage.googleapis.com/public-download-files/hgnc/json/json/hgnc_complete_set.json"
:target "hgnc.json",
:format :genegraph.gene-validity.base/hgnc}
{:name "http://dataexchange.clinicalgenome.org/terms"
Expand Down
5 changes: 4 additions & 1 deletion src/genegraph/gene_validity/graphql/schema/resource.clj
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@
:type :Resource
:resolve (fn [context args _]
(let [r (rdf/resource (:iri args) (:db context))]
(or (rdf/ld1-> r [[:cg/website-legacy-id :<]]) r)))})
(or (rdf/ld1-> r [[:cg/website-legacy-id :<]])
;; Phil sends requests from the website that match neither the direct IRI,
;; nor the assertion_ syntax. This should address that issue.
(s/replace r #"assertion_" ""))))})
2 changes: 1 addition & 1 deletion src/genegraph/gv_setup.clj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
::event/key (:name %)})))

(->> (-> "base.edn" io/resource slurp edn/read-string)
(filter #(= "http://dataexchange.clinicalgenome.org/missing-dosage-curations" (:name %)))
(filter #(= "https://www.genenames.org/" (:name %)))
(run! #(p/publish (get-in gv-seed-base-event
[:topics :fetch-base-events])
{::event/data %
Expand Down
71 changes: 71 additions & 0 deletions src/genegraph/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1919,3 +1919,74 @@ select ?sop where {
::event/key (:name %)})))

)

;; Erin report -- quarterly update of reports published per
;; GCEP
(comment
(storage/restore-snapshot
(get-in gv-test-app [:storage :gv-tdb]))
(tap> (get-in gv-test-app [:storage :gv-tdb]))

(let [q (rdf/create-query "
select ?x where { ?x a :sepio/GeneValidityProposition } limit 1")
tdb @(get-in gv-test-app [:storage :gv-tdb :instance])]
(rdf/tx tdb
(->> (q tdb)
(mapv #(storage/read tdb (str %)))
(run! rdf/pp-model))))
)



;; testing partial updates
(comment
(def last-50-gv
(event-store/with-event-reader [r "/Users/tristan/data/genegraph-neo/gene_validity_complete-2024-10-16.edn.gz"]
(->> (event-store/event-seq r)
(take-last 10)
(into []))))

(defn process-gv-event [e]
(p/process (get-in gv-test-app [:processors :gene-validity-transform])
(assoc e
::event/completion-promise (promise)
::event/skip-local-effects true
::event/skip-publish-effects true)))

(->> last-50-gv
#_(map #(-> % ::event/timestamp Instant/ofEpochMilli))
(take-last 1)
(map #(:gene-validity/model (process-gv-event %)))
(run! rdf/pp-model))

(defn process-gv-event [e]
(p/process (get-in gv-test-app [:processors :gene-validity-transform])
(assoc e
::event/completion-promise (promise)
::event/skip-local-effects true
::event/skip-publish-effects true)))

(def sop-query
(rdf/create-query "
select ?sop where {
?curation a :sepio/GeneValidityEvidenceLevelAssertion ;
:sepio/is-specified-by ?sop .
} "))

(->> last-10-gv
(map process-gv-event)
(map :gene-validity/model)
(map sop-query)
(map first)
tap>)

(->> (-> "base.edn" io/resource slurp edn/read-string)
(filter #(= "http://purl.obolibrary.org/obo/sepio-clingen-gene-validity"
(:name %)))
(run! #(p/publish (get-in gv-test-app
[:topics :fetch-base-events])
{::event/data %
::event/key (:name %)})))

)

0 comments on commit f1cd07f

Please sign in to comment.