Skip to content

Commit

Permalink
0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoqing Fang committed Jun 23, 2017
1 parent 8586c7d commit f19e035
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gseapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from .enrichr import enrichr
from .parser import get_library_name

__version__='0.8.0'
__version__='0.8.1'


2 changes: 1 addition & 1 deletion gseapy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# or args = argparser.parse_args() will throw bugs!!!


__version__ = '0.8.0'
__version__ = '0.8.1'

def main():
"""The Main function/pipeline for GSEAPY."""
Expand Down
7 changes: 2 additions & 5 deletions gseapy/gsea.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ def _plotting(self, rank_metric, results, res2d,

for gs in top_term:
hit = results.get(gs)['hit_index']
gs = gs.replace('/','_').replace(":","_")
"""
gsea_plot(rank_metric=rank_metric, enrich_term=gs, hit_ind=hit,
nes=results.get(gs)['nes'], pval=results.get(gs)['pval'], fdr=results.get(gs)['fdr'],
RES=results.get(gs)['rank_ES'], phenoPos=phenoPos, phenoNeg=phenoNeg, figsize=figsize,
format=format, outdir=outdir, module=module)
"""
#return fig obj to save.
pool.apply_async(gsea_plot, args=(rank_metric, gs, hit, results.get(gs)['nes'],
results.get(gs)['pval'],results.get(gs)['fdr'],
results.get(gs)['rank_ES'],
Expand All @@ -121,7 +119,6 @@ def _plotting(self, rank_metric, results, res2d,
#no values need to be returned
for gs in top_term:
hit = results.get(gs)['hit_index']
gs = gs.replace('/','_').replace(":","_")
pool_heat.apply_async(heatmap, args=(datAB.iloc[hit], gs, outdir, 0,
(width, len(hit)/2), format))
#heatmap(datAB.iloc[hit], gs, outdir, 0, (width, len(hit)/2), format)
Expand Down Expand Up @@ -151,7 +148,7 @@ def _save_results(self, zipdata, outdir, module, gmt, rank_metric, permutation_t
rdict['hit_index'] = ind
res[gs] = rdict

res_df = DataFrame.from_dict(res, orient='index')
res_df = pd.DataFrame.from_dict(res, orient='index')
res_df.index.name = 'Term'
res_df.sort_values(by='fdr', inplace=True)
res_df.drop(['rank_ES','hit_index'], axis=1, inplace=True)
Expand Down Expand Up @@ -492,7 +489,7 @@ def run(self):
weighted_score_type=self.weighted_score_type,
correl_vector=correl_vector)[2]
#plotting
fig = gsea_plot(rank_metric, enrich_term, hit_ind, nes, pval,
gsea_plot(rank_metric, enrich_term, hit_ind, nes, pval,
fdr, RES, phenoPos, phenoNeg, self.figsize,
self.format, self.outdir, self.module)

Expand Down
2 changes: 2 additions & 0 deletions gseapy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def heatmap(df, term, outdir, axis=0, figsize=(5,5), format='png'):
ax.spines[side].set_visible(False)
cbar.ax.spines[side].set_visible(False)
#cbar.ax.set_title('',loc='left')
term = term.replace('/','_').replace(":","_")
canvas.print_figure("{a}/{b}.heatmap.{c}".format(a=outdir, b=term, c=format),
bbox_inches='tight')

Expand Down Expand Up @@ -197,6 +198,7 @@ def gsea_plot(rank_metric, enrich_term, hit_ind, nes, pval, fdr, RES,
fig.subplots_adjust(hspace=0)
#fig.tight_layout()
#plt.close(fig)
enrich_term = enrich_term.replace('/','_').replace(":","_")
canvas.print_figure('{0}/{1}.{2}.{3}'.format(outdir, enrich_term, module, format),
bbox_inches='tight', dpi=300,)
return
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import sys, os
from setuptools import setup

__version__='0.8.0'
__version__='0.8.1'

if sys.argv[-1] == 'publish':
os.system("python setup.py sdist bdist_egg register upload")
os.system("python setup.py sdist bdist_wheel register upload")
print("You probably want to also tag the version now:")
print(" git tag -a %s -m 'version %s'" % (__version__,__version__))
print(" git push --tags")
Expand Down

0 comments on commit f19e035

Please sign in to comment.