{"id":13751906,"url":"https://github.com/modernatx/seqlike","last_synced_at":"2025-10-21T19:58:59.452Z","repository":{"id":38863595,"uuid":"414609779","full_name":"modernatx/seqlike","owner":"modernatx","description":"Unified biological sequence manipulation in Python","archived":false,"fork":false,"pushed_at":"2024-06-12T19:49:41.000Z","size":1278,"stargazers_count":207,"open_issues_count":9,"forks_count":21,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-21T19:58:54.016Z","etag":null,"topics":["biological-sequences","biopython","machine-learning","sequence"],"latest_commit_sha":null,"homepage":"https://modernatx.github.io/seqlike","language":"Python","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/modernatx.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-07T13:20:39.000Z","updated_at":"2025-04-06T05:49:44.000Z","dependencies_parsed_at":"2022-07-20T01:19:01.062Z","dependency_job_id":"38cf5636-c2e5-47b3-8cb3-d538db72d514","html_url":"https://github.com/modernatx/seqlike","commit_stats":{"total_commits":108,"total_committers":14,"mean_commits":7.714285714285714,"dds":0.7037037037037037,"last_synced_commit":"1859afc419b6f530d37ff849f4b76cd8576b8bd8"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/modernatx/seqlike","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernatx%2Fseqlike","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernatx%2Fseqlike/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernatx%2Fseqlike/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernatx%2Fseqlike/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modernatx","download_url":"https://codeload.github.com/modernatx/seqlike/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernatx%2Fseqlike/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280325297,"owners_count":26311419,"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-21T02:00:06.614Z","response_time":58,"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":["biological-sequences","biopython","machine-learning","sequence"],"created_at":"2024-08-03T09:00:56.857Z","updated_at":"2025-10-21T19:58:59.437Z","avatar_url":"https://github.com/modernatx.png","language":"Python","funding_links":[],"categories":["Ranked by starred repositories"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg src=\"docs/images/logo-symbol-color.svg?raw=true\", width=\"300\", alt=\"SeqLike\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e SeqLike - flexible biological sequence objects in Python \u003c/h1\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"#contributors-\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/modernatx/seqlike/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache%202-blue\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\u003c!--- BADGES: START ---\u003e\n\u003cp align=\"center\"\u003e\n  \u003c!--- This badge will work once supported python version information is available on PyPI ---\u003e\n  \u003ca href=\"https://pypi.org/project/seqlike/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/seqlike?logo=pypi\u0026style=flat\u0026color=blue\" alt=\"PyPI - Supported Python Version\" /\u003e\n  \u003c/a\u003e\n  \u003c!--- Supported Python Version Badge End ---\u003e\n  \u003ca href=\"https://pypi.org/project/seqlike/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/seqlike?logo=pypi\u0026style=flat\u0026color=orange\" alt=\"PyPI - Package Version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://anaconda.org/conda-forge/seqlike\"\u003e\n    \u003cimg src=\"https://img.shields.io/conda/pn/conda-forge/seqlike?logo=anaconda\u0026style=flat\" alt=\"Conda - Platform\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://anaconda.org/conda-forge/seqlike\"\u003e\n    \u003cimg src=\"https://img.shields.io/conda/vn/conda-forge/seqlike?logo=anaconda\u0026style=flat\u0026color=orange\" alt=\"Conda (channel only)\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://modernatx.github.io/seqlike\"\u003e\n    \u003cimg src=\"https://img.shields.io/static/v1?logo=github\u0026style=flat\u0026color=pink\u0026label=docs\u0026message=seqlike\" alt=\"Docs - GitHub.io\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c!--- BADGES: END ---\u003e\n\n## Introduction\n\nA single object API that makes working with biological sequences in Python\n more ergonomic. It'll handle anything _like a sequence_.  \n\nBuilt around the [Biopython SeqRecord class](https://biopython.org/wiki/SeqRecord),\nSeqLikes abstract over the semantics of molecular biology (DNA -\u003e RNA -\u003e AA)\nand data structures (strings, Seqs, SeqRecords, numerical encodings)\nto allow manipulation of a biological sequence\nat the level which is most computationally convenient.\n\n## Code samples and examples\n\n### Build data-type agnostic functions\n\n```python\ndef f(seq: SeqLikeType, *args):\n\tseq = SeqLike(seq, seq_type=\"nt\").to_seqrecord()\n\t# ...\n```\n\n#### Streamline conversion to/from ML friendly representations\n\n```python\nprediction = model(aaSeqLike('MSKGEELFTG').to_onehot())\nnew_seq = ntSeqLike(generative_model.sample(), alphabet=\"-ACGTUN\")\n```\n\n### Interconvert between AA and NT forms of a sequence\n\nBack-translation is conveniently built-in!\n\n```python\ns_nt = ntSeqLike(\"ATGTCTAAAGGTGAA\")\ns_nt[0:3] # ATG\ns_nt.aa()[0:3] # MSK, nt-\u003eaa is well defined\ns_nt.aa()[0:3].nt() # ATGTCTAAA, works because SeqLike now has both reps\ns_nt[:-1].aa() # TypeError, len(s_nt) not a multiple of 3\n\ns_aa = aaSeqLike(\"MSKGE\")\ns_aa.nt() # AttributeError, aa-\u003ent is undefined w/o codon map\ns_aa = aaSeqLike(s_aa, codon_map=random_codon_map)\ns_aa.nt() # now works, backtranslated to e.g. ATGTCTAAAGGTGAA\ns_aa[:1].nt() # ATG, codon_map is maintained\n```\n\n### Easily plot multiple sequence alignments\n\n```python\nseqs = [s for s in SeqIO.parse(\"file.fasta\", \"fasta\")]\ndf = pd.DataFrame(\n    {\n        \"names\": [s.name for s in seqs],\n        \"seqs\": [aaSeqLike(s) for s in seqs],\n    }\n)\ndf[\"aligned\"] = df[\"seqs\"].seq.align()\ndf[\"aligned\"].seq.plot()\n```\n\n### Flexibly build and parse numerical sequence representations\n\n```python\n# Assume you have a dataframe with a column of 10 SeqLikes of length 90\ndf[\"seqs\"].seq.to_onehot().shape # (10, 90, 23), padded if needed\n```\n\nTo see more in action,\nplease check out the [docs](https://modernatx.github.io/seqlike/)!\n\n\u003c!-- ![Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/th5xamgrr6se0x5ro4g6.png) --\u003e\n\n\n## Getting Started\n\nInstall the library with `pip` or `conda`.\n\n**With pip**\n\n```python\npip install seqlike\n```\n\n**With conda**\n\n```sh\nconda install -c conda-forge seqlike\n```\n\n## Authors\n\n- [@andrewgiessel](https://github.com/andrewgiessel)\n- [@maxasauruswall](https://github.com/maxasauruswall)\n- [@MihirMetkar](https://github.com/MihirMetkar)\n- [@ndousis](https://github.com/ndousis)\n- [@ericmjl](https://github.com/ericmjl)\n\n## Support\n\n- Questions about usage should be posed on [Stack Overflow with the #seqlike tag][SO].\n- Bug reports and feature requests are managed using the [Github issue tracker][gh_issues].\n\n[SO]: https://stackoverflow.com/questions/tagged/seqlike\n[gh_issues]: https://github.com/modernatx/seqlike/issues\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ndousis\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/15198691?v=4?s=100\" width=\"100px;\" alt=\"Nasos Dousis\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNasos Dousis\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=ndousis\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://giessel.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1160997?v=4?s=100\" width=\"100px;\" alt=\"andrew giessel\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eandrew giessel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=andrewgiessel\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/maxasauruswall\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/14082213?v=4?s=100\" width=\"100px;\" alt=\"Max Wall\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMax Wall\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=maxasauruswall\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/modernatx/seqlike/commits?author=maxasauruswall\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://ericmjl.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2631566?v=4?s=100\" width=\"100px;\" alt=\"Eric Ma\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEric Ma\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=ericmjl\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/modernatx/seqlike/commits?author=ericmjl\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/MihirMetkar\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/9938754?v=4?s=100\" width=\"100px;\" alt=\"Mihir Metkar\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMihir Metkar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-MihirMetkar\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/modernatx/seqlike/commits?author=MihirMetkar\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mccaron707\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/26267127?v=4?s=100\" width=\"100px;\" alt=\"Marcus Caron\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarcus Caron\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=mccaron707\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/pagpires\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7856031?v=4?s=100\" width=\"100px;\" alt=\"pagpires\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003epagpires\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=pagpires\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/sugatoray/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/10201242?v=4?s=100\" width=\"100px;\" alt=\"Sugato Ray\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSugato Ray\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-sugatoray\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"#maintenance-sugatoray\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://dmnfarrell.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7859189?v=4?s=100\" width=\"100px;\" alt=\"Damien Farrell\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDamien Farrell\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=dmnfarrell\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/farbod-nobar\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/44842525?v=4?s=100\" width=\"100px;\" alt=\"Farbod Mahmoudinobar\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFarbod Mahmoudinobar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/modernatx/seqlike/commits?author=farbod-nobar\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/JacobHayes\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2555532?v=4?s=100\" width=\"100px;\" alt=\"Jacob Hayes\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJacob Hayes\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-JacobHayes\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodernatx%2Fseqlike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodernatx%2Fseqlike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodernatx%2Fseqlike/lists"}