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
if(!(all(c("plyr","optparse","tools","magrittr") %in% installed.packages()))) { | |
cat("'plyr','optparse','tools','magrittr' are not installed.\nYou must install them for this script to work!\nInstall by running the following commands:\ninstall.packages('plyr')\ninstall.packages('optparse')\ninstall.packages('tools')\ninstall.packages('magrittr')") | |
} | |
library(plyr) | |
library(optparse) | |
library(tools) | |
library(magrittr) |
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("magrittr") | |
library("optparse") | |
args = commandArgs(trailingOnly=TRUE) | |
option_list = list( | |
make_option(c("-d", "--dir"), type="character", default=NULL, | |
help="Directory of fastqc results", metavar="character"), | |
make_option(c("-o", "--outdir"), type="character", default=NULL, | |
help="An existing dir in which to create the output files.", metavar="character") |
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(magrittr) | |
colhex2col <- function(colhex) { | |
# Convert hex to RGB | |
mycol <- colhex %>% col2rgb() | |
# Convert all x11 colors to RGB, adn transform | |
colors() %>% # Get X11 colors (hex) | |
col2rgb %>% # Convert to RGB matrix | |
data.frame %>% # Convert to data.frame | |
setNames(.,colors()) %>% # Set color names |