Skip to content

Instantly share code, notes, and snippets.

View sklarz-bgu's full-sized avatar
💭
Working on NeatSeq-Flow, towards publication

Menachem Sklarz sklarz-bgu

💭
Working on NeatSeq-Flow, towards publication
View GitHub Profile
@sklarz-bgu
sklarz-bgu / primer_search_wrapper.R
Created May 3, 2017 07:06
Wrapper for primer_search from EMBOSS
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)
@sklarz-bgu
sklarz-bgu / fastqc_summary.R
Created February 8, 2017 11:14
Return tabular version of fastqc results for multiple samples.
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")
@sklarz-bgu
sklarz-bgu / hex2col.R
Last active February 8, 2017 11:05
R script for converting hex colors into closest X11 color name.
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