Skip to content

Commit

Permalink
Two small bugfixes to 02-EvidenceQC (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
RCollins13 authored Apr 29, 2024
1 parent 8267f0f commit 10c8a22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sv-pipeline/scripts/make_evidence_qc_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,11 @@ def read_all_outlier(outlier_manta_df: pd.DataFrame, outlier_melt_df: pd.DataFra
for counted in outlier_dicts:
merged_dicts.update(counted)
all_outliers = dict(merged_dicts)
all_outliers_df = pd.DataFrame.from_dict(all_outliers, orient="index").reset_index()
all_outliers_df.columns = [ID_COL, outlier_type + "_overall_outliers"]
if len(all_outliers) == 0:
all_outliers_df = pd.DataFrame(columns=[ID_COL, outlier_type + "_overall_outliers"])
else:
all_outliers_df.columns = [ID_COL, outlier_type + "_overall_outliers"]
all_outliers_df = pd.DataFrame.from_dict(all_outliers, orient="index").reset_index()
return all_outliers_df


Expand Down Expand Up @@ -187,6 +190,8 @@ def merge_evidence_qc_table(
df_melt_high_outlier, df_wham_high_outlier, df_total_high_outliers,
df_manta_low_outlier, df_melt_low_outlier, df_wham_low_outlier, df_total_low_outliers,
df_melt_insert_size]
for df in dfs:
df[ID_COL] = df[ID_COL].astype(object)
output_df = reduce(lambda left, right: pd.merge(left, right, on=ID_COL, how="outer"), dfs)
output_df = output_df[output_df[ID_COL] != EMPTY_OUTLIERS]

Expand Down

0 comments on commit 10c8a22

Please sign in to comment.