Skip to content

Commit 35c6e6f

Browse files
author
Christian "Tischi" Tischer
committed
minor update
1 parent 9cee540 commit 35c6e6f

File tree

4 files changed

+25
-57
lines changed

4 files changed

+25
-57
lines changed

gui.R

+8-29
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,8 @@ guiHandler_JitterPlot <- function(h,...){
690690
gp <- ggroup(horizontal = T, container=w)
691691
glabel("Experiment selection: ", container=gp)
692692
guiExpSubset <- gcombobox(c("None selected", experiments),
693-
container = gp,
694693
selected = htmGetListSetting(htm,"visualisation","jitterPlotExpSubset",gui=T),
694+
container = gp,
695695
handler = function(h,...){
696696
htmSetListSetting(htm,"visualisation","jitterPlotExpSubset",svalue(h$obj),gui=T)
697697
})
@@ -706,14 +706,7 @@ guiHandler_JitterPlot <- function(h,...){
706706

707707
gp <- ggroup(horizontal = T, container=w)
708708
glabel("Sorting: ", container=gp)
709-
guiSorting <- gcombobox(c("none","alphabetic","median value"),
710-
container = gp,
711-
selected = htmGetListSetting(htm,"visualisation","jitterPlot_sorting",gui=T),
712-
handler = function(h,...){
713-
htmSetListSetting(htm, "visualisation","jitterPlot_sorting",svalue(h$obj),gui=T)
714-
}
715-
)
716-
709+
guiSorting <- gcombobox(c("None selected","alphabetic","median value"), container=gp)
717710

718711
gp <- ggroup(horizontal = T, container=w)
719712
glabel("Compute t-test against: ", container=gp)
@@ -728,10 +721,10 @@ guiHandler_JitterPlot <- function(h,...){
728721
cx = svalue(cx),
729722
cy = svalue(cy),
730723
.ylab = svalue(cy),
731-
datatype = htmGetListSetting(htm,"visualisation","jitterPlot_datatype",gui=T),
724+
datatype = svalue(guiSelectedData),
732725
experimentSubset = svalue(guiExpSubset),
733726
treatmentSubset = htmGetVectorSettings("visualisation$treatmentSelectionForPlotting"),
734-
sorting = htmGetListSetting(htm,"visualisation","jitterPlot_sorting",gui=T),
727+
sorting = svalue(guiSorting),
735728
colorizeTreatments = htmGetListSetting(htm,"visualisation","jitterPlot_colorizeTreatments_TF",gui=T),
736729
showMedian = htmGetListSetting(htm,"visualisation","jitterPlot_showMedianAndMAD_TF",gui=T),
737730
showMean = htmGetListSetting(htm,"visualisation","jitterPlot_showMeanAndSD_TF",gui=T),
@@ -745,9 +738,9 @@ guiHandler_JitterPlot <- function(h,...){
745738
htm <- get("htm", envir = globalenv())
746739
htmJitterplot(htm, svalue(cx), svalue(cy), .xlim=sort(loc$x),.ylim=sort(loc$y),.ylab=svalue(cy),
747740
experimentSubset = svalue(guiExpSubset),
748-
datatype = htmGetListSetting(htm,"visualisation","jitterPlot_datatype",gui=T),
741+
datatype = svalue(guiSelectedData),
749742
colorizeTreatments = htmGetListSetting(htm,"visualisation","jitterPlot_colorizeTreatments_TF",gui=T),
750-
sorting = htmGetListSetting(htm,"visualisation","jitterPlot_sorting",gui=T),
743+
sorting = svalue(guiSorting),
751744
newdev = F,
752745
treatmentSubset = htmGetVectorSettings("visualisation$treatmentSelectionForPlotting"),
753746
showMedian = htmGetListSetting(htm,"visualisation","jitterPlot_showMedianAndMAD_TF",gui=T),
@@ -766,7 +759,7 @@ guiHandler_JitterPlot <- function(h,...){
766759
svalue(cx),svalue(cy),.xlim=sort(loc$x),.ylim=sort(loc$y),
767760
experimentSubset = svalue(guiExpSubset),
768761
colorizeTreatments = htmGetListSetting(htm,"visualisation","jitterPlot_colorizeTreatments_TF",gui=T),
769-
sorting = htmGetListSetting(htm,"visualisation","jitterPlot_sorting",gui=T),
762+
sorting = svalue(guiSorting),
770763
datatype = svalue(guiSelectedData),
771764
newdev = F, action="click",
772765
treatmentSubset = htmGetVectorSettings("visualisation$treatmentSelectionForPlotting")
@@ -836,16 +829,7 @@ guiHandler_JitterPlot_Options <- function(h,...) {
836829
container = w,
837830
handler = function(h,...){
838831
htmSetListSetting(htm, "visualisation","jitterPlot_log2_TF",svalue(h$obj),gui=T)
839-
})
840-
841-
glabel("x axis font size factor:", container=w)
842-
gcombobox(c("0.3","0.4","0.5","0.6","0.7","0.8","0.9","1.0"),
843-
container = w,
844-
selected = htmGetListSetting(htm,"visualisation","jitterPlot_x_axis_font_size",gui=T),
845-
handler = function(h,...){
846-
htmSetListSetting(htm, "visualisation","jitterPlot_x_axis_font_size",svalue(h$obj),gui=T)
847-
}
848-
)
832+
})
849833

850834
visible(w) <- T
851835
}
@@ -1129,15 +1113,10 @@ guiHandler_SetColumns <- function(h, ...) {
11291113

11301114
gbutton(" Apply ", container = gg, handler = function(h,...) {
11311115
htm <- get("htm", envir = globalenv())
1132-
# auto-make batch_treat and treat_batch
11331116
cTreat = htmGetListSetting(htm,"columns","treatment",gui=T)
11341117
cBatch = htmGetListSetting(htm,"columns","experiment",gui=T)
11351118
htm@data$Metadata_batch_treatment = paste(htm@data[[cBatch]],htm@data[[cTreat]],sep="__")
11361119
print(paste("Generated new colum Metadata_batch_treatment, combining",cBatch,"and",cTreat))
1137-
htm@data$Metadata_treatment_batch = paste(htm@data[[cTreat]],htm@data[[cBatch]],sep="__")
1138-
print(paste("Generated new colum Metadata_treatment_batch, combining",cTreat,"and",cBatch))
1139-
1140-
11411120
assign("htm", htm, envir = globalenv())
11421121
dispose(w)
11431122
})

india.pdf

62.2 KB
Binary file not shown.

plots.R

+9-19
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ htmShowImagesFromRow <- function(htm,data,irs,appendCommand=""){
6161
filenamePrefix = htm@settings@visualisation$image_filename_prefix
6262
foldernamePrefix = htm@settings@visualisation$image_foldername_prefix
6363
# convert to forward slashes immideately, otherwise gsub has problems later
64-
rootFolderTable = gsub("\\\\" ,"/",htmGetListSetting(htm,"visualisation","image_root_foldername_in_table",gui=T))
65-
rootFolderReal = gsub("\\\\" ,"/",htmGetListSetting(htm,"visualisation","image_root_foldername_on_this_computer",gui=T))
66-
print(paste(" Pattern in table:",rootFolderTable))
67-
print(paste(" Pattern for real:",rootFolderReal))
68-
64+
rootFolderTable = gsub("\\\\" ,"/",htm@settings@visualisation$image_root_foldername_in_table)
65+
rootFolderReal = gsub("\\\\" ,"/",htm@settings@visualisation$image_root_foldername_on_this_computer)
66+
6967
if( .Platform$OS.type == "unix" ) {
7068
#imageViewerCMD = "/Applications/Fiji.app/Contents/MacOS/fiji-macosx --no-splash"
7169
imageViewerCMD = '/Applications/Fiji.app/Contents/MacOS/ImageJ-macosx -debug '
@@ -90,13 +88,10 @@ htmShowImagesFromRow <- function(htm,data,irs,appendCommand=""){
9088
imagename = strsplit(colname,filenamePrefix)[[1]][2]
9189
filename = data[[colname]][ir]
9290
cFolder = paste(foldernamePrefix,imagename,sep="")
93-
foldername = data[[cFolder]][ir]
94-
print(paste(" Folder in table:",foldername))
95-
foldername = gsub("\\\\" ,"/", foldername)
96-
#print(paste(" Folder after replacement of slashes:",foldername))
91+
#print(cFolder)
92+
foldername = gsub("\\\\" ,"/",data[[cFolder]][ir])
9793
foldername = gsub(rootFolderTable, rootFolderReal, foldername)
98-
print(paste(" Folder after subsitution of local mapping:",foldername))
99-
94+
10095
if ( .Platform$OS.type == "unix" ) {
10196
#foldername = gsub("\\\\" ,"/", foldername)
10297
#pathname = paste('"',foldername,"/",filename,'"',sep="")
@@ -703,7 +698,7 @@ htmHeatmap_MarkSelectedTreatment <- function(htm, selectedExp, selectedTreatment
703698

704699
htmJitterplot <- function(htm=htm, cx, cy, .xlab="", .ylab="", treatmentSubset = "None selected",
705700
.xlim=NA, .ylim=NA, datatype="images", colorizeTreatments=F,
706-
sorting="none", experimentSubset="None selected", newdev = T,
701+
sorting="None selected", experimentSubset="None selected", newdev = T,
707702
action="plot", printMeanSD = T, showMean = T, showMedian = T, save2file = F,
708703
scaleFromZero = F, reference="None selected") {
709704

@@ -777,7 +772,7 @@ htmJitterplot <- function(htm=htm, cx, cy, .xlab="", .ylab="", treatmentSubset =
777772
}
778773

779774
print(paste(" sorting:",sorting))
780-
if(sorting=="none") {
775+
if(sorting=="None selected") {
781776
ids = 1:nrow(data)
782777
}
783778
if(sorting=="alphabetic") {
@@ -946,12 +941,7 @@ htmJitterplot <- function(htm=htm, cx, cy, .xlab="", .ylab="", treatmentSubset =
946941
} else { # zooming
947942
plot(jp.x, jp.y, xaxt = "n", xlab=.xlab, ylab=.ylab, xlim=.xlim, ylim=.ylim, pch=pchQC, cex=dotsize, col=.colors, cex.lab =1)
948943
}
949-
if(htmGetListSetting(htm,"visualisation","jitterPlot_x_axis_font_size",gui=T) != "None selected") {
950-
x_axis_font_size = as.numeric(htmGetListSetting(htm,"visualisation","jitterPlot_x_axis_font_size",gui=T))
951-
} else {
952-
x_axis_font_size = 1
953-
}
954-
axis(1, at=1:length(lx), labels=lx, las=2, cex.axis = x_axis_font_size)
944+
axis(1, at=1:length(lx), labels=lx, las=2, cex.axis = 1)
955945

956946
plotTitle = ""
957947
if(experimentSubset[1] != "None selected") {

run.R

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11

2+
## specify libraries
3+
libs = list("gWidgets","gWidgetstcltk","markdown","plyr")
24

35
## install libraries
4-
if(F) {
5-
install.packages("gWidgets", repos='http://cran.us.r-project.org')
6-
install.packages("gWidgetstcltk", repos='http://cran.us.r-project.org')
7-
install.packages("markdown", repos='http://cran.us.r-project.org')
8-
install.packages("plyr", repos='http://cran.us.r-project.org')
9-
}
6+
# sapply(libs, biocLite)
7+
# install.packages("gWidgets")
8+
# install.packages("gWidgetstcltk")
9+
# install.packages("markdown")
10+
# install.packages("plyr")
11+
1012

1113
## load libraries
1214
print("Loading libraries...")
13-
libs = list("gWidgets","gWidgetstcltk","markdown","plyr")
1415
sapply(libs, function(x) do.call("library", list(x)))
1516

1617
options(warn = 2)
1718

1819
# path = "C:\\Users\\Christian Tischer\\Dropbox\\R\\HTM\\HTM_Explorer\\HTM_Explorer";setwd(path);source("run.R");
1920
# path = "/Users/tischi/Dropbox/R/HTM/HTM_Explorer/HTM_Explorer";setwd(path);source("run.R");
20-
# path = "\\\\almf\\almf\\software\\scripts\\R\\HTM_Explorer";setwd(path);source("run.R");
21-
# path = "Y:\\R\\HTM_Explorer";setwd(path);source("run.R");
2221

2322
## source code
2423
#setwd(path);source("install.R");

0 commit comments

Comments
 (0)