trackplot 0.5.3__tar.gz → 0.5.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 (94) hide show
  1. {trackplot-0.5.3 → trackplot-0.5.4}/PKG-INFO +24 -29
  2. trackplot-0.5.4/pyproject.toml +48 -0
  3. trackplot-0.5.4/setup.cfg +4 -0
  4. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/plot.py +1 -1
  5. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/plot_func.py +18 -46
  6. trackplot-0.5.4/trackplot.egg-info/PKG-INFO +296 -0
  7. trackplot-0.5.4/trackplot.egg-info/SOURCES.txt +91 -0
  8. trackplot-0.5.4/trackplot.egg-info/dependency_links.txt +1 -0
  9. trackplot-0.5.4/trackplot.egg-info/requires.txt +17 -0
  10. trackplot-0.5.4/trackplot.egg-info/top_level.txt +2 -0
  11. trackplot-0.5.4/ui/assets/Home-BV58jH3t.js +1 -0
  12. trackplot-0.5.4/ui/assets/Plot-BALbchCV.css +1 -0
  13. trackplot-0.5.4/ui/assets/Plot-Cnt8iJB8.js +21 -0
  14. trackplot-0.5.4/ui/assets/el-divider-DcvrsrBa.css +1 -0
  15. trackplot-0.5.4/ui/assets/el-divider-IbBQ8ZK2.js +4 -0
  16. trackplot-0.5.4/ui/assets/index-C4Mi9Kmf.js +30 -0
  17. trackplot-0.5.4/ui/assets/index-DgEIiwRJ.css +1 -0
  18. {trackplot-0.5.3 → trackplot-0.5.4}/ui/index.html +2 -2
  19. trackplot-0.5.3/pyproject.toml +0 -49
  20. {trackplot-0.5.3 → trackplot-0.5.4}/LICENSE +0 -0
  21. {trackplot-0.5.3 → trackplot-0.5.4}/README.md +0 -0
  22. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/__init__.py +0 -0
  23. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/anno/AxLabel.py +0 -0
  24. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/anno/__init__.py +0 -0
  25. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/anno/theme.py +0 -0
  26. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/CoordinateMap.py +0 -0
  27. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/GenomicLoci.py +0 -0
  28. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/Junction.py +0 -0
  29. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/Protein.py +0 -0
  30. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/ReadDepth.py +0 -0
  31. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/Readder.py +0 -0
  32. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/Stroke.py +0 -0
  33. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/Transcript.py +0 -0
  34. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/__init__.py +0 -0
  35. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/base/pyUniprot.py +0 -0
  36. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/cli.py +0 -0
  37. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/conf/DomainSetting.py +0 -0
  38. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/conf/__init__.py +0 -0
  39. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/conf/config.py +0 -0
  40. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/conf/drawing.py +0 -0
  41. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/conf/ui.py +0 -0
  42. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/ATAC.py +0 -0
  43. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Annotation.py +0 -0
  44. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Bam.py +0 -0
  45. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/BedGraph.py +0 -0
  46. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Bigwig.py +0 -0
  47. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Depth.py +0 -0
  48. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Fasta.py +0 -0
  49. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/File.py +0 -0
  50. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/HiCMatrixTrack.py +0 -0
  51. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Junction.py +0 -0
  52. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/Motif.py +0 -0
  53. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/ReadSegments.py +0 -0
  54. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/file/__init__.py +0 -0
  55. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/plot_tests.py +0 -0
  56. {trackplot-0.5.3 → trackplot-0.5.4}/trackplot/server.py +0 -0
  57. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-7GzAh8lS.js +0 -0
  58. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-CDW3Zwoa.js +0 -0
  59. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-DOO13BH7.js +0 -0
  60. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-QmeAKOl4.js +0 -0
  61. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-RdVPWns6.js +0 -0
  62. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-jSR0MsHI.css +0 -0
  63. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Home-zRV7yePL.css +0 -0
  64. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-BmqHZ4QE.css +0 -0
  65. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-BrjU8Kwg.js +0 -0
  66. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-Bvyo6ju9.css +0 -0
  67. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-COvGnprQ.css +0 -0
  68. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-CTM-EDrj.js +0 -0
  69. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-Cyj_LlDt.js +0 -0
  70. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-DiuFnwNK.js +0 -0
  71. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-DpL7z7tp.css +0 -0
  72. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-hvkDteAn.js +0 -0
  73. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/Plot-rbQz1TOM.css +0 -0
  74. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-BHm65SRq.css +0 -0
  75. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-BVZhQIwQ.js +0 -0
  76. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-Brt4-Qvr.js +0 -0
  77. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-BuEUMHwE.css +0 -0
  78. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-Cwxg0Ado.css +0 -0
  79. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-SYT5K-ds.css +0 -0
  80. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-VYjL3C7L.js +0 -0
  81. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-eEJXnQD5.js +0 -0
  82. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-i9JMIXVR.css +0 -0
  83. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/el-divider-u9f0bZWY.js +0 -0
  84. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-4hxJ_zbq.js +0 -0
  85. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-CETGMNio.css +0 -0
  86. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-CWfdj0DH.js +0 -0
  87. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-Cexhr_fn.css +0 -0
  88. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-CrzyEb9s.js +0 -0
  89. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-D_Cw0sbX.js +0 -0
  90. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-Dd6Bavnk.js +0 -0
  91. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-O8P0XkxB.css +0 -0
  92. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-Sq2gI4sE.css +0 -0
  93. {trackplot-0.5.3 → trackplot-0.5.4}/ui/assets/index-ns9n7-F7.css +0 -0
  94. {trackplot-0.5.3 → trackplot-0.5.4}/ui/vite.svg +0 -0
