{"id":19909684,"url":"https://github.com/chrovis/cljam","last_synced_at":"2025-05-16T16:03:48.072Z","repository":{"id":13051445,"uuid":"15731549","full_name":"chrovis/cljam","owner":"chrovis","description":"A DNA Sequence Alignment/Map (SAM) library for Clojure","archived":false,"fork":false,"pushed_at":"2024-10-30T06:22:38.000Z","size":37982,"stargazers_count":90,"open_issues_count":9,"forks_count":12,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-30T08:41:23.698Z","etag":null,"topics":["2bit","bam","bcf","bed","bigwig","bioinformatics","clojure","cram","fasta","fastq","genomics","gff","sam","vcf","wig"],"latest_commit_sha":null,"homepage":"https://chrovis.github.io/cljam","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":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-08T09:52:14.000Z","updated_at":"2024-10-22T06:56:24.000Z","dependencies_parsed_at":"2023-10-03T08:33:10.662Z","dependency_job_id":"85d8f7cd-14cb-42ef-afe1-f6ef9f2692ef","html_url":"https://github.com/chrovis/cljam","commit_stats":{"total_commits":1309,"total_committers":17,"mean_commits":77.0,"dds":0.6875477463712758,"last_synced_commit":"121e5446b4f823e1b8bc45a7080a526759323b63"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fcljam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fcljam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fcljam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrovis%2Fcljam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrovis","download_url":"https://codeload.github.com/chrovis/cljam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578874,"owners_count":21127714,"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":["2bit","bam","bcf","bed","bigwig","bioinformatics","clojure","cram","fasta","fastq","genomics","gff","sam","vcf","wig"],"created_at":"2024-11-12T21:16:20.912Z","updated_at":"2025-04-12T14:21:35.447Z","avatar_url":"https://github.com/chrovis.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cljam\n\nA DNA Sequence Alignment/Map (SAM) library for Clojure. [[API Reference]][api-reference] [[Annotated Source]][annotated-source]\n\n[![Clojars Project](https://img.shields.io/clojars/v/cljam.svg)](https://clojars.org/cljam)\n\n[![Build Status](https://github.com/chrovis/cljam/workflows/main/badge.svg)](https://github.com/chrovis/cljam/actions)\n\n[![codecov](https://codecov.io/gh/chrovis/cljam/branch/master/graph/badge.svg)](https://codecov.io/gh/chrovis/cljam)\n\n## Installation\n\ncljam is available as a Maven artifact from [Clojars](https://clojars.org/cljam).\n\nClojure CLI/deps.edn:\n\n```clojure\ncljam {:mvn/version \"0.8.5\"}\n```\n\nLeiningen/Boot:\n\n```clojure\n[cljam \"0.8.5\"]\n```\n\n## Breaking changes in 0.8.0\n\n* `cljam.io.tabix` is rewritten. [#180](https://github.com/chrovis/cljam/pull/180)\n* `cljam.io.bam-index.writer/pos-\u003elidx-offset` is moved to `cljam.io.util.bin/pos-\u003elidx-offset`. [#180](https://github.com/chrovis/cljam/pull/180)\n* `cljam.io.sam.util/reg-\u003ebin` is moved to `cljam.io.util.bin/reg-\u003ebin`. Also, a coordinate system of its argument is changed from 0-based half-open to 1-based fully-closed. [#190](https://github.com/chrovis/cljam/pull/190)\n\n## Getting started\n\nTo read a SAM/BAM format file,\n\n```clojure\n(require '[cljam.io.sam :as sam])\n\n;; Open a file\n(with-open [r (sam/reader \"path/to/file.bam\")]\n  ;; Retrieve header\n  (sam/read-header r)\n  ;; Retrieve alignments\n  (doall (take 5 (sam/read-alignments r))))\n```\n\nTo create a sorted file,\n\n```clojure\n(require '[cljam.io.sam :as sam]\n         '[cljam.algo.sorter :as sorter])\n\n(with-open [r (sam/reader \"path/to/file.bam\")\n            w (sam/writer \"path/to/sorted.bam\")]\n  ;; Sort by chromosomal coordinates\n  (sorter/sort-by-pos r w))\n```\n\nTo create a BAM index file,\n\n```clojure\n(require '[cljam.algo.bam-indexer :as bai])\n\n;; Create a new BAM index file\n(bai/create-index \"path/to/sorted.bam\" \"path/to/sorted.bam.bai\")\n```\n\nTo calculate coverage depth for a BAM file,\n\n```clojure\n(require '[cljam.io.sam :as sam]\n         '[cljam.algo.depth :as depth])\n\n(with-open [r (sam/reader \"path/to/sorted.bam\")]\n  ;; Pileup \"chr1\" alignments\n  (depth/depth r {:chr \"chr1\", :start 1, :end 10}))\n;;=\u003e (0 0 0 0 0 0 1 1 3 3)\n```\n\nIf you are Clojure beginner, read [Getting Started for Clojure Beginners](https://github.com/chrovis/cljam/wiki/Getting-Started-for-Clojure-Beginners).\n\n## Command-line tool\n\ncljam provides a command-line tool to use the features easily.\n\n**NOTICE**\nThe command-line tool functionality will be removed from cljam on the next\nrelease. The functionality has been already integrated into\n[Gnife](https://github.com/chrovis/gnife), which is a pure command-line tool.\n\n### Executable installation\n\n`lein bin` creates standalone console executable into `target` directory.\n\n```console\n$ lein bin\nCreating standalone executable: /path/to/cljam/target/cljam\n```\n\nCopy the executable `cljam` somewhere in your `$PATH`.\n\n### Usage\n\nAll commands are displayed by `cljam -h`, and detailed help for each command are displayed by `cljam [cmd] -h`.\n\n```console\n$ cljam view -h\n```\n\nFor example, to display contents of a SAM file including the header,\n\n```console\n$ cljam view --header path/to/file.sam\n```\n\nSee [command-line tool manual](https://github.com/chrovis/cljam/wiki/Command-line-tool) for more information.\n\n## Development\n\n### Test\n\nTo run tests,\n\n- `lein test` for basic tests,\n- `lein test :slow` for slow tests with local resources,\n- `lein test :remote` for tests with remote resources.\n\nTo get coverage\n\n```console\n$ lein cloverage\n```\n\nAnd open `target/coverage/index.html`.\n\n### Generating document\n\ncljam uses [Codox](https://github.com/weavejester/codox) for API reference and\n[Marginalia](https://github.com/gdeer81/marginalia) for annotated source code.\n\n```console\n$ lein docs\n```\n\ngenerates these documents in `target/docs` and `target/literate` directories.\n\n## Citing cljam\n\nT. Takeuchi, A. Yamada, T. Aoki, and K. Nishimura. [cljam: a library for handling DNA sequence alignment/map (SAM) with parallel processing](http://dx.doi.org/10.1186/s13029-016-0058-6). Source Code for Biology and Medicine, Vol. 11, No. 1, pp. 1-4, 2016.\n\n## Contributors\n\nSorted by first commit.\n\n- Toshiki Takeuchi ([@totakke](https://github.com/totakke))\n- Takashi Aoki ([@federkasten](https://github.com/federkasten))\n- Atsuo Yamada ([@ayamada](https://github.com/ayamada))\n- Jun Imura ([@alumi](https://github.com/alumi))\n- Shogo Ohta ([@athos](https://github.com/athos))\n- Shunya Kawabata ([@r6eve](https://github.com/r6eve))\n- Yuji Ito ([@yito88](https://github.com/yito88))\n- Akira Inoue ([@niyarin](https://github.com/niyarin))\n- Atsushi Kitahara ([@xckitahara](https://github.com/xckitahara))\n- Kei Komazaki ([@k-kom](https://github.com/k-kom))\n- Tomoki Matsuda ([@matsutomo81](https://github.com/matsutomo81))\n- Ryutaro Nagata ([@nuggetoriniku](https://github.com/nuggetoriniku))\n\n## License\n\nCopyright 2013-2024 [Xcoo, Inc.](https://xcoo.jp/)\n\nLicensed under the [Apache License, Version 2.0](LICENSE).\n\n[api-reference]: https://chrovis.github.io/cljam/docs\n[annotated-source]: https://chrovis.github.io/cljam/literate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fcljam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrovis%2Fcljam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrovis%2Fcljam/lists"}