pycmplot 0.1.0__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.1.0/LICENSE +21 -0
- pycmplot-0.1.0/PKG-INFO +182 -0
- pycmplot-0.1.0/README.md +158 -0
- pycmplot-0.1.0/pycmplot/__init__.py +43 -0
- pycmplot-0.1.0/pycmplot/_core.py +419 -0
- pycmplot-0.1.0/pycmplot/annotation.py +368 -0
- pycmplot-0.1.0/pycmplot/cli.py +229 -0
- pycmplot-0.1.0/pycmplot/constants.py +66 -0
- pycmplot-0.1.0/pycmplot/data/Homo_sapiens.GRCh37.geneinfo.tsv.gz +0 -0
- pycmplot-0.1.0/pycmplot/data/Homo_sapiens.GRCh38.geneinfo.tsv.gz +0 -0
- pycmplot-0.1.0/pycmplot/data/hg19ToHg38.over.chain +56506 -0
- pycmplot-0.1.0/pycmplot/io.py +342 -0
- pycmplot-0.1.0/pycmplot/liftover.py +111 -0
- pycmplot-0.1.0/pycmplot/plotting/circular.py +261 -0
- pycmplot-0.1.0/pycmplot/plotting/linear.py +375 -0
- pycmplot-0.1.0/pycmplot/resources.py +116 -0
- pycmplot-0.1.0/pycmplot/stats.py +106 -0
- pycmplot-0.1.0/pycmplot.egg-info/PKG-INFO +182 -0
- pycmplot-0.1.0/pycmplot.egg-info/SOURCES.txt +25 -0
- pycmplot-0.1.0/pycmplot.egg-info/dependency_links.txt +1 -0
- pycmplot-0.1.0/pycmplot.egg-info/entry_points.txt +2 -0
- pycmplot-0.1.0/pycmplot.egg-info/requires.txt +13 -0
- pycmplot-0.1.0/pycmplot.egg-info/top_level.txt +2 -0
- pycmplot-0.1.0/pyproject.toml +35 -0
- pycmplot-0.1.0/setup.cfg +31 -0
- pycmplot-0.1.0/setup.py +3 -0
pycmplot-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kevin Esoh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pycmplot-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pycmplot
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Multi-track circular and linear Manhattan plot generation for GWAS summary statistics
|
|
5
|
+
Author: Kevin Esoh
|
|
6
|
+
Author-email: Kevin Esoh <kesohku1@jhmi.edu>
|
|
7
|
+
License: MIT
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: pandas>=1.5
|
|
12
|
+
Requires-Dist: numpy>=1.23
|
|
13
|
+
Requires-Dist: matplotlib>=3.6
|
|
14
|
+
Requires-Dist: pillow>=9.0
|
|
15
|
+
Requires-Dist: pycirclize>=0.6
|
|
16
|
+
Requires-Dist: natsort>=8.0
|
|
17
|
+
Requires-Dist: adjustText>=0.8
|
|
18
|
+
Requires-Dist: pyliftover>=0.4
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest; extra == "dev"
|
|
21
|
+
Requires-Dist: black; extra == "dev"
|
|
22
|
+
Requires-Dist: ruff; extra == "dev"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# pycmplot
|
|
26
|
+
|
|
27
|
+
Multi-track **circular** and **linear** Manhattan plot generation for GWAS summary statistics.
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
|
31
|
+
| PACKAGE FOR CIRCULAR AND LINEAR MANHATTAN PLOTTING |
|
|
32
|
+
| Kevin Esoh, 2026 |
|
|
33
|
+
| kesohku1@jh.edu |
|
|
34
|
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
### From PyPI
|
|
42
|
+
```bash
|
|
43
|
+
pip install pycmplot
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### From source code
|
|
48
|
+
```bash
|
|
49
|
+
wget <url>
|
|
50
|
+
|
|
51
|
+
tar zxvf ...
|
|
52
|
+
|
|
53
|
+
cd pycmplot-xxx
|
|
54
|
+
|
|
55
|
+
pip install -e .
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### From GitHub
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/esohkevin/pycmplot.git
|
|
62
|
+
|
|
63
|
+
cd pycmplot
|
|
64
|
+
|
|
65
|
+
pip install -e .
|
|
66
|
+
|
|
67
|
+
# or
|
|
68
|
+
|
|
69
|
+
pip install -e . --break-system-packages
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Use python virtual environment if local installation is not possible
|
|
74
|
+
```bash
|
|
75
|
+
python -m venv ~/bin/pycmplot
|
|
76
|
+
|
|
77
|
+
source ~/bin/pycmplot/bin/activate
|
|
78
|
+
|
|
79
|
+
pip install --upgrade pip setuptools wheel
|
|
80
|
+
|
|
81
|
+
# then follow any of the installation steps above
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# Test the installation
|
|
86
|
+
```bash
|
|
87
|
+
pycmplot -h
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Dependencies
|
|
91
|
+
|
|
92
|
+
| Package | Purpose |
|
|
93
|
+
|---------|---------|
|
|
94
|
+
| pandas, numpy | Data loading & statistics |
|
|
95
|
+
| matplotlib | Plotting backend |
|
|
96
|
+
| pycirclize | Circular (Circos-style) tracks |
|
|
97
|
+
| natsort | Natural chromosome sorting |
|
|
98
|
+
| adjustText | Label collision avoidance |
|
|
99
|
+
| pyliftover | hg19 to hg38 coordinate conversion |
|
|
100
|
+
| Pillow | Image utilities |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Command-line usage
|
|
106
|
+
|
|
107
|
+
### Linear Manhattan (default)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pycmplot \
|
|
111
|
+
--sum_stats HbF.tsv.gz,MCV.txt.gz,MCH.tsv.gz \
|
|
112
|
+
--labels HbF,MCV,MCH \
|
|
113
|
+
--logp \
|
|
114
|
+
--signif_line \
|
|
115
|
+
--highlight \
|
|
116
|
+
--annotate GENE \
|
|
117
|
+
--output_dir ./results \
|
|
118
|
+
--output_format png \
|
|
119
|
+
--dpi 300
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Circular Manhattan
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pycmplot \
|
|
126
|
+
--sum_stats HbF.tsv.gz,MCV.tsv.gz \
|
|
127
|
+
--labels HbF,MCV \
|
|
128
|
+
--mode cm \
|
|
129
|
+
--logp \
|
|
130
|
+
--signif_threshold \
|
|
131
|
+
--plot_title "RBC Traits" \
|
|
132
|
+
--output_dir ./results
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Key options
|
|
136
|
+
|
|
137
|
+
| Flag | Description | Default |
|
|
138
|
+
|------|-------------|---------|
|
|
139
|
+
| `-s, --sum_stats` | Comma-separated sumstats files | **required** |
|
|
140
|
+
| `-l, --labels` | Comma-separated track labels | **required** |
|
|
141
|
+
| `-m, --mode` | `lm` linear or `cm` circular | `lm` |
|
|
142
|
+
| `-qq, --qq_plot` | Also generate a QQ-plot | off (coming soon...) |
|
|
143
|
+
| `--logp` | Plot -log10(p) | off |
|
|
144
|
+
| `-sig, --signif_threshold` | Genome-wide significance threshold | off (auto 0.05/N) |
|
|
145
|
+
| `-sigl, --signif_line` | Value for genome-wide significance line if different from `-sig` | `-sig` |
|
|
146
|
+
| `-sug, --suggest_threshold` | Suggestive significance line | off |
|
|
147
|
+
| `-hl, --highlight` | Highlight significant loci | off |
|
|
148
|
+
| `-a, --annotate` | Annotate with `SNP` or `GENE` | `SNP` |
|
|
149
|
+
| `-tp, --trim_pval` | Trim variants above this p-value for speed | off |
|
|
150
|
+
| `-st, --sort_track` | Sort tracks by `label` or `chrom_len` | input order |
|
|
151
|
+
| `-od, --output_dir` | Output directory | `.` |
|
|
152
|
+
| `-of, --output_format` | Output format (`png`, `pdf`, `svg`, `jpg`) | `png` |
|
|
153
|
+
|
|
154
|
+
Run `pycmplot -h` for the full option list.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Python API
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
from pycmplot import plot_linear
|
|
162
|
+
import pandas as pd
|
|
163
|
+
|
|
164
|
+
df1 = pd.read_csv("HbF.tsv.gz", sep="\t")
|
|
165
|
+
df2 = pd.read_csv("MCV.tsv.gz", sep="\t")
|
|
166
|
+
|
|
167
|
+
plot_linear(
|
|
168
|
+
tracks=[df1, df2],
|
|
169
|
+
track_labels=["HbF", "MCV"],
|
|
170
|
+
chr_col="CHR",
|
|
171
|
+
pos_col="POS",
|
|
172
|
+
p_col="P",
|
|
173
|
+
logp=True,
|
|
174
|
+
highlight=True,
|
|
175
|
+
plot_title="results/HbF_MCV.png",
|
|
176
|
+
figsize=(15, 8),
|
|
177
|
+
)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
_Under development_
|
pycmplot-0.1.0/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# pycmplot
|
|
2
|
+
|
|
3
|
+
Multi-track **circular** and **linear** Manhattan plot generation for GWAS summary statistics.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
|
7
|
+
| PACKAGE FOR CIRCULAR AND LINEAR MANHATTAN PLOTTING |
|
|
8
|
+
| Kevin Esoh, 2026 |
|
|
9
|
+
| kesohku1@jh.edu |
|
|
10
|
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### From PyPI
|
|
18
|
+
```bash
|
|
19
|
+
pip install pycmplot
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### From source code
|
|
24
|
+
```bash
|
|
25
|
+
wget <url>
|
|
26
|
+
|
|
27
|
+
tar zxvf ...
|
|
28
|
+
|
|
29
|
+
cd pycmplot-xxx
|
|
30
|
+
|
|
31
|
+
pip install -e .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### From GitHub
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/esohkevin/pycmplot.git
|
|
38
|
+
|
|
39
|
+
cd pycmplot
|
|
40
|
+
|
|
41
|
+
pip install -e .
|
|
42
|
+
|
|
43
|
+
# or
|
|
44
|
+
|
|
45
|
+
pip install -e . --break-system-packages
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Use python virtual environment if local installation is not possible
|
|
50
|
+
```bash
|
|
51
|
+
python -m venv ~/bin/pycmplot
|
|
52
|
+
|
|
53
|
+
source ~/bin/pycmplot/bin/activate
|
|
54
|
+
|
|
55
|
+
pip install --upgrade pip setuptools wheel
|
|
56
|
+
|
|
57
|
+
# then follow any of the installation steps above
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# Test the installation
|
|
62
|
+
```bash
|
|
63
|
+
pycmplot -h
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Dependencies
|
|
67
|
+
|
|
68
|
+
| Package | Purpose |
|
|
69
|
+
|---------|---------|
|
|
70
|
+
| pandas, numpy | Data loading & statistics |
|
|
71
|
+
| matplotlib | Plotting backend |
|
|
72
|
+
| pycirclize | Circular (Circos-style) tracks |
|
|
73
|
+
| natsort | Natural chromosome sorting |
|
|
74
|
+
| adjustText | Label collision avoidance |
|
|
75
|
+
| pyliftover | hg19 to hg38 coordinate conversion |
|
|
76
|
+
| Pillow | Image utilities |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Command-line usage
|
|
82
|
+
|
|
83
|
+
### Linear Manhattan (default)
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pycmplot \
|
|
87
|
+
--sum_stats HbF.tsv.gz,MCV.txt.gz,MCH.tsv.gz \
|
|
88
|
+
--labels HbF,MCV,MCH \
|
|
89
|
+
--logp \
|
|
90
|
+
--signif_line \
|
|
91
|
+
--highlight \
|
|
92
|
+
--annotate GENE \
|
|
93
|
+
--output_dir ./results \
|
|
94
|
+
--output_format png \
|
|
95
|
+
--dpi 300
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Circular Manhattan
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pycmplot \
|
|
102
|
+
--sum_stats HbF.tsv.gz,MCV.tsv.gz \
|
|
103
|
+
--labels HbF,MCV \
|
|
104
|
+
--mode cm \
|
|
105
|
+
--logp \
|
|
106
|
+
--signif_threshold \
|
|
107
|
+
--plot_title "RBC Traits" \
|
|
108
|
+
--output_dir ./results
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Key options
|
|
112
|
+
|
|
113
|
+
| Flag | Description | Default |
|
|
114
|
+
|------|-------------|---------|
|
|
115
|
+
| `-s, --sum_stats` | Comma-separated sumstats files | **required** |
|
|
116
|
+
| `-l, --labels` | Comma-separated track labels | **required** |
|
|
117
|
+
| `-m, --mode` | `lm` linear or `cm` circular | `lm` |
|
|
118
|
+
| `-qq, --qq_plot` | Also generate a QQ-plot | off (coming soon...) |
|
|
119
|
+
| `--logp` | Plot -log10(p) | off |
|
|
120
|
+
| `-sig, --signif_threshold` | Genome-wide significance threshold | off (auto 0.05/N) |
|
|
121
|
+
| `-sigl, --signif_line` | Value for genome-wide significance line if different from `-sig` | `-sig` |
|
|
122
|
+
| `-sug, --suggest_threshold` | Suggestive significance line | off |
|
|
123
|
+
| `-hl, --highlight` | Highlight significant loci | off |
|
|
124
|
+
| `-a, --annotate` | Annotate with `SNP` or `GENE` | `SNP` |
|
|
125
|
+
| `-tp, --trim_pval` | Trim variants above this p-value for speed | off |
|
|
126
|
+
| `-st, --sort_track` | Sort tracks by `label` or `chrom_len` | input order |
|
|
127
|
+
| `-od, --output_dir` | Output directory | `.` |
|
|
128
|
+
| `-of, --output_format` | Output format (`png`, `pdf`, `svg`, `jpg`) | `png` |
|
|
129
|
+
|
|
130
|
+
Run `pycmplot -h` for the full option list.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Python API
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from pycmplot import plot_linear
|
|
138
|
+
import pandas as pd
|
|
139
|
+
|
|
140
|
+
df1 = pd.read_csv("HbF.tsv.gz", sep="\t")
|
|
141
|
+
df2 = pd.read_csv("MCV.tsv.gz", sep="\t")
|
|
142
|
+
|
|
143
|
+
plot_linear(
|
|
144
|
+
tracks=[df1, df2],
|
|
145
|
+
track_labels=["HbF", "MCV"],
|
|
146
|
+
chr_col="CHR",
|
|
147
|
+
pos_col="POS",
|
|
148
|
+
p_col="P",
|
|
149
|
+
logp=True,
|
|
150
|
+
highlight=True,
|
|
151
|
+
plot_title="results/HbF_MCV.png",
|
|
152
|
+
figsize=(15, 8),
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
_Under development_
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
pycmplot
|
|
3
|
+
========
|
|
4
|
+
Multi-track circular and linear Manhattan plot generation for GWAS summary statistics.
|
|
5
|
+
|
|
6
|
+
Quickstart
|
|
7
|
+
----------
|
|
8
|
+
Command-line::
|
|
9
|
+
|
|
10
|
+
pycmplot -s file1.gz,file2.gz -l HbF,MCV --logp --mode lm
|
|
11
|
+
|
|
12
|
+
Python API::
|
|
13
|
+
|
|
14
|
+
from pycmplot.plotting import plot_linear, plot_circular
|
|
15
|
+
from pycmplot.stats import get_lead_snps
|
|
16
|
+
from pycmplot.annotation import get_hits_summary_table
|
|
17
|
+
|
|
18
|
+
Public surface
|
|
19
|
+
--------------
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from pycmplot.plotting.linear import plot_linear
|
|
23
|
+
from pycmplot.plotting.circular import plot_circular, compute_track_radii_dict
|
|
24
|
+
from pycmplot.stats import get_lead_snps, get_highlight_snps
|
|
25
|
+
from pycmplot.io import get_sumstats_and_merged_sector_list
|
|
26
|
+
from pycmplot.annotation import get_hits_summary_table
|
|
27
|
+
from pycmplot.constants import hg38_chr_lengths, BIOTYPE_WEIGHTS
|
|
28
|
+
from pycmplot.resources import ResourceConfig
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"plot_linear",
|
|
32
|
+
"plot_circular",
|
|
33
|
+
"compute_track_radii_dict",
|
|
34
|
+
"get_lead_snps",
|
|
35
|
+
"get_highlight_snps",
|
|
36
|
+
"get_sumstats_and_merged_sector_list",
|
|
37
|
+
"get_hits_summary_table",
|
|
38
|
+
"hg38_chr_lengths",
|
|
39
|
+
"BIOTYPE_WEIGHTS",
|
|
40
|
+
"ResourceConfig",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
__version__ = "0.1.0"
|