Source code for modalysis.core.plots.label_format
"""Formatting helpers for plot labels."""
MODIFICATION_DISPLAY_LABELS = {
"5MC": "5mC",
"5MC_5HMC": "5mC 5hmC",
}
[docs]
def format_modification_label(modification: str) -> str:
"""Convert normalized modification labels into human-readable labels."""
normalized = modification.strip().upper()
if normalized in MODIFICATION_DISPLAY_LABELS:
return MODIFICATION_DISPLAY_LABELS[normalized]
return modification.strip()