$ uname -r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load necessary libraries | |
| library(airway) | |
| library(DESeq2) | |
| library(org.Hs.eg.db) | |
| library(dplyr) | |
| # 1. Load the dataset | |
| data("airway") | |
| # 2. Build the DESeq2 object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a version of the Shiny app found at https://github.com/BIFX547-26/ShinyHood for running with `shiny::runGist()` | |
| library(shiny) | |
| library(dplyr) | |
| library(bslib) | |
| library(DT) | |
| # Load course data | |
| courses <- read.csv("https://github.com/BIFX547-26/ShinyHood/raw/refs/heads/main/data/courses.csv", stringsAsFactors = FALSE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(dplyr) | |
| # example data | |
| dat <- tibble(sid = c('SAC001', 'SAC002', 'SAC003', 'SAC004', 'SAC005', | |
| 'SAC006', 'SAC007', 'SAC008', 'SAC009', 'SAC010'), | |
| theoretical_lab = c(1, 1, 1, 1, 2, 2, 2, 3, 3, 3), | |
| lab1 = c(2, 1, 1, 3, 2, 1, 3, 3, 3, 3), | |
| lab2 = c(1, 1, 2, 3, 2, 2, 1, 3, 2, 2), | |
| lab3 = c(1, 1, 1, 2, 2, 2, 2, 3, 3, 2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############ nice colorblind pallete found at http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/ ############### | |
| cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7") | |
| ############ another nice pallete from http://mkweb.bcgsc.ca/colorblind/img/colorblindness.palettes.simple.png ############# | |
| ## ordering from dark to light | |
| # indistinguishible pairs for tritanopia: | |
| # *--------------------* *------------------------------------------------------* *---------------------* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!require(tidyverse)) | |
| install.packages('tidyverse', dependencies = TRUE) | |
| if(!require(seqplots)) | |
| { | |
| source("https://bioconductor.org/biocLite.R") | |
| biocLite("seqplots", suppressUpdates = TRUE) | |
| } | |
| if(!require(ggbio)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Practice Transformations | |
| # after sourcing this gist, try to figure out what the best transformation is to make the association linear (without looking at the source code) | |
| require(tidyverse) | |
| N <- 500 | |
| # log normal association | |
| set.seed(293847) | |
| dat1 <- data_frame(x = rnorm(N), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # practice data for interactions | |
| # this creates 3 data sets, dat1, dat2 and dat3 | |
| library(tidyverse) | |
| set.seed(23478) | |
| n <- 100 | |
| #################### interaction with a linear spline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # simulated glomerular filtration rate as a function of age, gender and blood pressure | |
| # linearity assumption may be violated, depending on the model | |
| # multivariate normal assumption may be violated | |
| # homoscedasticity assumption may be violated | |
| require(tidyverse) | |
| n <- 500 | |
| set.seed(239847) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # clt.R | |
| # function for exploring the Central Limit Theorem | |
| # Randy Johnson | |
| # distn = any function returning random numbers | |
| # the first argument is assumed to be sample size! | |
| # Sample size argument should be 'n' | |
| # sample_size = number of random variables to draw for each mean | |
| # ... = arguments to be passed to distn | |
| clt.test <- function(distn, sample_size, seed=NULL, ...) |
NewerOlder