trackplot 0.6.3__tar.gz → 0.6.4__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.3/trackplot.egg-info → trackplot-0.6.4}/PKG-INFO +1 -1
  2. {trackplot-0.6.3 → trackplot-0.6.4}/pyproject.toml +1 -1
  3. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/cli.py +28 -0
  4. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/coord.py +11 -8
  5. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/core.py +10 -2
  6. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/limits.py +5 -1
  7. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/render.py +6 -1
  8. {trackplot-0.6.3 → trackplot-0.6.4/trackplot.egg-info}/PKG-INFO +1 -1
  9. {trackplot-0.6.3 → trackplot-0.6.4}/LICENSE +0 -0
  10. {trackplot-0.6.3 → trackplot-0.6.4}/README.md +0 -0
  11. {trackplot-0.6.3 → trackplot-0.6.4}/setup.cfg +0 -0
  12. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/__init__.py +0 -0
  13. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/anno/AxLabel.py +0 -0
  14. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/anno/__init__.py +0 -0
  15. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/anno/theme.py +0 -0
  16. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/CoordinateMap.py +0 -0
  17. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/GenomicLoci.py +0 -0
  18. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/Junction.py +0 -0
  19. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/Protein.py +0 -0
  20. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/ReadDepth.py +0 -0
  21. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/Readder.py +0 -0
  22. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/Stroke.py +0 -0
  23. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/Transcript.py +0 -0
  24. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/__init__.py +0 -0
  25. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/base/pyUniprot.py +0 -0
  26. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/conf/DomainSetting.py +0 -0
  27. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/conf/__init__.py +0 -0
  28. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/conf/config.py +0 -0
  29. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/conf/drawing.py +0 -0
  30. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/conf/ui.py +0 -0
  31. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/ATAC.py +0 -0
  32. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Annotation.py +0 -0
  33. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Bam.py +0 -0
  34. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/BedGraph.py +0 -0
  35. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Bigwig.py +0 -0
  36. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Depth.py +0 -0
  37. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Fasta.py +0 -0
  38. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/File.py +0 -0
  39. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/HiCMatrixTrack.py +0 -0
  40. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Junction.py +0 -0
  41. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/Motif.py +0 -0
  42. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/ReadSegments.py +0 -0
  43. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/file/__init__.py +0 -0
  44. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/__init__.py +0 -0
  45. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/info.py +0 -0
  46. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot/utils.py +0 -0
  47. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/plot_func.py +0 -0
  48. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot/server.py +0 -0
  49. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot.egg-info/SOURCES.txt +0 -0
  50. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot.egg-info/dependency_links.txt +0 -0
  51. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot.egg-info/requires.txt +0 -0
  52. {trackplot-0.6.3 → trackplot-0.6.4}/trackplot.egg-info/top_level.txt +0 -0
  53. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/Home-B1EPE6Lq.js +0 -0
  54. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/Home-DuHqFHEh.css +0 -0
  55. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/Plot-CkylK0fA.css +0 -0
  56. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/Plot-jZAsK7Tq.js +0 -0
  57. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/_plugin-vue_export-helper-DLf8tVwz.css +0 -0
  58. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/_plugin-vue_export-helper-IgiCOkTJ.js +0 -0
  59. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/css-BDwM7dEv.css +0 -0
  60. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/css-CKLNJEB6.js +0 -0
  61. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/index-De-rfTdP.js +0 -0
  62. {trackplot-0.6.3 → trackplot-0.6.4}/ui/assets/index-Dlq_kUQH.css +0 -0
  63. {trackplot-0.6.3 → trackplot-0.6.4}/ui/index.html +0 -0
  64. {trackplot-0.6.3 → trackplot-0.6.4}/ui/vite.svg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trackplot
3
- Version: 0.6.3
3
+ Version: 0.6.4
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.3"
3
+ version = "0.6.4"
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" }
@@ -1214,6 +1214,30 @@ def _add_interval(p, f):
1214
1214
  @optgroup.option(
1215
1215
  "--title", type=click.STRING, default=None, help="Title", show_default=True
1216
1216
  )
