gwaslab 3.4.41__tar.gz → 3.4.43__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.
Potentially problematic release.
This version of gwaslab might be problematic. Click here for more details.
- {gwaslab-3.4.41/src/gwaslab.egg-info → gwaslab-3.4.43}/PKG-INFO +8 -3
- {gwaslab-3.4.41 → gwaslab-3.4.43}/README.md +6 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/pyproject.toml +3 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/bd_common_data.py +14 -1
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/bd_get_hapmap3.py +7 -3
- gwaslab-3.4.43/src/gwaslab/cache_manager.py +687 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_Sumstats.py +156 -138
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_SumstatsPair.py +15 -15
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_version.py +2 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/hm_harmonize_sumstats.py +558 -32
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/io_read_tabular.py +7 -7
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/io_to_formats.py +96 -21
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/io_to_pickle.py +1 -1
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/ldsc_ldscore.py +1 -1
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/qc_fix_sumstats.py +4 -11
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_calculate_ldmatrix.py +2 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_calculate_prs.py +2 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_ldsc.py +163 -110
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_plink_filter.py +2 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_run_clumping.py +2 -2
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_filter_value.py +27 -9
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_mqqplot.py +12 -11
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_trumpetplot.py +115 -4
- {gwaslab-3.4.41 → gwaslab-3.4.43/src/gwaslab.egg-info}/PKG-INFO +8 -3
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab.egg-info/SOURCES.txt +1 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab.egg-info/requires.txt +1 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/LICENSE +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/LICENSE_before_v3.4.39 +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/setup.cfg +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/__init__.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/bd_config.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/bd_download.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/chrx_par/chrx_par_hg19.bed.gz +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/chrx_par/chrx_par_hg38.bed.gz +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/formatbook.json +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/hapmap3_SNPs/hapmap3_db150_hg19.snplist.gz +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/hapmap3_SNPs/hapmap3_db151_hg38.snplist.gz +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/high_ld/high_ld_hla_hg19.bed.gz +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/high_ld/high_ld_hla_hg38.bed.gz +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/data/reference.json +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_Log.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_Phenotypes.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_SumstatsT.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_Sumstats_summary.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_meta.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/g_vchange_status.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/hm_casting.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/hm_rsid_to_chrpos.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/io_preformat_input.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/io_read_ldsc.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/ldsc_irwls.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/ldsc_jackknife.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/ldsc_parse.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/ldsc_regressions.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/ldsc_sumstats.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/qc_check_datatype.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/run_script.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_gwascatalog.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_ldproxyfinder.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_process_h5.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_process_ref.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_run_2samplemr.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_run_coloc.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_ex_run_susie.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_calculate_gc.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_calculate_power.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_convert_h2.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_correct_winnerscurse.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_fill_data.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_get_density.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/util_in_get_sig.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_aux_annotate_plot.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_aux_quickfix.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_aux_reposition_text.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_aux_save_figure.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_compare_af.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_compare_effect.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_forestplot.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_miamiplot.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_miamiplot2.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_qqplot.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_regionalplot.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_rg_heatmap.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab/viz_plot_stackedregional.py +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab.egg-info/dependency_links.txt +0 -0
- {gwaslab-3.4.41 → gwaslab-3.4.43}/src/gwaslab.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gwaslab
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.43
|
|
4
4
|
Summary: A collection of handy tools for GWAS SumStats
|
|
5
5
|
Author-email: Yunye <yunye@gwaslab.com>
|
|
6
6
|
Project-URL: Homepage, https://cloufield.github.io/gwaslab/
|
|
@@ -24,6 +24,7 @@ Requires-Dist: liftover>=1.1.13
|
|
|
24
24
|
Requires-Dist: scikit-allel>=1.3.5
|
|
25
25
|
Requires-Dist: pyensembl==2.2.3
|
|
26
26
|
Requires-Dist: gtfparse==1.3.0
|
|
27
|
+
Requires-Dist: h5py>=3.10.0
|
|
27
28
|
|
|
28
29
|
# GWASLab
|
|
29
30
|
|
|
@@ -50,7 +51,7 @@ Warning: Known issues of GWASLab are summarized in [https://cloufield.github.io/
|
|
|
50
51
|
### install via pip
|
|
51
52
|
|
|
52
53
|
```
|
|
53
|
-
pip install gwaslab==3.4.
|
|
54
|
+
pip install gwaslab==3.4.41
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
```python
|
|
@@ -89,7 +90,7 @@ Create a Python 3.9 environment and install gwaslab using pip:
|
|
|
89
90
|
```
|
|
90
91
|
conda env create -n gwaslab_test -c conda-forge python=3.9
|
|
91
92
|
conda activate gwaslab
|
|
92
|
-
pip install gwaslab==3.4.
|
|
93
|
+
pip install gwaslab==3.4.41
|
|
93
94
|
```
|
|
94
95
|
|
|
95
96
|
or create a new environment using yml file [environment_3.4.40.yml](https://github.com/Cloufield/gwaslab/blob/main/environment_3.4.40.yml)
|
|
@@ -193,6 +194,7 @@ dependencies:
|
|
|
193
194
|
- adjustText==0.8
|
|
194
195
|
- pysam==0.19
|
|
195
196
|
- pyensembl==2.2.3
|
|
197
|
+
- h5py==3.10.0
|
|
196
198
|
```
|
|
197
199
|
|
|
198
200
|
## How to cite
|
|
@@ -201,6 +203,9 @@ dependencies:
|
|
|
201
203
|
## Sample Data
|
|
202
204
|
- Sample GWAS data used in GWASLab is obtained from: http://jenger.riken.jp/ (Suzuki, Ken, et al. "Identification of 28 new susceptibility loci for type 2 diabetes in the Japanese population." Nature genetics 51.3 (2019): 379-386.).
|
|
203
205
|
|
|
206
|
+
## Acknowledgement
|
|
207
|
+
|
|
208
|
+
Thanks to @sup3rgiu, @soumickmj and @gmauro for their contributions to the source codes.
|
|
204
209
|
|
|
205
210
|
## Contacts
|
|
206
211
|
* Github: [https://github.com/Cloufield/gwaslab](https://github.com/Cloufield/gwaslab)
|
|
@@ -23,7 +23,7 @@ Warning: Known issues of GWASLab are summarized in [https://cloufield.github.io/
|
|
|
23
23
|
### install via pip
|
|
24
24
|
|
|
25
25
|
```
|
|
26
|
-
pip install gwaslab==3.4.
|
|
26
|
+
pip install gwaslab==3.4.41
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
```python
|
|
@@ -62,7 +62,7 @@ Create a Python 3.9 environment and install gwaslab using pip:
|
|
|
62
62
|
```
|
|
63
63
|
conda env create -n gwaslab_test -c conda-forge python=3.9
|
|
64
64
|
conda activate gwaslab
|
|
65
|
-
pip install gwaslab==3.4.
|
|
65
|
+
pip install gwaslab==3.4.41
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
or create a new environment using yml file [environment_3.4.40.yml](https://github.com/Cloufield/gwaslab/blob/main/environment_3.4.40.yml)
|
|
@@ -166,6 +166,7 @@ dependencies:
|
|
|
166
166
|
- adjustText==0.8
|
|
167
167
|
- pysam==0.19
|
|
168
168
|
- pyensembl==2.2.3
|
|
169
|
+
- h5py==3.10.0
|
|
169
170
|
```
|
|
170
171
|
|
|
171
172
|
## How to cite
|
|
@@ -174,6 +175,9 @@ dependencies:
|
|
|
174
175
|
## Sample Data
|
|
175
176
|
- Sample GWAS data used in GWASLab is obtained from: http://jenger.riken.jp/ (Suzuki, Ken, et al. "Identification of 28 new susceptibility loci for type 2 diabetes in the Japanese population." Nature genetics 51.3 (2019): 379-386.).
|
|
176
177
|
|
|
178
|
+
## Acknowledgement
|
|
179
|
+
|
|
180
|
+
Thanks to @sup3rgiu, @soumickmj and @gmauro for their contributions to the source codes.
|
|
177
181
|
|
|
178
182
|
## Contacts
|
|
179
183
|
* Github: [https://github.com/Cloufield/gwaslab](https://github.com/Cloufield/gwaslab)
|
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "gwaslab"
|
|
10
|
-
version = "3.4.
|
|
10
|
+
version = "3.4.43"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Yunye", email="yunye@gwaslab.com" },
|
|
13
13
|
]
|
|
@@ -27,7 +27,8 @@ dependencies = [
|
|
|
27
27
|
"liftover>=1.1.13",
|
|
28
28
|
"scikit-allel>=1.3.5",
|
|
29
29
|
"pyensembl==2.2.3",
|
|
30
|
-
"gtfparse==1.3.0"
|
|
30
|
+
"gtfparse==1.3.0",
|
|
31
|
+
"h5py>=3.10.0"
|
|
31
32
|
]
|
|
32
33
|
|
|
33
34
|
requires-python = ">=3.9,<=3.10"
|
|
@@ -298,9 +298,22 @@ def gtf_to_protein_coding(gtfpath,log=Log(),verbose=True):
|
|
|
298
298
|
|
|
299
299
|
return protein_coding_path
|
|
300
300
|
|
|
301
|
+
####################################################################################################################
|
|
302
|
+
# From BioPython: https://github.com/biopython/biopython/blob/c5a6b1374267d769b19c1022b4b45472316e78b4/Bio/Seq.py#L36
|
|
303
|
+
def _maketrans(complement_mapping):
|
|
304
|
+
"""Make a python string translation table.
|
|
305
|
+
|
|
306
|
+
Arguments:
|
|
307
|
+
- complement_mapping - a dictionary.
|
|
301
308
|
|
|
302
|
-
|
|
309
|
+
Returns a translation table (a bytes object of length 256) for use with
|
|
310
|
+
the python string's translate method.
|
|
303
311
|
|
|
312
|
+
Compatible with lower case and upper case sequences.
|
|
313
|
+
"""
|
|
314
|
+
keys = "".join(complement_mapping.keys()).encode("ASCII")
|
|
315
|
+
values = "".join(complement_mapping.values()).encode("ASCII")
|
|
316
|
+
return bytes.maketrans(keys + keys.lower(), values + values.lower())
|
|
304
317
|
|
|
305
318
|
####################################################################################################################
|
|
306
319
|
|
|
@@ -12,7 +12,7 @@ from gwaslab.qc_fix_sumstats import finished
|
|
|
12
12
|
#A P-value
|
|
13
13
|
#A signed summary statistic (beta, OR, log odds, Z-score, etc)
|
|
14
14
|
|
|
15
|
-
def gethapmap3(sumstats,rsid="rsID",chrom="CHR", pos="POS", ea="EA", nea="NEA",build="19", verbose=True, match_allele= True, log=Log()):
|
|
15
|
+
def gethapmap3(sumstats,rsid="rsID",chrom="CHR", pos="POS", ea="EA", nea="NEA",build="19", verbose=True, match_allele= True, how="inner", log=Log()):
|
|
16
16
|
##start function with col checking##########################################################
|
|
17
17
|
_start_line = "extract HapMap3 SNPs"
|
|
18
18
|
_end_line = "extracting HapMap3 SNPs"
|
|
@@ -47,7 +47,7 @@ def gethapmap3(sumstats,rsid="rsID",chrom="CHR", pos="POS", ea="EA", nea="NEA",b
|
|
|
47
47
|
#rsid A1 A2 #CHROM POS
|
|
48
48
|
#rs3094315 G A 1 752566
|
|
49
49
|
|
|
50
|
-
if rsid in sumstats.columns:
|
|
50
|
+
if rsid in sumstats.columns and how=="inner":
|
|
51
51
|
output = sumstats.loc[sumstats[rsid].isin(hapmap3_ref["rsid"].values),:].copy()
|
|
52
52
|
return output
|
|
53
53
|
|
|
@@ -56,11 +56,15 @@ def gethapmap3(sumstats,rsid="rsID",chrom="CHR", pos="POS", ea="EA", nea="NEA",b
|
|
|
56
56
|
sumstats ["chr:pos"] = sumstats[chrom].astype("string")+":"+sumstats[pos].astype("string")
|
|
57
57
|
hapmap3_ref["chr:pos"] = hapmap3_ref["#CHROM"]+":"+hapmap3_ref["POS"]
|
|
58
58
|
hapmap3_ref = hapmap3_ref.rename(columns={"rsid":"rsID"})
|
|
59
|
-
output = pd.merge(sumstats,hapmap3_ref.loc[:,["chr:pos","rsID"]+additional_cols],left_on="chr:pos",right_on="chr:pos",how=
|
|
59
|
+
output = pd.merge(sumstats,hapmap3_ref.loc[:,["chr:pos","rsID"]+additional_cols],left_on="chr:pos",right_on="chr:pos",how=how,suffixes=('', '_hapmap3')).copy()
|
|
60
60
|
if match_allele:
|
|
61
61
|
log.write(" -Checking if alleles are same...")
|
|
62
62
|
is_matched = ((output[ea].astype("string") == output["A1"]) & (output[nea].astype("string") == output["A2"])) \
|
|
63
63
|
| ((output[ea].astype("string") == output["A2"]) & (output[nea].astype("string") == output["A1"]))
|
|
64
|
+
if how=="right":
|
|
65
|
+
is_matched = ((output[ea].astype("string") == output["A1"]) & (output[nea].astype("string") == output["A2"])) \
|
|
66
|
+
| ((output[ea].astype("string") == output["A2"]) & (output[nea].astype("string") == output["A1"])) | output[ea].isna()
|
|
67
|
+
|
|
64
68
|
log.write(" -Variants with macthed alleles: {}".format(sum(is_matched)))
|
|
65
69
|
output = output.loc[is_matched,:]
|
|
66
70
|
output = output.drop(columns=["chr:pos"]+additional_cols)
|