```r

Print the contents of a help text file with notes for new users

writeLines(readLines(paste(getwd(), "intro.txt", sep="/")))

```r
# Print the End User License Agreement for MEM
writeLines(readLines(paste(getwd(), "EULA-MEM.txt", sep="/")))
# Check to make sure FCS files, documentation, and MEM code are available
cat("This section checks to see if files and paths are working correctly. You should see lists of files below.  If it outputs character(0), something is wrong.\n\n")

# Check the MEM code path
cat("\n\nThe /MEM folder contains the MEM source code for install and related files:\n")
list.files(getwd())

# Check for datasets
cat("\n\nCourse FCS format files are in subdirecties of the /datafiles folder:\n")
list.files(paste(getwd(), "/datafiles", sep=""))
# Check version of R and install new version if available 
if(!require(installr)){install.packages("installr"); require(installr)}
updateR()
cat("If you run this chunk of code again and do not see that your R version is 
up-to-date, go to Tools --> Global Options --> General (Basic) --> change the 
path to the latest versio of R under R session. You may then be prompted to quit 
and re-open RStudio. If you do not see the new version listed in the directory, 
you will need to try installing the latest version of R again.")
# Print the contents a help file that explains installing packages
writeLines(readLines(paste(getwd(), "installing.txt", sep="/")))
# install bioconductor and flow cytometry tools for R
cat("If this works, you should see 4 sets of messages about downloading files that end in a message saying something like package 'BiocManager' successfully unpacked and MD5 sums checked.  You should see this for BioCManager, Biobase, flowCore, and FlowSOM.\n\n")
install.packages("BiocManager", repos = "http://cran.us.r-project.org")

if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install("flowCore")
BiocManager::install("FlowSOM")
# Load and test whether bioconductor and flow packages are installed
cat("If this works, you may see Attaching Package messages or no message at all; that's good.  If you get a warning, go back to the last CHUNK.\n\n")
library(FlowSOM)
library(flowCore)
library(Biobase)
# install plotting packages
cat("If this works, you will see text about packages being downloaded.\n\n")
install.packages("gplots", repos = "http://cran.us.r-project.org")
install.packages("ggplot2", repos = "http://cran.us.r-project.org")
install.packages("hexbin", repos = "http://cran.us.r-project.org")
install.packages("viridis", repos = "http://cran.us.r-project.org")
install.packages("ggExtra", repos = "http://cran.us.r-project.org")
# Load and test whether gplots and ggplot2 packages are installed
cat("If this works, you may see Attaching Package messages or no message at all; that's good.  If you get a warning, go back to the last CHUNK.\n\n")
library(gplots)
library(ggplot2)
library(hexbin)
library(viridis)
library(ggExtra)
# install MEM, load it, and test if it is all set
cat("If this works, you should see several lines about installing files, then DONE (MEM) near the end.  The MEM help page will also open in the Help menu in RStudio.\n\n")

# If you have previously installed MEM, you may get an error message. If this is the case, try restarting your RStudio session
install.packages(getwd(), type="source", repos=NULL)
library(MEM)
?MEM

# OR 
#install.packages("devtools", repos = "http://cran.us.r-project.org")
#devtools::install_github("JonathanIrish/MEMv3")
# install the last packages for UMAP, t-SNE and other tools
print("You may see a bunch of messages, this is OK as long as they are not errors.\n\n")
install.packages("tidyverse", repos = "http://cran.us.r-project.org")
install.packages("Rtsne", repos = "http://cran.us.r-project.org")
install.packages("uwot", repos = "http://cran.us.r-project.org")
install.packages("RColorBrewer", repos = "http://cran.us.r-project.org")
# Load and test the last libraries
library(tidyverse)
library(Rtsne)
library(uwot)
library(RColorBrewer)
# install the R package
install.packages('tinytex', repos = "http://cran.us.r-project.org")

# setup the external stuff and configure
tinytex::install_tinytex()


JonathanIrish/MEMv3 documentation built on July 14, 2019, 10:43 p.m.