annotate scripts/raceID_kmeans_heatmap.R @ 0:ea8215239735 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
author iuc
date Sat, 03 Mar 2018 17:33:56 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
1 #!/usr/bin/env Rscript
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
2
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
3 args = commandArgs(trailingOnly=T)
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
4
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
5 script_dir = args[1]
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
6 config_file = args[2]
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
7
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
8 # Load libs, common functions, source RaceID,
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
9 # Galaxy Params, and read input data (sc)
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
10 source(paste(script_dir, "common.R", sep="/"))
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
11
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
12 # Read input data
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
13 message("Count matrix with %.0f cells and %.0f genes", dim(sc@fdata)[1], dim(sc@fdata)[2])
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
14 message("Performing clustering using the following parameters: metric=%s, cln=%.0f, do.gap=%.0f clustnr=%.0f, B.gap=%.0f, SE.method=%s, SE.factor=%.2f, bootnr=%.0f, rseed=%.0f", c_metric, c_cln, dogap, c_clustnr, bgap, semethod, sefactor, c_bootnr, c_rseed)
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
15
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
16 sc <- clustexp(
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
17 sc,
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
18 metric=c_metric, cln=c_cln, do.gap=dogap, clustnr=c_clustnr,
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
19 B.gap=bgap, SE.method=semethod, SE.factor=sefactor,
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
20 bootnr=c_bootnr, rseed=c_rseed
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
21 )
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
22
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
23 message("Plotting images")
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
24 plotter("plot_gap", plotgap(sc))
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
25 plotter("plot_jaccard", plotjaccard(sc))
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
26 plotter("plot_silhouette", plotsilhouette(sc))
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
27 plotter("plot_clustheatmap", x <- clustheatmap(sc, final=FALSE, hmethod="single"))
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
28
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
29
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
30 message("Finished plots")
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
31
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
32 if (generate_final_rdata){
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
33 message("Saving SC object")
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
34 saveRDS(sc, output_rdat)
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
35 }
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
36
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
37
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
38
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
39
ea8215239735 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid commit 39918bfdb08f06862ca395ce58a6f5e4f6dd1a5e
iuc
parents:
diff changeset
40