trackplot 0.6.0__tar.gz → 0.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {trackplot-0.6.0/trackplot.egg-info → trackplot-0.6.3}/PKG-INFO +1 -1
  2. {trackplot-0.6.0 → trackplot-0.6.3}/pyproject.toml +1 -1
  3. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Bam.py +2 -4
  4. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/core.py +7 -1
  5. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/limits.py +19 -2
  6. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/render.py +20 -4
  7. {trackplot-0.6.0 → trackplot-0.6.3/trackplot.egg-info}/PKG-INFO +1 -1
  8. {trackplot-0.6.0 → trackplot-0.6.3}/LICENSE +0 -0
  9. {trackplot-0.6.0 → trackplot-0.6.3}/README.md +0 -0
  10. {trackplot-0.6.0 → trackplot-0.6.3}/setup.cfg +0 -0
  11. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/__init__.py +0 -0
  12. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/anno/AxLabel.py +0 -0
  13. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/anno/__init__.py +0 -0
  14. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/anno/theme.py +0 -0
  15. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/CoordinateMap.py +0 -0
  16. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/GenomicLoci.py +0 -0
  17. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/Junction.py +0 -0
  18. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/Protein.py +0 -0
  19. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/ReadDepth.py +0 -0
  20. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/Readder.py +0 -0
  21. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/Stroke.py +0 -0
  22. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/Transcript.py +0 -0
  23. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/__init__.py +0 -0
  24. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/base/pyUniprot.py +0 -0
  25. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/cli.py +0 -0
  26. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/conf/DomainSetting.py +0 -0
  27. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/conf/__init__.py +0 -0
  28. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/conf/config.py +0 -0
  29. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/conf/drawing.py +0 -0
  30. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/conf/ui.py +0 -0
  31. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/ATAC.py +0 -0
  32. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Annotation.py +0 -0
  33. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/BedGraph.py +0 -0
  34. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Bigwig.py +0 -0
  35. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Depth.py +0 -0
  36. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Fasta.py +0 -0
  37. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/File.py +0 -0
  38. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/HiCMatrixTrack.py +0 -0
  39. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Junction.py +0 -0
  40. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/Motif.py +0 -0
  41. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/ReadSegments.py +0 -0
  42. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/file/__init__.py +0 -0
  43. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/__init__.py +0 -0
  44. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/coord.py +0 -0
  45. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/info.py +0 -0
  46. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot/utils.py +0 -0
  47. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/plot_func.py +0 -0
  48. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot/server.py +0 -0
  49. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot.egg-info/SOURCES.txt +0 -0
  50. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot.egg-info/dependency_links.txt +0 -0
  51. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot.egg-info/requires.txt +0 -0
  52. {trackplot-0.6.0 → trackplot-0.6.3}/trackplot.egg-info/top_level.txt +0 -0
  53. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/Home-B1EPE6Lq.js +0 -0
  54. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/Home-DuHqFHEh.css +0 -0
  55. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/Plot-CkylK0fA.css +0 -0
  56. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/Plot-jZAsK7Tq.js +0 -0
  57. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/_plugin-vue_export-helper-DLf8tVwz.css +0 -0
  58. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/_plugin-vue_export-helper-IgiCOkTJ.js +0 -0
  59. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/css-BDwM7dEv.css +0 -0
  60. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/css-CKLNJEB6.js +0 -0
  61. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/index-De-rfTdP.js +0 -0
  62. {trackplot-0.6.0 → trackplot-0.6.3}/ui/assets/index-Dlq_kUQH.css +0 -0
  63. {trackplot-0.6.0 → trackplot-0.6.3}/ui/index.html +0 -0
  64. {trackplot-0.6.0 → trackplot-0.6.3}/ui/vite.svg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trackplot
