Repository navigation
Conversation
Port SAFARI (Rubin et al. 2025, NAR Genomics and Bioinformatics 7(4), lqaf170, doi:10.1093/nargab/lqaf170) from its vg 1.44 fork into vg. vg rymer builds an RYmer index: the DNA minimizers of a GBZ's haplotypes, stored under their purine/pyrimidine encoding with the DNA key as payload. It is an ordinary gbwtgraph minimizer index, so gbwtgraph is unchanged. vg safari is vg giraffe plus one more source of seeds. For each read minimizer under the RYmer index's k and w, graph k-mers with the same RYmer are scored with a deamination-aware posterior. Accepted k-mers are put into an all-N stand-in read, and its minimizers are added as seeds. It takes every vg giraffe option plus the RYmer index, 5' and 3' deamination profiles, a posterior threshold and a spurious-match prior. Giraffe changes: - MinimizerMapper gets an optional stand_in_sequences hook, called after find_minimizers in map_from_extensions and map_from_chains. It is unset in vg giraffe and returns at once. - The body of main_giraffe moves unchanged into run_giraffe(), which takes a GiraffeVariant so vg safari can reuse giraffe's options. vg giraffe output was checked byte-identical to an unmodified build on single-end, paired, provenance-tracking, chaining-sr, hifi and r10 runs, and its help text is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GSbnmoxNgG37pZTf1LCmuk
This branch has not been deployed
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.
Port SAFARI (Rubin et al. 2025, NAR Genomics and Bioinformatics 7(4), lqaf170, doi:10.1093/nargab/lqaf170) from its vg 1.44 fork into vg.
vg rymer builds an RYmer index: the DNA minimizers of a GBZ's haplotypes, stored under their purine/pyrimidine encoding with the DNA key as payload. It is an ordinary gbwtgraph minimizer index, so gbwtgraph is unchanged.
vg safari is vg giraffe plus one more source of seeds. For each read minimizer under the RYmer index's k and w, graph k-mers with the same RYmer are scored with a deamination-aware posterior. Accepted k-mers are put into an all-N stand-in read, and its minimizers are added as seeds. It takes every vg giraffe option plus the RYmer index, 5' and 3' deamination profiles, a posterior threshold and a spurious-match prior.
Giraffe changes:
vg giraffe output was checked byte-identical to an unmodified build on single-end, paired, provenance-tracking, chaining-sr, hifi and r10 runs, and its help text is unchanged.
Claude-Session: https://claude.ai/code/session_01GSbnmoxNgG37pZTf1LCmuk
Changelog Entry
To be copied to the draft changelog by merger:
Description
This adds SAFARI, an ancient-DNA mapper first written as a fork of vg 1.44 (https://github.com/grenaud/SAFARI), to current vg as two subcommands:
vg rymerbuilds an RYmer index from a GBZ: the haplotypes' DNA minimizers, stored under their purine/pyrimidine encoding (deamination never changes it) with the DNA key as payload. It is an ordinary gbwtgraph minimizer index, so gbwtgraph is unchanged. The original fork patched gbwtgraph.vg safariisvg giraffeplus one more source of seeds. For each read minimizer, graph k-mers with the same RYmer are scored with a deamination-aware posterior from 5'/3' damage profiles. Each accepted k-mer goes into an all-N stand-in read, and that read's minimizers are added as seeds. It takes every giraffe option plus-q(RYmer index),--deam-5p,--deam-3p,-jand-V.Both commands' help asks users to cite the paper and prints a BibTeX entry.
Changes to giraffe
MinimizerMappergets an optionalstand_in_sequenceshook, called afterfind_minimizersinmap_from_extensionsandmap_from_chains.vg giraffenever sets it, and the function returns at once when it is unset.main_giraffemoves unchanged intorun_giraffe()(giraffe_main.hpp). It takes aGiraffeVariant, sovg safarireuses giraffe's option parsing.Testing
vg giraffeoutput (GAF) is byte-identical to an unmodified build of the base commit for single-end, paired,--track-provenance,chaining-sr,hifiandr10runs.vg giraffeandvg giraffe --helpprint the same text.vg test(1061 test cases) and the wholetest/t/suite pass.vg test "[safari]"andartifacts/test/vg_safari.t.vg safariplaced 444 correctly versus 363 forvg giraffe. Neither made a wrong placement at MAPQ ≥ 30.Differences from the original SAFARI
vg safariwarns when given paired reads.artifacts/doc/safari.mdfor the method and the remaining differences.New code is in
artifacts/per the repository's rules for machine-written files. The two subcommands are insrc/subcommand/, because the Makefile only builds commands from there.🤖 Generated with Claude Code