From d60223ef139a6e25439ae08368c68e244f5663ac Mon Sep 17 00:00:00 2001 From: abbyjerger Date: Fri, 19 Aug 2022 16:13:16 -0700 Subject: [PATCH 1/4] [debug] Replace mathtext plus or minus sign since it breaks the plotting in Windows machines. --- snekmer/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snekmer/plot.py b/snekmer/plot.py index 302f88b..e3c2076 100644 --- a/snekmer/plot.py +++ b/snekmer/plot.py @@ -89,7 +89,7 @@ def cv_roc_curve(clf, X, y, title="ROC Curve", ax=None, dpi=400): mean_fpr, mean_tpr, color="b", - label=(f"Mean ROC (AUC = {mean_auc:0.2f}" r" $\pm$ " f" {std_auc:0.2f})"), + label=f"Mean ROC (AUC = {mean_auc:0.2f} ± {std_auc:0.2f})", lw=2, alpha=0.8, ) From ca22b15cc429ea9c41d22940f0cf8c8bdd7d4ca6 Mon Sep 17 00:00:00 2001 From: abbyjerger Date: Fri, 19 Aug 2022 16:15:55 -0700 Subject: [PATCH 2/4] [debug] Edit how figures are saved and cleared to fix matplotlib issues on Windows machines. --- snekmer/rules/model.smk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/snekmer/rules/model.smk b/snekmer/rules/model.smk index 7b27003..4e6debb 100644 --- a/snekmer/rules/model.smk +++ b/snekmer/rules/model.smk @@ -374,15 +374,16 @@ rule model: # save ROC-AUC figure if not exists(output.figs): makedirs(output.figs) - plt.savefig( + fig.savefig( join( output.figs, ( f"{family}_roc-auc-curve_{alphabet_name.lower()}" f"_k-{config['k']:02d}.png" ), - ) + ), dpi=fig.dpi ) + fig.clf() plt.close("all") # PR-AUC figure @@ -399,15 +400,16 @@ rule model: results["cv_split"] += [i + 1 for i in range(cv)] # save PR-AUC figure - plt.savefig( + fig.savefig( join( output.figs, ( f"{family}_aupr-curve_{alphabet_name.lower()}" f"_k-{config['k']:02d}.png" ), - ) + ), dpi=fig.dpi ) + fig.clf() plt.close("all") # save model From 9b03db9de3bf280128309c62a1d37e1bfb4875a7 Mon Sep 17 00:00:00 2001 From: abbyjerger Date: Fri, 19 Aug 2022 17:08:50 -0700 Subject: [PATCH 3/4] Specify Snekmer Abby branch and snakemake-minimal for Windows install. --- environment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 48d67d8..0a534bb 100644 --- a/environment.yml +++ b/environment.yml @@ -14,10 +14,10 @@ dependencies: - pandas - seaborn - scikit-learn - - snakemake == 7.0 + - snakemake-minimal == 7.0 - umap-learn - hdbscan - pip - pip: - - -e git+https://github.com/PNNL-CompBio/Snekmer#egg=snekmer + - -e git+https://github.com/PNNL-CompBio/Snekmer@Abby#egg=snekmer From 696c28dda47718aae4767e742d2b755efa63f272 Mon Sep 17 00:00:00 2001 From: abbyjerger Date: Wed, 24 Aug 2022 11:30:50 -0700 Subject: [PATCH 4/4] Create separate yml for Windows installs for now --- environment.yml | 4 ++-- environment_Windows.yml | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 environment_Windows.yml diff --git a/environment.yml b/environment.yml index 0a534bb..48d67d8 100644 --- a/environment.yml +++ b/environment.yml @@ -14,10 +14,10 @@ dependencies: - pandas - seaborn - scikit-learn - - snakemake-minimal == 7.0 + - snakemake == 7.0 - umap-learn - hdbscan - pip - pip: - - -e git+https://github.com/PNNL-CompBio/Snekmer@Abby#egg=snekmer + - -e git+https://github.com/PNNL-CompBio/Snekmer#egg=snekmer diff --git a/environment_Windows.yml b/environment_Windows.yml new file mode 100644 index 0000000..f0f22c8 --- /dev/null +++ b/environment_Windows.yml @@ -0,0 +1,23 @@ +name: snekmer +channels: + - anaconda + - bioconda + - numba + - conda-forge +dependencies: + - python >= 3.9 + - biopython + - matplotlib + - numpy >= 1.22.3 + - numba >= 0.56 + - scipy + - pandas + - seaborn + - scikit-learn + - snakemake-minimal == 7.0 + - umap-learn + - hdbscan + - pip + - pip: + - -e git+https://github.com/PNNL-CompBio/Snekmer#egg=snekmer +