Platform: Windows 10 Linux Subsystem, rpy2 = 2.8.1, edgeR = 3.14.0, limma = 3.29.0, all installed through conda
I'm trying to use R Bioconductor libraries, specifically limma and edgeR, inside the jupyter notebook along with rpy2. However, I am running into issues. I am able to successfully load the libraries in the R shell, but I get an error message when I try to do it in the jupyter notebook:
---------------------------------------------------------------------------
RRuntimeError Traceback (most recent call last)
<ipython-input-4-97eee1ac695c> in <module>()
----> 1 get_ipython().run_cell_magic(u'R', u'', u'library(limma)')
/home/alex/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell)
2113 magic_arg_s = self.var_expand(line, stack_depth)
2114 with self.builtin_trap:
-> 2115 result = fn(magic_arg_s, cell)
2116 return result
2117
<decorator-gen-126> in R(self, line, cell, local_ns)
/home/alex/anaconda2/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
186 # but it's overkill for just that one bit of state.
187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
189
190 if callable(arg):
/home/alex/anaconda2/lib/python2.7/site-packages/rpy2/ipython/rmagic.pyc in R(self, line, cell, local_ns)
663 ro.r.assign(input, localconverter.py2ri(val))
664
--> 665 tmpd = self.setup_graphics(args)
666
667 text_output = ''
/home/alex/anaconda2/lib/python2.7/site-packages/rpy2/ipython/rmagic.pyc in setup_graphics(self, args)
413 # Note: that %% is to pass into R for interpolation there
414 ro.r.png("%s/Rplots%%03d.png" % tmpd_fix_slashes,
--> 415 **argdict)
416 elif self.device == 'svg':
417 self.cairo.CairoSVG("%s/Rplot.svg" % tmpd_fix_slashes,
/home/alex/anaconda2/lib/python2.7/site-packages/rpy2/robjects/functions.pyc in __call__(self, *args, **kwargs)
176 v = kwargs.pop(k)
177 kwargs[r_k] = v
--> 178 return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
179
180 pattern_link = re.compile(r'\\link\{(.+?)\}')
/home/alex/anaconda2/lib/python2.7/site-packages/rpy2/robjects/functions.pyc in __call__(self, *args, **kwargs)
104 for k, v in kwargs.items():
105 new_kwargs[k] = conversion.py2ri(v)
--> 106 res = super(Function, self).__call__(*new_args, **new_kwargs)
107 res = conversion.ri2ro(res)
108 return res
RRuntimeError: Error in (function (filename = "Rplot%03d.png", width = 480, height = 480, :
X11 module cannot be loaded