diff --git a/CGATReport/Stats.py b/CGATReport/Stats.py index 2704745..3f20269 100644 --- a/CGATReport/Stats.py +++ b/CGATReport/Stats.py @@ -750,12 +750,15 @@ def doMannWhitneyUTest(xvals, yvals): if len(xvals) == 0 or len(yvals) == 0: result = Result() else: - r_result = R['wilcox.test'](xvals, yvals, paired=False) - result = Result().fromR( - (("pvalue", 'p.value'), - ('alternative', None), - ('method', None)), - r_result) + if R: + r_result = R['wilcox.test'](xvals, yvals, paired=False) + result = Result().fromR( + (("pvalue", 'p.value'), + ('alternative', None), + ('method', None)), + r_result) + else: + raise ValueError("rpy2 not available") result.xobservations = len(xvals) result.yobservations = len(yvals) diff --git a/CGATReport/Tracker.py b/CGATReport/Tracker.py index bc49f44..e03d076 100644 --- a/CGATReport/Tracker.py +++ b/CGATReport/Tracker.py @@ -22,12 +22,6 @@ import sqlalchemy.exc as exc import sqlalchemy.engine -# for rpy2 for data frames -try: - from rpy2.robjects import r as R -except ImportError: - R = None - from CGATReport import Utils from CGATReport import Stats diff --git a/requires.txt b/requires.txt index c0cf105..f27c9b0 100644 --- a/requires.txt +++ b/requires.txt @@ -8,16 +8,18 @@ pandas>=0.16.0 patsy>=0.2.1 statsmodels>=0.5.0 seaborn>=0.3.1 -rpy2>=2.6.0 ggplot>=0.6.8 sphinx>=1.0.5 sphinxcontrib-programoutput>=0.8 sqlalchemy>=0.7.0 -web.py>=0.37 +# Optional dependency +# web.py>=0.37 openpyxl>=2.0.3 xlwt>=0.7.4 mpld3>=0.2 pillow>=2.7.0 +# rpy2 now an optional module +# rpy2>=2.6.0 # Disabled, as it requires pytz==2013b, which # conflicts with other packages that require a # more recent pytz.