From 67e487122e8223548f5859861f72a937985a74ce Mon Sep 17 00:00:00 2001 From: cchu70 Date: Sat, 9 Sep 2023 13:36:19 -0400 Subject: [PATCH] Update cnv_helper_methods.py calc_avg_cn dataframes df is already filtered, but then is filtered using the original input seg file --- cnv_suite/utils/cnv_helper_methods.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cnv_suite/utils/cnv_helper_methods.py b/cnv_suite/utils/cnv_helper_methods.py index 60a85ad..0ce6ee6 100644 --- a/cnv_suite/utils/cnv_helper_methods.py +++ b/cnv_suite/utils/cnv_helper_methods.py @@ -131,7 +131,7 @@ def calc_avg_cn(seg_df, # remove sex chromosomes df = seg_df[~(seg_df[chr_col].isin(['X', 'Y', '23', '24', 23, 24]))].copy() if remove_null: # remove null allelic segments - df = df[~(seg_df[allele_col].isnull())].copy() + df = df[~(df[allele_col].isnull())].copy() avg_acr = (df[total_cn_col] * df[len_col]).sum() / (2 * df[len_col].sum()) return avg_acr