diff --git a/src/cgr_gwas_qc/workflow/scripts/sample_qc_table.py b/src/cgr_gwas_qc/workflow/scripts/sample_qc_table.py index 6111b738..2165b5de 100755 --- a/src/cgr_gwas_qc/workflow/scripts/sample_qc_table.py +++ b/src/cgr_gwas_qc/workflow/scripts/sample_qc_table.py @@ -192,7 +192,9 @@ def main( ) add_qc_columns( - sample_qc, remove_contam, remove_rep_discordant, + sample_qc, + remove_contam, + remove_rep_discordant, ) sample_qc["is_unexpected_replicate"] = ( sample_qc["is_unexpected_replicate"].replace("", False).fillna(False) @@ -413,7 +415,8 @@ def _read_contam(file_name: Optional[Path], Sample_IDs: pd.Index) -> pd.DataFram if file_name is None: return pd.DataFrame( - index=Sample_IDs, columns=["Contamination_Rate", "is_contaminated"], + index=Sample_IDs, + columns=["Contamination_Rate", "is_contaminated"], ).astype({"Contamination_Rate": "float", "is_contaminated": "boolean"}) return ( @@ -456,12 +459,16 @@ def _read_intensity(file_name: Optional[Path], Sample_IDs: pd.Index) -> pd.Serie def add_qc_columns( - sample_qc: pd.DataFrame, remove_contam: bool, remove_rep_discordant: bool, + sample_qc: pd.DataFrame, + remove_contam: bool, + remove_rep_discordant: bool, ) -> pd.DataFrame: add_call_rate_flags(sample_qc) _add_identifiler(sample_qc) _add_analytic_exclusion( - sample_qc, remove_contam, remove_rep_discordant, + sample_qc, + remove_contam, + remove_rep_discordant, ) _add_subject_representative(sample_qc) _add_subject_dropped_from_study(sample_qc) @@ -507,7 +514,9 @@ def reason_string(row: pd.Series) -> str: def _add_analytic_exclusion( - sample_qc: pd.DataFrame, remove_contam: bool, remove_rep_discordant: bool, + sample_qc: pd.DataFrame, + remove_contam: bool, + remove_rep_discordant: bool, ) -> pd.DataFrame: """Adds a flag to remove samples based on provided conditions. @@ -527,7 +536,7 @@ def _add_analytic_exclusion( exclusion_criteria["is_contaminated"] = "Contamination" if remove_rep_discordant: - exclusion_criteria["is_discordant_replicate"] = "Replicate Discordance" + exclusion_criteria["Expected Replicate Discordance"] = "Replicate Discordance" sample_qc["analytic_exclusion"] = sample_qc.reindex(exclusion_criteria.keys(), axis=1).any( axis=1