Support URL inputs in taffy view -r and the Python API#85
Open
glennhickey wants to merge 1 commit intomainfrom
Open
Support URL inputs in taffy view -r and the Python API#85glennhickey wants to merge 1 commit intomainfrom
glennhickey wants to merge 1 commit intomainfrom
Conversation
Routes URL inputs (http://, https://, s3://, ...) through htslib's
URL-aware bgzf_open, so a region query against a remote MAF/TAF only
fetches the .tai plus the BGZF blocks the iterator actually needs.
- LI_construct_from_path: thin wrapper over bgzf_open, used in lieu of
fopen+LI_construct when the input is a URL
- remote_io.{h,c}: URL detector + .tai slurp helper that writes the
fetched bytes to a tmpfile (so downstream LI_construct(FILE*) can
fileno() it)
- taf_view.c: detects URL inputs, requires -r, falls through to the
shared cleanup path
- Python: AlignmentReader and TafIndex accept URL strings; URL-backed
readers skip the per-FILE* close that would otherwise corrupt
- Clear error message when htslib was built without libcurl, with a
pointer to ./configure --enable-libcurl
- README note documenting the htslib-with-libcurl requirement
Verified against a 184 GB MAF on S3: a 500 bp slice returns the right
content in ~8 s, dominated by the 5.9 MB index fetch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use htslib to support inputs over http. Seems to work pretty well thugh applied only to indexed taffy view (-r) queries for now.
These work by downloading the entire .tai, loading it into memory, then reading only the selected range from the remote alignment file.
Some things I need to check before merging: cactus integration (inc static build) and if it works on Mac.