3
- Version: 0.6.0
3
+ Version: 0.6.3
4
4
  Summary: The trackplot is a tool for visualizing various next-generation sequencing (NGS) data, including DNA-seq, RNA-seq, single-cell RNA-seq and full-length sequencing datasets. https://sashimi.readthedocs.io/
5
5
  Author-email: ygidtu <ygidtu@gmail.com>
6
6
  License-Expression: BSD-3-Clause
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "trackplot"
3
- version = "0.6.0"
3
+ version = "0.6.3"
4
4
  description = "The trackplot is a tool for visualizing various next-generation sequencing (NGS) data, including DNA-seq, RNA-seq, single-cell RNA-seq and full-length sequencing datasets. https://sashimi.readthedocs.io/"
5
5
  authors = [
6
6
  { name = "ygidtu", email = "ygidtu@gmail.com" }
@@ -366,11 +366,9 @@ class Bam(SingleCell):
366
366
 
367
367
  if kept:
368
368
  if k.strand == "+":
369
- spanned_junctions_plus[k] = 1 + spanned_junctions_plus.get(k, v)
369
+ spanned_junctions_plus[k] = v
370
370
  elif k.strand == "-":
371
- spanned_junctions_minus[k] = -1 + spanned_junctions_minus.get(
372
- k, v
373
- )
371
+ spanned_junctions_minus[k] = v
374
372
 
375
373
  except IOError as err:
376
374
  logger.error("There is no .bam file at {0}".format(self.path))
@@ -880,7 +880,7 @@ class Plot(object):
880
880
  graph_coords=self.graph_coords,
881
881
  **kwargs,
882
882
  )
883
- logger.info(f"{_max} {_min}")
883
+
884
884
  if obj.label in same_y_by_groups:
885
885
  key = same_y_by_groups[obj.label]
886
886
  max_used_y_dict[key] = max(_max, max_used_y_dict.get(key, 0))
@@ -1060,6 +1060,12 @@ class Plot(object):
1060
1060
  same_y_sc=kwargs.get("same_y_sc"),
1061
1061
  same_y=kwargs.get("same_y"),
1062
1062
  )
1063
+
1064
+ if max_y_val_ is not None:
1065
+ max_y_val_ *= 1.1
1066
+
1067
+ if min_y_val_ is not None:
1068
+ min_y_val_ *= 1.1
1063
1069
 
