Conference info: https://bioc2018.bioconductor.org/
My first Bioconductor meeting, and I'm not a BioC or R expert so these notes are probably going to be naïve!
library(tidyverse) | |
library(raster) | |
library(gganimate) | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# Not going to directly link in to script to avoid hitting server | |
# https://www.spriters-resource.com/resources/sheets/12/12593.png | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
sprite_sheet <- png::readPNG("12593.png") |
Conference info: https://bioc2018.bioconductor.org/
My first Bioconductor meeting, and I'm not a BioC or R expert so these notes are probably going to be naïve!
# what dominates PC1: 100 features with 10x fold change or 1 feature with 2x fold change? | |
mat <- rbind(matrix(rpois(8*100,rep(c(10,100),each=4)),ncol=8,byrow=TRUE), | |
rpois(8,rep(c(1000,1000,2000,2000),2))) | |
plot(prcomp(t(mat))$x[,1]) |
accession2url <- function(x) { | |
prefix <- "ftp://ftp.sra.ebi.ac.uk/vol1/fastq" | |
dir1 <- paste0("/",substr(x,1,6)) | |
dir2 <- ifelse(nchar(x) == 9, "", | |
ifelse(nchar(x) == 10, paste0("/00",substr(x,10,10)), | |
ifelse(nchar(x) == 11, paste0("/0",substr(x,10,11)), | |
paste0("/",substr(x,10,12))))) | |
paste0(prefix,dir1,dir2,"/",x) | |
} |
n <- 200 | |
m <- 40 | |
set.seed(1) | |
x <- runif(n, -1, 1) | |
library(rafalib) | |
bigpar(2,2,mar=c(3,3,3,1)) | |
library(RColorBrewer) | |
cols <- brewer.pal(11, "Spectral")[as.integer(cut(x, 11))] | |
plot(x, rep(0,n), ylim=c(-1,1), yaxt="n", xlab="", ylab="", | |
col=cols, pch=20, main="underlying data") |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.
Highly recommended things!
This is my five-star list. These are my favorite things in all the world.
A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★
data_sets <- c("mtcars", "morley", "rock") | |
shinyServer(function(input, output) { | |
# Drop-down selection box for which data set | |
output$choose_dataset <- renderUI({ | |
selectInput("dataset", "Data set", as.list(data_sets)) | |
}) | |
# Check boxes |
# Randomly allocating observations into groups, for, e.g. cross-validation | |
kk <- 10 # Number of partitions, as in "kk-fold cross-validation." | |
# Here is a data.frame full of good data: | |
nn <- 1003 | |
myData <- data.frame(matrix(rnorm(nn * 3), ncol = 3)) | |
colnames(myData) <- LETTERS[1:3] | |
# This does not work: | |
whichK <- sample(LETTERS[1:kk], nrow(myData), replace = T) |