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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
- Debugged a test that counts observed haplotypes (#154).
- Replaced global pooled Ae values with 26-population average as the default Ae reported (#155).
- Replaced global pooled Ae values with 26-population average as the default Ae reported (#155, #158).
- Replaced deprecated `pkg_resources` module with `importlib.resources` (#156).
- Upgraded versioneer to a Python 3.12+ compatible version (#156).

Expand Down
10 changes: 5 additions & 5 deletions microhapdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def retrieve_by_id(ident):
2592 mh17KK-014 3 37 chr17 4497061 4497097 4497061;4497089;4497097 4400356;4400384;4400392 rs333113;rs8074965;rs11657785 Kidd2018 2.074
>>> retrieve_by_id("Chagga")
ID Name Source
16 mMHseq-Chagga Chagga Gandotra2020
17 SA000487T Chagga Kidd2018
15 mMHseq-Chagga Chagga Gandotra2020
16 SA000487T Chagga Kidd2018
>>> retrieve_by_id("Asia")
ID Name Source
9 MHDBP-936bc36f79 Asia vanderGaag2018
8 MHDBP-936bc36f79 Asia vanderGaag2018
>>> retrieve_by_id("Japanese")
ID Name Source
54 MHDBP-63967b883e Japanese Hiroaki2015
55 SA000010B Japanese Kidd2018
53 MHDBP-63967b883e Japanese Hiroaki2015
54 SA000010B Japanese Kidd2018
"""

def id_in_series(ident, series):
Expand Down
1 change: 0 additions & 1 deletion microhapdb/data/population.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ID,Name,Source
1KGP,1000 Genomes Aggregate,Byrska-Bishop2022
mMHseq-Adygei,Adygei,Gandotra2020
SA000017I,Adygei,Kidd2018
AFR,Africa,Byrska-Bishop2022
Expand Down
2 changes: 1 addition & 1 deletion microhapdb/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Population:
SA000010B Japanese Kidd2018
JPT Japanese in Tokyo, Japan Byrska-Bishop2022
>>> microhapdb.populations.shape
(125, 3)
(124, 3)
"""

def __init__(self, popid, name, source):
Expand Down
4 changes: 2 additions & 2 deletions microhapdb/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_main_pop_noargs(capsys):
microhapdb.cli.main(args)
out, err = capsys.readouterr()
outlines = out.strip().split("\n")
assert len(outlines) == 1 + 125
assert len(outlines) == 1 + 124


def test_main_pop_detail(capsys):
Expand Down Expand Up @@ -689,7 +689,7 @@ def test_cli_summarize(capsys):
- 2413 distinct loci
[frequencies]
- 59753 haplotypes
- 125 population groups
- 124 population groups
- 885503 total microhap frequencies
"""
print(observed)
Expand Down
18 changes: 9 additions & 9 deletions microhapdb/tests/test_population.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_standardize_ids():

def test_assumptions():
num_populations_per_source = [
31, # Byrska-Bishop2022
30, # Byrska-Bishop2022
1, # Chen2019
7, # Gandotra2020
1, # Hiroaki2015
Expand All @@ -49,8 +49,8 @@ def test_populations():
SA000040E Kachari Kidd2018
>>> Population.table_from_ids(["EAS", "SAS"])
ID Name Source
27 EAS East Asia Byrska-Bishop2022
104 SAS South Asia Byrska-Bishop2022
26 EAS East Asia Byrska-Bishop2022
103 SAS South Asia Byrska-Bishop2022
>>> for pop in Population.from_query("Name.str.contains('Han')"):
... print(pop.popid, pop.name, pop.source)
ChengduHan Chengdu Han Zou2022
Expand All @@ -62,14 +62,14 @@ def test_populations():
CHS Southern Han Chinese Byrska-Bishop2022
>>> Population.table_from_query("Name.str.contains('Afr')")
ID Name Source
3 AFR Africa Byrska-Bishop2022
4 MHDBP-3dab7bdd14 Africa vanderGaag2018
5 SA000101C African Americans Kidd2018
6 ACB African Caribbeans in Barbados Byrska-Bishop2022
7 ASW Americans of African Ancestry in SW USA Byrska-Bishop2022
2 AFR Africa Byrska-Bishop2022
3 MHDBP-3dab7bdd14 Africa vanderGaag2018
4 SA000101C African Americans Kidd2018
5 ACB African Caribbeans in Barbados Byrska-Bishop2022
6 ASW Americans of African Ancestry in SW USA Byrska-Bishop2022
"""
pop = microhapdb.populations
assert pop.shape == (125, 3)
assert pop.shape == (124, 3)
assert Population.from_id("MHDBP-7c055e7ee8").name == "Swedish"
assert Population.from_id("SA000028K").name == "Karitiana"
result = Population.table_from_query("Name.str.contains('Jews')")
Expand Down