Skip to main content

pyTwobit

Package for fetching sequence from twobit files from local paths or URLs.

Installing

pip install pyTwobit

Usage

To fetch sequence for a genomic region create a TwoBit object with either a local file path or url. Sequence is fetched with the fetch function which takes chromosome name, start, and end coordinates. The UCSC coordinate convention is used (0 start, half-open).

Local file

from pytwobit import TwoBit

twobit = TwoBit('test.2bit')
seq = twobit.fetch("chr1", 50, 57)  # -> "CTATCTA"

Remote file

from pytwobit import TwoBit

twobit = TwoBit("https://igv.org/genomes/data/hg38/hg38.2bit")
seq = twobit.fetch("chr1", 120565294, 120565335)  # -> "TATGAACTTTTGTTCGTTGGTgctcagtcctagaccctttt"

Metadata

Release files for pytwobit 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytwobit 0.3.1
File Size Uploaded
pytwobit-0.3.1.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytwobit 0.3.1
File Interpreter ABI Platform
pytwobit-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / pytwobit-0.3.1.tar.gz

Download URL pytwobit-0.3.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
30f7ff8b50e8aa8ee933a3f49911d275299def9de43c4287fd26411c2b49d62f
BLAKE2b-256 checksum
How to use checksums
ab883af2a82a2220016ac6c5609e9ce14e95449954e5046997f5f6ea8f049aef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.5

Release files / pytwobit-0.3.1-py3-none-any.whl

Download URL pytwobit-0.3.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed7f1d27f0e5bf5a99b8130d8fce72c0bedf1815f8178467631fff5e49ad8432
BLAKE2b-256 checksum
How to use checksums
9d1e5aced5817befbf374106b3381f02cfaed2301bd5c68c86eb99f44aab74ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page