Skip to content
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
9 changes: 3 additions & 6 deletions content/9.0_Generation_for_Antibody_Engineering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": 2,
"id": "b8ed5dc9",
"metadata": {
"scrolled": true
Expand All @@ -70,11 +70,8 @@
"from Bio.PDB import *\n",
"\n",
"from biolmai import BioLM\n",
"from matplotlib.font_manager import fontManager, FontProperties\n",
"font_path = \"../font/Geist-Regular.ttf\"\n",
"fontManager.addfont(font_path)\n",
"prop = FontProperties(fname=font_path)\n",
"sns.set_theme(font=prop.get_name(), style=\"white\", context='notebook', palette='pastel')"
"from helpers.styling import apply_plot_styling\n",
"apply_plot_styling()"
]
},
{
Expand Down
9 changes: 3 additions & 6 deletions content/9.1_Intrinsic_Scoring_for_Antibody_Engineering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"id": "b8ed5dc9",
"metadata": {},
"outputs": [],
Expand All @@ -73,11 +73,8 @@
"from Bio.PDB import *\n",
"\n",
"from biolmai import BioLM\n",
"from matplotlib.font_manager import fontManager, FontProperties\n",
"font_path = \"../font/Geist-Regular.ttf\"\n",
"fontManager.addfont(font_path)\n",
"prop = FontProperties(fname=font_path)\n",
"sns.set_theme(font=prop.get_name(), style=\"white\", context='notebook', palette='pastel')"
"from helpers.styling import apply_plot_styling\n",
"apply_plot_styling()"
]
},
{
Expand Down
9 changes: 3 additions & 6 deletions content/9.2_Structural_Scoring_for_Antibody_Engineering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 1,
"id": "b8ed5dc9",
"metadata": {},
"outputs": [],
Expand All @@ -66,11 +66,8 @@
"from Bio.PDB import *\n",
"import os\n",
"from biolmai import BioLM\n",
"from matplotlib.font_manager import fontManager, FontProperties\n",
"font_path = \"../font/Geist-Regular.ttf\"\n",
"fontManager.addfont(font_path)\n",
"prop = FontProperties(fname=font_path)\n",
"sns.set_theme(font=prop.get_name(), style=\"white\", context='notebook', palette='pastel')"
"from helpers.styling import apply_plot_styling\n",
"apply_plot_styling()"
]
},
{
Expand Down
7 changes: 2 additions & 5 deletions content/9.3_Downstream_for_Antibody_Engineering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@
"from Bio.PDB import *\n",
"\n",
"from biolmai import BioLM\n",
"from matplotlib.font_manager import fontManager, FontProperties\n",
"font_path = \"../font/Geist-Regular.ttf\"\n",
"fontManager.addfont(font_path)\n",
"prop = FontProperties(fname=font_path)\n",
"sns.set_theme(font=prop.get_name(), style=\"white\", context='notebook', palette='pastel')"
"from helpers.styling import apply_plot_styling\n",
"apply_plot_styling()"
]
},
{
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions content/helpers/styling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import seaborn as sns
import os
from matplotlib import rcParams
from matplotlib.font_manager import fontManager, FontProperties

def apply_plot_styling(font_filename="Geist-Regular.ttf"):
"""
Applies custom font and Seaborn theme styling for consistent plot visuals.

Parameters:
font_filename (str): Name of the .ttf font file located in the same directory as this script.
"""
current_dir = os.path.dirname(os.path.abspath(__file__))
font_path = os.path.join(current_dir, font_filename)

fontManager.addfont(font_path)
prop = FontProperties(fname=font_path)
font_name = prop.get_name()

sns.set_theme(
font=font_name,
style="white",
context="notebook",
palette="pastel"
)

rcParams['font.family'] = font_name