## ---- eval=FALSE--------------------------------------------------------- ## source("https://bioconductor.org/biocLite.R") ## biocLite() ## ---- eval=FALSE--------------------------------------------------------- ## biocLite("flowPloidy") ## ---- eval=FALSE--------------------------------------------------------- ## biocLite("flowPloidyData") ## ---- eval = FALSE------------------------------------------------------- ## install.packages("devtools", dependencies = TRUE) ## library("devtools") ## install_github("plantarum/flowPloidy") ## ------------------------------------------------------------------------ library(flowPloidy) library(flowPloidyData) ## ---- output = "hold"---------------------------------------------------- viewFlowChannels(flowPloidyFiles[1]) ## ------------------------------------------------------------------------ fh1 <- FlowHist(file = flowPloidyFiles[1], channel = "FL3.INT.LIN", analyze = FALSE) ## ----simplePlot, fig.cap = "FCS Histogram"------------------------------- plot(fh1) ## ----initialValues, fig.cap = "Histogram with Initial Values"------------ plot(fh1, init = TRUE) ## ------------------------------------------------------------------------ fh1 <- fhAnalyze(fh1) ## ----simpleAnalysis, fig.cap = "Histogram with Fitted Model"------------- plot(fh1) ## ---- output = "hold"---------------------------------------------------- fh1 ## ----noisyData, fig.cap = "Histogram with Bad Initial Values"------------ fh2 <- FlowHist(file = flowPloidyFiles["734.LMD"], channel = "FL3.INT.LIN") plot(fh2, init = TRUE) ## ---- eval = FALSE------------------------------------------------------- ## fh2 <- pickInit(fh2) ## ----fakingInteraction, echo = FALSE, fig.cap = "Histogram with Manually Selected Peaks"---- ## This stuff is automatically done by the interactive function pickInit, ## which we can't actually use in the automated vignette. ## Using internal functions here, not intended for use by users fh2 <- flowPloidy:::resetFlowHist(fh2) flowPloidy:::fhPeaks(fh2) <- structure(c(50.2623811329645, 139.061074258603, 258.242164238835, 178.771283080744), .Dim = c(2L, 2L), .Dimnames = list(NULL, c("mean", "height"))) fh2 <- flowPloidy:::addComponents(fh2) fh2 <- flowPloidy:::makeModel(fh2) fh2 <- flowPloidy:::getInit(fh2) plot(fh2) points(flowPloidy:::fhInit(fh2)$Ma, 255, col = 2, cex = 3) points(flowPloidy:::fhInit(fh2)$Mb, 175, col = 3, cex = 3) ## ----initPick, fig.cap = "Histogram with Corrected Initial Values"------- plot(fh2, init = TRUE) ## ----correctedAnalysis, fig.cap = "Histogram with Fitted Model"---------- fh2 <- fhAnalyze(fh2) plot(fh2) fh2 ## ----multi-cut model----------------------------------------------------- fh2MC <- updateFlowHist(fh2, debris = "MC") plot(fh2MC) ## ----FlowHist multi-cut, eval = FALSE------------------------------------ ## fh2MC <- FlowHist(file = flowPloidyFiles["734.LMD"], ## channel = "FL3.INT.LIN", debris = "MC") ## ------------------------------------------------------------------------ tabulateFlowHist(fh1) ## ------------------------------------------------------------------------ tabulateFlowHist(list(fh1, fh2)) ## ---- eval = FALSE------------------------------------------------------- ## tabulateFlowHist(list(fh1, fh2), file = "flow-results.csv") ## ---- eval = FALSE------------------------------------------------------- ## my.files <- list.files("datadir/", full.names = TRUE) ## ---- eval = FALSE------------------------------------------------------- ## my.files <- list.files("datadir/", pattern = ".LMD", full.names = TRUE) ## ---- eval = FALSE------------------------------------------------------- ## my.files <- list.files("datadir1/", full.names = TRUE) ## my.files <- c(my.files, list.files("datadir2/", full.names = TRUE)) ## ----histBatch----------------------------------------------------------- batch1 <- batchFlowHist(flowPloidyFiles, channel = "FL3.INT.LIN") ## ------------------------------------------------------------------------ tabulateFlowHist(batch1) ## ---- eval = FALSE------------------------------------------------------- ## parOld <- par(ask = TRUE) ## lapply(batch1, FUN = plot) ## ## press enter to scroll through your files! ## par(parOld) ## ----browseFlowHist, eval = FALSE---------------------------------------- ## batch1 <- browseFlowHist(batch1) ## ----flowShiny-output, eval = FALSE-------------------------------------- ## plot(batch1[["240+S.LMD"]]) ## ----flowShiny-export, eval = FALSE-------------------------------------- ## tabulateFlowHist(batch1) ## ---- eval = FALSE------------------------------------------------------- ## tabulateFlowHist(batch1, file = "my-analysis-output.csv")