diff --git a/Changelog.md b/Changelog.md index a3dacae..24ff8ff 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,6 +15,8 @@ For changes in deployment, please see the [deployment changelog](deploy/cttso-ic * Update sample type trimming of _sample suffix (https://github.com/umccr/cttso-ica-to-pieriandx/pull/150) * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/149 +* Update patient_care naming to patientcare (https://github.com/umccr/cttso-ica-to-pieriandx/pull/156) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/155 ## 2023-10-18 diff --git a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md index cbca804..8286ecb 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md +++ b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md @@ -13,6 +13,8 @@ are nested under deploy/cttso-ica-to-pieriandx-cdk. * Dont resubmit deleted samples - also remove deleted samples from the lims sheet (https://github.com/umccr/cttso-ica-to-pieriandx/pull/151) * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/146 +* Use loc over iloc for pandas selection (https://github.com/umccr/cttso-ica-to-pieriandx/pull/154) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/153 ## 2023-10-18 diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py index 3b8a258..0e7918c 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py @@ -263,7 +263,7 @@ def get_libraries_for_processing(merged_df) -> pd.DataFrame: logger.warning(f"Already run and deleted this combination {process_row['subject_id']} / {process_row['library_id']} / {process_row['portal_wfr_id']}, not reprocessing") # Delete via index - to_process_df = to_process_df.iloc[list( + to_process_df = to_process_df.loc[list( set(to_process_df.index.tolist()) - set(already_deleted_list_index) )] diff --git a/utils/accession.py b/utils/accession.py index 184f3bf..21759c7 100644 --- a/utils/accession.py +++ b/utils/accession.py @@ -450,7 +450,11 @@ def sanitise_data_frame(input_df: pd.DataFrame) -> pd.DataFrame: # Coerce patient care sample to patientcare input_df["sample_type"] = input_df["sample_type"].apply(lambda x: SampleType( - re.sub(r"_?sample$", "", x.lower().replace(" ", "")) + re.sub( + r"_?sample$", + "", + x.lower().replace(" ", "").replace("patient_care", "patientcare") + ) )) input_df["ethnicity"] = input_df["ethnicity"].apply(lambda x: Ethnicity(x.lower())) input_df["race"] = input_df["race"].apply(lambda x: Race(x.lower()))