This file contains 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) | |
library(tidyr) | |
library(impulse) # from github/shackett | |
timepts <- c(0, 5, 10, 20, 30, 40, 60, 90) # time points measured | |
measurement_sd <- 0.5 # standard deviation of Gaussian noise added to each observation | |
total_measurements <- 10000 # total number of genes | |
signal_frac <- 0.2 # what fraction of genes contain real signal | |
set.seed(1234) |
This file contains 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
parallel_fread <- function(path, mc.cores = parallel::detectCores(), header = TRUE, ...) { | |
stopifnot(file.exists(path)) | |
dots <- list(...) | |
fread_args <- dots[intersect(names(formals(fread)), names(dots))] | |
if (any(c("skip", "nrows") %in% fread_args)) { | |
stop(paste(intersect(c("skip", "nrows"), fread_args), collapse = " & "), " cannot be provided") | |
} | |
This file contains 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
extract_color_space <- function(hmin=0, hmax=360, cmin=0, cmax=180, lmin=0, lmax=100) { | |
# This is a pared down version of the code to generate a | |
# Presently doesn't allow hmax > hmin (H is circular) | |
# hmin: lower bound of hue (0-360) | |
# hmax: upper bound of hue (0-360) | |
# cmin: lower bound of chroma (0-180) | |
# cmax: upper bound of chroma (0-180) | |
# lmin: lower bound of luminance (0-100) |
This file contains 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(scales) | |
library(ggplot2) | |
library(gridExtra) | |
library(tidyr) | |
options(stringsAsFactors = F) | |
source_dist <- 0.5 # fraction of protonated source | |
uptake_rate <- 1000 # uptake of A | |
Vol = 1e7 |
This file contains 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
shack_peakHeight <- function( inList ){ | |
#### For baseline subtraction and quantification using peak height #### | |
# Save spectra baseline file in a list so that original and baseline | |
# subtracted spectra can be compared side-by-side | |
# Quantification by the maximum value once the baseline has been removed | |
require(baseline) | |
if(!exists("outList")){ |