1217
+ @optgroup.option(
1218
+ "--no-title",
1219
+ type=click.BOOL,
1220
+ is_flag=True,
1221
+ default=False,
1222
+ help="Disable the plot title entirely",
1223
+ show_default=True,
1224
+ )
1225
+ @optgroup.option(
1226
+ "--no-region-text",
1227
+ type=click.BOOL,
1228
+ is_flag=True,
1229
+ default=False,
1230
+ help="Disable the --event region text on the x-axis ruler",
1231
+ show_default=True,
1232
+ )
1233
+ @optgroup.option(
1234
+ "--junctions-on-top",
1235
+ type=click.BOOL,
1236
+ is_flag=True,
1237
+ default=False,
1238
+ help="Force all junction arcs to be drawn above the density plot (only effective when --density-by-strand is not set)",
1239
+ show_default=True,
1240
+ )
1217
1241
  @optgroup.option(
1218
1242
  "--font", type=click.STRING, default=None, help="Fonts", show_default=True
1219
1243
  )
@@ -1362,6 +1386,10 @@ def main(**kwargs):
1362
1386
  normalize_format=kwargs.get("normalize_format"),
1363
1387
  fill_step=kwargs.get("fill_step", "post"),
1364
1388
  smooth_bin=kwargs["smooth_bin"],
1389
+ title=kwargs["title"],
1390
+ no_title=kwargs["no_title"],
1391
+ no_region_text=kwargs["no_region_text"],
1392
+ junctions_on_top=kwargs["junctions_on_top"],
1365
1393
  )
1366
1394
 
1367
1395
 
