Add scripts/refbuild: build GOR chromSeq reference builds from FASTA - #133
Open
gorfather wants to merge 1 commit into
Open
Add scripts/refbuild: build GOR chromSeq reference builds from FASTA#133gorfather wants to merge 1 commit into
gorfather wants to merge 1 commit into
Conversation
GOR's reference-build commands and functions (VARJOIN, VARMERGE, VARNORM and refbase()/refbases()) read reference bases from a build folder holding one <contig>.txt per chromosome (one byte per base, no newlines) plus buildsize.gor and buildsplit.txt. There was no in-repo tool to produce that layout from FASTA. - fasta_to_chromseq.py: stream a FASTA (plain/gz) into <contig>.txt, measure buildsize.gor, emit buildsplit.txt from GOR's built-in tables, write gor_config.txt. Handles Ensembl vs UCSC naming (--chr-prefix, --mt) and primary-assembly filtering. - download_build.sh: one-shot download + convert for hg38/hg19 (Ensembl default, UCSC alternative); bundles the curl URLs. - chromseq_to_gor.py + validate.sh: drive gorpipe against a build to verify GOR reads it correctly -- refbase() vs the stored bytes, and VCF REF alleles vs refbases() (e.g. a GIAB cross-check). - README.md: download URLs, conversion, config wiring, validation, and a buildsize-vs-buildsplit explanation. Reference data itself is kept out of the repo (built into a user-chosen root). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
What
Adds
scripts/refbuild/— tooling to build GOR chromSeq reference builds from standard FASTA.GOR's reference-build commands and functions (
VARJOIN,VARMERGE,VARNORMandrefbase()/refbases()) read reference bases from a build folder holding one<contig>.txtper chromosome (one byte per base, no newlines) plusbuildsize.gorandbuildsplit.txt. GOR does not read FASTA directly, and there was no in-repo tool to produce that layout. This fills that gap.Contents
fasta_to_chromseq.py— stream a FASTA (plain or gzipped) into<contig>.txt, measurebuildsize.gor, emitbuildsplit.txtfrom GOR's built-in split tables, and writegor_config.txt. Handles Ensembl vs UCSC contig naming (--chr-prefix,--mt) and primary-assembly filtering (--primary). Streams, so memory stays flat on whole genomes.download_build.sh— one-shot download + convert for hg38/hg19 (Ensembl by default, UCSC alternative); bundles the source URLs.chromseq_to_gor.py+validate.sh— drivegorpipeagainst a build to prove GOR reads it correctly:refbase()vs the stored bytes, and VCFREFalleles vsrefbases()(e.g. a GIAB cross-check).README.md— download URLs, conversion, config wiring, validation, and abuildsizevsbuildsplitexplanation.Notes
ReferenceBuildDefaults.java(hg19 shares hg18's table);buildsize.goris measured from the FASTA.tests/data/ref_minibyte-for-byte, and full Ensembl GRCh38/GRCh37 builds pass genome-wide self-consistency and GIAB chr21REFcross-checks.🤖 Generated with Claude Code