| Crates.io | rust-lib-reference-genome |
| lib.rs | rust-lib-reference-genome |
| version | 0.2.1 |
| created_at | 2025-11-21 14:58:13.886817+00 |
| updated_at | 2025-11-21 14:58:13.886817+00 |
| description | Reference genome library for Rust |
| homepage | https://github.com/holtjma/rust-lib-reference-genome |
| repository | https://github.com/holtjma/rust-lib-reference-genome |
| max_upload_size | |
| id | 1943693 |
| size | 33,375 |
This is a library that will load a reference genome into memory for quick lookups. This is largely an in-memory wrapper for a FASTA file.
Basic example:
let reference_fn = "./test_data/test_reference.fa";
let simple_reference_fn: PathBuf = PathBuf::from(reference_fn);
let reference_genome = ReferenceGenome::from_fasta(&simple_reference_fn).unwrap();
assert_eq!(reference_genome.contig_keys(), &[
"chr1".to_string(),
"chr2".to_string()
]);
//chr1 = ACGTACGT
let chr1_string: Vec<u8> = "ACGTACGT".as_bytes().to_vec();
assert_eq!(reference_genome.get_slice(&"chr1", 0, 8), &chr1_string);