|
9 | 9 |
|
10 | 10 | DOTTED_LINES_WIDTH = 1 |
11 | 11 |
|
12 | | -START_POS = 638 |
13 | 12 | END_POS = 9632 |
14 | 13 | XOFFSET = 400 |
15 | 14 | CANVAS_WIDTH = 900 |
@@ -67,7 +66,7 @@ def add_genome_overview(figure, landmarks, height=12, xoffset=XOFFSET): |
67 | 66 | Draw a simple overview of the reference (NL43) using the provided |
68 | 67 | landmarks list. Each landmark should be a dict with 'start', 'end', 'name' |
69 | 68 | and optionally 'colour' and 'frame'. Coordinates are assumed to be in the |
70 | | - same reference coordinate system as START_POS/END_POS; this function adds |
| 69 | + same reference coordinate system as 1/END_POS; this function adds |
71 | 70 | XOFFSET so the overview lines up with the main plot. |
72 | 71 | """ |
73 | 72 |
|
@@ -239,8 +238,7 @@ class SplicingSites: |
239 | 238 | """ |
240 | 239 | def __init__(self, splicing_sites, total_height, total_samples=0, lineheight=5, h=60): |
241 | 240 | self.splicing_sites = splicing_sites |
242 | | - self.start = min(START_POS, min(site.start for site in splicing_sites)) |
243 | | - self.a = self.start + XOFFSET |
| 241 | + self.a = XOFFSET |
244 | 242 | self.b = END_POS + XOFFSET |
245 | 243 | self.w = self.b - self.a |
246 | 244 | self.h = h # height of the component (increased for multi-level labels) |
@@ -695,10 +693,10 @@ def plot(transcripts, groups, splicing_sites, title=None) -> draw.Drawing: |
695 | 693 | # add a small blank multitrack to create vertical separation between the splicing sites |
696 | 694 | # and the sample tracks (gap value tuned to avoid overlap with multi-level labels) |
697 | 695 | try: |
698 | | - figure.add(Multitrack([Track(START_POS + XOFFSET, START_POS + XOFFSET, color='#ffffff', h=2)]), gap=25) |
| 696 | + figure.add(Multitrack([Track(XOFFSET, XOFFSET, color='#ffffff', h=2)]), gap=25) |
699 | 697 | except TypeError: |
700 | 698 | # fallback if Track signature differs; attempt without named color |
701 | | - figure.add(Multitrack([Track(START_POS + XOFFSET, START_POS + XOFFSET, color='#ffffff', h=2)]), gap=25) |
| 699 | + figure.add(Multitrack([Track(XOFFSET, XOFFSET, color='#ffffff', h=2)]), gap=25) |
702 | 700 |
|
703 | 701 | # Add all pre-created group components to the figure |
704 | 702 | for group_component in group_components: |
|
0 commit comments