pycmplot 0.4.0__tar.gz → 0.4.1__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.
- {pycmplot-0.4.0/pycmplot.egg-info → pycmplot-0.4.1}/PKG-INFO +3 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/README.md +2 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/__init__.py +1 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/_core.py +0 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/cache.py +1 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/plotting/circular.py +4 -5
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/plotting/linear.py +36 -8
- {pycmplot-0.4.0 → pycmplot-0.4.1/pycmplot.egg-info}/PKG-INFO +3 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pyproject.toml +1 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/setup.cfg +1 -1
- {pycmplot-0.4.0 → pycmplot-0.4.1}/LICENSE +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/benchmark/bench_python.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/benchmark/build_composite_figure.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/benchmark/collect_results.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/benchmark/generate_multi_sumstats.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/benchmark/generate_sumstats.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/docs-bak/conf.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/__main__.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/annotation.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/cli.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/constants.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/data/Homo_sapiens.GRCh37.geneinfo.tsv.gz +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/data/Homo_sapiens.GRCh38.geneinfo.tsv.gz +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/data/hg18ToHg38.over.chain.gz +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/data/hg19ToHg38.over.chain.gz +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/io.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/liftover.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/plotting/__init__.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/plotting/qq.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/resources.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot/stats.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/__init__.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/__main__.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/_core.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/annotation.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/cache.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/cli.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/constants.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/io.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/liftover.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/plotting/__init__.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/plotting/circular.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/plotting/linear.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/plotting/qq.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/resources.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot-bak/stats.py +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot.egg-info/SOURCES.txt +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot.egg-info/dependency_links.txt +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot.egg-info/entry_points.txt +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot.egg-info/requires.txt +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/pycmplot.egg-info/top_level.txt +0 -0
- {pycmplot-0.4.0 → pycmplot-0.4.1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycmplot
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Multi-track circular and linear Manhattan plot generation for GWAS summary statistics
|
|
5
5
|
Author: Kevin Esoh
|
|
6
6
|
Author-email: Kevin Esoh <kesohku1@jh.edu>
|
|
@@ -43,9 +43,11 @@ Dynamic: license-file
|
|
|
43
43
|
<h1 align="center">Multi-track circular and linear Manhattan plotting in Python.</h1>
|
|
44
44
|
</div>
|
|
45
45
|
|
|
46
|
+
<!--
|
|
46
47
|
<p align="center">
|
|
47
48
|
<img width="600" height="400" src="https://github.com/esohkevin/pycmplot/blob/main/docs/pycmplot-logo-circular.png">
|
|
48
49
|
</p>
|
|
50
|
+
-->
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
```
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
<h1 align="center">Multi-track circular and linear Manhattan plotting in Python.</h1>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
+
<!--
|
|
7
8
|
<p align="center">
|
|
8
9
|
<img width="600" height="400" src="https://github.com/esohkevin/pycmplot/blob/main/docs/pycmplot-logo-circular.png">
|
|
9
10
|
</p>
|
|
11
|
+
-->
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
```
|
|
@@ -303,7 +303,6 @@ def main() -> None:
|
|
|
303
303
|
signif_line = signif_line,
|
|
304
304
|
signif_lines = signif_lines,
|
|
305
305
|
highlight = highlight,
|
|
306
|
-
highlight_thresh = highlight_thresh,
|
|
307
306
|
highlight_color = highlight_color,
|
|
308
307
|
highlight_line = highlight_line,
|
|
309
308
|
highlight_line_color = highlight_line_color,
|
|
@@ -738,7 +738,7 @@ def write_hits_overlay(
|
|
|
738
738
|
def _write(p: Path) -> None:
|
|
739
739
|
with open(p, "w", encoding="utf-8") as fh:
|
|
740
740
|
fh.write(HITS_HEADER_COMMENT)
|
|
741
|
-
merged.to_csv(fh, sep="\t", index=False)
|
|
741
|
+
merged.to_csv(fh, sep="\t", index=False, na_rep='NA')
|
|
742
742
|
|
|
743
743
|
_atomic_write(hits_path, _write)
|
|
744
744
|
|
|
@@ -385,7 +385,6 @@ def plot_circular(
|
|
|
385
385
|
chrom_label_size: float = 6,
|
|
386
386
|
signif_line: Optional[bool | float] = None,
|
|
387
387
|
highlight: bool = False,
|
|
388
|
-
highlight_thresh: float = None,
|
|
389
388
|
highlight_color: str = 'brown',
|
|
390
389
|
highlight_line: bool = False,
|
|
391
390
|
highlight_line_color: str = 'grey',
|
|
@@ -455,8 +454,6 @@ def plot_circular(
|
|
|
455
454
|
line. Default ``5e-8``.
|
|
456
455
|
highlight : bool, optional
|
|
457
456
|
Render significant-locus variants in brown. Default ``False``.
|
|
458
|
-
highlight_thresh : float, optional
|
|
459
|
-
P-value threshold for locus highlighting. Default ``5e-8``.
|
|
460
457
|
highlight_color : str, optional
|
|
461
458
|
Color of highlighted positions when *highlight* is ``True``.
|
|
462
459
|
Default ``brown``.
|
|
@@ -809,8 +806,10 @@ def plot_circular(
|
|
|
809
806
|
]
|
|
810
807
|
circos.ax.legend(
|
|
811
808
|
handles=handles,
|
|
812
|
-
loc="upper left",
|
|
813
|
-
bbox_to_anchor=(-0.05, -0.0),
|
|
809
|
+
#loc="upper left",
|
|
810
|
+
#bbox_to_anchor=(-0.05, -0.0),
|
|
811
|
+
loc="upper right",
|
|
812
|
+
bbox_to_anchor=(1.05, 1.1),
|
|
814
813
|
title="Highlighted Categories",
|
|
815
814
|
fontsize=track_label_size,
|
|
816
815
|
title_fontsize=track_label_size,
|
|
@@ -967,8 +967,10 @@ def plot_linearm(
|
|
|
967
967
|
label_col: Optional[str] = 'SNP',
|
|
968
968
|
chr_order: Optional[list[str]] = None,
|
|
969
969
|
chr_spacing: float = 9e6,
|
|
970
|
+
chrom_label_size: float = 6,
|
|
970
971
|
track_heights: Optional[list[float]] = None,
|
|
971
972
|
linear_track_spacing: float = 0.10,
|
|
973
|
+
track_label_size: float = 6,
|
|
972
974
|
annot_rail_frac: float = 0.95,
|
|
973
975
|
point_size: float = 8,
|
|
974
976
|
colors: Optional[list[str]] = ['steelblue','silver'],
|
|
@@ -978,6 +980,7 @@ def plot_linearm(
|
|
|
978
980
|
fig_format: Optional[str] = None,
|
|
979
981
|
dpi: int = 300,
|
|
980
982
|
figsize: Optional[list[float]] = [10, 4],
|
|
983
|
+
ax: Optional[plt.Axes] = None,
|
|
981
984
|
):
|
|
982
985
|
"""Core rendering engine for the multi-track stacked linear Manhattan plot.
|
|
983
986
|
|
|
@@ -1025,6 +1028,8 @@ def plot_linearm(
|
|
|
1025
1028
|
chr_spacing : float, optional
|
|
1026
1029
|
Gap in base-pairs inserted between consecutive chromosomes on the
|
|
1027
1030
|
x-axis. Default ``9e6``.
|
|
1031
|
+
chrom_label_size : float, optional
|
|
1032
|
+
Chromosome label font size. Default ``6``.
|
|
1028
1033
|
track_heights : list of float, optional
|
|
1029
1034
|
Relative height ratios for the gridspec rows. The first element
|
|
1030
1035
|
controls the annotation sub-panel; subsequent elements control the
|
|
@@ -1033,6 +1038,8 @@ def plot_linearm(
|
|
|
1033
1038
|
linear_track_spacing : float, optional
|
|
1034
1039
|
Vertical ``hspace`` between tracks as a fraction of average track
|
|
1035
1040
|
height. Default ``0.10``.
|
|
1041
|
+
track_label_size : float, optional
|
|
1042
|
+
Track (sumstat) label font size. Default ``6``.
|
|
1036
1043
|
annot_rail_frac : float, optional
|
|
1037
1044
|
Fraction of horizontal space covering the center of the annotation track within
|
|
1038
1045
|
which to place annotation texts. Default ``0.98`` (annotation texts will cover
|
|
@@ -1066,6 +1073,11 @@ def plot_linearm(
|
|
|
1066
1073
|
Output resolution in dots per inch. Default ``300``.
|
|
1067
1074
|
figsize : tuple of (float, float), optional
|
|
1068
1075
|
Figure dimensions ``(width, height)`` in inches. Default ``(15, 9)``.
|
|
1076
|
+
ax : matplotlib.axes.Axes, optional
|
|
1077
|
+
Target Matplotlib cartesian axis on which to render the linear plot.
|
|
1078
|
+
If ``None`` (default), a new standalone figure is initialized automatically.
|
|
1079
|
+
When *ax* is supplied, automatic figure saving via *output_dir* and
|
|
1080
|
+
*plot_title* is bypassed to facilitate multi-panel composition.
|
|
1069
1081
|
|
|
1070
1082
|
Returns
|
|
1071
1083
|
-------
|
|
@@ -1226,7 +1238,6 @@ def plot_linearm(
|
|
|
1226
1238
|
data_total = sum(data_heights)
|
|
1227
1239
|
y_lab_pos = data_total / (2 * total_height)
|
|
1228
1240
|
|
|
1229
|
-
|
|
1230
1241
|
fig = plt.figure(figsize=figsize)
|
|
1231
1242
|
gs = fig.add_gridspec(
|
|
1232
1243
|
expected_n, 1,
|
|
@@ -1322,7 +1333,7 @@ def plot_linearm(
|
|
|
1322
1333
|
transform=ax.transAxes,
|
|
1323
1334
|
ha="left", va="center",
|
|
1324
1335
|
rotation=-90,
|
|
1325
|
-
fontsize=
|
|
1336
|
+
fontsize=track_label_size,
|
|
1326
1337
|
)
|
|
1327
1338
|
|
|
1328
1339
|
if highlight:
|
|
@@ -1362,12 +1373,6 @@ def plot_linearm(
|
|
|
1362
1373
|
zorder=3,
|
|
1363
1374
|
rasterized=True,
|
|
1364
1375
|
)
|
|
1365
|
-
# Vertical lines across all data tracks at highlight positions
|
|
1366
|
-
if highlight_line:
|
|
1367
|
-
for x in sig["x"].values:
|
|
1368
|
-
for _ax in loop_axes:
|
|
1369
|
-
_ax.axvline(x, color=highlight_line_color, alpha=0.1, linewidth=0.2,
|
|
1370
|
-
linestyle="--", zorder=0)
|
|
1371
1376
|
|
|
1372
1377
|
if sig_lines is not None and i < len(sig_lines):
|
|
1373
1378
|
sl = sig_lines[i]
|
|
@@ -1380,6 +1385,14 @@ def plot_linearm(
|
|
|
1380
1385
|
|
|
1381
1386
|
ax.set_xlim(-left_pad, xmax)
|
|
1382
1387
|
|
|
1388
|
+
|
|
1389
|
+
# Vertical lines across all data tracks at highlight positions
|
|
1390
|
+
if highlight_line:
|
|
1391
|
+
for x in annot_df['x'].values:
|
|
1392
|
+
for _ax in loop_axes:
|
|
1393
|
+
_ax.axvline(x, color=highlight_line_color, alpha=0.1, linewidth=0.2,
|
|
1394
|
+
linestyle="--", zorder=4)
|
|
1395
|
+
|
|
1383
1396
|
# ------------------------------------------------------------------
|
|
1384
1397
|
# Annotation track
|
|
1385
1398
|
# ------------------------------------------------------------------
|
|
@@ -1558,7 +1571,9 @@ def plot_linear(
|
|
|
1558
1571
|
annotation_size: float = 8,
|
|
1559
1572
|
label_col: Optional[str] = None,
|
|
1560
1573
|
chr_spacing: Optional[float] = 9e6,
|
|
1574
|
+
chrom_label_size: float = 6,
|
|
1561
1575
|
linear_track_spacing: Optional[float] = None,
|
|
1576
|
+
track_label_size: float = 6,
|
|
1562
1577
|
annot_rail_frac: Optional[float] = 0.98,
|
|
1563
1578
|
colors: list[str] = ['steelblue','silver'],
|
|
1564
1579
|
plot_title: Optional[str] = None,
|
|
@@ -1568,6 +1583,7 @@ def plot_linear(
|
|
|
1568
1583
|
output_format: Optional[str] = 'png',
|
|
1569
1584
|
output_dir: Optional[str] = '.',
|
|
1570
1585
|
figsize: Optional[list[float]] = [10, 4],
|
|
1586
|
+
ax: Optional[plt.Axes] = None,
|
|
1571
1587
|
):
|
|
1572
1588
|
"""Generate a multi-track stacked linear Manhattan plot.
|
|
1573
1589
|
|
|
@@ -1608,9 +1624,13 @@ def plot_linear(
|
|
|
1608
1624
|
default ``'label'``).
|
|
1609
1625
|
chr_spacing : float, optional
|
|
1610
1626
|
Horizontal gap between chromosomes in base-pairs. Default ``9e6``.
|
|
1627
|
+
chrom_label_size : float, optional
|
|
1628
|
+
Chromosome label font size. Default ``6``.
|
|
1611
1629
|
linear_track_spacing : float, optional
|
|
1612
1630
|
Vertical space between tracks as a fraction of average track height.
|
|
1613
1631
|
Default ``0.10``.
|
|
1632
|
+
track_label_size : float, optional
|
|
1633
|
+
Track (sumstat) label font size. Default ``6``.
|
|
1614
1634
|
annot_rail_frac : float, optional
|
|
1615
1635
|
Fraction of horizontal space covering the center of the annotation track within
|
|
1616
1636
|
which to place annotation texts. Default ``0.98`` (annotation texts will cover
|
|
@@ -1640,6 +1660,11 @@ def plot_linear(
|
|
|
1640
1660
|
Directory in which to save the output files. Default ``'.'``.
|
|
1641
1661
|
figsize : tuple of (float, float), optional
|
|
1642
1662
|
Figure dimensions ``(width, height)`` in inches. Default ``(15, 9)``.
|
|
1663
|
+
ax : matplotlib.axes.Axes, optional
|
|
1664
|
+
Target Matplotlib cartesian axis on which to render the linear plot.
|
|
1665
|
+
If ``None`` (default), a new standalone figure is initialized automatically.
|
|
1666
|
+
When *ax* is supplied, automatic figure saving via *output_dir* and
|
|
1667
|
+
*plot_title* is bypassed to facilitate multi-panel composition.
|
|
1643
1668
|
|
|
1644
1669
|
Returns
|
|
1645
1670
|
-------
|
|
@@ -1712,8 +1737,10 @@ def plot_linear(
|
|
|
1712
1737
|
annot_df=hits_table if hits_table is not None and not hits_table.empty else None,
|
|
1713
1738
|
label_col=label,
|
|
1714
1739
|
chr_spacing=chr_spacing,
|
|
1740
|
+
chrom_label_size=chrom_label_size,
|
|
1715
1741
|
track_heights=track_heights,
|
|
1716
1742
|
linear_track_spacing=linear_track_spacing,
|
|
1743
|
+
track_label_size=track_label_size,
|
|
1717
1744
|
annot_rail_frac=annot_rail_frac,
|
|
1718
1745
|
colors=colors,
|
|
1719
1746
|
sig_lines=signif_lines,
|
|
@@ -1723,6 +1750,7 @@ def plot_linear(
|
|
|
1723
1750
|
dpi=dpi,
|
|
1724
1751
|
fig_format=output_format,
|
|
1725
1752
|
figsize=figsize,
|
|
1753
|
+
ax=ax,
|
|
1726
1754
|
)
|
|
1727
1755
|
|
|
1728
1756
|
return axes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycmplot
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Multi-track circular and linear Manhattan plot generation for GWAS summary statistics
|
|
5
5
|
Author: Kevin Esoh
|
|
6
6
|
Author-email: Kevin Esoh <kesohku1@jh.edu>
|
|
@@ -43,9 +43,11 @@ Dynamic: license-file
|
|
|
43
43
|
<h1 align="center">Multi-track circular and linear Manhattan plotting in Python.</h1>
|
|
44
44
|
</div>
|
|
45
45
|
|
|
46
|
+
<!--
|
|
46
47
|
<p align="center">
|
|
47
48
|
<img width="600" height="400" src="https://github.com/esohkevin/pycmplot/blob/main/docs/pycmplot-logo-circular.png">
|
|
48
49
|
</p>
|
|
50
|
+
-->
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|