@@ -1,34 +1,30 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: trackplot
3
- Version: 0.5.3
3
+ Version: 0.5.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
- License: BSD-3
6
- Author: ygidtu
7
- Author-email: ygidtu@gmail.com
8
- Requires-Python: >=3.10,<3.13
9
- Classifier: License :: Other/Proprietary License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Requires-Dist: adjusttext (>=0.7.3,<0.8.0)
15
- Requires-Dist: cairocffi (>=1.4.0,<2.0.0)
16
- Requires-Dist: click (>=8.1.3,<9.0.0)
17
- Requires-Dist: click-option-group (>=0.5.5,<0.6.0)
18
- Requires-Dist: filetype (>=1.2.0,<2.0.0)
19
- Requires-Dist: flask (>=2.3.2,<3.0.0)
20
- Requires-Dist: hicmatrix (>=17,<18)
21
- Requires-Dist: loguru (>=0.6.0,<0.7.0)
22
- Requires-Dist: matplotlib (>=3.6.3,<4.0.0)
23
- Requires-Dist: numpy (>=1.24.1,<2.0.0)
24
- Requires-Dist: pandas (>=1.5.3,<2.0.0)
25
- Requires-Dist: pybigwig (>=0.3.18,<0.4.0)
26
- Requires-Dist: pysam (>=0.21.0,<0.22.0)
27
- Requires-Dist: requests (>=2.28.2,<3.0.0)
28
- Requires-Dist: scipy (>=1.10.0,<2.0.0)
29
- Requires-Dist: seaborn (>=0.12.2,<0.13.0)
30
- Requires-Dist: xmltodict (>=0.13.0,<0.14.0)
5
+ Author-email: ygidtu <ygidtu@gmail.com>
6
+ License-Expression: BSD-3-Clause
7
+ Requires-Python: >=3.11
31
8
  Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: adjusttext>=1.3.0
11
+ Requires-Dist: cairocffi>=1.7.1
12
+ Requires-Dist: click>=8.2.1
13
+ Requires-Dist: click-option-group>=0.5.7
14
+ Requires-Dist: filetype>=1.2.0
15
+ Requires-Dist: flask>=3.1.1
16
+ Requires-Dist: hicmatrix>=17.2
17
+ Requires-Dist: loguru>=0.7.3
18
+ Requires-Dist: matplotlib>=3.10.3
19
+ Requires-Dist: numpy>=2.3.0
20
+ Requires-Dist: pandas>=2.3.0
21
+ Requires-Dist: pybigwig>=0.3.24
22
+ Requires-Dist: pysam>=0.23.3
23
+ Requires-Dist: requests>=2.32.4
24
+ Requires-Dist: scipy>=1.15.3
25
+ Requires-Dist: seaborn>=0.13.2
26
+ Requires-Dist: xmltodict>=0.14.2
27
+ Dynamic: license-file
32
28
 
33
29
  # trackplot
34
30
 
