{"id":19909661,"url":"https://github.com/chrovis/clj-deconstruct-sigs","last_synced_at":"2026-02-09T07:05:57.327Z","repository":{"id":43366952,"uuid":"168477466","full_name":"chrovis/clj-deconstruct-sigs","owner":"chrovis","description":"deconstructSigs for Clojure","archived":false,"fork":false,"pushed_at":"2025-01-09T07:32:25.000Z","size":475,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-07T10:35:54.137Z","etag":null,"topics":["clojure","clojurescript","cosmic","mutational-signatures"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrovis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-31T06:51:23.000Z","updated_at":"2025-01-09T07:32:26.000Z","dependencies_parsed_at":"2022-09-05T22:40:05.605Z","dependency_job_id":null,"html_url":"https://github.com/chrovis/clj-deconstruct-sigs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-deconstruct-sigs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-deconstruct-sigs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-deconstruct-sigs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fclj-deconstruct-sigs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrovis","download_url":"https://codeload.github.com/chrovis/clj-deconstruct-sigs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251052205,"owners_count":21528793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","clojurescript","cosmic","mutational-signatures"],"created_at":"2024-11-12T21:16:17.681Z","updated_at":"2026-02-09T07:05:57.320Z","avatar_url":"https://github.com/chrovis.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/clj-deconstruct-sigs.svg)](https://clojars.org/clj-deconstruct-sigs)\n\n[![Build Status](https://travis-ci.org/chrovis/clj-deconstruct-sigs.svg?branch=master)](https://travis-ci.org/chrovis/clj-deconstruct-sigs)\n\n# clj-deconstruct-sigs\n\n![Mutational Signature](docs/img/v3.2_SBS3_PROFILE_GA_GRCh37_ygeJJyb.original.jpg \"Mutational Signature\")\n\nclj-deconstruct-sigs is a Clojure port of [deconstructSigs](https://github.com/raerose01/deconstructSigs).\n\n## What are Mutational Signatures?\n\nYou can find a comprehensive description [here](https://cancer.sanger.ac.uk/cosmic/signatures).\nIn short, treating an individual's somatic mutation pattern as a combination of known distinct signatures could lead to insights of cancer's characteristics.\n\n## Usage\n\nThe main function is `clj-deconstruct-sigs.core/which-signatures`, which takes a sample tumor and a reference signatures matrix and returns a map with the following keys.\n\n```\n:seed-idx - Index of the signature that was used as the initial seed\n:weights  - A map of weight indices to weight.\n:weights-with-names  - A map of weight that associated signature names as key on behalf of indices.\n:product - matrix product of :weights and the provided signatures\n:unknown - 1 minus the sum of weights\n:diff - element wise difference of the provided sample tumor and the product\n:error-sum - Square root of the sum of the element wise square of :diff. Indicates how close the :product is from the original input\n```\n\nHere is a REPL session that adds more context.\n\n```clojure\n(require '[clj-deconstruct-sigs.core :refer :all])\n\n;; A 96 element vector representing the substitution patterns as per https://cancer.sanger.ac.uk/cosmic/signatures.\n;; Start from A[C\u003eA]A and ends with T[T\u003eG]T\n(def sample-tumor [0.00131420164040066,....])\n\n;; Reference set of signatures to use, represented with m rows x 96 columns.\n;; This library provides cosmic.signature-data.generated/latest-cosmic-signatures which is based on parsing the latest\n;; signatures at https://cancer.sanger.ac.uk/cancergenome/assets/signatures_probabilities.txt\n(require '[clj-deconstruct-sigs.db])\n(def cosmic-signatures (clj-deconstruct-sigs.db/load-signature-database \"dev-resources/COSMIC_v3.2_SBS_GRCh38.txt\"))\n\n(which-signatures sample-tumor cosmic-signatures)\n=\u003e\n{:seed-idx 25,\n :weights {0 0.36016636298023036,...},\n :weights-with-names {\"SBS1\" 0.36016636298023036,...},\n :product [6.690145741717268E-4,...],\n :unknown 0.09329024976612943,\n :diff [6.451870662289333E-4,...],\n :error-sum 0.023682681269721964}\n```\n\n## License\n\nCopyright 2019-2022 [Xcoo, Inc.](https://xcoo.jp/)\n\nLicensed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fclj-deconstruct-sigs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrovis%2Fclj-deconstruct-sigs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fclj-deconstruct-sigs/lists"}