Skip to main content

A fast reader for local or remote UCSC twobit sequence files.

Project description

pyTwoBit

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

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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyTwobit-0.2.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

pyTwobit-0.2.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pyTwobit-0.2.0.tar.gz.

File metadata

  • Download URL: pyTwobit-0.2.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.5

File hashes

Hashes for pyTwobit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6c1bcbe932d17bcc49a696be7ab9623052270e7e0ea9ef3b08da69e2c7382fb6
MD5 032d6626d26d762372023c9bc927664c
BLAKE2b-256 455dc1064b04b78d34a004d90deb990c268b59113615323886c7c86980b6f45b

See more details on using hashes here.

File details

Details for the file pyTwobit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyTwobit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.5

File hashes

Hashes for pyTwobit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 583d4ddacf80de25059fdb2b13922b84a466a1d3dea70dcd8aab832cc5f7caf6
MD5 a8c6792e1e971921396f7ecf7e8df333
BLAKE2b-256 513c423ba4353e8df92f4d86e08de69ab76497dce4864f9d4acc38278599fe45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page