Skip to content

Instantly share code, notes, and snippets.

@cbare
cbare / recursive_download.py
Last active April 18, 2016 03:59
Recursively download the contents of a Project or Folder from Synapse
import os
import shutil
import synapseclient
from synapseclient import Project, Folder, Entity, File
syn = synapseclient.login()
def download(entity, directory=None, verbose=False, indent=0):
"""
@jkeirstead
jkeirstead / gp-predict.stan
Last active April 18, 2018 01:34
A demo of Gaussian processes using RStan
// Predict from Gaussian Process
// All data parameters must be passed as a list to the Stan call
// Based on original file from https://code.google.com/p/stan/source/browse/src/models/misc/gaussian-process/
data {
int<lower=1> N1;
vector[N1] x1;
vector[N1] y1;
int<lower=1> N2;
vector[N2] x2;
@mbjoseph
mbjoseph / vioplot2.R
Last active December 9, 2020 17:06
Slight change to the vioplot function from Daniel Adler that plots median lines instead of points, and gives the option to plot either side of a violin rather than always both.
vioplot2 <- function (x, ..., range = 1.5, h = NULL, ylim = NULL, names = NULL,
horizontal = FALSE, col = "magenta", border = "black", lty = 1,
lwd = 1, rectCol = "black", colMed = "white", pchMed = 19,
at, add = FALSE, wex = 1, drawRect = TRUE, side="both")
{
datas <- list(x, ...)
n <- length(datas)
if (missing(at))
at <- 1:n
upper <- vector(mode = "numeric", length = n)