Mercurial > repos > bornea > saint_bubblebeam
comparison bubbles_v9_NSAF_natural_log.R @ 10:79285a7acfbf draft
Uploaded
author | bornea |
---|---|
date | Thu, 19 Nov 2015 13:18:06 -0500 |
parents | 8eb1dd926f6e |
children | 80cc85d7d6e3 |
comparison
equal
deleted
inserted
replaced
9:9617d82034c6 | 10:79285a7acfbf |
---|---|
1 rm(list=ls()) | 1 rm(list=ls()) |
2 ################################################################################################### | 2 ################################################################################################### |
3 # R-code: Multi-bubble graph generation from SAINTexpress output | 3 # R-code: Multi-bubble graph generation from SAINTexpress output |
4 # Author: Brent Kuenzi | 4 # Author: Brent Kuenzi |
5 ################################################################################################### | 5 ################################################################################################### |
6 ins_check_run() | |
6 library(dplyr); library(tidyr); library(ggplot2) | 7 library(dplyr); library(tidyr); library(ggplot2) |
7 ################################################################################################### | 8 ################################################################################################### |
8 ### Run program ### | 9 ### Run program ### |
9 | 10 |
10 ## REQUIRED INPUT ## | 11 ## REQUIRED INPUT ## |
224 # Check Saintscore cutoff and stop program if not between 0 and 1 | 225 # Check Saintscore cutoff and stop program if not between 0 and 1 |
225 ################################################################################################### | 226 ################################################################################################### |
226 cutoff_check <- function(cutoff){ | 227 cutoff_check <- function(cutoff){ |
227 if( any(cutoff < 0 | cutoff > 1) ) stop('SAINT score cutoff not between 0 and 1. Please correct and try again') | 228 if( any(cutoff < 0 | cutoff > 1) ) stop('SAINT score cutoff not between 0 and 1. Please correct and try again') |
228 } | 229 } |
229 | 230 ins_check_run <- function() { |
231 if ('dplyr' %in% rownames(installed.packages())){} | |
232 else { | |
233 install.packages('dplyr', repos='http://cran.us.r-project.org') | |
234 } | |
235 if ('tidyr' %in% rownames(installed.packages())){} | |
236 else { | |
237 install.packages('tidyr', repos='http://cran.us.r-project.org') | |
238 } | |
239 if ('ggplot2' %in% rownames(installed.packages())){} | |
240 else { | |
241 install.packages('ggplot2', repos='http://cran.us.r-project.org') | |
242 } | |
243 } | |
244 | |
245 ins_check_run() | |
230 args <- commandArgs(trailingOnly = TRUE) | 246 args <- commandArgs(trailingOnly = TRUE) |
231 main(args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9]) | 247 main(args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9]) |
232 | 248 |
233 #main("test_list.txt", "preytest.txt", crapome="craptest.txt", color="crapome", label=TRUE) | 249 #main("test_list.txt", "preytest.txt", crapome="craptest.txt", color="crapome", label=TRUE) |
234 #main("Crizo_list.txt", "prey_cr.txt", crapome = "crizo_crap.txt", color="crapome", label=TRUE, cutoff=0.7) | 250 #main("Crizo_list.txt", "prey_cr.txt", crapome = "crizo_crap.txt", color="crapome", label=TRUE, cutoff=0.7) |