From 7c1a30bced3681e491ef4b1cfe5ca24270efb180 Mon Sep 17 00:00:00 2001 From: Okke van Eck Date: Tue, 23 May 2023 15:52:20 +0200 Subject: [PATCH] added annotate option --- prospr/__init__.py | 2 +- prospr/visualize.py | 53 +++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/prospr/__init__.py b/prospr/__init__.py index 5883f33..f350657 100644 --- a/prospr/__init__.py +++ b/prospr/__init__.py @@ -8,7 +8,7 @@ from .datasets import load_vanEck250, load_vanEck1000, load_vanEck_hratio from .visualize import plot_protein -__version__ = "0.2a42" +__version__ = "0.2a43" __all__ = [ "__version__", diff --git a/prospr/visualize.py b/prospr/visualize.py index 3e3d8da..8145708 100644 --- a/prospr/visualize.py +++ b/prospr/visualize.py @@ -102,7 +102,7 @@ def _plot_aminos_2d_paper( label="P", ) - # Plot first point with a subscript 1. + # Plot first point with a green edge color. if annotate_first: # Plot first point with a different color. if df.iloc[0]["Type"] == "H": @@ -245,31 +245,32 @@ def _plot_aminos_3d_paper( depthshade=False, ) - # Plot first point with a different color. - if df.iloc[0]["Type"] == "H": - ax.scatter( - df.iloc[0]["x"], - df.iloc[0]["y"], - df.iloc[0]["z"], - marker="o", - fc="royalblue", - ec="#00ce00", - lw=1.3, - s=markersize, - zorder=2, - ) - else: - ax.scatter( - df.iloc[0]["x"], - df.iloc[0]["y"], - df.iloc[0]["z"], - marker="o", - fc="white", - ec="#00ce00", - lw=1.3, - s=markersize, - zorder=2, - ) + # Plot first point with a green edge color. + if annotate_first: + if df.iloc[0]["Type"] == "H": + ax.scatter( + df.iloc[0]["x"], + df.iloc[0]["y"], + df.iloc[0]["z"], + marker="o", + fc="royalblue", + ec="#00ce00", + lw=1.3, + s=markersize, + zorder=2, + ) + else: + ax.scatter( + df.iloc[0]["x"], + df.iloc[0]["y"], + df.iloc[0]["z"], + marker="o", + fc="white", + ec="#00ce00", + lw=1.3, + s=markersize, + zorder=2, + ) # Plot dotted lines between the aminos that increase the stability. pairs = get_scoring_pairs(protein)