Skip to content

Commit 8bff087

Browse files
committed
fix: make column drops succeed if missing
1 parent 2b5319d commit 8bff087

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dx_app/resources/stjude/bin/generate_plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def label_samples (row):
7878
combined['highlight'] = combined.apply(lambda row: label_samples(row), axis=1)
7979

8080
# Drop unneeded columns
81-
combined = combined.drop(columns=["id", "name", "folder", "sj_access_unit", "sj_dataset_accessions", "sj_pmid_accessions", "file_type", "sj_embargo_date", "sj_pipeline_name", "sj_pipeline_version", "sj_pub_accessions", "sj_publication_titles", "projects"])
82-
combined = combined.drop(columns=["sj_disease"])
81+
combined = combined.drop(columns=["id", "name", "folder", "sj_access_unit", "sj_dataset_accessions", "sj_pmid_accessions", "file_type", "sj_embargo_date", "sj_pipeline_name", "sj_pipeline_version", "sj_pub_accessions", "sj_publication_titles", "projects"], errors="ignore")
82+
combined = combined.drop(columns=["sj_disease"], errors="ignore")
8383

8484
# Copy user submitted sample names to the standard 'sample_name' column
8585
combined['sample_name'] = combined['sample_name'].fillna(combined['samples'])
@@ -88,7 +88,7 @@ def label_samples (row):
8888
#combined = combined.rename(columns={"sj_long_disease_name_x": "sj_long_disease_name"})
8989

9090
# Drop unneeded columns
91-
combined = combined.drop(columns=["samples", "classes", "diagnosisNames"])
91+
combined = combined.drop(columns=["samples", "classes", "diagnosisNames"], errors="ignore")
9292

9393
# Fill group in a way to avoid duplicates
9494
combined['group'] = combined['group'].fillna('Other ' + combined['attr_diagnosis_group'])

0 commit comments

Comments
 (0)