# 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
```python
from pytwobit import TwoBit
twobit = TwoBit('test.2bit')
seq = twobit.fetch("chr1", 50, 57) # -> "CTATCTA"
```
Remote file
```python
from pytwobit import TwoBit
twobit = TwoBit("https://igv.org/genomes/data/hg38/hg38.2bit")
seq = twobit.fetch("chr1", 120565294, 120565335) # -> "TATGAACTTTTGTTCGTTGGTgctcagtcctagaccctttt"
```
Raw data
{
"_id": null,
"home_page": "https://github.com/jrobinso/pyTwoBit",
"name": "pyTwobit",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Jim Robinson",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/45/5d/c1064b04b78d34a004d90deb990c268b59113615323886c7c86980b6f45b/pyTwobit-0.2.0.tar.gz",
"platform": null,
"description": "# pyTwoBit\n\nPackage for fetching sequence from twobit files from local paths or URLs. \n\n## Usage\n\nTo fetch sequence for a genomic region create a TwoBit object with either a local file path or url. Sequence\nis fetched with the `fetch` function which takes chromosome name, start, and end coordinates.\nThe UCSC coordinate convention is used (0 start, half-open).\n\n\nLocal file\n\n```python\n\nfrom pytwobit import TwoBit\n\ntwobit = TwoBit('test.2bit')\nseq = twobit.fetch(\"chr1\", 50, 57) # -> \"CTATCTA\"\n\n\n```\n\nRemote file\n\n```python\n\nfrom pytwobit import TwoBit\n\ntwobit = TwoBit(\"https://igv.org/genomes/data/hg38/hg38.2bit\")\nseq = twobit.fetch(\"chr1\", 120565294, 120565335) # -> \"TATGAACTTTTGTTCGTTGGTgctcagtcctagaccctttt\"\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A fast reader for local or remote UCSC twobit sequence files.",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/jrobinso/pyTwoBit"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "513c423ba4353e8df92f4d86e08de69ab76497dce4864f9d4acc38278599fe45",
"md5": "a8c6792e1e971921396f7ecf7e8df333",
"sha256": "583d4ddacf80de25059fdb2b13922b84a466a1d3dea70dcd8aab832cc5f7caf6"
},
"downloads": -1,
"filename": "pyTwobit-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a8c6792e1e971921396f7ecf7e8df333",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5817,
"upload_time": "2024-09-26T04:13:00",
"upload_time_iso_8601": "2024-09-26T04:13:00.415902Z",
"url": "https://files.pythonhosted.org/packages/51/3c/423ba4353e8df92f4d86e08de69ab76497dce4864f9d4acc38278599fe45/pyTwobit-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "455dc1064b04b78d34a004d90deb990c268b59113615323886c7c86980b6f45b",
"md5": "032d6626d26d762372023c9bc927664c",
"sha256": "6c1bcbe932d17bcc49a696be7ab9623052270e7e0ea9ef3b08da69e2c7382fb6"
},
"downloads": -1,
"filename": "pyTwobit-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "032d6626d26d762372023c9bc927664c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5976,
"upload_time": "2024-09-26T04:13:01",
"upload_time_iso_8601": "2024-09-26T04:13:01.286506Z",
"url": "https://files.pythonhosted.org/packages/45/5d/c1064b04b78d34a004d90deb990c268b59113615323886c7c86980b6f45b/pyTwobit-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-26 04:13:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jrobinso",
"github_project": "pyTwoBit",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": []
}
],
"lcname": "pytwobit"
}