Mercurial > repos > gaelcge > r_signac_galaxy
comparison signac-LSI.R @ 0:6e0b320d8b6a draft default tip
"planemo upload commit dc808171975d0012e25bd7b32adc7a5a5c56a145-dirty"
author | gaelcge |
---|---|
date | Tue, 02 Aug 2022 19:11:27 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6e0b320d8b6a |
---|---|
1 #!/usr/bin/env Rscript | |
2 | |
3 # Load optparse we need to check inputs | |
4 | |
5 suppressPackageStartupMessages(require(optparse)) | |
6 | |
7 # Load common functions | |
8 | |
9 suppressPackageStartupMessages(require(workflowscriptscommon)) | |
10 | |
11 # parse options | |
12 | |
13 option_list = list( | |
14 make_option( | |
15 c("--signac-object"), | |
16 action = "store", | |
17 default = NA, | |
18 type = 'character', | |
19 help = "" | |
20 ), | |
21 make_option( | |
22 c("--min-cutoff"), | |
23 action = "store", | |
24 default = NA, | |
25 type = 'character', | |
26 help = "" | |
27 ), | |
28 make_option( | |
29 c("--output-depthcor"), | |
30 action = "store", | |
31 default = NA, | |
32 type = 'character', | |
33 help = "TSS output plot." | |
34 ), | |
35 make_option( | |
36 c("-w", "--png-width"), | |
37 action = "store", | |
38 default = 1000, | |
39 type = 'integer', | |
40 help = "Width of png (px)." | |
41 ), | |
42 make_option( | |
43 c("-j", "--png-height"), | |
44 action = "store", | |
45 default = 1000, | |
46 type = 'integer', | |
47 help = "Height of png file (px)." | |
48 ), | |
49 make_option( | |
50 c("--output-object-file"), | |
51 action = "store", | |
52 default = NA, | |
53 type = 'character', | |
54 help = "File name in which to store serialized R matrix object." | |
55 ) | |
56 ) | |
57 | |
58 opt <- wsc_parse_args(option_list) | |
59 | |
60 suppressPackageStartupMessages(require(Signac)) | |
61 | |
62 set.seed(1234) | |
63 | |
64 # extract gene annotations from EnsDb | |
65 signac_object <- readRDS(file = opt$signac_object) | |
66 | |
67 | |
68 signac_object <- RunTFIDF(signac_object) | |
69 signac_object <- FindTopFeatures(signac_object, min.cutoff = opt$min_cutoff) | |
70 signac_object <- RunSVD(signac_object) | |
71 | |
72 ## Plot the Depth correlation plot | |
73 png(filename = opt$output_depthcor, width = opt$png_width, height = opt$png_height) | |
74 DepthCor(signac_object) | |
75 dev.off() | |
76 | |
77 # Output to a serialized R object | |
78 saveRDS(signac_object, file = opt$output_object_file) |