| """canonical class -> color mapping shared across every panda figure.
|
|
|
| related classes share hue families (fibroblasts red, keratinocytes orange,
|
| melanocyte lineage purple, endothelial teal, immune yellow, etc.). every
|
| figure imports CLASS_COLORS[cls] so class X gets the same color everywhere.
|
| """
|
|
|
|
|
| _SKIN = {
|
| "basal-IFE": "#e07b39",
|
| "spinous": "#c94f21",
|
| "granular": "#a53818",
|
| "HF-placode": "#8b4513",
|
| "HF-ORS": "#c68e4b",
|
| "sebaceous": "#bfa970",
|
| "fibroblast-papillary": "#d94848",
|
| "fibroblast-reticular": "#8f1e1e",
|
| "endothelial": "#2e8b8b",
|
| "immune": "#d1c02b",
|
| "melanoblast": "#6a5acd",
|
| "melanocyte-precursor": "#9370db",
|
| "melanocyte": "#4b3ca3",
|
| }
|
|
|
|
|
| _HSC = {
|
| "LT-HSC": "#1a3d78",
|
| "MPP": "#7d5fc9",
|
| "erythroid": "#c1272d",
|
| "megakaryocyte": "#a1204b",
|
| "basophil-mast": "#e07b39",
|
| "myeloid": "#8a5822",
|
| "monocyte": "#d4a373",
|
| "macrophage": "#6b4321",
|
| "lymphoid": "#1e7a4f",
|
| "T-cell": "#3aa17f",
|
| "naive-B": "#5cbf88",
|
| "pro-B": "#7fd39d",
|
| "endothelial": "#2e8b8b",
|
| "fibroblast": "#8f1e1e",
|
| "stromal": "#6b4a3b",
|
| }
|
|
|
|
|
| _PANC = {
|
| "alpha": "#a3123a",
|
| "adult-alpha": "#7a0e2b",
|
| "alpha_progenitor": "#d94360",
|
| "beta": "#1f4e9e",
|
| "adult-beta": "#123469",
|
| "beta_progenitor": "#4d78c4",
|
| "delta": "#7d3c98",
|
| "gamma": "#af7ac5",
|
| "epsilon": "#f39c12",
|
| "Fev-EP": "#e67e22",
|
| "endocrine-progenitor": "#c68e4b",
|
| "endocrine-progenitor-primed": "#a86b28",
|
| "pancreatic-progenitor": "#16a085",
|
| "proliferating": "#48c9b0",
|
| "acinar": "#8a5822",
|
| "exocrine": "#5d3a11",
|
| "ductal": "#7b6b57",
|
| "endothelial": "#2e8b8b",
|
| "immune": "#d1c02b",
|
| "mesenchyme": "#6b4a3b",
|
| }
|
|
|
|
|
| CLASS_COLORS = {**_SKIN, **_HSC, **_PANC}
|
|
|
|
|
| GENOTYPE_COLORS = {
|
| "WT": "#1f77b4",
|
| "En1-cKO": "#d62728",
|
| "Kit_W41": "#d62728",
|
| "control": "#1f77b4",
|
| "other": "#bbbbbb",
|
| }
|
|
|
|
|
| STAGE_COLORS = {
|
| "3": "#440154",
|
| "4": "#3b528b",
|
| "5": "#21918c",
|
| "6": "#fde725",
|
| }
|
|
|
|
|
|
|
| SUPTITLE_FS = 15
|
| TITLE_FS = 14
|
| LABEL_FS = 13
|
| TICK_FS = 12
|
| LEGEND_FS = 11
|
| ANNOT_FS = 11
|
| CBAR_FS = 12
|
|
|
|
|
| def color_for(cls, fallback="#888888"):
|
| """look up a class name; return fallback if missing."""
|
| if cls in CLASS_COLORS:
|
| return CLASS_COLORS[cls]
|
|
|
| s = str(cls).strip()
|
| return CLASS_COLORS.get(s, fallback)
|
|
|
|
|
| def apply_style():
|
| """shared rcparams; call at top of every figure script."""
|
| import matplotlib.pyplot as plt
|
| plt.rcParams.update({
|
| "font.family": "DejaVu Sans",
|
| "font.size": 12,
|
| "axes.titlesize": TITLE_FS,
|
| "axes.labelsize": LABEL_FS,
|
| "xtick.labelsize": TICK_FS,
|
| "ytick.labelsize": TICK_FS,
|
| "legend.fontsize": LEGEND_FS,
|
| "legend.title_fontsize": LEGEND_FS + 1,
|
| "figure.titlesize": SUPTITLE_FS,
|
| "pdf.fonttype": 42,
|
| "ps.fonttype": 42,
|
| "axes.spines.top": False,
|
| "axes.spines.right": False,
|
| "axes.linewidth": 1.2,
|
| "xtick.major.width": 1.2,
|
| "ytick.major.width": 1.2,
|
| })
|
|
|