Skip to content

Commit

Permalink
dependencies for doc generation removed as not needed for user and often
Browse files Browse the repository at this point in the history
lead to troubles; fixed in pw scoring for autorescore flag
  • Loading branch information
Dan-RAI committed Feb 6, 2023
1 parent 25f317e commit 6ce84dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
19 changes: 11 additions & 8 deletions python/PascalX/pathway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6ce84dd

Please sign in to comment.