-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix renaming #111
Fix renaming #111
Conversation
mh21KK-320.v1,Italians,A|A|C|A,0.25000,Turchi2019 | ||
mh21KK-320.v1,Italians,A|A|C|G,0.10700,Turchi2019 | ||
mh21KK-320.v1,Italians,G|A|C|A,0.12200,Turchi2019 | ||
mh21KK-320.v1,Italians,G|A|C|G,0.16800,Turchi2019 | ||
mh21KK-320.v1,Italians,G|A|T|A,0.07700,Turchi2019 | ||
mh21KK-320.v1,Italians,G|G|C|A,0.08200,Turchi2019 | ||
mh21KK-320.v1,Italians,G|G|C|G,0.19400,Turchi2019 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These frequencies now correspond to the correct definition (see #110).
mh18KK-293.v1,MHDBP-7c055e7ee8,A|G|A|A,0.59300,Staadig2021 | ||
mh18KK-293.v1,MHDBP-7c055e7ee8,A|G|A|G,0.02000,Staadig2021 | ||
mh18KK-293.v1,MHDBP-7c055e7ee8,A|T|A|G,0.02000,Staadig2021 | ||
mh18KK-293.v1,MHDBP-7c055e7ee8,A|T|G|A,0.07300,Staadig2021 | ||
mh18KK-293.v1,MHDBP-7c055e7ee8,G|G|A|A,0.24700,Staadig2021 | ||
mh18KK-293.v1,MHDBP-7c055e7ee8,G|T|A|A,0.01300,Staadig2021 | ||
mh18KK-293.v1,MHDBP-7c055e7ee8,G|T|A|G,0.03300,Staadig2021 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fixed some Staadig and Gandotra associated frequencies.
def resolve(self): | ||
if len(self) <= 1: | ||
for marker in self.markers: | ||
yield marker | ||
return | ||
definitions = set(self.markers_by_definition) | ||
for marker in sorted(self.markers, key=lambda m: (m.sources[0].year, m.name.lower())): | ||
if marker.posstr() in self.definition_names: | ||
message = f"Marker {marker.name} as defined in {marker.sources[0].name} was defined previously and is redundant" | ||
print(message) | ||
self.source_name_map[marker.sources[0].name][marker.name] = self.definition_names[marker.posstr()] | ||
continue | ||
else: | ||
new_name = marker.name | ||
if len(self.markers_by_definition) > 1: | ||
new_name = f"{marker.name}.v{len(self.definition_names) + 1}" | ||
self.definition_names[marker.posstr()] = new_name | ||
self.source_name_map[marker.sources[0].name][marker.name] = new_name | ||
marker.name = new_name | ||
for othermarker in self.markers_by_definition[marker.posstr()]: | ||
if othermarker != marker: | ||
marker.sources.append(othermarker.sources[0]) | ||
yield marker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored code for determining which names are applied to which marker definitions.
self.source = source | ||
self.sources = list() | ||
if source is not None: | ||
self.sources.append(source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source list now instead of a single source.
The PR updates the database build code and fixes a bug with marker renaming. This fixes the issue noted in #110 with MH allele frequencies coming out of sync with the precise marker definitions to which they correspond.
As an added benefit, markers defined consistently in multiple studies will now have each study noted in its "Source" column. Markers from chr19 are shown below to demonstrate.
closes #110.