comparison w4mcorcov_calc.R @ 3:5aaab36bc523 draft

planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit 88004a3cf8868d68da1ec5bd2c1be53746350367
author eschen42
date Mon, 15 Jan 2018 14:30:15 -0500
parents e03582f26617
children 8bba31f628da
comparison
equal deleted inserted replaced
2:e03582f26617 3:5aaab36bc523
5 } 5 }
6 6
7 #### OPLS-DA 7 #### OPLS-DA
8 algoC <- "nipals" 8 algoC <- "nipals"
9 9
10 do_detail_plot <- function(x_dataMatrix, x_predictor, x_is_match, x_algorithm, x_prefix, x_show_labels, x_show_loado_labels, x_progress = print, x_env) { 10 do_detail_plot <- function(x_dataMatrix, x_predictor, x_is_match, x_algorithm, x_prefix, x_show_labels, x_show_loado_labels, x_progress = print, x_env, x_crossval_i) {
11 off <- function(x) if (x_show_labels == "0") 0 else x 11 off <- function(x) if (x_show_labels == "0") 0 else x
12 if (x_is_match && ncol(x_dataMatrix) > 0 && length(unique(x_predictor))> 1) { 12 if (x_is_match && ncol(x_dataMatrix) > 0 && length(unique(x_predictor))> 1) {
13 my_oplsda <- opls( 13 my_oplsda <- opls(
14 x = x_dataMatrix 14 x = x_dataMatrix
15 , y = x_predictor 15 , y = x_predictor
16 , algoC = x_algorithm 16 , algoC = x_algorithm
17 , predI = 1 17 , predI = 1
18 , orthoI = if (ncol(x_dataMatrix) > 1) 1 else 0 18 , orthoI = if (ncol(x_dataMatrix) > 1) 1 else 0
19 , printL = FALSE 19 , printL = FALSE
20 , plotL = FALSE 20 , plotL = FALSE
21 , crossvalI = x_crossval_i
21 ) 22 )
22 my_oplsda_suppLs_y_levels <- levels(as.factor(my_oplsda@suppLs$y)) 23 my_oplsda_suppLs_y_levels <- levels(as.factor(my_oplsda@suppLs$y))
23 fctr_lvl_1 <- my_oplsda_suppLs_y_levels[1] 24 fctr_lvl_1 <- my_oplsda_suppLs_y_levels[1]
24 fctr_lvl_2 <- my_oplsda_suppLs_y_levels[2] 25 fctr_lvl_2 <- my_oplsda_suppLs_y_levels[2]
25 my_cor_vs_cov <- cor_vs_cov( 26 my_cor_vs_cov <- cor_vs_cov(
303 , x_algorithm = algoC 304 , x_algorithm = algoC
304 , x_prefix = if (pairSigFeatOnly) "Significantly contrasting features" else "Significant features" 305 , x_prefix = if (pairSigFeatOnly) "Significantly contrasting features" else "Significant features"
305 , x_show_labels = labelFeatures 306 , x_show_labels = labelFeatures
306 , x_show_loado_labels = labelOrthoFeatures 307 , x_show_loado_labels = labelOrthoFeatures
307 , x_progress = progress_action 308 , x_progress = progress_action
309 , x_crossval_i = min(7, length(chosen_samples))
308 , x_env = calc_env 310 , x_env = calc_env
309 ) 311 )
310 if ( is.null(my_cor_cov) ) { 312 if ( is.null(my_cor_cov) ) {
311 progress_action("NOTHING TO PLOT.") 313 progress_action("NOTHING TO PLOT.")
312 } else { 314 } else {
359 , x_algorithm = algoC 361 , x_algorithm = algoC
360 , x_prefix = if (pairSigFeatOnly) "Significantly contrasting features" else "Significant features" 362 , x_prefix = if (pairSigFeatOnly) "Significantly contrasting features" else "Significant features"
361 , x_show_labels = labelFeatures 363 , x_show_labels = labelFeatures
362 , x_show_loado_labels = labelOrthoFeatures 364 , x_show_loado_labels = labelOrthoFeatures
363 , x_progress = progress_action 365 , x_progress = progress_action
366 , x_crossval_i = min(7, length(chosen_samples))
364 , x_env = calc_env 367 , x_env = calc_env
365 ) 368 )
366 if ( is.null(my_cor_cov) ) { 369 if ( is.null(my_cor_cov) ) {
367 progress_action("NOTHING TO PLOT.") 370 progress_action("NOTHING TO PLOT.")
368 } else { 371 } else {
412 , x_algorithm = algoC 415 , x_algorithm = algoC
413 , x_prefix = "Features" 416 , x_prefix = "Features"
414 , x_show_labels = labelFeatures 417 , x_show_labels = labelFeatures
415 , x_show_loado_labels = labelOrthoFeatures 418 , x_show_loado_labels = labelOrthoFeatures
416 , x_progress = progress_action 419 , x_progress = progress_action
420 , x_crossval_i = min(7, length(chosen_samples))
417 , x_env = calc_env 421 , x_env = calc_env
418 ) 422 )
419 if ( is.null(my_cor_cov) ) { 423 if ( is.null(my_cor_cov) ) {
420 progress_action("NOTHING TO PLOT") 424 progress_action("NOTHING TO PLOT")
421 } else { 425 } else {
457 , x_algorithm = algoC 461 , x_algorithm = algoC
458 , x_prefix = "Features" 462 , x_prefix = "Features"
459 , x_show_labels = labelFeatures 463 , x_show_labels = labelFeatures
460 , x_show_loado_labels = labelOrthoFeatures 464 , x_show_loado_labels = labelOrthoFeatures
461 , x_progress = progress_action 465 , x_progress = progress_action
466 , x_crossval_i = min(7, length(chosen_samples))
462 , x_env = calc_env 467 , x_env = calc_env
463 ) 468 )
464 if ( is.null(my_cor_cov) ) { 469 if ( is.null(my_cor_cov) ) {
465 progress_action("NOTHING TO PLOT") 470 progress_action("NOTHING TO PLOT")
466 } else { 471 } else {