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"

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.3.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytwobit-0.3.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pytwobit-0.3.1.tar.gz.

File metadata

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

File hashes

Hashes for pytwobit-0.3.1.tar.gz
Algorithm Hash digest
SHA256 30f7ff8b50e8aa8ee933a3f49911d275299def9de43c4287fd26411c2b49d62f
MD5 a24d5118513cb5ddb6e5d57fc4c54620
BLAKE2b-256 ab883af2a82a2220016ac6c5609e9ce14e95449954e5046997f5f6ea8f049aef

See more details on using hashes here.

File details

Details for the file pytwobit-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pytwobit-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed7f1d27f0e5bf5a99b8130d8fce72c0bedf1815f8178467631fff5e49ad8432
MD5 e32b9515f0725693f50b976f95dbda38
BLAKE2b-256 9d1e5aced5817befbf374106b3381f02cfaed2301bd5c68c86eb99f44aab74ef

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page