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.

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"

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.3.0.tar.gz (6.7 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.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyTwobit-0.3.0.tar.gz
  • Upload date:
  • Size: 6.7 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.0.tar.gz
Algorithm Hash digest
SHA256 29854cddd7c22676ca867043d446472cadaf551acbb265b1a3c78e1fc04b6e29
MD5 9f667cd25957ddb928074a7d38b4004a
BLAKE2b-256 2c9f14b50716d5ffeb71fcfb38767ec4428e43ea45e0d78e40096704683920b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyTwobit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc9a4beccfe311b57787754edfe441167069b63a506b0bc4ec174f171cd1a2c
MD5 2ab630117723159632889a4ac9d3bc7d
BLAKE2b-256 2a0a094ccf14e9ddb2ee8b7cb2b30ed4936ced335d4b67b6e53b5705f54248a6

See more details on using hashes here.

Supported by

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