Skip to content

Commit 5e1c1e7

Browse files
authored
Merge pull request #27 from BergmannLab/v0.0.4
V0.0.4
2 parents ecaef18 + 6ce84dd commit 5e1c1e7

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

python/PascalX/pathway.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _genefusion_fuse(self,modules,chrs=None):
202202

203203
return COMPUTE_SET, FUSION_SET
204204

205-
def _genefusion(self,modules,method='auto',mode='auto',reqacc=1e-100,parallel=1,nobar=False,chrs=None):
205+
def _genefusion(self,modules,method='auto',mode='auto',reqacc=1e-100,parallel=1,nobar=False,chrs=None,autorescore=False):
206206

207207
COMPUTE_SET, FUSION_SET = self._genefusion_fuse(modules,chrs)
208208

@@ -214,7 +214,7 @@ def _genefusion(self,modules,method='auto',mode='auto',reqacc=1e-100,parallel=1,
214214
print("Scoring",len(SET),"missing (meta)-genes")
215215

216216
# Compute missing (meta)-genes
217-
R = self._genescorer.score(SET,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,autorescore=True)
217+
R = self._genescorer.score(SET,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,autorescore=autorescore)
218218

219219
#print(R)
220220
#print(FUSION_SET)
@@ -263,7 +263,7 @@ class chi2rank(pathwayscorer):
263263
264264
"""
265265

266-
def score(self,modules,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False,genes_only=False,chrs_only=None):
266+
def score(self,modules,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False,genes_only=False,chrs_only=None,autorescore=True):
267267
"""
268268
Scores a set of pathways/modules
269269
@@ -274,15 +274,17 @@ def score(self,modules,method='saddle',mode='auto',reqacc=1e-100,parallel=1,noba
274274
method(string): Method to use to evaluate tail probability ('auto','davies','ruben','satterthwaite','pearson','saddle')
275275
mode(string): Precision mode to use ('','128b','100d','auto')
276276
reqacc(float): requested accuracy
277+
autorescore(bool): Automatically try to re-score failed genes
277278
nobar(bool): Show progress bar
278279
genes_only(bool): Compute only (fused)-genescores (accessible via genescorer method)
279-
chrs_only(list): Only consider genes on listed chromosomes. None for all.
280+
chrs_only(list): Only consider genes on listed chromosomes. None for all
280281
"""
281282
tic = time.time()
282283

284+
283285
# Compute fusion sets
284286
if self._fuse:
285-
COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,chrs=chrs_only)
287+
COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,chrs=chrs_only,autorescore=autorescore)
286288
else:
287289
COMPUTE_SET,FUSION_SET,R = self._nogenefusion(modules)
288290

@@ -400,7 +402,7 @@ class chi2perm(pathwayscorer):
400402
Genes in the background gene sets are NOT fused.
401403
"""
402404

403-
def score(self,modules,samples=100000,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False):
405+
def score(self,modules,samples=100000,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False,autorescore=True):
404406
"""
405407
Scores a set of pathways/modules
406408
@@ -412,11 +414,12 @@ def score(self,modules,samples=100000,method='saddle',mode='auto',reqacc=1e-100,
412414
mode(string): Precision mode to use ('','128b','100d','auto')
413415
reqacc(float): requested accuracy
414416
nobar(bool): Show progress bar
415-
417+
autorescore(bool): Automatically try to re-score failed genes
418+
416419
"""
417420
# Compute fusion sets
418421
if self._fuse:
419-
COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar)
422+
COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,autorescore=autorescore)
420423
else:
421424
COMPUTE_SET,FUSION_SET,R = self._nogenefusion(modules)
422425

python/docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Welcome to PascalX's documentation!
77
===================================
88

9-
PascalX is a python3 library (`source <https://github.com/BergmannLab/PascalX>`_) for high precision gene and pathway scoring for GWAS summary statistics. Aggregation of SNP p-values to gene and pathway scores follows the `Pascal <https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004714>`_ methodology, which is based on :math:`\chi^2` statistics. The cummulative distribution function of the weighted :math:`\chi^2` distribution can be calculated approximately or exactly via a multi-precision C++ implementation of Ruben's and Davies algorithm. This allows to apply the Pascal methodology to modern UK BioBank scale GWAS. In addition, PascalX offers a novel coherence test between two different GWAS on the level of genes, based on the product-normal distribution, as described `here <https://doi.org/10.1101/2021.05.16.21257289>`_.
9+
PascalX is a python3 library (`source <https://github.com/BergmannLab/PascalX>`_) for high precision gene and pathway scoring for GWAS summary statistics. Aggregation of SNP p-values to gene and pathway scores follows the `Pascal <https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004714>`_ methodology, which is based on :math:`\chi^2` statistics. The cumulative distribution function of the weighted :math:`\chi^2` distribution can be calculated approximately or exactly via a multi-precision C++ implementation of Ruben's and Davies algorithm. This allows to apply the Pascal methodology to modern UK BioBank scale GWAS. In addition, PascalX offers a novel coherence test between two different GWAS on the level of genes, based on the product-normal distribution, as described `here <https://doi.org/10.1101/2021.05.16.21257289>`_.
1010

1111
**Highlights:**
1212

python/setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ def find_version(*file_paths):
4242
"numpy>=1.18.0",
4343
"seaborn>=0.11.0",
4444
"progressbar>=2.5",
45-
"docutils<0.18",
46-
"sphinx<6,>=1.6",
47-
"sphinx-rtd-theme>=0.5.0",
48-
"fastnumbers>=3.1.0"
49-
],
45+
"fastnumbers>=3.1.0",
46+
#"docutils<0.18",
47+
#"sphinx<6,>=1.6",
48+
#"sphinx-rtd-theme>=0.5.0",
49+
],
5050
setup_requires=["cffi","path.py"],
5151
cffi_modules=["hpstats.py:ffibuilder","wchissum.py:ffibuilder"],
5252
zip_safe=False,

0 commit comments

Comments
 (0)