Skip to content

fix: replace twobitreader with py2bit to support large genomes#107

Merged
alejandrogzi merged 2 commits intohillerlab:mainfrom
NilaBlueshirt:fix/py2bit-large-genome
Apr 4, 2026
Merged

fix: replace twobitreader with py2bit to support large genomes#107
alejandrogzi merged 2 commits intohillerlab:mainfrom
NilaBlueshirt:fix/py2bit-large-genome

Conversation

@NilaBlueshirt
Copy link
Copy Markdown
Contributor

@NilaBlueshirt NilaBlueshirt commented Apr 1, 2026

twobitreader only handles version-0 .2bit files. faToTwoBit -long produces version-1 (64-bit) .2bit files required for larger genomes (e.g., lungfish ~40 GB, salamander ~21 GB). This caused crashes during the partition step.

py2bit supports both version-0 and version-1 .2bit files, fixes #56.

I have tested this fix on my side with large input data, and it works well.

Nil Mu and others added 2 commits March 31, 2026 20:38
twobitreader only handles version-0 .2bit files. faToTwoBit -long produces
version-1 (64-bit) .2bit files required for genomes larger than 4 GB (e.g.
lungfish ~40 GB, salamander ~21 GB). This caused crashes during LASTZ jobs.

py2bit supports both version-0 and version-1 .2bit files, fixing issue hillerlab#56.

Changes:
- standalone_scripts/run_lastz.py: import py2bit; use py2bit.open() and
  two_bit_conn.sequence() instead of TwoBitFile and dict-style access
- pyproject.toml: twobitreader -> py2bit in dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, writer side)

The previous commit fixed the reader (twobitreader → py2bit), but faToTwoBit
was still writing version-0 (32-bit) .2bit files without -long, causing an
index overflow abort on genomes with sequences larger than 4 GB.

Adding -long to both faToTwoBit call sites in project_setup_procedures.py
so it writes version-1 (64-bit) .2bit files that py2bit can then read.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alejandrogzi alejandrogzi self-assigned this Apr 3, 2026
@alejandrogzi alejandrogzi merged commit ffd088c into hillerlab:main Apr 4, 2026
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.

Alignment of a large genome in 2bit

2 participants