{"id":17220809,"url":"https://github.com/kojix2/ruby-libssw","last_synced_at":"2025-10-10T23:40:21.640Z","repository":{"id":45552385,"uuid":"328163622","full_name":"kojix2/ruby-libssw","owner":"kojix2","description":"Fast Smith-Waterman algorithm for Ruby","archived":false,"fork":false,"pushed_at":"2025-08-11T14:29:54.000Z","size":179,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T22:31:55.300Z","etag":null,"topics":["bioinformatics","ruby","smith-waterman"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kojix2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"kojix2"}},"created_at":"2021-01-09T13:40:30.000Z","updated_at":"2025-08-11T14:29:42.000Z","dependencies_parsed_at":"2024-10-15T03:53:24.103Z","dependency_job_id":"03d082bb-ac08-4fa2-b15d-4cff5f8947f4","html_url":"https://github.com/kojix2/ruby-libssw","commit_stats":{"total_commits":151,"total_committers":1,"mean_commits":151.0,"dds":0.0,"last_synced_commit":"372ce2071bcd1600069b781a3f98082f5450dd4d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kojix2/ruby-libssw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-libssw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-libssw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-libssw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-libssw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kojix2","download_url":"https://codeload.github.com/kojix2/ruby-libssw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-libssw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005577,"owners_count":26083920,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bioinformatics","ruby","smith-waterman"],"created_at":"2024-10-15T03:53:17.970Z","updated_at":"2025-10-10T23:40:21.607Z","avatar_url":"https://github.com/kojix2.png","language":"Ruby","funding_links":["https://ko-fi.com/kojix2"],"categories":[],"sub_categories":[],"readme":"# ruby-libssw\n\n![test](https://github.com/kojix2/ruby-libssw/workflows/CI/badge.svg)\n[![Gem Version](https://img.shields.io/gem/v/libssw?color=brightgreen)](https://rubygems.org/gems/libssw)\n[![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://rubydoc.info/gems/libssw)\n[![DOI](https://zenodo.org/badge/328163622.svg)](https://zenodo.org/badge/latestdoi/328163622)\n\n:checkered_flag: [libssw](https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library) - fast SIMD parallelized implementation of the Smith-Waterman algorithm - for Ruby\n\n## Installation\n\n```ssh\ngem install libssw\n```\n\nSet the environment variable `LIBSSWDIR` to specify the location of the shared library.\nFor example, on Ubuntu, you can use libssw in the following way.\n\n```\nsudo apt install libssw-dev\nexport LIBSSWDIR=/usr/lib/x86_64-linux-gnu/ # libssw.so\n```\n\n### Installing from source\n\nWhen installing from source code using the following steps, the shared library `libssw.so` or `libssw.dylib` will be packed in the Ruby gem. In this case, the environment variable `LIBSSWDIR` is not required. \n\n```sh\ngit clone --recursive https://github.com/kojix2/ruby-libssw\nbundle exec rake libssw:build\nbundle exec rake install\n```\n\nruby-libssw does not support Windows.\n\n## Usage\n\n```ruby\nrequire 'libssw'\n\nref_str  = \"AAAAAAAAACGTTAAAAAAAAAA\"\nref_int  = SSW::DNA.to_int_array(ref_str) \n# [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\nread_str1 = \"ACGTT\"\nread_str2 = SSW::DNA.revcomp(read_str1)\n# \"AACGT\"\nread_int1 = SSW::DNA.to_int_array(read_str1)\n# [0, 1, 2, 3, 3]\nread_int2 = SSW::DNA.to_int_array(read_str2)\n# [0, 0, 1, 2, 3]\n\nmat = SSW.create_scoring_matrix(SSW::DNA::Elements, 2, -2)\n# mat = [2, -2, -2, -2,  0,\n#       -2,  2, -2, -2,  0,\n#       -2, -2,  2, -2,  0,\n#       -2, -2, -2,  2,  0,\n#        0,  0,  0,  0,  0]\n\nprofile1 = SSW.init(read_int1, mat)\nalign1   = SSW.align(profile1, ref_int, 3, 1, 1, 0, 0)\npp align1.to_h\n# {\n#  :score1       =\u003e 10,\n#  :score2       =\u003e 0,\n#  :ref_begin1   =\u003e 8,\n#  :ref_end1     =\u003e 12,\n#  :read_begin1  =\u003e 0,\n#  :read_end1    =\u003e 4,\n#  :ref_end2     =\u003e 0,\n#  :cigar        =\u003e [80],\n#  :cigar_len    =\u003e 1,\n#  :cigar_string =\u003e \"5M\"\n# }\n\nprofile2 = SSW.init(read_int2, mat)\nalign2   = SSW.align(profile2, ref_int, 3, 1, 1, 0, 0)\npp align2.to_h\n# {\n#  :score1       =\u003e 10,\n#  :score2       =\u003e 0,\n#  :ref_begin1   =\u003e 7,\n#  :ref_end1     =\u003e 11,\n#  :read_begin1  =\u003e 0,\n#  :read_end1    =\u003e 4,\n#  :ref_end2     =\u003e 0,\n#  :cigar        =\u003e [80],\n#  :cigar_len    =\u003e 1,\n#  :cigar_string =\u003e \"5M\"\n# }\n\nputs SSW.build_path(read_str1, ref_str, align1)\n# 5M\n# ACGTT\n# |||||\n# ACGTT\n```\n\n## APIs\n\nSee [API Documentation](https://rubydoc.info/gems/libssw).\n\n```markdown\n* SSW module\n  * SSW.init\n  * SSW.init_destroy\n  * SSW.align\n  * SSW.align_destroy\n  * SSW.mark_mismatch\n  * SSW.create_scoring_matrix\n  * SSW.build_path\n  \n  * Profile class\n    * attributes\n      * read, mat, read_len, n, bias\n\n  * Align class\n    * attributes\n      * score1, score2, ref_begin1, ref_end1, read_begin1, read_end1, ref_end2\n        cigar, cigar_len, cigar_string\n  \n  * DNA module\n    * DNA.to_int_array\n    * DNA.from_int_array\n    * revcomp\n\n  * AASeq module\n    * AASeq.to_int_array\n    * AASeq.from_int_array\n\n  * BLOSUM62\n  * BLOSUM50\n```\n\n## Development\n\n```sh\ngit clone --recursive https://github.com/kojix2/ruby-libssw\nbundle exec rake libssw:build\nbundle exec rake test\n```\n\n    Do you need commit rights to my repository?\n    Do you want to get admin rights and take over the project?\n    If so, please feel free to contact me @kojix2.\n\n## Contributing\n\n* [Report bugs](https://github.com/kojix2/ruby-libssw/issues)\n* Fix bugs and [submit pull requests](https://github.com/kojix2/ruby-libssw/pulls)\n* Write, clarify, or fix documentation\n* English corrections are welcome\n* Suggest or add new features\n\n## License\n\n* [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fruby-libssw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkojix2%2Fruby-libssw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fruby-libssw/lists"}