about summary refs log tree commit diff
path: root/cwl
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-10-19 07:13:15 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-10-19 07:13:15 +0000
commitd504b5da9f5deeece9ba2ff4dcd8baf3dfa4dc32 (patch)
treeeaed193876da61ad7d6ae55906dccf4c6198c583 /cwl
parent477294a2aa9ae7348137271b66831ac93a6149d6 (diff)
downloadgenenetwork4-gemma-cwl-parallel.tar.gz
gemma: compile ravanan's ccwl workflow on demand, don't check in the CWL gemma-cwl-parallel
gemma-loco.cwl was a generated artifact (ccwl compile's output), but
was being committed like hand-written source. Remove it, and have
compute_ravanan compile cwl/gemma/gemma-loco.scm to a throwaway CWL
file under its own cache dir on every call instead -- cheap (pure
macro expansion, no Guix build involved), so there's no real cost to
regenerating it fresh each time, and no risk of a stale compiled file
drifting from its ccwl source.

Config gains a ccwl_cmd knob (default "ccwl", resolved via PATH,
alongside ravanan_cmd/gemma_wrapper_cmd); gemma_ravanan_workflow now
names the .scm source, not a .cwl file. Verified end to end by running
the exact compile-then-run sequence compute_ravanan now performs
against the real ccwl/ravanan/gemma-wrapper binaries and the BXD
fixtures: same correctness and timings as before.
Diffstat (limited to 'cwl')
-rw-r--r--cwl/gemma/gemma-loco.cwl175
-rw-r--r--cwl/gemma/gemma-loco.scm9
2 files changed, 6 insertions, 178 deletions
diff --git a/cwl/gemma/gemma-loco.cwl b/cwl/gemma/gemma-loco.cwl
deleted file mode 100644
index 5a27e7d..0000000
--- a/cwl/gemma/gemma-loco.cwl
+++ /dev/null
@@ -1,175 +0,0 @@
-cwlVersion: v1.2
-class: Workflow
-requirements:
-  SubworkflowFeatureRequirement: {}
-  ScatterFeatureRequirement: {}
-inputs:
-  genotype_file:
-    type: File
-  pheno_file:
-    type: File
-  snps_file:
-    type: File
-  lmm:
-    type: string
-  chromosomes:
-    type:
-      type: array
-      items: string
-  cache_dirs:
-    type:
-      type: array
-      items: string
-outputs:
-  gwa_json:
-    type:
-      type: array
-      items: File
-    outputSource: gwa/gwa_json
-  archive:
-    type:
-      type: array
-      items: File
-    outputSource: gwa/archive
-steps:
-  kinship:
-    in:
-      genotype_file: genotype_file
-      pheno_file: pheno_file
-      snps_file: snps_file
-      chr: chromosomes
-      cache_dir: cache_dirs
-    out:
-      - kinship_json
-      - archive
-    run:
-      cwlVersion: v1.2
-      class: CommandLineTool
-      requirements: {}
-      arguments:
-        - position: 0
-          valueFrom: "gemma-wrapper"
-        - position: 1
-          valueFrom: "--json"
-        - position: 2
-          valueFrom: "--loco"
-        - position: 3
-          valueFrom: "--no-parallel"
-        - position: 6
-          valueFrom: "--"
-        - position: 10
-          valueFrom: "-gk"
-      inputs:
-        cache_dir:
-          type: string
-          inputBinding:
-            position: 4
-            prefix: "--cache-dir"
-        chr:
-          type: string
-          inputBinding:
-            position: 5
-            prefix: "--chromosomes"
-        genotype_file:
-          type: File
-          inputBinding:
-            position: 7
-            prefix: "-g"
-        pheno_file:
-          type: File
-          inputBinding:
-            position: 8
-            prefix: "-p"
-        snps_file:
-          type: File
-          inputBinding:
-            position: 9
-            prefix: "-a"
-      outputs:
-        kinship_json:
-          type: stdout
-        archive:
-          type: File
-          outputBinding:
-            glob: "$(inputs.cache_dir)/*-gemma-cXX.tar.xz"
-      stdout: kinship.json
-    scatter:
-      - chr
-      - cache_dir
-    scatterMethod: dotproduct
-  gwa:
-    in:
-      genotype_file: genotype_file
-      pheno_file: pheno_file
-      snps_file: snps_file
-      lmm: lmm
-      chr: chromosomes
-      cache_dir: cache_dirs
-      kinship_json: kinship/kinship_json
-    out:
-      - gwa_json
-      - archive
-    run:
-      cwlVersion: v1.2
-      class: CommandLineTool
-      requirements: {}
-      arguments:
-        - position: 0
-          valueFrom: "gemma-wrapper"
-        - position: 1
-          valueFrom: "--json"
-        - position: 2
-          valueFrom: "--loco"
-        - position: 3
-          valueFrom: "--no-parallel"
-        - position: 7
-          valueFrom: "--"
-      inputs:
-        cache_dir:
-          type: string
-          inputBinding:
-            position: 4
-            prefix: "--cache-dir"
-        kinship_json:
-          type: File
-          inputBinding:
-            position: 5
-            prefix: "--input"
-        chr:
-          type: string
-          inputBinding:
-            position: 6
-            prefix: "--chromosomes"
-        genotype_file:
-          type: File
-          inputBinding:
-            position: 8
-            prefix: "-g"
-        pheno_file:
-          type: File
-          inputBinding:
-            position: 9
-            prefix: "-p"
-        snps_file:
-          type: File
-          inputBinding:
-            position: 10
-            prefix: "-a"
-        lmm:
-          type: string
-          inputBinding:
-            position: 11
-            prefix: "-lmm"
-      outputs:
-        gwa_json:
-          type: stdout
-        archive:
-          type: File
-          outputBinding:
-            glob: "$(inputs.cache_dir)/*-gemma-GWA.tar.xz"
-      stdout: "$(inputs.chr)-gwa.json"
-    scatter:
-      - chr
-      - cache_dir
-      - kinship_json
-    scatterMethod: dotproduct
diff --git a/cwl/gemma/gemma-loco.scm b/cwl/gemma/gemma-loco.scm
index 31c12e2..8c3ecda 100644
--- a/cwl/gemma/gemma-loco.scm
+++ b/cwl/gemma/gemma-loco.scm
@@ -7,10 +7,13 @@
 ;; do, so the two can be compared (correctness, timing).
 ;;
 ;; Written in ccwl (https://ccwl.systemreboot.net/), per Arun's
-;; request, and compiled to cwl/gemma/gemma-loco.cwl:
+;; request, not raw CWL. ravanan itself only runs compiled CWL, so
+;; src/gemma.rs's compute_ravanan compiles this file fresh on every
+;; call (`ccwl compile --output=<generated path> gemma-loco.scm`,
+;; cheap: pure macro expansion, no Guix build involved) into a
+;; throwaway file under its cache dir -- the compiled .cwl is never
+;; checked into the repo. To compile it by hand for inspection:
 ;;   ccwl compile --output=gemma-loco.cwl gemma-loco.scm
-;; ravanan itself still only runs the compiled .cwl; nothing here
-;; changes how src/gemma.rs's compute_ravanan invokes ravanan.
 
 (define kinship
   ;; gemma-wrapper's --loco kinship (-gk) step, restricted to one