Skip to content

Commit ece47dd

Browse files
committed
Merge remote-tracking branch 'origin/redux_to_one' into redux_to_one
# Conflicts: # pyard/data_repository.py
2 parents 43b4bfe + 5be407b commit ece47dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pyard/data_repository.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ def generate_ard_mapping(db_connection: sqlite3.Connection, imgt_version) -> ARS
114114
mlgx = df_g_group.drop_duplicates(["2d", "lgx"])["2d"].value_counts()
115115
multiple_lgx_list = mlgx[mlgx > 1].index.to_list()
116116

117+
# Keep only the alleles that have more than 1 mapping
118+
dup_lgx = (
119+
df_g_group[df_g_group["2d"].isin(multiple_lgx_list)][["lgx", "2d"]]
120+
.drop_duplicates()
121+
.groupby("2d", as_index=True)
122+
.agg("/".join)
123+
.to_dict()["lgx"]
124+
)
125+
117126
# Extract G group mapping
118127
df_g = pd.concat(
119128
[

0 commit comments

Comments
 (0)