{"id":16849204,"url":"https://github.com/mbhall88/pafpy","last_synced_at":"2025-06-22T11:32:46.823Z","repository":{"id":40552103,"uuid":"263569038","full_name":"mbhall88/pafpy","owner":"mbhall88","description":"A lightweight library for working with PAF (Pairwise mApping Format) files","archived":false,"fork":false,"pushed_at":"2022-05-03T00:07:33.000Z","size":220,"stargazers_count":31,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T18:10:23.676Z","etag":null,"topics":["alignment","bioinformatics","library","minimap2","paf","pairwise-mapping-format","python"],"latest_commit_sha":null,"homepage":"https://mbh.sh/pafpy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbhall88.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T08:22:25.000Z","updated_at":"2024-02-09T11:44:44.000Z","dependencies_parsed_at":"2022-08-09T23:00:35.471Z","dependency_job_id":null,"html_url":"https://github.com/mbhall88/pafpy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mbhall88/pafpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Fpafpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Fpafpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Fpafpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Fpafpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbhall88","download_url":"https://codeload.github.com/mbhall88/pafpy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbhall88%2Fpafpy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261008262,"owners_count":23096385,"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":["alignment","bioinformatics","library","minimap2","paf","pairwise-mapping-format","python"],"created_at":"2024-10-13T13:14:36.208Z","updated_at":"2025-06-22T11:32:41.783Z","avatar_url":"https://github.com/mbhall88.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pafpy\n\nA lightweight library for working with [PAF][PAF] (Pairwise mApping Format) files.\n\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/mbhall88/pafpy?sort=semver)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/mbhall88/pafpy/Python_package)](https://github.com/mbhall88/pafpy/actions)\n[![codecov](https://codecov.io/gh/mbhall88/pafpy/branch/master/graph/badge.svg)](https://codecov.io/gh/mbhall88/pafpy)\n![License](https://img.shields.io/github/license/mbhall88/pafpy)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n**Documentation**: \u003chttps://mbh.sh/pafpy\u003e\n\n[TOC]: #\n\n## Table of Contents\n- [Install](#install)\n  - [PyPi](#pypi)\n  - [Conda](#conda)\n  - [Locally](#locally)\n- [Usage](#usage)\n- [Contributing](#contributing)\n\n## Install\n\n### PyPi\n\n[![PyPI](https://img.shields.io/pypi/v/pafpy)](https://pypi.org/project/pafpy/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pafpy)\n\n```sh\npip install pafpy\n```\n\n### Conda\n\n![Conda](https://img.shields.io/conda/pn/bioconda/pafpy)\n[![Conda (channel only)](https://img.shields.io/conda/vn/bioconda/pafpy)](https://bioconda.github.io/recipes/pafpy/README.html)\n\n```sh\nconda install -c bioconda pafpy\n```\n\n### Locally\n\nIf you would like to install locally, the recommended way is using [poetry][poetry].\n\n```sh\ngit clone https://github.com/mbhall88/pafpy.git\ncd pafpy\nmake install\n# to check the library is installed run\npoetry run python -c \"from pafpy import PafRecord;print(str(PafRecord()))\"\n# you should see a (unmapped) PAF record printed to the terminal\n# you can also run the tests if you like\nmake test-code\n```\n\n## Usage\n\nFor full usage, please refer to the [documentation][docs]. If there is any functionality\nyou feel is missing or would make `pafpy` more user-friendly, please raise an issue with\na feature request.\n\nIn the below basic usage pattern, we collect the [BLAST identity][blast] of all primary\nalignments in our PAF file into a list.\n\n```py\nfrom typing import List\nfrom pafpy import PafFile\n\npath = \"path/to/sample.paf\"\n\nidentities: List[float] = []\nwith PafFile(path) as paf:\n    for record in paf:\n        if record.is_primary():\n            identity = record.blast_identity()\n            identities.append(identity)\n```\n\nAnother use case might be that we want to get the identifiers of all records aligned to\na specific contig, but only keep the alignments where more than 50% of the query (read)\nis aligned.\n\n```py\nfrom typing import List\nfrom pafpy import PafFile\n\npath = \"path/to/sample.paf\"\n\ncontig = \"chr1\"\nmin_covg = 0.5\nidentifiers: List[str] = []\nwith PafFile(path) as paf:\n    for record in paf:\n        if record.tname == contig and record.query_coverage \u003e min_covg:\n            identifiers.append(record.qname)\n```\n\n## Contributing\n\nIf you would like to contribute to `pafpy`, checkout [`CONTRIBUTING.md`][contribute].\n\n[PAF]: https://github.com/lh3/miniasm/blob/master/PAF.md\n[blast]: https://lh3.github.io/2018/11/25/on-the-definition-of-sequence-identity#blast-identity\n[contribute]: https://github.com/mbhall88/pafpy/blob/master/CONTRIBUTING.md\n[docs]: https://mbh.sh/pafpy/\n[poetry]: https://python-poetry.org/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbhall88%2Fpafpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbhall88%2Fpafpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbhall88%2Fpafpy/lists"}