@@ -298,4 +294,3 @@ contact [Yiming Zhang](https://github.com/ygidtu) or
298
294
  If you use the tool in your publication, please cite by
299
295
 
300
296
  [Zhang Y, Zhou R, Liu L, et al. Trackplot: A flexible toolkit for combinatorial analysis of genomic data[J]. PLoS computational biology, 2023, 19(9): e1011477.](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011477)
301
-
@@ -0,0 +1,48 @@
1
+ [project]
2
+ name = "trackplot"
3
+ version = "0.5.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
+ authors = [
6
+ { name = "ygidtu", email = "ygidtu@gmail.com" }
7
+ ]
8
+ license = "BSD-3-Clause"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ dependencies = [
12
+ "adjusttext>=1.3.0",
13
+ "cairocffi>=1.7.1",
14
+ "click>=8.2.1",
15
+ "click-option-group>=0.5.7",
16
+ "filetype>=1.2.0",
17
+ "flask>=3.1.1",
18
+ "hicmatrix>=17.2",
19
+ "loguru>=0.7.3",
20
+ "matplotlib>=3.10.3",
21
+ "numpy>=2.3.0",
22
+ "pandas>=2.3.0",
23
+ "pybigwig>=0.3.24",
24
+ "pysam>=0.23.3",
25
+ "requests>=2.32.4",
26
+ "scipy>=1.15.3",
27
+ "seaborn>=0.13.2",
28
+ "xmltodict>=0.14.2",
29
+ ]
30
+
31
+
32
+ [build-system]
33
+ requires = ["setuptools>=65.0", "wheel"]
34
+ build-backend = "setuptools.build_meta"
35
+
36
+
37
+ [tool.setuptools.packages.find]
38
+ # 搜索目前目录下的trackplot和ui及其子文件夹
39
+ where = ["."]
40
+ include = ["trackplot*", "ui*"] # 通配符匹配所有子包
41
+
42
+
43
+ [tool.setuptools.package-data]
44
+ # 不限定父目录(等号前为父目录),包含其下匹配特定正则的文件
45
+ "*" = [
46
+ "pyproject.toml", "*"
47
+ ]
48
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -30,7 +30,7 @@ logging.getLogger('matplotlib.font_manager').setLevel(logging.ERROR)
30
30
  faulthandler.enable()
31
31
 
32
32
 
33
- __version__ = "0.5.3"
33
+ __version__ = "0.5.4"
34
34
  __author__ = "ygidtu & Ran Zhou"
35
35
  __email__ = "ygidtu@gmail.com"
36
36
 
@@ -190,9 +190,6 @@ def init_graph_coords(region: GenomicLoci, exons: Optional[List[List[int]]] = No
190
190
  for i in range(exons[1][1] +1, len(region)):
191
191
  steps[i] = step
192
192
  graph_coords = list(map(int, itertools.accumulate(steps)))
193
- #increments match exactly with original code
194
- #for i, e in enumerate(graph_objects):
195
- # print(f"{i}\t{e}")
196
193
  else:
197
194
  # if there is not any exons, just init graph_coords by region
198
195
  for i, j in enumerate(range(region.start, region.end + 1)):
@@ -764,6 +761,7 @@ def plot_density(
764
761
  if data.strand_aware:
765
762
  max_used_y_val = max(abs(min_used_y_val), max_used_y_val)
766
763
  min_used_y_val = -max(abs(min_used_y_val), max_used_y_val) if data.minus is not None else 0
764
+
767
765
  if jxns:
768
766
  # sort the junctions by intron length for better plotting look
769
767
  jxns_sorted_list = sorted(jxns.keys(), key=lambda x: (x.end - x.start, x.start, x.end), reverse=True)
@@ -775,11 +773,8 @@ def plot_density(
775
773
  min_junction_count = min(jxns.values())
776
774
  junction_count_gap = max_junction_count - min_junction_count
777
775
 
778
- #recorded_pts = set()
779
776
  jxn_numbers = []
780
-
781
777
  for jxn_idx, jxn in enumerate(jxns_sorted_list):
782
- #logger.info(f"junctions of {y_label}: {jxn} - {round(jxns[jxn], 2)}")
783
778
  leftss, rightss = jxn.start, jxn.end
784
779
 
785
780
  # junction must at least have one anchor located in plotted region
@@ -792,18 +787,15 @@ def plot_density(
792
787
  # the junction out of boundaries, set the boundaries as coordinate
793
788
  ss1_idx, ss1_modified = get_limited_index(leftss - region.start, len(graph_coords))
794
789
  ss2_idx, ss2_modified = get_limited_index(rightss - region.start, len(graph_coords))
795
- #logger.info(f"{y_label} ss1_idx {ss1_idx} ss1_modified {ss1_modified} ss2_idx {ss2_idx} ss2_modified {ss2_modified}")
796
790
  u"""
797
791
  @2019.01.14
798
792
  add two new variables to make it clear which one is index, which one is genomic site
799
793
  """
800
794
  ss1, ss2 = graph_coords[ss1_idx], graph_coords[ss2_idx]
801
795
  # AD = keep junction arcs on top
802
- #min_used_y_val = 1
803
796
  jxn_on_top = True
804
- min_used_y_val = 0
805
- # draw junction on bottom
806
- """
797
+
798
+ # draw junction on bottom
807
799
  if kwargs.get("density_by_strand"):
808
800
  jxn_on_top = jxn.strand == "+"
809
801
  else:
@@ -811,7 +803,7 @@ def plot_density(
811
803
  #jxn_on_top = True # AD - keep all junctions on same strand
812
804
  if abs(min_used_y_val) < max_used_y_val:
813
805
  min_used_y_val = -max_used_y_val
814
- """
806
+
815
807
  if fill_step == "post":
816
808
  ss1_idx = max(0, ss1_idx - 1)
817
809
  elif fill_step == "pre":
@@ -835,14 +827,7 @@ def plot_density(
835
827
  -right_dens - current_height,
836
828
  -right_dens if not ss2_modified else -right_dens - current_height
837
829
  ]
838
- """
839
- if sum(pts) > 0:
840
- pts_ = "_".join([str(x) for x in pts])
841
- while pts_ in recorded_pts:
842
- pts[1], pts[2] = pts[1] * 1.1, pts[2] * 1.1
843
- pts_ = "_".join([str(x) for x in pts])
844
- recorded_pts.add(pts_)
845
- """
830
+
846
831
  """
847
832
  @2018.12.26
848
833
  scale the junctions line width
@@ -853,39 +838,26 @@ def plot_density(
853
838
  else:
854
839
  line_width = 0
855
840
  #line_width = max(.5,np.log())
856
- #pts = [(ss1, pts[0]), (ss1, pts[1]), (ss2, pts[2]), (ss2, pts[3])]
857
-
858
841
 
859
- temp = np.linspace(0, 1.0, 100)
860
- bdist = beta.pdf(temp, 3, 3) # or 2, 2
861
- bdist /= np.max(bdist) # max = 1
862
- bdist *= jxns[jxn]
863
- pts_x = np.linspace(ss1, ss2, 100)
864
-
865
- #pts = [(ss1, 0), (ss1+5, jxns[jxn]), (ss2-5, jxns[jxn]), (ss2, 0)]
866
- path = Path(np.array([pts_x, bdist]).T)
867
- patch = PathPatch(path, facecolor='none', edgecolor="#BA55D3", linewidth=line_width)
868
- ax.add_patch(patch)
869
- """
870
- # pts = [(ss1, 0), (midpt-5, jxns[jxn]), (midpt+5, jxns[jxn]), (ss2, 0)]
842
+ pts = [(ss1, pts[0]), (ss1, pts[1]), (ss2, pts[2]), (ss2, pts[3])]
871
843
  ax.add_patch(PathPatch(Path(pts, [Path.MOVETO, Path.CURVE4, Path.CURVE4, Path.CURVE4]),
872
- ec="#BA55D3", lw=line_width, fc='none'))
873
- #ec=color, lw=line_width + 0.2, fc='none'))
874
- """
844
+ ec=color, lw=line_width + 0.2, fc='none'))
845
+
875
846
  if show_junction_number:
876
- t = ax.text( (ss1+ss2)/2, jxns[jxn] * 1.1,
877
- '{0}'.format(round(jxns[jxn], 2)),
878
- fontsize=junction_number_font_size, ha='center', va='center')
879
- #, backgroundcolor='w' ) AD - white here overrides transparency below
847
+ midpt = cubic_bezier(pts, .5)
848
+
849
+ t = ax.text(
850
+ midpt[0], midpt[1],
851
+ '{0}'.format(round(jxns[jxn], 2)),
852
+ fontsize=junction_number_font_size,
853
+ ha='center', va='center',
854
+ backgroundcolor='w'
855
+ )
856
+
880
857
  # @2018.12.19 transparent background
881
858
  t.set_bbox(dict(alpha=0))
882
859
  jxn_numbers.append(t)
883
860
 
884
- # AD - this adds a dot next to the counts
885
- #try:
886
- # adjust_text(jxn_numbers, force_text=(0.2, 0.2), arrowprops=dict(arrowstyle="-", color='black', lw=1))
887
- #except IndexError as err:
888
- # logger.debug(err)
889
861
 
890
862
  if obj and obj.title:
891
863
  ax.text(max(graph_coords) - len(obj.title), max_used_y_val, obj.title, color=color, fontsize=font_size)
@@ -0,0 +1,296 @@
1
+ Metadata-Version: 2.4
2
+ Name: trackplot
3
+ Version: 0.5.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
+ Author-email: ygidtu <ygidtu@gmail.com>
6
+ License-Expression: BSD-3-Clause
7
+ Requires-Python: >=3.11
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: adjusttext>=1.3.0
11
+ Requires-Dist: cairocffi>=1.7.1
12
+ Requires-Dist: click>=8.2.1
13
+ Requires-Dist: click-option-group>=0.5.7
14
+ Requires-Dist: filetype>=1.2.0
15
+ Requires-Dist: flask>=3.1.1
16
+ Requires-Dist: hicmatrix>=17.2
17
+ Requires-Dist: loguru>=0.7.3
18
+ Requires-Dist: matplotlib>=3.10.3
19
+ Requires-Dist: numpy>=2.3.0
20
+ Requires-Dist: pandas>=2.3.0
21
+ Requires-Dist: pybigwig>=0.3.24
22
+ Requires-Dist: pysam>=0.23.3
23
+ Requires-Dist: requests>=2.32.4
24
+ Requires-Dist: scipy>=1.15.3
25
+ Requires-Dist: seaborn>=0.13.2
26
+ Requires-Dist: xmltodict>=0.14.2
27
+ Dynamic: license-file
28
+
29
+ # trackplot
30
+
31
+ [![PyPI version](https://badge.fury.io/py/trackplot.svg)](https://pypi.org/project/trackplot/)
32
+ [![PyPI download](https://img.shields.io/pypi/dm/trackplot.svg)](https://pypi.org/project/trackplot/)
33
+ [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/trackplot/README.html)
34
+ [![Documentation Status](https://readthedocs.org/projects/trackplot/badge/?version=latest)](https://trackplot.readthedocs.io/en/latest/)
35
+ [![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%20v3-clause.svg)](https://www.gnu.org/licenses/agpl-3.0)
36
+ [![DOI](https://img.shields.io/badge/DOI-10.1101%2F2022.11.02.514803%20-blue)](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011477)
37
+
38
+ ---
39
+
40
+ ![](example/diagram.png)
41
+
42
+ [Tutorials](https://trackplot.readthedocs.io/en/latest/)
43
+
44
+ ## what is trackplot
45
+
46
+ 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.
47
+
48
+ ### Features of trackplot
49
+
50
+ 1. Support various file formats as input
51
+ 2. Support strand-aware coverage plot
52
+ 3. Visualize coverage by heatmap, including HiC diagram
53
+ 4. Visualize protein domain based the given gene id
54
+ 5. Demultiplex the single-cell RNA/ATAC-seq which used cell barcode into cell population
55
+ 6. Support visualizing individual full-length reads in read-by-read style
56
+ 7. Support visualize circRNA sequencing data
57
+
58
+ ## Input
59
+
60
+ trackplot supports almost NGS data format, including
61
+
62
+ - BAM
63
+ - Bed
64
+ - Depth file generated by `samtools depth`
65
+ - bigBed [[pyBigWig](https://github.com/deeptools/pyBigWig) optional]
66
+ - bigWig [[pyBigWig](https://github.com/deeptools/pyBigWig) optional]
67
+ - naive Hi-C format [[hicmatrix](https://github.com/deeptools/HiCMatrix) optional]
68
+
69
+
70
+ ## Output
71
+
72
+ The output will be a pdf and other image file formats which satisfy the requirement of the major journals,
73
+ and each track on output corresponds these datasets from config file.
74
+
75
+ ## Usage
76
+
77
+ Trackplot is based on **Python3** `(python_requires='>=3.8')`,
78
+ and we have simplified the installation process on the main page.
79
+ For a more comprehensive installation guide, please refer to [this link](./docs/installation.md).
80
+
81
+ ### For impatient
82
+
83
+ ```shell
84
+ pip install trackplot
85
+ trackplot --help
86
+
87
+ # or using trackplot by conda
88
+
89
+ conda create -n trackplot -c bioconda -c conda-forge trackplot
90
+ conda activate trackplot
91
+ trackplot --help
92
+
93
+ ```
94
+
95
+ ###### Notes
96
+ >1. For users on **Microsoft Windows**, **Mac (Apple Silicon)**,
97
+ and **other ARM platforms**,
98
+ please note that Trackplot may not be installable via PyPI or Conda due to compatibility issues with pysam,
99
+ pybigwig, and hicmatrix libraries on these platforms.
100
+ As an alternative, we recommend using the Docker image for installation.
101
+
102
+ >2. If you encounter a `segment fault` error during multiple processing,
103
+ you may want to consider using the Docker image or running the command with the `-p 1` flag.
104
+
105
+ >3. If you encounter the message `Please install pyBigWig and hicmatrix`,
106
+ you can refer to the official documentation for [pyBigWig](https://github.com/deeptools/pyBigWig) and
107
+ [hicmatrix](https://github.com/deeptools/HiCMatrix) to fulfill their requirements and resolve the issue.
108
+
109
+ <details><summary>Using trackplot by a command line (click me) </summary>
110
+ <p>
111
+
112
+
113
+ 1. install from PyPi
114
+
115
+ Before running this command line, please check python (>=3.8) was installed.
116
+
117
+ ```bash
118
+ pip install trackplot
119
+ # __Note:__ We noticed some pypi mirrors are not syncing some packages we depend on,
120
+ # therefore please try another pypi mirror once you encounter
121
+ # `No local packages or working download links found for xxx`
122
+ ```
123
+
124
+ ---
125
+
126
+ 2. [AppImage](https://github.com/ygidtu/trackplot/releases) (Linux/WSL x86_64 platform only)
127
+
128
+ For a binary version of the tool and more comprehensive information, please visit [this link](./docs/installation.md).
129
+
130
+ ```bash
131
+ # example with version v0.3.5, please using your interested version according to your needs
132
+ export VERSION=0.3.5
133
+ chmod +x trackplot-${VERSION}-x86_64.AppImage
134
+ ./trackplot-${VERSION}-x86_64.AppImage --help
135
+ ```
136
+
137
+ ---
138
+
139
+ 3. using docker image
140
+
141
+ ```bash
142
+ docker pull ygidtu/trackplot
143
+ docker run --rm ygidtu/trackplot --help
144
+ ```
145
+
146
+ ---
147
+
148
+
149
+ 4. install from bioconda
150
+
151
+ ```bash
152
+ # install trackplot into the default conda env
153
+ conda install -c bioconda -c conda-forge trackplot
154
+
155
+ # or install trackplot into an isolated environments
156
+ conda create -n trackplot -c bioconda -c conda-forge trackplot
157
+
158
+ # activate the trackplot environment and execute the command line tool
159
+ conda activate trackplot
160
+ trackplot --help
161
+ ```
162
+
163
+
164
+ </p>
165
+ </details>
166
+
167
+
168
+ ---
169
+ <details><summary>Using trackplot by a local webserver (click me) </summary>
170
+ <p>
171
+
172
+
173
+ 1. [AppImage](https://github.com/ygidtu/trackplot/releases) (Linux/WSL x86_64 only)
174
+
175
+ ```bash
176
+ # example with version v0.3.3, please using your interested version according to your needs
177
+ export VERSION=0.3.3
178
+ gunzip trackplot-${VERSION}-x86_64.AppImage
179
+ chmod +x trackplot-${VERSION}-x86_64.AppImage
180
+ ./trackplot-${VERSION}-x86_64.AppImage --help
181
+
182
+ # startup webserver
183
+ ./trackplot-${VERSION}-x86_64.AppImage --start-server --host 0.0.0.0 --port 5000 --plots ./plots
184
+ ```
185
+
186
+ **Note:** the `--plots` were required while using appimages
187
+
188
+ ---
189
+
190
+ 2. Running using command line
191
+
192
+ ```bash
193
+ trackplot --start-server --host 0.0.0.0 --port 5000 --plots ./plots
194
+ ```
195
+
196
+ 3. Running using docker image
197
+
198
+ ```bash
199
+ docker pull ygidtu/trackplot
200
+
201
+ # Deploy the server
202
+ docker run --name trackplot \
203
+ --rm -v $PWD/example:/data -v $PWD/plots/:/plots -p 5000:5000 ygidtu/trackplot \
204
+ --start-server \
205
+ --host 0.0.0.0 \
206
+ --data /data \
207
+ --plots /plots
208
+ ```
209
+
210
+ `-p`: public and private port for the server, default:5000(public):5000(private)
211
+ - `-v`, `--volume`: mount the working directory to docker container, for example, the `$PWD/data` could replace by the path to your directory contains all necessary data
212
+ - `--user`: prevent docker read and write file using root privileges
213
+
214
+ </p>
215
+ </details>
216
+
217
+ ---
218
+
219
+ ## Example
220
+
221
+ The `example` folder is downloaded from [here.](https://github.com/ygidtu/trackplot/archive/refs/heads/main.zip)
222
+ And a more detailed tutorial could be found at [here.](https://trackplot.readthedocs.io/en/latest/)
223
+
224
+ ```bash
225
+ # example of basic plot types
226
+ trackplot \
227
+ -e chr1:1270656-1284730:+ \
228
+ -r example/example.sorted.gtf.gz \
229
+ --interval example/interval_list.tsv \
230
+ --density example/density_list.tsv \
231
+ --show-junction-num \
232
+ --igv example/igv.tsv \
233
+ --heatmap example/heatmap_list.tsv \
234
+ --focus 1272656-1272656:1275656-1277656 \
235
+ --stroke 1275656-1277656:1277856-1278656@blue \
236
+ --sites 1271656,1271656,1272656 \
237
+ --line example/line_list.tsv \
238
+ -o example.png \
239
+ --dpi 300 \
240
+ --width 10 \
241
+ --height 1 \
242
+ --barcode example/barcode_list.tsv \
243
+ --domain --remove-duplicate-umi \
244
+ --normalize-format cpm \
245
+ --annotation-scale .3 \
246
+ -p 4
247
+ ```
248
+
249
+ if trackplot was installed by docker, here is the cmd
250
+
251
+ ```bash
252
+ ## The absolute path is required in Docker env.
253
+
254
+ cat $PWD/example/interval_list.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/interval_list.abspath.tsv
255
+ cat $PWD/example/density_list.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/density_list.abspath.tsv
256
+ cat $PWD/example/igv.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/igv.abspath.tsv
257
+ cat $PWD/example/heatmap_list.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/heatmap_list.abspath.tsv
258
+
259
+ docker run -v $PWD:$PWD -w $PWD --rm ygidtu/trackplot \
260
+ -e chr1:1270656-1284730:+ \
261
+ -r $PWD/example/example.sorted.gtf.gz \
262
+ --interval $PWD/example/interval_list.tsv \
263
+ --density $PWD/example/density_list.tsv \
264
+ --show-junction-num \
265
+ --igv $PWD/example/igv.tsv \
266
+ --heatmap $PWD/example/heatmap_list.tsv \
267
+ --focus 1272656-1272656:1275656-1277656 \
268
+ --stroke 1275656-1277656:1277856-1278656@blue \
269
+ --sites 1271656,1271656,1272656 \
270
+ --line $PWD/example/line_list.tsv \
271
+ -o example.png \
272
+ --dpi 300 \
273
+ --width 10 \
274
+ --height 1 \
275
+ --barcode $PWD/example/barcode_list.tsv \
276
+ --domain --remove-duplicate-umi \
277
+ --normalize-format cpm \
278
+ --annotation-scale .3 \
279
+ -p 4
280
+
281
+ ```
282
+
283
+ here is the [output file](https://raw.githubusercontent.com/ygidtu/trackplot/main/example/example.png).
284
+
285
+
286
+ ## Questions
287
+
288
+ Visit [issues](https://github.com/ygidtu/trackplot/issues) or
289
+ contact [Yiming Zhang](https://github.com/ygidtu) or
290
+ [Ran Zhou](https://github.com/zhou-ran)
291
+
292
+ ## Citation
293
+
294
+ If you use the tool in your publication, please cite by
295
+
296
+ [Zhang Y, Zhou R, Liu L, et al. Trackplot: A flexible toolkit for combinatorial analysis of genomic data[J]. PLoS computational biology, 2023, 19(9): e1011477.](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011477)
@@ -0,0 +1,91 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ trackplot/__init__.py
5
+ trackplot/cli.py
6
+ trackplot/plot.py
7
+ trackplot/plot_func.py
8
+ trackplot/plot_tests.py
9
+ trackplot/server.py
10
+ trackplot.egg-info/PKG-INFO
11
+ trackplot.egg-info/SOURCES.txt
12
+ trackplot.egg-info/dependency_links.txt
13
+ trackplot.egg-info/requires.txt
14
+ trackplot.egg-info/top_level.txt
15
+ trackplot/anno/AxLabel.py
16
+ trackplot/anno/__init__.py
17
+ trackplot/anno/theme.py
18
+ trackplot/base/CoordinateMap.py
19
+ trackplot/base/GenomicLoci.py
20
+ trackplot/base/Junction.py
21
+ trackplot/base/Protein.py
22
+ trackplot/base/ReadDepth.py
23
+ trackplot/base/Readder.py
24
+ trackplot/base/Stroke.py
25
+ trackplot/base/Transcript.py
26
+ trackplot/base/__init__.py
27
+ trackplot/base/pyUniprot.py
28
+ trackplot/conf/DomainSetting.py
29
+ trackplot/conf/__init__.py
30
+ trackplot/conf/config.py
31
+ trackplot/conf/drawing.py
32
+ trackplot/conf/ui.py
33
+ trackplot/file/ATAC.py
34
+ trackplot/file/Annotation.py
35
+ trackplot/file/Bam.py
36
+ trackplot/file/BedGraph.py
37
+ trackplot/file/Bigwig.py
38
+ trackplot/file/Depth.py
39
+ trackplot/file/Fasta.py
40
+ trackplot/file/File.py
41
+ trackplot/file/HiCMatrixTrack.py
42
+ trackplot/file/Junction.py
43
+ trackplot/file/Motif.py
44
+ trackplot/file/ReadSegments.py
45
+ trackplot/file/__init__.py
46
+ ui/index.html
47
+ ui/vite.svg
48
+ ui/assets/Home-7GzAh8lS.js
49
+ ui/assets/Home-BV58jH3t.js
50
+ ui/assets/Home-CDW3Zwoa.js
51
+ ui/assets/Home-DOO13BH7.js
52
+ ui/assets/Home-QmeAKOl4.js
53
+ ui/assets/Home-RdVPWns6.js
54
+ ui/assets/Home-jSR0MsHI.css
55
+ ui/assets/Home-zRV7yePL.css
56
+ ui/assets/Plot-BALbchCV.css
57
+ ui/assets/Plot-BmqHZ4QE.css
58
+ ui/assets/Plot-BrjU8Kwg.js
59
+ ui/assets/Plot-Bvyo6ju9.css
60
+ ui/assets/Plot-COvGnprQ.css
61
+ ui/assets/Plot-CTM-EDrj.js
62
+ ui/assets/Plot-Cnt8iJB8.js
63
+ ui/assets/Plot-Cyj_LlDt.js
64
+ ui/assets/Plot-DiuFnwNK.js
65
+ ui/assets/Plot-DpL7z7tp.css
66
+ ui/assets/Plot-hvkDteAn.js
67
+ ui/assets/Plot-rbQz1TOM.css
68
+ ui/assets/el-divider-BHm65SRq.css
69
+ ui/assets/el-divider-BVZhQIwQ.js
70
+ ui/assets/el-divider-Brt4-Qvr.js
71
+ ui/assets/el-divider-BuEUMHwE.css
72
+ ui/assets/el-divider-Cwxg0Ado.css
73
+ ui/assets/el-divider-DcvrsrBa.css
74
+ ui/assets/el-divider-IbBQ8ZK2.js
75
+ ui/assets/el-divider-SYT5K-ds.css
76
+ ui/assets/el-divider-VYjL3C7L.js
77
+ ui/assets/el-divider-eEJXnQD5.js
78
+ ui/assets/el-divider-i9JMIXVR.css
79
+ ui/assets/el-divider-u9f0bZWY.js
80
+ ui/assets/index-4hxJ_zbq.js
81
+ ui/assets/index-C4Mi9Kmf.js
82
+ ui/assets/index-CETGMNio.css
83
+ ui/assets/index-CWfdj0DH.js
84
+ ui/assets/index-Cexhr_fn.css
85
+ ui/assets/index-CrzyEb9s.js
86
+ ui/assets/index-D_Cw0sbX.js
87
+ ui/assets/index-Dd6Bavnk.js
88
+ ui/assets/index-DgEIiwRJ.css
89
+ ui/assets/index-O8P0XkxB.css
90
+ ui/assets/index-Sq2gI4sE.css
91
+ ui/assets/index-ns9n7-F7.css
@@ -0,0 +1,17 @@
1
+ adjusttext>=1.3.0
2
+ cairocffi>=1.7.1
3
+ click>=8.2.1
4
+ click-option-group>=0.5.7
5
+ filetype>=1.2.0
6
+ flask>=3.1.1
7
+ hicmatrix>=17.2
8
+ loguru>=0.7.3
9
+ matplotlib>=3.10.3
10
+ numpy>=2.3.0
11
+ pandas>=2.3.0
12
+ pybigwig>=0.3.24
13
+ pysam>=0.23.3
14
+ requests>=2.32.4
15
+ scipy>=1.15.3
16
+ seaborn>=0.13.2
17
+ xmltodict>=0.14.2
@@ -0,0 +1,2 @@
1
+ trackplot
2
+ ui
@@ -0,0 +1 @@
1
+ import{d as _,c as m,a as u,b as e,t as c,w as t,E as f,o as g,e as h,f as n,u as i,_ as y}from"./index-C4Mi9Kmf.js";import{E as k,a as w,m as E,v,b}from"./el-divider-IbBQ8ZK2.js";const x={name:"Home",data(){return{msg:"Welcome to trackplot App",example:"https://trackplot.readthedocs.io/en/latest/imgs/diagram.png"}}},C=_({...x,setup(B){return(r,a)=>{const s=k,l=w,o=h,p=f,d=b;return g(),m("div",null,[u("h1",null,c(r.msg),1),e(s),e(p,null,{default:t(()=>[e(o,{span:12,offset:3},{default:t(()=>[e(l,{type:"primary",href:"/#/plot"},{default:t(()=>[...a[0]||(a[0]=[n("Create your own plot",-1)])]),_:1})]),_:1}),e(o,{span:6},{default:t(()=>[e(l,{type:"primary",href:"https://github.com/ygidtu/trackplot/issues",icon:i(E)},{default:t(()=>[...a[1]||(a[1]=[n("Report bug at Github",-1)])]),_:1},8,["icon"]),e(s,{direction:"vertical"}),e(l,{type:"primary",icon:i(v),href:"https://trackplot.readthedocs.io/en/latest/web/"},{default:t(()=>[...a[2]||(a[2]=[n("Read the tutorial",-1)])]),_:1},8,["icon"])]),_:1}),e(o,{span:6})]),_:1}),e(s),e(p,null,{default:t(()=>[e(o,{span:20,offset:2},{default:t(()=>[e(d,{src:r.example,width:"100%"},null,8,["src"])]),_:1})]),_:1})])}}}),V=y(C,[["__scopeId","data-v-3d7de397"]]);export{V as default};