Skip to content

Commit

Permalink
List SNPs associated with a given queried haplogroup (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpoznik authored Apr 25, 2024
1 parent 8b78235 commit 7c5c928
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)


## [2.1.10]

### Added
- List SNPs associated with a given queried haplogroup

[2.1.10]: https://github.com/23andMe/yhaplo/compare/2.1.9..2.1.10


## [2.1.9]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate_yhaplo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ yhaplo --example_text \
--depth_first \
--depth_first_table \
--mrca Q-M3 R-V88 \
--haplogroup_query E1b,Q-M3,foo \
--haplogroup_query E1b1,Q-M3,foo \
--snp_query L1335,S730,S530,foo
echo -e "\n"

Expand Down
5 changes: 5 additions & 0 deletions yhaplo/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,14 @@ def query_haplogroup(self, haplogroup: str) -> None:
haplogroup_node = self.haplogroup_to_node.get(haplogroup)

if haplogroup_node:
logger.info("Descent\n------")
for node in haplogroup_node.back_trace_path():
logger.info(node.str_simple)

logger.info("\nSNPs\n----")
for snp in haplogroup_node.snp_list:
logger.info(snp)

else:
logger.info(f'Haplogroup "{haplogroup}" not found')

Expand Down

0 comments on commit 7c5c928

Please sign in to comment.