1064
1070
  logger.info(
1065
1071
  f"plotting {p.type} at idx: {curr_idx} with height_ratio: {height_ratio[curr_idx]}"
@@ -56,6 +56,13 @@ def _compute_y_limits(
56
56
  if base_max % 2 == 1:
57
57
  base_max += 1
58
58
 
59
+ # --- Track whether limits were explicitly provided (from precompute/user) ---
60
+ # When both are given, they already account for junction expansion, so we
61
+ # must NOT expand them again — doing so causes non-convergent arc growth
62
+ # (the arc height computed from the incoming limit is larger than the one
63
+ # used during precomputation, inflating the limit on every re-calculation).
64
+ _limits_explicitly_set = max_used_y_val is not None and min_used_y_val is not None
65
+
59
66
  # --- Set initial y-axis limits ---
60
67
  if max_used_y_val is None:
61
68
  max_used_y_val = base_max
@@ -143,8 +150,13 @@ def _compute_y_limits(
143
150
  -right_dens if not ss2_modified else -right_dens - current_height,
144
151
  ]
145
152
 
146
- max_used_y_val = max(max_used_y_val, max(pts_y))
147
- min_used_y_val = min(min_used_y_val, min(pts_y))
153
+ # Only expand y-limits for junctions when limits were NOT explicitly
154
+ # provided. Explicit limits (from precompute / --same-y) already
155
+ # account for junction arcs; re-expanding would cause non-convergent
156
+ # growth because arc heights are recomputed from the incoming limit.
157
+ if not _limits_explicitly_set:
158
+ max_used_y_val = max(max_used_y_val, max(pts_y))
159
+ min_used_y_val = min(min_used_y_val, min(pts_y))
148
160
 
149
161
  # Strand-aware adjustment
150
162
  if not isinstance(data, dict) and data.strand_aware:
@@ -154,6 +166,11 @@ def _compute_y_limits(
154
166
  elif not density_by_strand and not jxns:
155
167
  min_used_y_val = 0
156
168
 
169
+ # Small expansion so the top / bottom arcs have visual breathing room
170
+ # and do not appear cramped against the axis edge.
171
+ max_used_y_val *= 1.1
172
+ min_used_y_val *= 1.1
173
+
157
174
  return max_used_y_val, min_used_y_val
158
175
 
159
176
 
@@ -474,7 +474,10 @@ def plot_density(
474
474
  _base_max += 1
475
475
 
476
476
  # Arc height reference: use the LARGER of (data baseline, incoming y-limit)
477
- # so arcs look proportional to the visible axis range (especially in --same-y mode).
477
+ # so arcs look proportional to the visible axis range (especially in
478
+ # --same-y / --same-y-sc mode). If we only used the data baseline, panels
479
+ # with small data would have tiny arcs hugging the x-axis when a large
480
+ # global y-limit is shared across panels.
478
481
  _arc_ref_max = (
479
482
  max(_base_max, max_used_y_val) if max_used_y_val is not None else _base_max
480
483
  )
@@ -500,8 +503,7 @@ def plot_density(
500
503
  fill_step=fill_step,
501
504
  show_mean_jxn_number=show_mean_jxn_number,
502
505
  )
503
- logger.info(f"precomputed y limits: {max_used_y_val} {min_used_y_val}")
504
-
506
+
505
507
  # Draw fill
506
508
  x, y1, y2 = [], [], []
507
509
  for i in range(len(graph_coords)):
@@ -531,6 +533,8 @@ def plot_density(
531
533
  min_junction_count = min(jxns.values()) if jxns else 0
532
534
  junction_count_gap = max_junction_count - min_junction_count
533
535
 
536
+ text_objs = []
537
+
534
538
  for jxn_idx, jxn in enumerate(jxns_sorted_list):
535
539
  leftss, rightss = jxn.start, jxn.end
536
540
  if (
@@ -542,7 +546,7 @@ def plot_density(
542
546
  f"junction {jxn} of {y_label} is out of plotting region, skip"
543
547
  )
544
548
  continue
545
-
549
+
546
550
  ss1_idx, ss1_modified = get_limited_index(
547
551
  leftss - region.start, len(graph_coords)
548
552
  )
@@ -572,6 +576,7 @@ def plot_density(
572
576
  right_dens + current_height,
573
577
  right_dens if not ss2_modified else right_dens + current_height,
574
578
  ]
579
+
575
580
  else:
576
581
  left_dens, right_dens = (
577
582
  abs(data.curr_min(ss1_idx)),
@@ -619,6 +624,17 @@ def plot_density(
619
624
  backgroundcolor="w",
620
625
  )
621
626
  t.set_bbox(dict(alpha=0))
627
+ text_objs.append(t)
628
+
629
+ if show_junction_number and len(text_objs) > 1:
630
+ adjust_text(
631
+ text_objs,
632
+ ax=ax,
633
+ force_text=(0.5, 0.5),
634
+ expand=(1.2, 1.2),
635
+ arrowprops=None,
636
+ lim=100,
637
+ )
622
638
 
623
639
  if obj and obj.title:
624
640
  ax.text(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trackplot
3
- Version: 0.6.0
3
+ Version: 0.6.3
4
4
  Summary: The trackplot is a tool for visualizing various next-generation sequencing (NGS) data, including DNA-seq, RNA-seq, single-cell RNA-seq and full-length sequencing datasets. https://sashimi.readthedocs.io/
5
5
  Author-email: ygidtu <ygidtu@gmail.com>
6
6
  License-Expression: BSD-3-Clause
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes