Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Call ``convert_coordinate()``:

```python3
c.convert_coordinate("chr7", 140453136, 140453137, Strand.POSITIVE)
# returns [LiftoverResult(chrom='chr7', start=140753336, end=140753337, strand=<Strand.POSITIVE: '+'>)]
# returns [LiftoverResult(chrom='chr7', start=140753336, end=140753337, strand=<Strand.POSITIVE: '+'>, score=14633688187)]
```

## Development
Expand Down
48 changes: 48 additions & 0 deletions analysis/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-e file:///Users/jss009/code/agct
appnope==0.1.4
asttokens==3.0.1
certifi==2025.6.15
charset-normalizer==3.4.2
click==8.2.1
comm==0.2.3
coverage==7.9.1
debugpy==1.8.20
decorator==5.2.1
executing==2.2.1
idna==3.10
iniconfig==2.1.0
ipykernel==7.2.0
ipython==9.11.0
ipython-pygments-lexers==1.1.1
jedi==0.19.2
jupyter-client==8.8.0
jupyter-core==5.9.1
matplotlib-inline==0.2.1
maturin==1.8.7
nest-asyncio==1.6.0
packaging==25.0
parso==0.8.6
pexpect==4.9.0
platformdirs==4.9.4
pluggy==1.6.0
prek==0.2.24
prompt-toolkit==3.0.52
psutil==7.2.2
ptyprocess==0.7.0
pure-eval==0.2.3
pygments==2.19.2
pyliftover==0.4.1
pytest==8.4.1
pytest-cov==6.2.1
python-dateutil==2.9.0.post0
pyzmq==27.1.0
requests==2.32.4
ruff==0.14.10
six==1.17.0
stack-data==0.6.3
tornado==6.5.5
tqdm==4.67.1
traitlets==5.14.3
urllib3==2.5.0
wags-tails==0.3.2
wcwidth==0.6.0
83 changes: 43 additions & 40 deletions analysis/speed_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
"id": "e70c802c-9a54-41e2-a928-7ea685017195",
"metadata": {},
"source": [
"We don't necessarily intend to keep this up to date; this notebook can be reproduced as of the commit that it's associated with.\n",
"\n",
"Don't forget to run `maturin develop --release`!"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 8,
"id": "856fbc60-6896-4824-8956-b466e29ddc69",
"metadata": {},
"outputs": [],
"source": [
"from pyliftover import LiftOver\n",
"\n",
"from agct import Converter"
"from agct import Converter\n",
"from agct.seqref_registry import Assembly"
]
},
{
Expand Down Expand Up @@ -46,7 +49,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1.11 s ± 26.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"498 ms ± 6.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand All @@ -57,21 +60,21 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 10,
"id": "2332acf9-c6eb-42ac-8426-fe46eba132a0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"217 ms ± 9.13 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"50.9 ms ± 807 μs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"%%timeit\n",
"converter = Converter(\"hg38\", \"hg19\")"
"converter = Converter(Assembly.HG38, Assembly.HG19)"
]
},
{
Expand All @@ -84,15 +87,15 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"id": "ae47dbbb-c9ad-46b4-9f4d-14823bbf26f2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.09 s ± 14.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"512 ms ± 16.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand All @@ -104,22 +107,22 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 13,
"id": "729abc9a-6429-4cb6-aaca-4bac4cd762f8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"215 ms ± 6.9 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"50.6 ms ± 1.17 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"%%timeit\n",
"converter = Converter(\"hg38\", \"hg19\")\n",
"converter.convert_coordinate(\"chr5\", 1404391, \"+\")"
"converter = Converter(Assembly.HG38, Assembly.HG19)\n",
"converter.convert_coordinate(\"chr5\", 1404391, 1404391, \"+\")"
]
},
{
Expand All @@ -132,27 +135,27 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 14,
"id": "7c51c0cb-e997-4ece-8a68-8e946b9dde3d",
"metadata": {},
"outputs": [],
"source": [
"# load beforehand\n",
"pyl = LiftOver(\"hg38\", \"hg19\")\n",
"converter = Converter(\"hg38\", \"hg19\")"
"converter = Converter(Assembly.HG38, Assembly.HG19)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 15,
"id": "b68a6af6-1a89-414f-b4f1-2378f3c4f50d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.97 µs ± 72.9 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n"
"1.04 μs ± 27.1 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
]
}
],
Expand All @@ -163,21 +166,21 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 16,
"id": "e6643c38-f9f5-4ed6-a277-9642e731e6bc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.77 µs ± 103 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n"
"713 ns ± 9.94 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
]
}
],
"source": [
"%%timeit\n",
"converter.convert_coordinate(\"chr5\", 1404391, \"+\")"
"converter.convert_coordinate(\"chr5\", 1404391, 1404391, \"+\")"
]
},
{
Expand All @@ -198,15 +201,15 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 17,
"id": "181231d8-3f00-407b-86a3-1ae268d4d931",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"303 ms ± 13.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"149 ms ± 2.79 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
Expand All @@ -217,21 +220,21 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 18,
"id": "7822b8e7-939d-4b6d-85f6-514999c55602",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"62.6 ms ± 2.99 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
"8.95 ms ± 73.5 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
]
}
],
"source": [
"%%timeit\n",
"converter = Converter(\"hg19\", \"hg38\")"
"converter = Converter(Assembly.HG19, Assembly.HG38)"
]
},
{
Expand All @@ -244,15 +247,15 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 19,
"id": "0ab6aeb8-88da-45e8-9efe-8b4a7825bcff",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"318 ms ± 15.5 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"151 ms ± 1.51 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
Expand All @@ -264,22 +267,22 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 21,
"id": "a014955a-5451-4b10-83bd-4d4843ddc227",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"57.8 ms ± 742 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
"8.68 ms ± 59.2 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
]
}
],
"source": [
"%%timeit\n",
"converter = Converter(\"hg19\", \"hg38\")\n",
"converter.convert_coordinate(\"chr5\", 1404391, \"+\")"
"converter = Converter(Assembly.HG19, Assembly.HG38)\n",
"converter.convert_coordinate(\"chr5\", 1404391, 1404391, \"+\")"
]
},
{
Expand All @@ -292,27 +295,27 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 22,
"id": "a516e0a8-02b1-4ce5-8e69-3d0badcaffa4",
"metadata": {},
"outputs": [],
"source": [
"# load beforehand\n",
"pyl = LiftOver(\"hg19\", \"hg38\")\n",
"converter = Converter(\"hg19\", \"hg38\")"
"converter = Converter(Assembly.HG19, Assembly.HG38)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 23,
"id": "d433fee3-9c40-4633-be5e-2649b723968e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.16 µs ± 232 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
"1.06 μs ± 7.62 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
]
}
],
Expand All @@ -323,29 +326,29 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 24,
"id": "5bb82164-e123-47ae-a748-7d4c4898fcb2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.87 µs ± 65 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n"
"718 ns ± 1.6 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
]
}
],
"source": [
"%%timeit\n",
"converter.convert_coordinate(\"chr5\", 1404391, \"+\")"
"converter.convert_coordinate(\"chr5\", 1404391, 1404391, \"+\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "liftovertest",
"display_name": "agct",
"language": "python",
"name": "liftovertest"
"name": "agct"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -357,7 +360,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.13.2"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agct"
version = "0.2.0"
version = "0.2.1"
authors = [
{name = "James Stevenson"},
{name = "Kori Kuzma"},
Expand Down
Loading
Loading