Mercurial > repos > iuc > seurat
annotate Seurat.R @ 15:fab6ff46e019 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
author | iuc |
---|---|
date | Fri, 07 Jul 2023 01:43:02 +0000 |
parents | c4db6ec33fec |
children |
rev | line source |
---|---|
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
1 #' --- |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
2 #' title: "Seurat Analysis" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
3 #' author: "Performed using Galaxy" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
4 #' params: |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
5 #' counts: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
6 #' min_cells: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
7 #' min_genes: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
8 #' low_thresholds: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
9 #' high_thresholds: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
10 #' numPCs: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
11 #' resolution: "" |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
12 #' perplexity: "" |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
13 #' min_pct: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
14 #' logfc_threshold: "" |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
15 #' end_step: "" |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
16 #' showcode: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
17 #' warn: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
18 #' varstate: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
19 #' vlnfeat: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
20 #' featplot: "" |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
21 #' PCplots: "" |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
22 #' nmds: "" |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
23 #' heatmaps: "" |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
24 #' norm_out: "" |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
25 #' variable_out: "" |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
26 #' pca_out : "" |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
27 #' clusters_out: "" |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
28 #' markers_out: "" |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
29 #' --- |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
30 |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
31 # nolint start |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
32 #+ echo=F, warning = F, message=F |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
33 options(show.error.messages = F, error = function() { |
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
34 cat(geterrmessage(), file = stderr()); q("no", 1, F) |
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
35 }) |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
36 showcode <- as.logical(params$showcode) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
37 warn <- as.logical(params$warn) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
38 varstate <- as.logical(params$varstate) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
39 vlnfeat <- as.logical(params$vlnfeat) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
40 featplot <- as.logical(params$featplot) |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
41 pc_plots <- as.logical(params$PCplots) |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
42 nmds <- as.logical(params$nmds) |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
43 heatmaps <- as.logical(params$heatmaps) |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
44 end_step <- as.integer(params$end_step) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
45 norm_out <- as.logical(params$norm_out) |
2
321bdd834266
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 3cf715ec11e2c9944f46572e324e5b2db5aa151f"
iuc
parents:
1
diff
changeset
|
46 # we need that to not crash Galaxy with an UTF-8 error on German LC settings. |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
47 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
48 |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
49 #+ echo = F, warning = `warn`, include =`varstate` |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
50 min_cells <- as.integer(params$min_cells) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
51 min_genes <- as.integer(params$min_genes) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
52 print(paste0("Minimum cells: ", min_cells)) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
53 print(paste0("Minimum features: ", min_genes)) |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
54 low_thresholds <- as.integer(params$low_thresholds) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
55 high_thresholds <- as.integer(params$high_thresholds) |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
56 print(paste0("Umi low threshold: ", low_thresholds)) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
57 print(paste0("Umi high threshold: ", high_thresholds)) |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
58 |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
59 if (end_step >= 2) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
60 variable_out <- as.logical(params$variable_out) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
61 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
62 |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
63 |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
64 if (end_step >= 3) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
65 num_pcs <- as.integer(params$numPCs) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
66 print(paste0("Number of principal components: ", num_pcs)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
67 pca_out <- as.logical(params$pca_out) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
68 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
69 if (end_step >= 4) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
70 if (params$perplexity == "") { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
71 perplexity <- -1 |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
72 print(paste0("Perplexity: ", perplexity)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
73 } else { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
74 perplexity <- as.integer(params$perplexity) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
75 print(paste0("Perplexity: ", perplexity)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
76 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
77 resolution <- as.double(params$resolution) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
78 print(paste0("Resolution: ", resolution)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
79 clusters_out <- as.logical(params$clusters_out) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
80 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
81 if (end_step >= 5) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
82 min_pct <- as.double(params$min_pct) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
83 logfc_threshold <- as.double(params$logfc_thresh) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
84 print(paste0("Minimum percent of cells", min_pct)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
85 print(paste0("Logfold change threshold", logfc_threshold)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
86 markers_out <- as.logical(params$markers_out) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
87 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
88 |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
89 |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
90 if (showcode == TRUE) print("Read in data, generate inital Seurat object") |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
91 #+ echo = `showcode`, warning = `warn`, message = F |
2
321bdd834266
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 3cf715ec11e2c9944f46572e324e5b2db5aa151f"
iuc
parents:
1
diff
changeset
|
92 counts <- read.delim(params$counts, row.names = 1) |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
93 seuset <- Seurat::CreateSeuratObject(counts = counts, min.cells = min_cells, min.features = min_genes) |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
94 |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
95 if (showcode == TRUE && vlnfeat == TRUE) print("Raw data vizualization") |
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
96 #+ echo = `showcode`, warning = `warn`, include=`vlnfeat` |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
97 if (vlnfeat == TRUE){ |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
98 print(Seurat::VlnPlot(object = seuset, features = c("nFeature_RNA", "nCount_RNA"))) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
99 print(Seurat::FeatureScatter(object = seuset, feature1 = "nCount_RNA", feature2 = "nFeature_RNA")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
100 } |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
101 |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
102 if (showcode == TRUE) print("Filter and normalize for UMI counts") |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
103 #+ echo = `showcode`, warning = `warn` |
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
104 seuset <- subset(seuset, subset = `nCount_RNA` > low_thresholds & `nCount_RNA` < high_thresholds) |
2
321bdd834266
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 3cf715ec11e2c9944f46572e324e5b2db5aa151f"
iuc
parents:
1
diff
changeset
|
105 seuset <- Seurat::NormalizeData(seuset, normalization.method = "LogNormalize", scale.factor = 10000) |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
106 if (norm_out == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
107 saveRDS(seuset, "norm_out.rds") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
108 } |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
109 |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
110 if (end_step >= 2) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
111 #+ echo = FALSE |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
112 if (showcode == TRUE && featplot == TRUE) print("Variable Genes") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
113 #+ echo = `showcode`, warning = `warn`, include = `featplot` |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
114 seuset <- Seurat::FindVariableFeatures(object = seuset, selection.method = "mvp") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
115 if (featplot == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
116 print(Seurat::VariableFeaturePlot(seuset, cols = c("black", "red"), selection.method = "disp")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
117 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
118 seuset <- Seurat::ScaleData(object = seuset, vars.to.regress = "nCount_RNA") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
119 if (variable_out == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
120 saveRDS(seuset, "var_out.rds") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
121 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
122 } |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
123 |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
124 if (end_step >= 3) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
125 #+ echo = FALSE |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
126 if (showcode == TRUE && pc_plots == TRUE) print("PCA Visualization") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
127 #+ echo = `showcode`, warning = `warn`, include = `pc_plots` |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
128 seuset <- Seurat::RunPCA(seuset, npcs = num_pcs) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
129 seuset <- Seurat::JackStraw(seuset, dims = num_pcs, reduction = "pca", num.replicate = 100) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
130 seuset <- Seurat::ScoreJackStraw(seuset, dims = 1:num_pcs) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
131 if (pc_plots == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
132 print(Seurat::VizDimLoadings(seuset, dims = 1:2)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
133 print(Seurat::DimPlot(seuset, dims = c(1, 2), reduction = "pca")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
134 print(Seurat::DimHeatmap(seuset, dims = 1:num_pcs, nfeatures = 30, reduction = "pca")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
135 print(Seurat::JackStrawPlot(seuset, dims = 1:num_pcs)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
136 print(Seurat::ElbowPlot(seuset, ndims = num_pcs, reduction = "pca")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
137 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
138 if (pca_out == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
139 saveRDS(seuset, "pca_out.rds") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
140 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
141 } |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
142 |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
143 if (end_step >= 4) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
144 #+ echo = FALSE |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
145 if (showcode == TRUE && nmds == TRUE) print("tSNE and UMAP") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
146 #+ echo = `showcode`, warning = `warn`, include = `nmds` |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
147 seuset <- Seurat::FindNeighbors(object = seuset) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
148 seuset <- Seurat::FindClusters(object = seuset) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
149 if (perplexity == -1) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
150 seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution); |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
151 } else { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
152 seuset <- Seurat::RunTSNE(seuset, dims = 1:num_pcs, resolution = resolution, perplexity = perplexity); |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
153 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
154 if (nmds == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
155 print(Seurat::DimPlot(seuset, reduction = "tsne")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
156 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
157 seuset <- Seurat::RunUMAP(seuset, dims = 1:num_pcs) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
158 if (nmds == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
159 print(Seurat::DimPlot(seuset, reduction = "umap")) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
160 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
161 if (clusters_out == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
162 tsnedata <- Seurat::Embeddings(seuset, reduction="tsne") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
163 saveRDS(seuset, "tsne_out.rds") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
164 umapdata <- Seurat::Embeddings(seuset, reduction="umap") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
165 saveRDS(seuset, "umap_out.rds") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
166 } |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
167 } |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
168 |
1
7319f83ae734
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit 88cf23c767023f71b4ea1e72aac568cc694cc34a"
iuc
parents:
diff
changeset
|
169 |
15
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
170 if (end_step == 5) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
171 #+ echo = FALSE |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
172 if (showcode == TRUE && heatmaps == TRUE) print("Marker Genes") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
173 #+ echo = `showcode`, warning = `warn`, include = `heatmaps` |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
174 markers <- Seurat::FindAllMarkers(seuset, only.pos = TRUE, min.pct = min_pct, logfc.threshold = logfc_threshold) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
175 top10 <- dplyr::group_by(markers, cluster) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
176 top10 <- dplyr::top_n(top10, n = 10, wt = avg_log2FC) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
177 print(top10) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
178 if (heatmaps == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
179 print(Seurat::DoHeatmap(seuset, features = top10$gene)) |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
180 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
181 if (markers_out == TRUE) { |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
182 saveRDS(seuset, "markers_out.rds") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
183 data.table::fwrite(x = markers, row.names=TRUE, sep="\t", file = "markers_out.tsv") |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
184 } |
fab6ff46e019
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit b437a46efb50e543b6d7c9988f954efe2caa9046
iuc
parents:
9
diff
changeset
|
185 } |
6
764f076e9d52
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat commit e8eeff2efea68e1e5bc697d0ff6a5808cd978db2"
iuc
parents:
2
diff
changeset
|
186 # nolint end |