Skip to content

Commit

Permalink
making rpy2 an optional dependency to avoid libreadline issues on conda
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHeger committed Jan 13, 2016
1 parent 8d0307b commit 07a2648
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
15 changes: 9 additions & 6 deletions CGATReport/Stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions CGATReport/Tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions requires.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 07a2648

Please sign in to comment.