Skip to content

Commit

Permalink
force var_grp to be sorted by the index.
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunhwan-bcm committed Jul 31, 2024
1 parent d251baf commit 123c74d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/extraModel/integrate_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def process_recessive_matrix(df):

result = []
for _, var_grp in var_grps:
var_grp = var_grp.sort_values("predict", ascending=False)
var_grp = var_grp.sort_index()
var_grp = var_grp.sort_values("predict", ascending=False, kind="stable")
result.append(var_grp.iloc[[0], :])
result = pd.concat(result)
result.set_index("var1", inplace=True)
Expand All @@ -31,6 +32,7 @@ def integrate_output(prj_folder, data_folder, sample_id):
expanded_df = pd.read_csv(
expanded_fn, sep="\t", index_col=0, compression="infer"
)
expanded_df = expanded_df.sort_index()
# expanded_df.append(df)
# expanded_df = pd.concat(expanded_df)
# expanded_df = expanded_df.loc[~expanded_df.index.duplicated(keep='first')]
Expand Down

0 comments on commit 123c74d

Please sign in to comment.