annotate sleuth.R @ 0:a9d7ab1986ca draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
author iuc
date Thu, 01 Jun 2023 07:55:48 +0000
parents
children 9a58bef001d5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
1 library(sleuth,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
2 quietly = TRUE,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
3 warn.conflicts = FALSE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
4 library(annotables, quietly = TRUE, warn.conflicts = FALSE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
5 library(argparse, quietly = TRUE, warn.conflicts = FALSE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
6 library(tidyverse)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
7
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
8
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
9 # setup R error handling to go to stderr
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
10 options(
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
11 show.error.messages = FALSE,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
12 error = function() {
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
13 cat(geterrmessage(), file = stderr())
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
14 q("no", 1, FALSE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
15 }
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
16 )
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
17
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
18 # we need that to not crash galaxy with an UTF8 error on German LC settings.
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
19 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
20
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
21 ################################################################################
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
22 ### Input Processing
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
23 ################################################################################
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
24
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
25
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
26 # Collect arguments from command line
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
27 parser <- ArgumentParser(description = "Sleuth R script")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
28
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
29 parser$add_argument("--factorLevel", action = "append", required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
30 parser$add_argument("--factorLevel_counts",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
31 action = "append",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
32 required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
33 parser$add_argument("--factorLevel_n", action = "append", required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
34 parser$add_argument("--cores", type = "integer", required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
35 parser$add_argument("--normalize", action = "store_true", required = FALSE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
36 parser$add_argument("--nbins", type = "integer", required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
37 parser$add_argument("--lwr", type = "numeric", required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
38 parser$add_argument("--upr", type = "numeric", required = TRUE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
39
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
40 args <- parser$parse_args()
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
41
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
42 all_files <- args$factorLevel_counts
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
43
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
44 conditions <- c()
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
45 for (x in seq_along(args$factorLevel)) {
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
46 temp <- append(conditions, rep(args$factorLevel[[x]]))
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
47 conditions <- temp
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
48 }
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
49
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
50 sample_names <- all_files %>%
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
51 str_replace(pattern = "\\.tab", "")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
52
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
53 design <-
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
54 data.frame(list(
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
55 sample = sample_names,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
56 condition = conditions,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
57 path = all_files
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
58 ))
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
59 so <- sleuth_prep(design,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
60 cores = args$cores,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
61 normalize = args$normalize)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
62
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
63 so <- sleuth_fit(
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
64 so,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
65 ~ condition,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
66 "full",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
67 n_bins = args$nbins,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
68 lwr = args$lwr,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
69 upr = args$upr
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
70 )
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
71
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
72 so <- sleuth_fit(
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
73 so,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
74 ~ 1,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
75 "reduced",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
76 n_bins = args$nbins,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
77 lwr = args$lwr,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
78 upr = args$upr
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
79 )
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
80
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
81 so <- sleuth_lrt(so, "reduced", "full")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
82
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
83 sleuth_table <-
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
84 sleuth_results(so, "reduced:full", "lrt", show_all = FALSE)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
85
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
86 write.table(
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
87 sleuth_table,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
88 file = "sleuth_table.tab",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
89 quote = FALSE,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
90 sep = "\t",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
91 col.names = TRUE,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
92 row.names = FALSE
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
93 )
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
94
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
95
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
96 outputFile <- file.path(getwd(), "pca_plot.pdf")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
97 pdf(file = outputFile,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
98 height = 6,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
99 width = 9)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
100 plot_pca(so, color_by = "condition")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
101 dev.off()
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
102
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
103 outputFile <- file.path(getwd(), "group_density.pdf")
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
104 pdf(file = outputFile,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
105 height = 6,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
106 width = 9)
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
107 plot_group_density(
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
108 so,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
109 use_filtered = TRUE,
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
110 units = "est_counts",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
111 trans = "log",
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
112 grouping = setdiff(colnames(so$sample_to_covariates),
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
113 "sample"),
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
114 offset = 1
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
115 )
a9d7ab1986ca planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 6b943159b4d68812dc6911309f23d54ec659282f
iuc
parents:
diff changeset
116 dev.off()