Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Use iloc over loc and fix patient_care to patientcare #157

Merged
merged 5 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions deploy/cttso-ica-to-pieriandx-cdk/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)]

Expand Down
6 changes: 5 additions & 1 deletion utils/accession.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down