@@ -134,14 +134,17 @@ def set_x_ticks(
134
134
  x_label = f"{x_label}, y axis is {log_trans} transformed"
135
135
 
136
136
  ax.hlines(y=0, xmin=0, xmax=max(graph_coords), color="black", lw=1)
137
- ax.text(
138
- x=graph_coords[len(graph_coords) // 2],
139
- y=-2.8,
140
- s=x_label,
141
- fontsize=font_size,
142
- ha="center",
143
- va="top",
144
- )
137
+
138
+ no_region_text = kwargs.pop("no_region_text", False)
139
+ if not no_region_text:
140
+ ax.text(
141
+ x=graph_coords[len(graph_coords) // 2],
142
+ y=-2.8,
143
+ s=x_label,
144
+ fontsize=font_size,
145
+ ha="center",
146
+ va="top",
147
+ )
145
148
 
146
149
  bk = 1
147
150
  if not sequence and nx_ticks > 1:
@@ -986,6 +986,11 @@ class Plot(object):
986
986
 
987
987
  igv_height_scale = kwargs.get("igv_height_scale")
988
988
 
989
+ # Extract / pop custom params before they flow into downstream **kwargs
990
+ title = kwargs.pop("title", None)
991
+ no_title = kwargs.pop("no_title", False)
992
+ junctions_on_top = kwargs.pop("junctions_on_top", False)
993
+
989
994
  # ====== Phase 1: Load data ======
990
995
  self._load_plot_data(n_jobs, *args, **kwargs)
991
996
 
@@ -1048,8 +1053,8 @@ class Plot(object):
1048
1053
  else:
1049
1054
  ax_var = plt.subplot(gs[curr_idx, 0])
1050
1055
 
1051
- if curr_idx == 0:
1052
- ax_var.set_title(str(self.region), loc="left")
1056
+ if curr_idx == 0 and not no_title:
1057
+ ax_var.set_title(title or str(self.region), loc="left")
1053
1058
 
1054
1059
  max_y_val_, min_y_val_ = self._resolve_plot_y_limits(
1055
1060
  p,
@@ -1088,6 +1093,7 @@ class Plot(object):
1088
1093
  distance_between_label_axis=distance_between_label_axis,
1089
1094
  raster=raster,
1090
1095
  fill_step=fill_step,
1096
+ junctions_on_top=junctions_on_top,
1091
1097
  **temp_params,
1092
1098
  )
1093
1099
  curr_idx += 1
@@ -1103,6 +1109,7 @@ class Plot(object):
1103
1109
  distance_between_label_axis=distance_between_label_axis,
1104
1110
  raster=raster,
1105
1111
  fill_step=fill_step,
1112
+ junctions_on_top=junctions_on_top,
1106
1113
  **self.params.get(p, {}),
1107
1114
  )
1108
1115
  elif p.type == "hic":
@@ -1123,6 +1130,7 @@ class Plot(object):
1123
1130
  min_used_y_val=min_y_val_,
1124
1131
  distance_between_label_axis=distance_between_label_axis,
1125
1132
  raster=raster,
1133
+ junctions_on_top=junctions_on_top,
1126
1134
  **self.params.get(p, {}),
1127
1135
  )
1128
1136
  curr_idx += 1
@@ -26,6 +26,7 @@ def _compute_y_limits(
26
26
  density_by_strand: bool = False,
27
27
  fill_step: str = "post",
28
28
  show_mean_jxn_number: bool = False,
29
+ junctions_on_top: bool = False,
29
30
  ) -> Tuple[float, float]:
30
31
  """
31
32
  Compute y-axis limits from ReadDepth data, including junction arc extents.
@@ -119,6 +120,8 @@ def _compute_y_limits(
119
120
 
120
121
  if density_by_strand:
121
122
  jxn_on_top = jxn.strand == "+"
123
+ elif junctions_on_top:
124
+ jxn_on_top = True
122
125
  else:
123
126
  jxn_on_top = jxn_idx % 2 == 0
124
127
  if abs(min_used_y_val) < max_used_y_val:
@@ -163,7 +166,7 @@ def _compute_y_limits(
163
166
  if density_by_strand:
164
167
  max_used_y_val = max(abs(min_used_y_val), max_used_y_val)
165
168
  min_used_y_val = -max_used_y_val
166
- elif not density_by_strand and not jxns:
169
+ elif not density_by_strand and (junctions_on_top or not jxns):
167
170
  min_used_y_val = 0
168
171
 
169
172
  # Small expansion so the top / bottom arcs have visual breathing room
@@ -207,4 +210,5 @@ def precompute_y_limits(
207
210
  density_by_strand=kwargs.get("density_by_strand", False),
208
211
  fill_step=fill_step,
209
212
  show_mean_jxn_number=False,
213
+ junctions_on_top=kwargs.get("junctions_on_top", False),
210
214
  )
@@ -493,6 +493,8 @@ def plot_density(
493
493
  # Compute y limits using shared logic
494
494
  fixed_max_used_y = max_used_y_val is not None
495
495
 
496
+ junctions_on_top = kwargs.get("junctions_on_top", False)
497
+
496
498
  max_used_y_val, min_used_y_val = _compute_y_limits(
497
499
  data=data,
498
500
  region=region,
@@ -502,6 +504,7 @@ def plot_density(
502
504
  density_by_strand=kwargs.get("density_by_strand", False),
503
505
  fill_step=fill_step,
504
506
  show_mean_jxn_number=show_mean_jxn_number,
507
+ junctions_on_top=junctions_on_top,
505
508
  )
506
509
 
507
510
  # Draw fill
@@ -557,6 +560,8 @@ def plot_density(
557
560
 
558
561
  if kwargs.get("density_by_strand"):
559
562
  jxn_on_top = jxn.strand == "+"
563
+ elif junctions_on_top:
564
+ jxn_on_top = True
560
565
  else:
561
566
  jxn_on_top = jxn_idx % 2 == 0
562
567
  if abs(min_used_y_val) < max_used_y_val:
@@ -659,7 +664,7 @@ def plot_density(
659
664
  ):
660
665
  max_used_y_val = max(abs(min_used_y_val), max_used_y_val)
661
666
  min_used_y_val = -max_used_y_val
662
- elif not kwargs.get("density_by_strand") and not jxns:
667
+ elif not kwargs.get("density_by_strand") and (junctions_on_top or not jxns):
663
668
  min_used_y_val = 0
664
669
 
665
670
  set_y_ticks(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trackplot
3
- Version: 0.6.3
3
+ Version: 0.6.4
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