From 7d9964474deaea4e06dcc8a415c0bcbc316c24b4 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 23 May 2023 16:07:11 +0300 Subject: Return an empty string if a dataset doesn't have a name Signed-off-by: Munyoki Kilyungi --- examples/dump-genotype.scm | 2 +- examples/dump-phenotype.scm | 7 ++++--- examples/dump-probeset.scm | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/dump-genotype.scm b/examples/dump-genotype.scm index 13e4885..cffa917 100755 --- a/examples/dump-genotype.scm +++ b/examples/dump-genotype.scm @@ -74,7 +74,7 @@ (ontology 'dataset: (regexp-substitute/global #f "[^A-Za-z0-9:]" - (field GenoFreeze Name) + (field ("IFNULL(GenoFreeze.Name, '')" DatasetName)) 'pre "_" 'post))) (set gn:chrNum (annotate-field diff --git a/examples/dump-phenotype.scm b/examples/dump-phenotype.scm index 08d5127..5f8cd94 100755 --- a/examples/dump-phenotype.scm +++ b/examples/dump-phenotype.scm @@ -91,9 +91,10 @@ (set gn:sequence (annotate-field (field PublishXRef Sequence) '^^xsd:int)) (set gn:phenotypeOfDataset (ontology 'dataset: - (regexp-substitute/global #f "[^A-Za-z0-9:]" - (field PublishFreeze Name) - 'pre "_" 'post))) + (regexp-substitute/global + #f "[^A-Za-z0-9:]" + (field ("IFNULL(PublishFreeze.Name, '')" DatasetName)) + 'pre "_" 'post))) (set gn:phenotypeOfPublication (let ((pmid (field ("IF(Publication.PubMed_ID IS NULL, '', CONVERT(Publication.PubMed_Id, INT))" diff --git a/examples/dump-probeset.scm b/examples/dump-probeset.scm index 0b37514..a71f708 100755 --- a/examples/dump-probeset.scm +++ b/examples/dump-probeset.scm @@ -44,7 +44,7 @@ 'probeset: (regexp-substitute/global #f "[^A-Za-z0-9:]" - (field ProbeSetFreeze Name) + (field ("IFNULL(ProbeSetFreeze.Name, '')" DatasetName)) 'pre "_" 'post))) (set gn:mean (annotate-field (field ("IFNULL(ProbeSetXRef.mean, '')" mean)) '^^xsd:double)) -- cgit v1.2.3