{"id":33936620,"url":"https://github.com/noamteyssier/faiquery","last_synced_at":"2026-04-07T04:32:05.053Z","repository":{"id":189980277,"uuid":"681762512","full_name":"noamteyssier/faiquery","owner":"noamteyssier","description":"perform interval queries on an indexed fasta file","archived":false,"fork":false,"pushed_at":"2023-08-23T18:39:15.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-14T02:27:19.823Z","etag":null,"topics":["fai","fasta","indexed-fasta","query"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/noamteyssier.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,"governance":null}},"created_at":"2023-08-22T17:50:38.000Z","updated_at":"2023-08-22T18:50:52.000Z","dependencies_parsed_at":"2023-08-22T19:24:58.795Z","dependency_job_id":null,"html_url":"https://github.com/noamteyssier/faiquery","commit_stats":null,"previous_names":["noamteyssier/faiquery"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noamteyssier/faiquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noamteyssier%2Ffaiquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noamteyssier%2Ffaiquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noamteyssier%2Ffaiquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noamteyssier%2Ffaiquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noamteyssier","download_url":"https://codeload.github.com/noamteyssier/faiquery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noamteyssier%2Ffaiquery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["fai","fasta","indexed-fasta","query"],"created_at":"2025-12-12T14:25:30.234Z","updated_at":"2026-04-07T04:32:05.046Z","avatar_url":"https://github.com/noamteyssier.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# faiquery\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)\n![actions status](https://github.com/noamteyssier/faiquery/workflows/CI/badge.svg)\n[![docs.rs](https://img.shields.io/docsrs/faiquery?color=green\u0026label=docs.rs)](https://docs.rs/faiquery/latest/faiquery/)\n\nperform interval queries on an indexed fasta file\n\n## Description\n\nThis is a simple utility library to request interval queries\non an indexed fasta file.\n\nThs index is assumed [`samtools faidx`](http://www.htslib.org/doc/samtools-faidx.html).\n\nThe fasta file is memory-mapped and a single mutable buffer is kept\nfor the indexed fasta reader.\nThis buffer is used to return a slice reference to the query sequence\nbut allows for a non-contiguous sequence (i.e. can return sequences without newlines)\n\nNote that because a mutable buffer is kept, this is not the best approach for\nconcurrent operations.\n\nHowever, for single-threaded applications, this performs very well with low memory\noverhead and runtime.\n\n## Usage\n\n```rust\nuse anyhow::Result;\nuse faiquery::{FastaIndex, IndexedFasta};\n\nfn main() -\u003e Result\u003c()\u003e {\n    let index = FastaIndex::from_filepath(\"example_data/example.fa.fai\")?;\n    let mut faidx = IndexedFasta::new(index, \"example_data/example.fa\")?;\n\n    // Query the first 10 bases of chr1\n    let seq = faidx.query(\"chr1\", 0, 10)?;\n    assert_eq!(seq, b\"ACCTACGATC\");\n\n    // Query the first 10 bases of chr2\n    let seq = faidx.query(\"chr2\", 0, 10)?;\n    assert_eq!(seq, b\"TTTTGATCGA\");\n\n    Ok(())\n}\n```\n\n## Similar Approaches\n\nThere are other index fasta readers that are available,\nhere is a nonexhaustive list of those:\n\n- [faimm](https://crates.io/crates/faimm)\n- [noodles](https://crates.io/crates/noodles)\n- [rust-bio](https://crates.io/crates/bio)\n\nIf you are looking for a powerful concurrent reader I recommend\nusing the [faimm](https://crates.io/crates/faimm) crate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoamteyssier%2Ffaiquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoamteyssier%2Ffaiquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoamteyssier%2Ffaiquery/lists"}