Commit e52410d7 authored by Hanna  JULIENNE's avatar Hanna JULIENNE
Browse files

update code to adjust to pandas newest version

parent f968ce7a
Pipeline #44965 passed with stages
in 1 minute and 35 seconds
......@@ -32,16 +32,17 @@ def realigned_zfiles_on_panel(ref_panel, zscore):
- ref_panel (pd.dataframe) : snp of reference on the imputed chromosome
- zscore (pd.dataframe):
"""
zscore.drop_duplicates(keep='first', inplace=True)
ref_panel.drop_duplicates(keep='first', inplace=True)
inter_id = zscore.index.intersection(ref_panel.index).drop_duplicates(keep='first')
print(inter_id)
zscore = zscore.loc[inter_id]
zscore.drop_duplicates(keep='first', inplace=True)
sub_ref_panel = ref_panel.loc[inter_id]
sub_ref_panel.drop_duplicates(keep='first', inplace=True)
print(inter_id)
print(sub_ref_panel.loc[inter_id])
print(sub_ref_panel.loc[inter_id].shape)
print(sub_ref_panel)
print(sub_ref_panel.shape)
print(zscore)
print(zscore.shape)
zscore.sort_index(inplace=True)
......@@ -187,10 +188,10 @@ def impg_like_imputation(ld_file, ref_panel, zscore, window_size, buffer, lamb,
# keep only SNP with non negligible explained variance
snp_well_predicted = (batch_df.Var < 0.9)
batch_df_filt = batch_df.loc[in_core_window & snp_well_predicted, zscore_results.columns]
batch_df_filt = batch_df.reindex[in_core_window & snp_well_predicted, zscore_results.columns]
zscore_results = pd.concat([zscore_results, batch_df_filt])
else:
zscore_results = pd.concat([zt, batch_df_filt])
zscore_results = pd.concat([zscore_results, zt])
i = i+1
print_progression(i, Nwindows)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment