Skip to content

Instantly share code, notes, and snippets.

Avatar

Laurent Gautier lgautier

View GitHub Profile
@lgautier
lgautier / multiproc_lab.py
Created Jan 3, 2020
"Lab" to show how to perform parallel R computing using `multiprocessing`.
View multiproc_lab.py
import argparse
import multiprocessing as mp
import uuid
import rpy2.rinterface as ri
import rpy2.rinterface_lib.embedded
R_ID_TAG = '_rpy2_R_id_'
def print_setup(args):
@lgautier
lgautier / rpy2-ld-library-path.sh
Created Dec 31, 2019
Set LD_LIBRARY_PATH for rpy2 when R is in a non-system location
View rpy2-ld-library-path.sh
export LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}
@lgautier
lgautier / demo_benchmark_mashingp.sh
Last active Jan 30, 2017
Demo/benchmark mashing-pumpkins to build minhash sketches
View demo_benchmark_mashingp.sh
#!/bin/sh
echo
echo '---------------'
echo ' test w/ FASTA '
echo '---------------'
testchrom=chr1.fa.gz
if [ ! -f "${testchrom}" ]; then
View dplyr.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View rpy2_stap_example
power <- function(x, n) {
# a not-so-useful reimplementation
x ^ n
}
square <- function(x) {
x^2
}
cube <- function(x) {
View ipysetup.py
# This is a setup snippet for an ipython notebook.
# It requires the presence of variable 'setup_digest',
# defined in the cell controlling the setup.
if 'setup_digest' not in locals():
import rpy2
%load_ext rpy2.ipython
# pigheaded / slow rpy2 developpers,
# customize away:
from rpy2.robjects.conversion import ri2py
View rmagic_singledispatch
{
"metadata": {
"name": "",
"signature": "sha256:cd75955d68d7ca272ff32886ce865002acb49b25f2e1cfba237539e70925eeda"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@lgautier
lgautier / gist:955e14077322480803e2
Created Sep 30, 2014
rpy2 and HTML display in ipython
View gist:955e14077322480803e2
{
"metadata": {
"name": "",
"signature": "sha256:e814b7d85c1dc274b3c62ca6849951326dee84fa31b999f9735064f46fb45a7a"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@lgautier
lgautier / gist:5426275
Created Apr 20, 2013
ipython notebook (Python 3.3.1, R-3.0.0, rpy2-2.4.0-dev
View gist:5426275
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "Untitled0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@lgautier
lgautier / rpy2_ggplot2
Last active Dec 15, 2015
rpy2: ggplot2 figures from pandas dataframes
View rpy2_ggplot2
{
"metadata": {
"name": "Untitled0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
You can’t perform that action at this time.