Skip to content
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

Two small bugfixes to 02-EvidenceQC #666

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading