aboutsummaryrefslogtreecommitdiff
path: root/examples/dump-probeset-metadata.scm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dump-probeset-metadata.scm')
-rwxr-xr-xexamples/dump-probeset-metadata.scm65
1 files changed, 24 insertions, 41 deletions
diff --git a/examples/dump-probeset-metadata.scm b/examples/dump-probeset-metadata.scm
index b0c4853..6da1eb0 100755
--- a/examples/dump-probeset-metadata.scm
+++ b/examples/dump-probeset-metadata.scm
@@ -16,9 +16,6 @@
(call-with-input-file (list-ref (command-line) 1)
read))
-(define %dump-directory
- (list-ref (command-line) 2))
-
(define-dump dump-probeset-metadata
(tables (ProbeSetXRef
@@ -27,14 +24,14 @@
"WHERE ProbeSetFreeze.public > 0 AND ProbeSetFreeze.confidentiality < 1")
(schema-triples
(gn:probesetData rdfs:range gn:probeset)
- (gn:hasProbeset rdfs:range rdfs:Literal))
+ (gn-term:hasProbeset rdfs:range rdfs:Literal))
(triples
(string->identifier
"probesetData"
(field ("CONCAT(ProbeSetFreeze.Name,':',IFNULL(ProbeSet.Name, ProbeSet.Id))"
ProbeSetName)))
(set rdf:type 'gn:probesetData)
- (set gn:hasProbeset
+ (set gn-term:hasProbeset
(ontology
'probeset:
(regexp-substitute/global
@@ -42,66 +39,52 @@
(field ("IFNULL(ProbeSet.Name, ProbeSet.Id)"
name))
'pre "_" 'post)))
- (set gn:probesetOfDataset
+ (set gn-term:probesetOfDataset
(ontology
'probeset:
(regexp-substitute/global #f "[^A-Za-z0-9:]"
(field ProbeSetFreeze Name)
'pre "_" 'post)))
- (set gn:mean
+ (set gn-term:mean
(annotate-field
(field ("IFNULL(ProbeSetXRef.mean, '')" mean))
'^^xsd:double))
- (set gn:se
+ (set gn-term:se
(annotate-field
(field ("IFNULL(ProbeSetXRef.se, '')" se))
'^^xsd:double))
- (set gn:locus (field ProbeSetXRef Locus))
+ (set gn-term:locus (field ProbeSetXRef Locus))
(set gn:LRS
(annotate-field
(field ("IFNULL(ProbeSetXRef.LRS, '')" LRS))
'^^xsd:double))
- (set gn:pValue
+ (set gn-term:pValue
(annotate-field
(field ("IFNULL(ProbeSetXRef.pValue, '')" pValue))
'^^xsd:double))
- (set gn:additive
+ (set gn-term:additive
(annotate-field
(field ("IFNULL(ProbeSetXRef.additive, '')" additive))
'^^xsd:double))
- (set gn:h2
+ (set gn-term:h2
(annotate-field
(field ("IFNULL(ProbeSetXRef.h2, '')" h2))
'^^xsd:float))))
-(call-with-target-database
- %connection-settings
- (lambda (db)
- (with-output-to-file (string-append %dump-directory "dump-probeset-metadata.ttl")
- (lambda ()
- (prefix "chebi:" "<http://purl.obolibrary.org/obo/CHEBI_>")
- (prefix "dct:" "<http://purl.org/dc/terms/>")
- (prefix "foaf:" "<http://xmlns.com/foaf/0.1/>")
- (prefix "generif:" "<http://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=Graphics&list_uids=>")
- (prefix "gn:" "<http://genenetwork.org/>")
- (prefix "hgnc:" "<http://bio2rdf.org/hgnc:>")
- (prefix "homologene:" "<https://bio2rdf.org/homologene:>")
- (prefix "kegg:" "<http://bio2rdf.org/ns/kegg#>")
- (prefix "molecularTrait:" "<http://genenetwork.org/molecular-trait/>")
- (prefix "nuccore:" "<https://www.ncbi.nlm.nih.gov/nuccore/>")
- (prefix "omim:" "<https://www.omim.org/entry/>")
- (prefix "owl:" "<http://www.w3.org/2002/07/owl#>")
- (prefix "phenotype:" "<http://genenetwork.org/phenotype/>")
- (prefix "pubchem:" "<https://pubchem.ncbi.nlm.nih.gov/>")
- (prefix "pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>")
- (prefix "rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
- (prefix "rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
- (prefix "uniprot:" "<http://purl.uniprot.org/uniprot/>")
- (prefix "up:" "<http://purl.uniprot.org/core/>")
- (prefix "xsd:" "<http://www.w3.org/2001/XMLSchema#>")
- (prefix "probeset:" "<http://genenetwork.org/probeset/>")
- (newline)
- (dump-probeset-metadata db))
- #:encoding "utf8")))
+(dump-with-documentation
+ (name "Probeset Metadata")
+ (connection %connection-settings)
+ (table-metadata? #f)
+ (prefixes
+ '(("gn:" "<http://genenetwork.org/id/>")
+ ("gn-term:" "<http://genenetwork.org/id/>")
+ ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
+ ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
+ ("xsd:" "<http://www.w3.org/2001/XMLSchema#>")))
+ (inputs
+ (list dump-probeset-metadata))
+ (outputs
+ '(#:documentation "./docs/dump-probeset-metadata.md"
+ #:rdf "./verified-data/dump-probeset-metadata.ttl")))