Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store cigar offsets in lightweight index #1

Merged
merged 10 commits into from
Apr 1, 2024
Merged

Conversation

bkille
Copy link
Contributor

@bkille bkille commented Mar 29, 2024

Similar to an .fai index, create an .impg index which stores the byte offset and byte size of the cigar string (the cg:Z tag value), as opposed to storing the entire cigar itself. Then, whenever a record is queried, impg looks up the corresponding byte offset/size values, opens the PAF file, seeks the offset, and reads the bytes into a cigar buffer.

TODO:

  • Compute byte position/offset from .gz files
  • Get tests working

Benchmark

Ran on 23Gb bgzipped PAF file (80 threads for Main and 16 threads for this PR)

impg --paf-file test-data/primates16.20231205_wfmash-v0.12.5.paf.bgz --query chm13#1#chr6:28385000-33300000 -x

Main

Index:

User time (seconds): 113885.48
System time (seconds): 15729.87
Elapsed (wall clock) time (h:mm:ss or m:ss): 30:59.03
Maximum resident set size (kbytes): 147000032

Query:

User time (seconds): 53.11
System time (seconds): 14.96
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:08.11
Maximum resident set size (kbytes): 19346680

This PR

Index:

User time (seconds): 600.19
System time (seconds): 23.18
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:45.43
Maximum resident set size (kbytes): 272596

Query:

User time (seconds): 0.65
System time (seconds): 0.08
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.74
Maximum resident set size (kbytes): 67592

@ekg ekg merged commit 308bc1f into pangenome:main Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants