From eef86469aef56b925ef5168330d9db8121e2ec67 Mon Sep 17 00:00:00 2001 From: Tong-Chen Date: Wed, 22 Nov 2023 11:08:34 +0800 Subject: [PATCH] add genelabel rotation (customize x and y for rotation with angle 0) --- jcvi/graphics/synteny.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jcvi/graphics/synteny.py b/jcvi/graphics/synteny.py index 065bdc40..bb209cdc 100644 --- a/jcvi/graphics/synteny.py +++ b/jcvi/graphics/synteny.py @@ -196,6 +196,7 @@ def __init__( loc_label=True, gene_labels: Optional[set] = None, genelabelsize=0, + genelabelrotation=25, pad=0.05, vpad=0.015, extra_features=None, @@ -280,7 +281,7 @@ def __init__( y + height / 2 + genelabelsize * vpad / 3, markup(gene_name), size=genelabelsize, - rotation=25, + rotation=genelabelrotation, ha="left", va="center", color="lightslategray", @@ -602,6 +603,13 @@ def main(): + "However, plot may appear visually crowded. " + "Reasonably good values are 2 to 6 [Default: disabled]", ) + p.add_option( + "--genelabelrotation", + default=25, + type="int", + help="Rotate gene labels at this angle (anti-clockwise), useful for debugging. " + + "[Default: 25]", + ) p.add_option( "--scalebar", default=False, @@ -650,6 +658,7 @@ def main(): extra_features=opts.extra, gene_labels=gene_labels, genelabelsize=opts.genelabelsize, + genelabelrotation=opts.genelabelrotation, scalebar=opts.scalebar, shadestyle=opts.shadestyle, glyphstyle=opts.glyphstyle,