From 37c6a9ae8cd5699c2ec22f22ce2ea860654e503d Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:46:17 +0100 Subject: [PATCH 1/7] Remove comment Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index 31ab66b2..9be05f09 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -325,7 +325,6 @@ def rank_features_groups( >>> ep.tl.rank_features_groups(adata, "service_unit") >>> ep.pl.rank_features_groups(adata) """ - # if rank_obs_columns is indicated, layer must be None if layer is not None and rank_obs_columns is not None: raise ValueError("Only one of layer and rank_obs_columns can be specified.") From 06c2a009ea216cb200e11b6d71f151b7ab7c6933 Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:47:27 +0100 Subject: [PATCH 2/7] Remove comment Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index 9be05f09..8a7894fb 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -353,7 +353,6 @@ def rank_features_groups( # if groupby in rank_obs_columns: # rank_obs_columns.remove(groupby) - # move obs columns to X adata_with_moved_columns = move_to_x(adata, rank_obs_columns) # remove columns previously in X From 6fa3de16a646c1d132ddf271e4fb0b87fc2bf322 Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:47:47 +0100 Subject: [PATCH 3/7] Remove comment Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index 8a7894fb..cfaf9b8b 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -333,7 +333,6 @@ def rank_features_groups( if rank_obs_columns is not None: # keep reference to original adata, needed if copy=False adata_orig = adata - # copy adata to work on adata = adata.copy() if isinstance(rank_obs_columns, str): From 458520ec1a232d390170072795ff2ee99959f600 Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:49:28 +0100 Subject: [PATCH 4/7] Update ehrapy/tools/feature_ranking/_rank_features_groups.py Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index cfaf9b8b..21d119a2 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -326,7 +326,7 @@ def rank_features_groups( >>> ep.pl.rank_features_groups(adata) """ if layer is not None and rank_obs_columns is not None: - raise ValueError("Only one of layer and rank_obs_columns can be specified.") + raise ValueError("Only one of 'layer' and 'rank_obs_columns' can be specified.") adata = adata.copy() if copy else adata From 210bac6f4b001cdae8de220fb0c46f4fc32c34c4 Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:54:28 +0100 Subject: [PATCH 5/7] Remove comment Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index 21d119a2..d7e36e3e 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -354,7 +354,6 @@ def rank_features_groups( adata_with_moved_columns = move_to_x(adata, rank_obs_columns) - # remove columns previously in X columns_to_select = adata_with_moved_columns.var_names.difference(adata.var_names) adata_with_moved_columns = adata_with_moved_columns[:, columns_to_select] From ffadf71d7c53e36fa2b0e912e7936cccf5627cc8 Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:54:43 +0100 Subject: [PATCH 6/7] Remove comment Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index d7e36e3e..ebb802fe 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -357,7 +357,6 @@ def rank_features_groups( columns_to_select = adata_with_moved_columns.var_names.difference(adata.var_names) adata_with_moved_columns = adata_with_moved_columns[:, columns_to_select] - # encode categoricals adata_with_moved_columns = encode(adata_with_moved_columns, autodetect=True, encodings="label") # assign numeric and categorical columns From f0f4867a1474a05b707ae8cef62ca4fa2f1711d6 Mon Sep 17 00:00:00 2001 From: Eljas Roellin <65244425+eroell@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:56:31 +0100 Subject: [PATCH 7/7] Update ehrapy/tools/feature_ranking/_rank_features_groups.py Co-authored-by: Lukas Heumos --- ehrapy/tools/feature_ranking/_rank_features_groups.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ehrapy/tools/feature_ranking/_rank_features_groups.py b/ehrapy/tools/feature_ranking/_rank_features_groups.py index ebb802fe..3b3cf0f9 100644 --- a/ehrapy/tools/feature_ranking/_rank_features_groups.py +++ b/ehrapy/tools/feature_ranking/_rank_features_groups.py @@ -359,7 +359,6 @@ def rank_features_groups( adata_with_moved_columns = encode(adata_with_moved_columns, autodetect=True, encodings="label") - # assign numeric and categorical columns adata_with_moved_columns.uns[ "non_numerical_columns" ] = [] # this should be empty, as have only numeric and encoded