diff --git a/python/PascalX/pathway.py b/python/PascalX/pathway.py index 7e77347..f02f528 100755 --- a/python/PascalX/pathway.py +++ b/python/PascalX/pathway.py @@ -202,7 +202,7 @@ def _genefusion_fuse(self,modules,chrs=None): return COMPUTE_SET, FUSION_SET - def _genefusion(self,modules,method='auto',mode='auto',reqacc=1e-100,parallel=1,nobar=False,chrs=None): + def _genefusion(self,modules,method='auto',mode='auto',reqacc=1e-100,parallel=1,nobar=False,chrs=None,autorescore=False): COMPUTE_SET, FUSION_SET = self._genefusion_fuse(modules,chrs) @@ -214,7 +214,7 @@ def _genefusion(self,modules,method='auto',mode='auto',reqacc=1e-100,parallel=1, print("Scoring",len(SET),"missing (meta)-genes") # Compute missing (meta)-genes - R = self._genescorer.score(SET,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,autorescore=True) + R = self._genescorer.score(SET,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,autorescore=autorescore) #print(R) #print(FUSION_SET) @@ -263,7 +263,7 @@ class chi2rank(pathwayscorer): """ - def score(self,modules,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False,genes_only=False,chrs_only=None): + def score(self,modules,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False,genes_only=False,chrs_only=None,autorescore=True): """ Scores a set of pathways/modules @@ -274,15 +274,17 @@ def score(self,modules,method='saddle',mode='auto',reqacc=1e-100,parallel=1,noba method(string): Method to use to evaluate tail probability ('auto','davies','ruben','satterthwaite','pearson','saddle') mode(string): Precision mode to use ('','128b','100d','auto') reqacc(float): requested accuracy + autorescore(bool): Automatically try to re-score failed genes nobar(bool): Show progress bar genes_only(bool): Compute only (fused)-genescores (accessible via genescorer method) - chrs_only(list): Only consider genes on listed chromosomes. None for all. + chrs_only(list): Only consider genes on listed chromosomes. None for all """ tic = time.time() + # Compute fusion sets if self._fuse: - COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,chrs=chrs_only) + COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,chrs=chrs_only,autorescore=autorescore) else: COMPUTE_SET,FUSION_SET,R = self._nogenefusion(modules) @@ -400,7 +402,7 @@ class chi2perm(pathwayscorer): Genes in the background gene sets are NOT fused. """ - def score(self,modules,samples=100000,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False): + def score(self,modules,samples=100000,method='saddle',mode='auto',reqacc=1e-100,parallel=1,nobar=False,autorescore=True): """ Scores a set of pathways/modules @@ -412,11 +414,12 @@ def score(self,modules,samples=100000,method='saddle',mode='auto',reqacc=1e-100, mode(string): Precision mode to use ('','128b','100d','auto') reqacc(float): requested accuracy nobar(bool): Show progress bar - + autorescore(bool): Automatically try to re-score failed genes + """ # Compute fusion sets if self._fuse: - COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar) + COMPUTE_SET,FUSION_SET,R = self._genefusion(modules,method=method,mode=mode,reqacc=reqacc,parallel=parallel,nobar=nobar,autorescore=autorescore) else: COMPUTE_SET,FUSION_SET,R = self._nogenefusion(modules) diff --git a/python/docs/source/index.rst b/python/docs/source/index.rst index aef46b3..d06bfc4 100644 --- a/python/docs/source/index.rst +++ b/python/docs/source/index.rst @@ -6,7 +6,7 @@ Welcome to PascalX's documentation! =================================== -PascalX is a python3 library (`source `_) for high precision gene and pathway scoring for GWAS summary statistics. Aggregation of SNP p-values to gene and pathway scores follows the `Pascal `_ 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 `_. +PascalX is a python3 library (`source `_) for high precision gene and pathway scoring for GWAS summary statistics. Aggregation of SNP p-values to gene and pathway scores follows the `Pascal `_ 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 `_. **Highlights:** diff --git a/python/setup.py b/python/setup.py index 413ae00..4dbd39c 100755 --- a/python/setup.py +++ b/python/setup.py @@ -42,11 +42,11 @@ def find_version(*file_paths): "numpy>=1.18.0", "seaborn>=0.11.0", "progressbar>=2.5", - "docutils<0.18", - "sphinx<6,>=1.6", - "sphinx-rtd-theme>=0.5.0", - "fastnumbers>=3.1.0" - ], + "fastnumbers>=3.1.0", + #"docutils<0.18", + #"sphinx<6,>=1.6", + #"sphinx-rtd-theme>=0.5.0", + ], setup_requires=["cffi","path.py"], cffi_modules=["hpstats.py:ffibuilder","wchissum.py:ffibuilder"], zip_safe=False,