File tree 5 files changed +32
-8
lines changed
5 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,15 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
7
7
8
8
No unreleased changes
9
9
10
- [ Unreleased ] : https://github.com/23andMe/yhaplo/compare/2.1.6..HEAD
10
+ [ Unreleased ] : https://github.com/23andMe/yhaplo/compare/2.1.7..HEAD
11
+
12
+
13
+ ## [ 2.1.7] - 2024-02-23
14
+
15
+ ### Added
16
+ - ` SNP.info ` property, called from ` Tree.query_snp_path `
17
+
18
+ [ 2.1.7 ] : https://github.com/23andMe/yhaplo/compare/2.1.6..2.1.7
11
19
12
20
13
21
## [ 2.1.6] - 2024-02-07
@@ -73,7 +81,7 @@ and faster processing of most input types.
73
81
- BCF support
74
82
- Automated tests
75
83
- Optional dependencies
76
- - ` Sample ` subclasses: ` TextSample ` , ` VCFSample ` , ` AblockSample `
84
+ - ` Sample ` subclasses: ` TextSample ` , ` VCFSample `
77
85
- ` CHANGELOG.md `
78
86
79
87
### Changed
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ def get_command_line_args(set_defaults: bool = False) -> argparse.Namespace:
92
92
action = "store_true" ,
93
93
help = "Generate all auxiliary output.\n "
94
94
"Equivalent to these seven options:\n "
95
- "--ancDerCounts --haplogroupPaths --haplogroupPathsDetail \n "
96
- "--derSNPs --derSNPsDetail --ancSNPs --ancSNPsDetail " ,
95
+ "--anc_der_counts --haplogroup_paths --haplogroup_paths_detail \n "
96
+ "--der_snps --der_snps_detail --anc_snps --anc_snps_detail " ,
97
97
)
98
98
group .add_argument (
99
99
"-c" ,
@@ -204,7 +204,8 @@ def get_command_line_args(set_defaults: bool = False) -> argparse.Namespace:
204
204
"--snp_query" ,
205
205
dest = "query_snp_names" ,
206
206
metavar = "snp_names" ,
207
- help = "List phylogenetic path for each SNP in comma-separated list" ,
207
+ help = "For each SNP in comma-separated list, output properties\n "
208
+ "and the phylogenetic path to the haplogroup it is associated with" ,
208
209
)
209
210
group .add_argument (
210
211
"-pt" ,
Original file line number Diff line number Diff line change 4
4
* Sample
5
5
* TextSample
6
6
* VCFSample
7
- * AblockSample
8
7
9
8
"""
10
9
Original file line number Diff line number Diff line change @@ -125,6 +125,21 @@ def __str__(self) -> str:
125
125
f"{ self .ancestral } ->{ self .derived } "
126
126
)
127
127
128
+ @property
129
+ def info (self ) -> str :
130
+ """Return multiline summary of SNP."""
131
+
132
+ names = [name for name in self .name_list if name != self .label ]
133
+ aliases_str = ", " .join (names ) if names else "None"
134
+ info = (
135
+ f"Name: { self .label } \n "
136
+ f"YCC haplogroup: { self .node .label } \n "
137
+ f"GRCh37 position: { self .position :,} \n "
138
+ f"Mutation: { self .ancestral } ->{ self .derived } \n "
139
+ f"Aliases: { aliases_str } "
140
+ )
141
+ return info
142
+
128
143
@property
129
144
def str_with_all_names (self ) -> str :
130
145
"""Return long string representation.
@@ -133,8 +148,8 @@ def str_with_all_names(self) -> str:
133
148
plus a comma-separated list of names.
134
149
135
150
"""
136
- names = "," .join (self .name_list )
137
- str_with_all_names = f"{ str (self )} { names } "
151
+ names_str = "," .join (self .name_list )
152
+ str_with_all_names = f"{ str (self )} { names_str } "
138
153
return str_with_all_names
139
154
140
155
@property
Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ def query_snp_path(self, query_snp_name: str) -> None:
239
239
snp = self .snp_dict .get (query_snp_name )
240
240
241
241
if snp :
242
+ logger .info (f"{ snp .info } \n " )
242
243
for node in snp .back_trace_path ():
243
244
logger .info (node .str_simple )
244
245
You can’t perform that action at this time.
0 commit comments