Skip to content

Commit 789268d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 66e3509 commit 789268d

8 files changed

Lines changed: 22 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Version 0.0.1
3+
## Version 0.0.1
44

5-
- Initial implementation to access OrgDB objects.
5+
- Initial implementation to access OrgDB objects.
66
- This also fetches the annotation hub sqlite file and queries for available org sqlite files instead of a static registry used in the txdb package.

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
furo
2+
myst-nb
13
# Requirements file for ReadTheDocs, check .readthedocs.yml.
24
# To build the module reference correctly, make sure every external package
35
# under `install_requires` in `setup.cfg` is also listed here!
46
# sphinx_rtd_theme
57
myst-parser[linkify]
68
sphinx>=3.2.1
7-
myst-nb
8-
furo
99
sphinx-autodoc-typehints

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
Setup file for orgdb.
3-
Use setup.cfg to configure your project.
2+
Setup file for orgdb.
3+
Use setup.cfg to configure your project.
44
5-
This file was generated with PyScaffold 4.6.
6-
PyScaffold helps you to put up the scaffold of your new Python project.
7-
Learn more under: https://pyscaffold.org/
5+
This file was generated with PyScaffold 4.6.
6+
PyScaffold helps you to put up the scaffold of your new Python project.
7+
Learn more under: https://pyscaffold.org/
88
"""
99

1010
from setuptools import setup

src/orgdb/orgdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def genes(self) -> GenomicRanges:
543543
return GenomicRanges.empty()
544544

545545
query = """
546-
SELECT
546+
SELECT
547547
g.gene_id,
548548
c.seqname,
549549
c.start_location,

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- https://docs.pytest.org/en/stable/writing_plugins.html
88
"""
99

10-
import sqlite3
10+
import sqlite3
1111
from orgdb import OrgDb
1212
import pytest
1313

@@ -102,4 +102,4 @@ def mock_orgdb(mock_orgdb_path):
102102
"""Return an open OrgDb instance using the mock database."""
103103
db = OrgDb(mock_orgdb_path)
104104
yield db
105-
db.close()
105+
db.close()

tests/test_orgdb.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ def test_select_simple(mock_orgdb):
4141
def test_select_multikey(mock_orgdb):
4242
res = mock_orgdb.select(keys=["1", "10"], columns=["SYMBOL"], keytype="ENTREZID")
4343
assert len(res) == 2
44-
44+
4545
symbols = res.get_column("SYMBOL")
4646
assert "A1BG" in symbols
4747
assert "NAT2" in symbols
4848

4949
def test_select_go_expansion(mock_orgdb):
5050
res = mock_orgdb.select(keys="1", columns=["GO"], keytype="ENTREZID")
51-
51+
5252
col_names = list(res.column_names)
5353
assert "GO" in col_names
5454
assert "EVIDENCE" in col_names
5555
assert "ONTOLOGY" in col_names
56-
56+
5757
assert len(res) == 2
5858
go_ids = res.get_column("GO")
5959
assert "GO:0000001" in go_ids
@@ -66,12 +66,12 @@ def test_select_many_to_one(mock_orgdb):
6666

6767
def test_mapIds(mock_orgdb):
6868
keys = ["1", "10", "100"]
69-
69+
7070
res = mock_orgdb.mapIds(keys, column="SYMBOL", keytype="ENTREZID")
7171
assert isinstance(res, dict)
7272
assert res["1"] == "A1BG"
7373
assert res["10"] == "NAT2"
74-
74+
7575
res_list = mock_orgdb.mapIds(["1"], column="GO", keytype="ENTREZID", multiVals="list")
7676
assert isinstance(res_list["1"], list)
7777
assert len(res_list["1"]) == 2
@@ -81,12 +81,12 @@ def test_genes_genomicranges(mock_orgdb):
8181
gr = mock_orgdb.genes()
8282
assert isinstance(gr, GenomicRanges)
8383
assert len(gr) == 2
84-
84+
8585
names = list(gr.names)
8686
idx = names.index("1")
8787
assert str(gr.seqnames[idx]) == "chr19"
8888
assert gr.start[idx] == 58346806
8989
assert gr.end[idx] == 58353492
90-
90+
9191
assert "gene_id" in gr.mcols.column_names
92-
assert gr.mcols.get_column("gene_id")[idx] == "1"
92+
assert gr.mcols.get_column("gene_id")[idx] == "1"

tests/test_real.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ def test_real_orgdb_workflow(tmp_path):
2121
"GO:0048699",
2222
"GO:0048143"],
2323
columns="SYMBOL")
24-
24+
2525
assert res.shape == (104, 4)
2626
orgdb.close()

tests/test_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def registry(tmp_path):
99
def test_registry_init(registry):
1010
assert isinstance(registry, OrgDbRegistry)
1111
assert "org.Hs.eg.db" in registry.list_orgdb()
12-
12+
1313
def test_get_record(registry):
1414
rec = registry.get_record("org.Hs.eg.db")
1515
assert rec.orgdb_id == "org.Hs.eg.db"

0 commit comments

Comments
 (0)