{"id":41713159,"url":"https://github.com/kentwait/alignmentrs","last_synced_at":"2026-01-24T21:49:47.022Z","repository":{"id":57409756,"uuid":"168092487","full_name":"kentwait/alignmentrs","owner":"kentwait","description":"Quickly read and manipulate multiple sequence alignments in Python","archived":false,"fork":false,"pushed_at":"2019-09-13T06:34:23.000Z","size":633,"stargazers_count":1,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-29T01:08:23.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/kentwait.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-29T05:05:09.000Z","updated_at":"2019-07-10T00:14:44.000Z","dependencies_parsed_at":"2022-08-24T20:00:18.349Z","dependency_job_id":null,"html_url":"https://github.com/kentwait/alignmentrs","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/kentwait/alignmentrs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentwait%2Falignmentrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentwait%2Falignmentrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentwait%2Falignmentrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentwait%2Falignmentrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentwait","download_url":"https://codeload.github.com/kentwait/alignmentrs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentwait%2Falignmentrs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28737622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T21:19:41.845Z","status":"ssl_error","status_checked_at":"2026-01-24T21:13:38.675Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-24T21:49:46.476Z","updated_at":"2026-01-24T21:49:47.018Z","avatar_url":"https://github.com/kentwait.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alignmentrs\n\nQuickly read and manipulate multiple sequence alignments in Python\n\n## Installation\n\n    pip install alignmentrs\n\n## Quickstart\n\n### Import alignment into Python\n```python\n\u003e\u003e\u003e import alignmentrs as rs\n\u003e\u003e\u003e aln = rs.Alignment.from_fasta('hiv.fna', 'HIV_alignment')\n\u003e\u003e\u003e aln\nAlignment(nsamples=10, nsites=120, nmarkers=0)\n\u003e\u003e\u003e aln.sample_ids\n['sample01', 'sample02', 'sample03', 'sample04', 'sample05', 'sample06'\n 'sample07', 'sample08', 'sample09', 'sample10']\n```\n\n### Select sites to remove from the alignment\n```python\n\u003e\u003e\u003e sites_to_remove = [i for i in range(120) if (i-2) % 3 != 0]  # remove 1st and 2nd position in codon triplet\n\u003e\u003e\u003e aln.remove_sites(sites_to_remove, copy=False)  # manipulate inplace, copy=True returns a new copy\nAlignment(nsamples=10, nsites=40, nmarkers=0)\n```\n\n### Select sites to retain in the alignment\n```python\n\u003e\u003e\u003e sites_to_retain = list(range(2, 3, 120))  # third position in codon triplet\n\u003e\u003e\u003e aln.retain_sites(sites_to_retain, copy=False)  # manipulate inplace, copy=True returns a new copy\nAlignment(nsamples=10, nsites=40, nmarkers=0)\n```\n\n### Get a subset of samples and sites\n```python\n\u003e\u003e\u003e sub_aln = aln.subset(samples=['sample01', 'sample03', 'sample05'], sites=list(range(2, 3, 120)))\n\u003e\u003e\u003e sub_aln\nAlignment(nsamples=3, nsites=40, nmarkers=0)\n```\n\n## License\n\n[MIT License](https://github.com/kentwait/alignmentrs/blob/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentwait%2Falignmentrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentwait%2Falignmentrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentwait%2Falignmentrs/lists"}