From 54ba0cc5e8ed477a0d98f6a35cad74115814e257 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 24 Nov 2023 14:42:32 +0300 Subject: Move remap-species-identifier to strings.scm. Signed-off-by: Munyoki Kilyungi --- examples/genotype.scm | 10 ---------- transform/strings.scm | 12 ++++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/genotype.scm b/examples/genotype.scm index da8e3b1..a5e30f9 100755 --- a/examples/genotype.scm +++ b/examples/genotype.scm @@ -15,16 +15,6 @@ -(define (remap-species-identifiers str) - "This procedure remaps identifiers to standard binominal. Obviously this should - be sorted by correcting the database!" - (match str - ["Fly (Drosophila melanogaster dm6)" "Drosophila melanogaster"] - ["Oryzias latipes (Japanese medaka)" "Oryzias latipes"] - ["Macaca mulatta" "Macaca nemestrina"] - ["Bat (Glossophaga soricina)" "Glossophaga soricina"] - [str str])) - (define-transformer genotypes (tables (Geno (left-join Species "USING (SpeciesId)"))) diff --git a/transform/strings.scm b/transform/strings.scm index 7d9bc82..7545f62 100644 --- a/transform/strings.scm +++ b/transform/strings.scm @@ -11,6 +11,7 @@ delete-substrings replace-substrings remove-duplicates + remap-species-identifiers str sanitize-rdf-string snake->lower-camel lower-case-and-replace-spaces @@ -119,3 +120,14 @@ association list mapping substrings to their replacements." ((null? lst) (reverse result)) ((memq (car lst) result) (loop (cdr lst) result)) (else (loop (cdr lst) (cons (car lst) result)))))) + + +(define (remap-species-identifiers str) + "This procedure remaps identifiers to standard binominal. Obviously this should + be sorted by correcting the database!" + (match str + ["Fly (Drosophila melanogaster dm6)" "Drosophila melanogaster"] + ["Oryzias latipes (Japanese medaka)" "Oryzias latipes"] + ["Macaca mulatta" "Macaca nemestrina"] + ["Bat (Glossophaga soricina)" "Glossophaga soricina"] + [str str])) -- cgit v1.2.3