The "rest" can be an external program, a remote program or a library made for a different language. To a certain degree all languages became good at accessing external resources but Python excels at it. We learned how to access remote APIs. We will only learn here how to deal with C and R.
There are ways to extend Python with C and C++, but it is cumbersome. There are different interpreters for Python, most popular being CPython which is the standard one and PyPy which is a just-in-time compiler and interpreter having speeds that match .js and Java. In principle the extension code needs to be re-written in order to run on different interpreters.
Here is an example extension C code, written for the CPython interpreter. When compiled the spam function is callable from Python, so Python was extended with a new module.function():
static PyObject *
spam_system(PyObject *self, PyObject *args)
{
const char *command;
int sts;
if (!PyArg_ParseTuple(args, "s", &command))
return NULL;
sts = system(command);
return Py_BuildValue("i", sts);
}
Enter Cython.
Cython is a static compiler that makes it possible to combine C with Python. It is heavily promoted and used by the Scipy stack and it can run on PyPy too. The following code is written in Cython, and as you can see it does differ in one substantial way to Python: variable are statically declared. Another major difference is that this code does not run on an interpreter, instead it is compiled into C and assembled in machine code. A similar project exists for Java, called Jython.
def primes(int kmax): # The argument will be converted to int or raise a TypeError.
cdef int n, k, i # These variables are declared with C types.
cdef int p[1000] # Another C type
result = [] # A Python type
if kmax > 1000:
kmax = 1000
k = 0
n = 2
while k < kmax:
i = 0
while i < k and n % p[i] != 0:
i = i + 1
if i == k:
p[k] = n
k = k + 1
result.append(n)
n = n + 1
return result
SWIG
While Cython is cool, it does require you to write new code. If you have a C/C++ codebase and you want it in Python, perhaps the best option is SWIG. This is a multilanguage library, one can extend Tcl, Perl, Java and C# with it. Let's say you have the following pure C code containing a number of different functions:
/* File : example.c */
#include <time.h>
double My_variable = 3.0;
int fact(int n) {
if (n <= 1) return 1;
else return n*fact(n-1);
}
int my_mod(int x, int y) {
return (x%y);
}
char *get_time()
{
time_t ltime;
time(<ime);
return ctime(<ime);
}
All you have to do is write an interface of the code to SWIG:
/* example.i */
%module example
%{
/* Put header files here or function declarations like below */
extern double My_variable;
extern int fact(int n);
extern int my_mod(int x, int y);
extern char *get_time();
%}
extern double My_variable;
extern int fact(int n);
extern int my_mod(int x, int y);
extern char *get_time();
Run a sequence of commands that compiles and links the code with special SWIG signatures. This is slightly different depending on the OS, what you see is Unix/Linux modus operandi.
swig -python example.i
gcc -c example.c example_wrap.c -I/usr/local/include/python2.7
ld -shared example.o example_wrap.o -o _example.so
On Python the result is a module like any other:
>>> import example
>>> example.fact(5)
120
>>> example.my_mod(7,3)
1
>>> example.get_time()
'Sun Feb 11 23:01:07 1996'
While some Python and R programmers don't talk to each other, the languages do. It is possible to call Python from R (rpy) and R from Python (rPython). From our perspective it is more natural to call R from Python, in fact the library is much more developed in this direction.
It requires a special module called rpy2. We will make use of R again in the 'omics chapters. For now let us use this example slightly modified for rpy2. You can see the whole output from R and you can also interact with R environment through the execution.
But, how to get the required rpy2 module?
Google 'conda install rpy2' and feel lucky, the page at https://anaconda.org/r/rpy2 says:
conda install rpy2
This failed on my Ubuntu 64 bits system, it seems that Anaconda has problems maintaining it on the site. So I went to rpy2 homepage:
.. and I installed rpy2 with pip (Anaconda installs the pip package manager)
pip install rpy2
.. Yea, so this took me one hour last night to fix, but the problem was only affecting Linux and Anaconda. Only use import readline if you have Linux.
In [ ]:
import readline
import rpy2.robjects as robjects
robjects.r('''
source("http://www.bioconductor.org/biocLite.R")
biocLite("ALL")
library("ALL")
data("ALL")
#install.packages("gplots")
eset <- ALL[, ALL$mol.biol %in% c("BCR/ABL", "ALL1/AF4")]
library("limma")
f <- factor(as.character(eset$mol.biol))
design <- model.matrix(~f)
fit <- eBayes(lmFit(eset,design))
selected <- p.adjust(fit$p.value[, 2]) <0.05
esetSel <- eset [selected, ]
color.map <- function(mol.biol) { if (mol.biol=="ALL1/AF4") "#FF0000" else "#0000FF" }
patientcolors <- unlist(lapply(esetSel$mol.bio, color.map))
#heatmap(exprs(esetSel), col=topo.colors(100), ColSideColors=patientcolors)
library("gplots")
heatmap.2(exprs(esetSel), col=redgreen(75), scale="row", ColSideColors=patientcolors,
key=TRUE, symkey=FALSE, density.info="none", trace="none", cexRow=0.5)
''')
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: Bioconductor version 3.2 (BiocInstaller 1.20.1), ?biocLite for help
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: BioC_mirror: http://bioconductor.org
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: Using Bioconductor 3.2 (BiocInstaller 1.20.1), R 3.2.4 Revised (2016-03-16
r70336).
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: Installing package(s) ‘ALL’
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: also installing the dependencies ‘BiocGenerics’, ‘Biobase’
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/BiocGenerics_0.16.1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: Content type 'application/x-gzip'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 38289 bytes (37 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: =
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning:
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 37 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/Biobase_2.30.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1671178 bytes (1.6 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.6 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/data/experiment/src/contrib/ALL_1.12.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 11401831 bytes (10.9 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 10.9 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: Old packages: 'ALL', 'annotate', 'BiocParallel', 'biomaRt', 'biovizBase',
'BSgenome', 'cummeRbund', 'edgeR', 'GenomicAlignments', 'GenomicFeatures',
'Gviz', 'hgu133plus2cdf', 'limma', 'mouse4302cdf', 'mouse4302.db',
'org.Mm.eg.db', 'Rsamtools', 'rtracklayer', 'VariantAnnotation', 'BH',
'boot', 'car', 'caret', 'cluster', 'digest', 'evaluate', 'formatR',
'ggplot2', 'glmnet', 'gtable', 'htmltools', 'htmlwidgets', 'jsonlite',
'knitr', 'lme4', 'maps', 'Matrix', 'mgcv', 'munsell', 'nlme', 'nnet',
'pbkrtest', 'quantreg', 'R6', 'rbokeh', 'Rcpp', 'RcppEigen', 'rmarkdown',
'scales', 'shiny', 'survival', 'tidyr', 'TTR', 'xtable'
res = super(Function, self).__call__(*new_args, **new_kwargs)
The downloaded source packages are in
‘/tmp/RtmpKCmZkb/downloaded_packages’
Update all/some/none? [a/s/n]:
a
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: also installing the dependencies ‘AnnotationDbi’, ‘XML’, ‘RCurl’, ‘S4Vectors’, ‘IRanges’, ‘GenomeInfoDb’, ‘GenomicRanges’, ‘SummarizedExperiment’, ‘Biostrings’, ‘XVector’, ‘RSQLite’, ‘zlibbioc’
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/AnnotationDbi_1.32.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 4268480 bytes (4.1 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 4.1 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/XML_3.98-1.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1599214 bytes (1.5 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.5 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/RCurl_1.95-4.8.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 916934 bytes (895 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 895 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/S4Vectors_0.8.11.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 204026 bytes (199 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 199 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/IRanges_2.4.8.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 497031 bytes (485 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 485 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/GenomeInfoDb_1.6.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 19364480 bytes (18.5 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 18.5 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/GenomicRanges_1.22.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 933002 bytes (911 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 911 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/SummarizedExperiment_1.0.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 947194 bytes (924 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 924 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/Biostrings_2.38.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 12730670 bytes (12.1 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 12.1 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/XVector_0.10.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 58534 bytes (57 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 57 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/RSQLite_1.0.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1745731 bytes (1.7 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.7 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/zlibbioc_1.16.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 257446 bytes (251 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 251 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/annotate_1.48.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1852419 bytes (1.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.8 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/BiocParallel_1.4.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 603688 bytes (589 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 589 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/biomaRt_2.26.1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 274975 bytes (268 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 268 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/biovizBase_1.18.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 2428064 bytes (2.3 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 2.3 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/BSgenome_1.38.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 6055101 bytes (5.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 5.8 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/cummeRbund_2.12.1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 2317294 bytes (2.2 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 2.2 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/edgeR_3.12.1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1193464 bytes (1.1 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.1 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/GenomicAlignments_1.6.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1939420 bytes (1.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/GenomicFeatures_1.22.13.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 818121 bytes (798 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 798 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/Gviz_1.14.7.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 3384767 bytes (3.2 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 3.2 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/data/annotation/src/contrib/hgu133plus2cdf_2.18.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 4353300 bytes (4.2 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 4.2 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/limma_3.26.9.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1446258 bytes (1.4 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.4 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/data/annotation/src/contrib/mouse4302cdf_2.18.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 3531403 bytes (3.4 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 3.4 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/data/annotation/src/contrib/mouse4302.db_3.2.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1700840 bytes (1.6 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/data/annotation/src/contrib/org.Mm.eg.db_3.2.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 63617232 bytes (60.7 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 60.7 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/Rsamtools_1.22.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 2981559 bytes (2.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 2.8 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/rtracklayer_1.30.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1357354 bytes (1.3 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.3 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://bioconductor.org/packages/3.2/bioc/src/contrib/VariantAnnotation_1.16.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1311934 bytes (1.3 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
The downloaded source packages are in
‘/tmp/RtmpKCmZkb/downloaded_packages’
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: also installing the dependencies ‘curl’, ‘openssl’, ‘httr’, ‘pryr’, ‘gistr’
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/curl_0.9.7.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 263926 bytes (257 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 257 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/openssl_0.9.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 882041 bytes (861 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 861 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/httr_1.1.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 118882 bytes (116 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 116 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/pryr_0.1.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 42498 bytes (41 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 41 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/gistr_0.3.6.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1861452 bytes (1.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/BH_1.60.0-1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 9618456 bytes (9.2 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 9.2 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/boot_1.3-18.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 231831 bytes (226 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 226 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/car_2.1-2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 619120 bytes (604 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 604 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/caret_6.0-68.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 4181028 bytes (4.0 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 4.0 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/cluster_2.0.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 293783 bytes (286 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 286 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/digest_0.6.9.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 116746 bytes (114 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 114 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/evaluate_0.8.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 18622 bytes (18 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 18 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/formatR_1.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 28139 bytes (27 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 27 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_2.1.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1571788 bytes (1.5 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/glmnet_2.0-5.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1908735 bytes (1.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/gtable_0.2.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 24157 bytes (23 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 23 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/htmltools_0.3.5.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 44048 bytes (43 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 43 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/htmlwidgets_0.6.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 940844 bytes (918 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 918 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/jsonlite_0.9.19.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 955099 bytes (932 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 932 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/knitr_1.12.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 830827 bytes (811 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 811 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/lme4_1.1-12.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 3868402 bytes (3.7 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 3.7 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/maps_3.1.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 2332670 bytes (2.2 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/Matrix_1.2-5.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1801692 bytes (1.7 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/mgcv_1.8-12.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 815245 bytes (796 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 796 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/munsell_0.4.3.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 97244 bytes (94 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 94 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/nlme_3.1-127.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 776625 bytes (758 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 758 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/nnet_7.3-12.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 28521 bytes (27 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/pbkrtest_0.4-6.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 165269 bytes (161 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 161 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/quantreg_5.21.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1718934 bytes (1.6 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/R6_2.1.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 270461 bytes (264 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 264 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/rbokeh_0.4.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 924860 bytes (903 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 903 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.12.4.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 2402065 bytes (2.3 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/RcppEigen_0.3.2.8.1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1240083 bytes (1.2 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 1.2 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/rmarkdown_0.9.5.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1772637 bytes (1.7 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/scales_0.4.0.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 57358 bytes (56 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 56 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/shiny_0.13.2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 1854845 bytes (1.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/survival_2.39-2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 5015076 bytes (4.8 MB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 4.8 MB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/tidyr_0.4.1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 158472 bytes (154 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 154 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/TTR_0.23-1.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 304259 bytes (297 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: downloaded 297 KB
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: trying URL 'http://cran.rstudio.com/src/contrib/xtable_1.8-2.tar.gz'
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/sergiun/programs/anaconda3/envs/py35/lib/python3.5/site-packages/rpy2/robjects/functions.py:106: UserWarning: length 619611 bytes (605 KB)
res = super(Function, self).__call__(*new_args, **new_kwargs)
However in the example above there is no real communication between the two languages. Let us change that with another small example, in which we send a numpy matrix to R. Don't worry at this point about what numpy is, we will learn it in the scientific computing chapter.
In [3]:
import readline
import numpy as np
from rpy2.robjects import r
import rpy2.robjects.numpy2ri
rpy2.robjects.numpy2ri.activate()
data = np.random.random((10,10))
r.heatmap(data)
Out[3]:
<ListVector - Python:0x7f7610048c48 / R:0x2cfe3c0>
[IntVector, IntVector, RNULLType, RNULLType]
rowInd: <class 'rpy2.robjects.vectors.IntVector'>
<IntVector - Python:0x7f7610048b48 / R:0x2cfa040>
[ 8, 9, 10, ..., 2, 5, 4]
colInd: <class 'rpy2.robjects.vectors.IntVector'>
<IntVector - Python:0x7f75ec7d59c8 / R:0x2e4c1d0>
[ 2, 6, 7, ..., 1, 4, 8]
Rowv: <class 'rpy2.rinterface.RNULLType'>
rpy2.rinterface.NULL
Colv: <class 'rpy2.rinterface.RNULLType'>
rpy2.rinterface.NULL
All is well above, except the display happens in an external R GUI frame. It would be nice to have an inline plot, matplotlib style. Well guess what, you are in luck because IPython is also having native support for R. This is the recommended way in which Python and R can interact in the IPython notebook:
In [5]:
#%load_ext rpy2.ipython
#from rpy2.robjects import r
#import rpy2.robjects.numpy2ri
#rpy2.robjects.numpy2ri.activate()
import numpy as np
data = np.random.random((10,10))
%Rpush data
%R heatmap(data)
Out[5]:
<ListVector - Python:0x7f761004a088 / R:0x2c40c00>
[IntVector, IntVector, RNULLType, RNULLType]
rowInd: <class 'rpy2.robjects.vectors.IntVector'>
<IntVector - Python:0x7f7604017348 / R:0x2cdadd0>
[ 7, 8, 1, ..., 2, 5, 6]
colInd: <class 'rpy2.robjects.vectors.IntVector'>
<IntVector - Python:0x7f75ec7dcbc8 / R:0x2d11670>
[ 6, 9, 3, ..., 1, 7, 8]
Rowv: <class 'rpy2.rinterface.RNULLType'>
rpy2.rinterface.NULL
Colv: <class 'rpy2.rinterface.RNULLType'>
rpy2.rinterface.NULL
In [ ]:
Content source: grokkaine/biopycourse
Similar notebooks: