diff options
| author | pjotr | 2026-05-10 22:55:37 +0000 |
|---|---|---|
| committer | pjotr | 2026-05-29 08:59:13 +0000 |
| commit | c654eb5b0964f05c05bcf06d9fc561a848a8bb3f (patch) | |
| tree | 3b5b69e5f4284842941f6ae427553d0cd6892292 | |
| parent | a70b3ec1daba11625bef028248655529f3f7ed3f (diff) | |
| download | guix-bioinformatics-c654eb5b0964f05c05bcf06d9fc561a848a8bb3f.tar.gz | |
Added impop and dependencies
| -rw-r--r-- | gn/packages/pangenome-rust.scm | 277 | ||||
| -rw-r--r-- | gn/packages/pangenome.scm | 165 |
2 files changed, 440 insertions, 2 deletions
diff --git a/gn/packages/pangenome-rust.scm b/gn/packages/pangenome-rust.scm index a488375..451c020 100644 --- a/gn/packages/pangenome-rust.scm +++ b/gn/packages/pangenome-rust.scm @@ -1754,6 +1754,16 @@ (file-name (git-file-name "rust-ragc" "0.1.1.e9e4a6f")) (sha256 (base32 "0ks74pgh0vjy4mzxvp7riq1rkf9zh9kqzhvvy8iys46zrbkxmhs7")))) +(define rust-ragc-0.1.1.40e5cad + ;; ekg's fork of ragc, used by impop's hprc-ibs. Same workspace + ;; layout; copied to a path dir by the impop build phase. + (origin + (method git-fetch) + (uri (git-reference (url "https://github.com/ekg/ragc") + (commit "40e5cad11cab7d4df07a72d6b16d68c2d60b0742"))) + (file-name (git-file-name "rust-ragc" "0.1.1.40e5cad")) + (sha256 (base32 "1p71jj02ppcvkrvnbs4y0yf00cslzqhlx4idscx8fk4lhmip4kla")))) + (define rust-seqwish-0.1.3.b65a7e0 (origin (method git-fetch) @@ -2607,6 +2617,107 @@ (crate-source "rustc-hash" "2.1.2" "1gjdc5bw9982cj176jvgz9rrqf9xvr1q1ddpzywf5qhs7yzhlc4l")) +(define rust-assert-cmd-2.1.2 + (crate-source "assert_cmd" "2.1.2" + "0505wrwzjfy2wdqhvmk0an4s69vbxfp5a45i5k8mvi4sfjlcynww")) + +(define rust-bstr-1.12.1 + (crate-source "bstr" "1.12.1" + "1arc1v7h5l86vd6z76z3xykjzldqd5icldn7j9d3p7z6x0d4w133")) + +(define rust-clap-4.5.54 + (crate-source "clap" "4.5.54" + "15737jmai272j6jh4ha4dq4ap14ysx2sa5wsjv6zbkvrrnfzzrn6")) + +(define rust-clap-builder-4.5.54 + (crate-source "clap_builder" "4.5.54" + "001cnl5ccva6z3x5nw3m72zs3bzb650anz1scs7vqhbs5d6wyhps")) + +(define rust-clap-derive-4.5.49 + (crate-source "clap_derive" "4.5.49" + "0wbngw649138v3jwx8pm5x9sq0qsml3sh0sfzyrdxcpamy3m82ra")) + +(define rust-clap-lex-0.7.7 + (crate-source "clap_lex" "0.7.7" + "0cibsbziyzw2ywar2yh6zllsamhwkblfly565zgi56s3q064prn3")) + +(define rust-difflib-0.4.0 + (crate-source "difflib" "0.4.0" + "1s7byq4d7jgf2hcp2lcqxi2piqwl8xqlharfbi8kf90n8csy7131")) + +(define rust-float-cmp-0.10.0 + (crate-source "float-cmp" "0.10.0" + "1n760i3nxd2x0zc7fkxkg3vhvdyfbvzngna006cl9s9jacaz775h")) + +(define rust-js-sys-0.3.92 + ;; TODO REVIEW: Check bundled sources. + (crate-source "js-sys" "0.3.92" + "15gr27bg97yzcxx13kab95xcjajlxbypfpv4x35ymrm2bbs90k6c")) + +(define rust-libc-0.2.180 + (crate-source "libc" "0.2.180" + "1z2n7hl10fnk1xnv19ahhqxwnb4qi9aclnl6gigim2aaahw5mhxw")) + +(define rust-normalize-line-endings-0.3.0 + (crate-source "normalize-line-endings" "0.3.0" + "1gp52dfn2glz26a352zra8h04351icf0fkqzw1shkwrgh1vpz031")) + +(define rust-predicates-3.1.3 + (crate-source "predicates" "3.1.3" + "0wrm57acvagx0xmh5xffx5xspsr2kbggm698x0vks132fpjrxld5")) + +(define rust-predicates-core-1.0.9 + (crate-source "predicates-core" "1.0.9" + "1yjz144yn3imq2r4mh7k9h0r8wv4yyjjj57bs0zwkscz24mlczkj")) + +(define rust-predicates-tree-1.0.12 + (crate-source "predicates-tree" "1.0.12" + "0p223d9y02ywwxs3yl68kziswz4da4vabz67jfhp7yqx71njvpbj")) + +(define rust-syn-2.0.114 + (crate-source "syn" "2.0.114" + "0akw62dizhyrkf3ym1jsys0gy1nphzgv0y8qkgpi6c1s4vghglfl")) + +(define rust-tempfile-3.24.0 + (crate-source "tempfile" "3.24.0" + "171fz3h6rj676miq15fyv1hnv69p426mlp8489bwa1b3xg3sjpb5")) + +(define rust-termtree-0.5.1 + (crate-source "termtree" "0.5.1" + "10s610ax6nb70yi7xfmwcb6d3wi9sj5isd0m63gy2pizr2zgwl4g")) + +(define rust-toml-0.5.11 + (crate-source "toml" "0.5.11" + "0d2266nx8b3n22c7k24x4428z6di8n83a9n466jm7a2hipfz1xzl")) + +(define rust-unicode-ident-1.0.22 + (crate-source "unicode-ident" "1.0.22" + "1x8xrz17vqi6qmkkcqr8cyf0an76ig7390j9cnqnk47zyv2gf4lk")) + +(define rust-wait-timeout-0.2.1 + (crate-source "wait-timeout" "0.2.1" + "04azqv9mnfxgvnc8j2wp362xraybakh2dy1nj22gj51rdl93pb09")) + +(define rust-wasm-bindgen-0.2.115 + (crate-source "wasm-bindgen" "0.2.115" + "0nj9a27y6am4qpjx7j6bmxdfsqc12fmyzic9d8wkwqxp2y8dc8v5")) + +(define rust-wasm-bindgen-macro-0.2.115 + (crate-source "wasm-bindgen-macro" "0.2.115" + "0rrfqcnijmkimjxz79vf68a6dzjvgxrzabq57pnh3xxjirsnqfjf")) + +(define rust-wasm-bindgen-macro-support-0.2.115 + (crate-source "wasm-bindgen-macro-support" "0.2.115" + "1pzyanqchcq5xdhx4h4wdyd9c19dal0p68xvpi96p204g5ry47cj")) + +(define rust-wasm-bindgen-shared-0.2.115 + (crate-source "wasm-bindgen-shared" "0.2.115" + "14sa6v10fb0wnjxh0saw3nx37bnrp8vp6lh4qqs8kda2z5m98gm9")) + +(define rust-web-sys-0.3.92 + ;; TODO REVIEW: Check bundled sources. + (crate-source "web-sys" "0.3.92" + "157d0p462dnnry1bmqfvbskgwks91j4vb32v32qzqz2dgx8fikc4")) (define-cargo-inputs lookup-cargo-inputs (gfainject => (list rust-adler-1.0.2 @@ -3903,6 +4014,172 @@ rust-zmij-1.0.21 rust-zstd-0.13.3 rust-zstd-safe-7.2.4 + rust-zstd-sys-2.0.16+zstd.1.5.7)) + (impop => + (list rust-adler2-2.0.1 + rust-ahash-0.8.12 + rust-aho-corasick-1.1.4 + rust-allocator-api2-0.2.21 + rust-anes-0.1.6 + rust-anstream-0.6.21 + rust-anstream-1.0.0 + rust-anstyle-1.0.13 + rust-anstyle-parse-0.2.7 + rust-anstyle-parse-1.0.0 + rust-anstyle-query-1.1.5 + rust-anstyle-wincon-3.0.11 + rust-anyhow-1.0.100 + rust-arbitrary-chunks-0.4.1 + rust-assert-cmd-2.1.2 + rust-autocfg-1.5.0 + rust-bgzip-0.3.1 + rust-bincode-1.3.3 + rust-bitflags-2.10.0 + rust-block-buffer-0.10.4 + rust-block-pseudorand-0.1.2 + rust-bstr-1.12.1 + rust-bumpalo-3.20.2 + rust-byteorder-1.5.0 + rust-bytes-1.11.1 + rust-cast-0.3.0 + rust-cc-1.2.58 + rust-cfg-if-1.0.4 + rust-chiapos-chacha8-0.1.0 + rust-ciborium-0.2.2 + rust-ciborium-io-0.2.2 + rust-ciborium-ll-0.2.2 + rust-clap-4.5.54 + rust-clap-builder-4.5.54 + rust-clap-derive-4.5.49 + rust-clap-lex-0.7.7 + rust-colorchoice-1.0.4 + rust-cpufeatures-0.2.17 + rust-crc32fast-1.5.0 + rust-criterion-0.5.1 + rust-criterion-plot-0.5.0 + rust-crossbeam-0.8.4 + rust-crossbeam-channel-0.5.15 + rust-crossbeam-deque-0.8.6 + rust-crossbeam-epoch-0.9.18 + rust-crossbeam-queue-0.3.12 + rust-crossbeam-utils-0.8.21 + rust-crunchy-0.2.4 + rust-crypto-common-0.1.7 + rust-dashmap-6.1.0 + rust-difflib-0.4.0 + rust-digest-0.10.7 + rust-either-1.15.0 + rust-env-filter-1.0.1 + rust-env-logger-0.11.10 + rust-errno-0.3.14 + rust-fastrand-2.3.0 + rust-find-msvc-tools-0.1.9 + rust-flate2-1.1.9 + rust-float-cmp-0.10.0 + rust-generic-array-0.14.7 + rust-getrandom-0.3.4 + rust-half-2.7.1 + rust-hashbrown-0.14.5 + rust-heck-0.5.0 + rust-hermit-abi-0.5.2 + rust-is-terminal-0.4.17 + rust-is-terminal-polyfill-1.70.2 + rust-itertools-0.10.5 + rust-itoa-1.0.18 + rust-jiff-0.2.23 + rust-jiff-static-0.2.23 + rust-jobserver-0.1.34 + rust-js-sys-0.3.92 + rust-lib-wfa2-0.1.0.8859b6a + rust-libc-0.2.180 + rust-linux-raw-sys-0.11.0 + rust-lock-api-0.4.14 + rust-log-0.4.29 + rust-memchr-2.7.6 + rust-miniz-oxide-0.8.9 + rust-nanorand-0.6.1 + rust-noodles-0.100.0 + rust-noodles-bgzf-0.42.0 + rust-normalize-line-endings-0.3.0 + rust-num-cpus-1.17.0 + rust-num-traits-0.2.19 + rust-once-cell-1.21.3 + rust-once-cell-polyfill-1.70.2 + rust-oorandom-11.1.5 + rust-parking-lot-core-0.9.12 + rust-partition-0.1.2 + rust-pkg-config-0.3.32 + rust-plotters-0.3.7 + rust-plotters-backend-0.3.7 + rust-plotters-svg-0.3.7 + rust-portable-atomic-1.13.1 + rust-portable-atomic-util-0.2.6 + rust-predicates-3.1.3 + rust-predicates-core-1.0.9 + rust-predicates-tree-1.0.12 + rust-proc-macro2-1.0.106 + rust-quote-1.0.44 + rust-r-efi-5.3.0 + ;; ragc is a Cargo workspace (ragc-core + ragc-common); + ;; the per-crate origins confuse cargo's git-checkout + ;; vendor mapping. Use the workspace origin and copy it + ;; to a path dir at build time (see impop's + ;; copy-ragc-workspace phase in pangenome.scm). + rust-ragc-0.1.1.40e5cad + rust-rayon-1.11.0 + rust-rayon-core-1.13.0 + rust-rdst-0.20.14 + rust-redox-syscall-0.5.18 + rust-regex-1.12.3 + rust-regex-automata-0.4.13 + rust-regex-syntax-0.8.10 + rust-rustix-1.1.3 + rust-rustversion-1.0.22 + rust-same-file-1.0.6 + rust-scopeguard-1.2.0 + rust-serde-1.0.228 + rust-serde-core-1.0.228 + rust-serde-derive-1.0.228 + rust-serde-json-1.0.149 + rust-sha2-0.10.9 + rust-shlex-1.3.0 + rust-simd-adler32-0.3.8 + rust-smallvec-1.15.1 + rust-strsim-0.11.1 + rust-syn-2.0.114 + rust-tempfile-3.24.0 + rust-termtree-0.5.1 + rust-thiserror-1.0.69 + rust-thiserror-impl-1.0.69 + rust-tikv-jemalloc-sys-0.5.4+5.3.0-patched + rust-tikv-jemallocator-0.5.4 + rust-tinytemplate-1.2.1 + rust-toml-0.5.11 + rust-tpa-0.1.0.49f1801 + rust-tracepoints-0.1.0.66a5511 + rust-typenum-1.19.0 + rust-unicode-ident-1.0.22 + rust-utf8parse-0.2.2 + rust-version-check-0.9.5 + rust-voracious-radix-sort-1.2.0 + rust-wait-timeout-0.2.1 + rust-walkdir-2.5.0 + rust-wasip2-1.0.2+wasi-0.2.9 + rust-wasm-bindgen-0.2.115 + rust-wasm-bindgen-macro-0.2.115 + rust-wasm-bindgen-macro-support-0.2.115 + rust-wasm-bindgen-shared-0.2.115 + rust-web-sys-0.3.92 + rust-winapi-util-0.1.11 + rust-windows-link-0.2.1 + rust-windows-sys-0.61.2 + rust-wit-bindgen-0.51.0 + rust-zerocopy-0.8.48 + rust-zerocopy-derive-0.8.48 + rust-zlib-rs-0.6.3 + rust-zmij-1.0.21 + rust-zstd-0.13.3 + rust-zstd-safe-7.2.4 rust-zstd-sys-2.0.16+zstd.1.5.7))) ;;; diff --git a/gn/packages/pangenome.scm b/gn/packages/pangenome.scm index 977751e..e309d1b 100644 --- a/gn/packages/pangenome.scm +++ b/gn/packages/pangenome.scm @@ -1680,6 +1680,159 @@ and supporting tools like minimap2, samtools, bedtools, bwa-mem2, meryl, kfilt, miniprot, pangene, wally, and vcfbub.") (license license:expat))) +(define-public impop + ;; Population-genomics tools for implicit pangenomes (impop_k suite). + ;; The Rust workspace ships under source/ inside MarsicoFL/memimpopk + ;; until MarsicoFL/IMPOPk is released; see memimpopk/bin/README.md + ;; for the provenance note. Builds four binaries: ibs, ibd, + ;; ancestry, jacquard (plus the ibd-validate auxiliary). + (let ((commit "d0c6ca847468153c81da64078c6a112b6569eb1c") + (revision "0")) + (package + (name "impop") + (version (git-version "0.2.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/MarsicoFL/memimpopk") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00ln6bfnqcq0skwfdmsd29bclifc116mrw81zkki02b6lmf7r652")))) + (build-system cargo-build-system) + (arguments + (list #:install-source? #f + #:tests? #f ; integration tests need data + the workshop scripts + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir-to-workspace + (lambda _ + ;; The Cargo workspace ships in source/; everything + ;; outside is workshop material. + (chdir "source"))) + ;; configure unpacks vendored crates to guix-vendor/; + ;; wit-bindgen 0.51 ships a pre-built static archive + ;; that the vendor audit flags as non-reproducible. + ;; Strip it; the binaries we build do not exercise the + ;; wasm component-model runtime. + (add-before 'build 'remove-prebuilt-wit-bindgen-archive + (lambda _ + (let ((stale "guix-vendor/rust-wit-bindgen-0.51.0.tar.gz/src/rt/libwit_bindgen_cabi.a")) + (when (file-exists? stale) + (delete-file stale))))) + ;; ragc (https://github.com/ekg/ragc) is a Cargo + ;; workspace; copy the whole tree into ragc-workspace/ + ;; and point ibs-cli's ragc-core dep at it. Same + ;; pattern as impg's ragc-workspace handling. + (add-before 'build 'copy-ragc-workspace + (lambda* (#:key inputs #:allow-other-keys) + (let ((src (assoc-ref inputs + "rust-ragc-0.1.1.40e5cad-checkout"))) + (copy-recursively src "ragc-workspace")))) + ;; ibs-cli depends on lib_wfa2 (git rev) and + ;; ragc-core (git rev, workspace). Point both at + ;; local paths so cargo can resolve offline, and + ;; tell impop's outer workspace to ignore the + ;; nested ragc one (otherwise cargo treats ragc-core + ;; as a member of impop's workspace and + ;; workspace.package inheritance picks the wrong + ;; root manifest). + (add-before 'build 'fix-dependency-sources + (lambda _ + (substitute* "Cargo.toml" + (("members = \\[") + "exclude = [\"ragc-workspace\"]\nmembers = [")) + (substitute* "src/ibs-cli/Cargo.toml" + (("tpa = \\{ git = \"[^\"]*\"[^}]*\\}") + "tpa = { path = \"../../guix-vendor/rust-tpa-0.1.0.49f1801-checkout\", version = \"0.1.0\" }") + (("lib_wfa2 = \\{ git = \"[^\"]*\", rev = \"[^\"]*\" \\}") + "lib_wfa2 = { path = \"../../guix-vendor/rust-lib-wfa2-0.1.0.8859b6a-checkout\", version = \"0.1.0\" }") + (("tracepoints = \\{ git = \"[^\"]*\", rev = \"[^\"]*\" \\}") + "tracepoints = { path = \"../../guix-vendor/rust-tracepoints-0.1.0.66a5511-checkout\", version = \"0.1.0\" }") + (("ragc-core = \\{ git = \"[^\"]*\", rev = \"[^\"]*\" \\}") + "ragc-core = { path = \"../../ragc-workspace/ragc-core\" }")) + ;; tpa and tracepoints have nested git deps on + ;; lib_wfa2 (same rev) and on each other. Rewire + ;; them to the same vendored checkouts. + (substitute* "guix-vendor/rust-tpa-0.1.0.49f1801-checkout/Cargo.toml" + (("lib_wfa2 = \\{ git = \"[^\"]*\"[^}]*\\}") + "lib_wfa2 = { path = \"../rust-lib-wfa2-0.1.0.8859b6a-checkout\", version = \"0.1.0\" }") + (("tracepoints = \\{ git = \"[^\"]*\"[^}]*\\}") + "tracepoints = { path = \"../rust-tracepoints-0.1.0.66a5511-checkout\", version = \"0.1.0\" }") + ;; Strip dev-deps; cargo --offline still wants + ;; them in the vendor even though we don't run + ;; tpa's tests. + (("^rand = .*") "") + (("\\[dev-dependencies\\]") "[fake-removed]")) + (substitute* "guix-vendor/rust-tracepoints-0.1.0.66a5511-checkout/Cargo.toml" + (("lib_wfa2 = \\{ git = \"[^\"]*\"[^}]*\\}") + "lib_wfa2 = { path = \"../rust-lib-wfa2-0.1.0.8859b6a-checkout\", version = \"0.1.0\" }")))) + ;; cargo-build-system's default install runs + ;; `cargo install --path .`, which fails for a virtual + ;; workspace root with no [package]. Copy the four + ;; workshop binaries out of target/release/ manually. + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") + "/bin"))) + (mkdir-p bin) + (for-each + (lambda (name) + (install-file (string-append "target/release/" name) + bin)) + '("ibs" "ibd" "ancestry" "jacquard"))))) + ;; lib_wfa2's build.rs builds WFA2-lib from a git + ;; submodule we don't have. Replace it with a stub + ;; that links against the system wfa2-lib-static; + ;; same pattern impg uses for its lib_wfa2 checkout. + (add-before 'build 'patch-lib-wfa2-use-system + (lambda _ + (let ((br "guix-vendor/rust-lib-wfa2-0.1.0.8859b6a-checkout/build.rs")) + (chmod br #o644) + (call-with-output-file br + (lambda (port) + (display + (string-append + "fn main() {\n" + " println!(\"cargo:rustc-link-lib=static=wfa\");\n" + " println!(\"cargo:rustc-link-lib=gomp\");\n" + " println!(\"cargo:rustc-link-search=native=" + #$(file-append wfa2-lib-static "/lib") "\");\n" + "}\n") + port)))) + ;; bindings_wfa.rs uses u32::cast_signed / + ;; i32::cast_unsigned, both unstable before Rust + ;; 1.87. Replace with explicit `as` casts. + (substitute* + "guix-vendor/rust-lib-wfa2-0.1.0.8859b6a-checkout/src/bindings_wfa.rs" + (("u32::cast_signed\\(self\\._bitfield_1\\.get\\(0usize, 24u8\\) as u32\\)") + "((self._bitfield_1.get(0usize, 24u8) as u32) as i32)") + (("u32::cast_signed\\(<") + "((<") + ((" \\) as u32\\)") + " ) as u32) as i32)") + (("i32::cast_unsigned\\(val\\)") + "(val as u32)") + (("i32::cast_unsigned\\(_flags2\\)") + "(_flags2 as u32)"))))))) + (native-inputs (list pkg-config)) + (inputs (cons* wfa2-lib-static + zlib + (list zstd "lib") + (cargo-inputs 'impop + #:module '(gn packages pangenome-rust)))) + (home-page "https://github.com/MarsicoFL/memimpopk") + (synopsis "Population genomics for implicit pangenomes") + (description "impop_k provides IBS, IBD, local-ancestry, and +Jacquard relatedness inference directly on per-window pairwise +identity matrices produced by @code{impg similarity}, without ever +calling variants or building a VCF. Each binary wraps a hidden +Markov model whose emissions are conditional probabilities over +per-window identity, with transitions calibrated by recombination +rate.") + (license license:expat)))) + (define mempang-workshop-pangenomes ;; pangenomes propagates the current vg (1.72.0) and wfmash-0.14 ;; release; the workshop is pinned to vg 1.71.0 and a wfmash-0.14 @@ -1708,8 +1861,16 @@ kfilt, miniprot, pangene, wally, and vcfbub.") (list mempang-workshop-pangenomes vg-1.71 wfmash-0.14-snapshot - ;; libgcc_s.so.1 for the prebuilt impop_k (Part 6) binaries - ;; that ship with the MarsicoFL/memimpopk repo. + ;; impop_k (Part 6): the source-built {ibs,ibd,ancestry, + ;; jacquard} from MarsicoFL/memimpopk's bundled source/. + ;; The workshop's memimpopk clone still ships its own + ;; prebuilt bin/, but with impop on PATH attendees who + ;; can't run the prebuilts (older glibc, ARM, ...) get + ;; working binaries automatically. + impop + ;; libgcc_s.so.1 for the memimpopk-prebuilt impop_k + ;; binaries; impop above is Guix-built and self-contained + ;; but the upstream prebuilts still need this. (list gcc "lib") bc bcftools |
