Nothing
#set of functions, directly/indirectly involved, in oneChannelGUI rnatargetmenu
#oneChannelGUI masigpro.edesign genrates a masigpro edesing using a specific configuration of the target file
#contains affylmGUI tclArrayVar
#calling internally oneChannelGUI copyFcn
#calling internally oneChannelGUI saveTargetsFile
#oneChannelGUI ML.edesign generates a data.frame containing the clinical parameters to be used for classification
#contains affylmGUI tclArrayVar
#calling internally oneChannelGUI copyFcn
#calling internally oneChannelGUI saveTargetsFile
#oneChannelGUI delete.ML cancel an ML design
#################################################################################
#modified 14 11 2006 adding the maSigPro.available=FALSE
#this function allow to run masigpro from the extAffylmGUI
#The function use a specific configuration of Target column of the affylmGUI target file
#each row of this column describe the array on the basis of the experimental design
#the first thre element of the row are Time_Replicate_Control separated by _
#all the other elements refers to various experimental conditions
#Considering two conditions each row is made of 5 elements:
#Time_Replicate_Control_cond1_cond2
#If we have an experiment made of two time points 0h and 24h in triplicate with two experimental condition
#the column will look like:
# Target
#0_1_1_0_0
#0_1_1_0_0
#0_1_1_0_0
#24_2_0_1_0
#24_2_0_1_0
#24_2_0_1_0
#24_3_0_0_1
#24_3_0_0_1
#24_3_0_0_1
#to get more info about the structure of edesign see maSigPro package
"masigpro.edesign"<-function(){
# require(maSigPro) || stop("library maSigPro could not be found !")
Try(whichArrayPlatform <- get("whichArrayPlatform",envir=affylmGUIenvironment))
if(whichArrayPlatform ==""){
Try(tkmessageBox(title="RNA Targets",message="No arrays have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
Try(return())
}
Try(targets <- affylmGUIenvironment$Targets$Target)
Try(targets <- strsplit(targets, "_"))
Try(targets <- t(as.data.frame(targets)))
Try(mysize <- dim(targets))
Try( targets <- matrix(data=as.numeric(targets), nrow=mysize[1]))
Try(targets <- as.data.frame(targets))
#defining the conditions evaluated
#3 represent Time, replicates control
Try(mycond <- dim(targets)[2] - 3 )
Try(mycond.num <- seq(from=1, to= mycond))
Try(mycond.names <- rep("cond", mycond))
Try(mycond <- paste(mycond.names, mycond.num, sep=""))
if(dim(targets)[2] == 4){
Try(dimnames(targets)[[2]] <- c("Time","Replicate", "Control", mycond))
} else if(dim(targets)[2] == 3){
Try(dimnames(targets)[[2]] <- c("Time","Replicate", "Control"))
}
Try(dimnames(targets)[[1]] <- sampleNames(affylmGUIenvironment$NormalizedAffyData))
#assigning a slot in the affylmenvironment to the masigpro design
assign("edesign" , targets, affylmGUIenvironment)
#checking the masigpro target
Try(NumSlides <- get("NumSlides",envir=affylmGUIenvironment))
Try(Targets <- get("edesign",envir=affylmGUIenvironment))
Try(ArraysLoaded <- get("ArraysLoaded", envir=affylmGUIenvironment))
if(ArraysLoaded==FALSE)
{
Try(tkmessageBox(title="RNA Targets",message="No arrays have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
return()
}
if(nrow(Targets)==0)
{
Try(tkmessageBox(title="RNA Targets",message="No RNA targets have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
return()
}
Try(TclRequire("Tktable"))
Try(ttViewRNATargets <- tktoplevel(.affylmGUIglobals$ttMain))
Try(tkwm.deiconify(ttViewRNATargets))
# Try(tkgrab.set(ttViewRNATargets))
Try(tkfocus(ttViewRNATargets))
Try(tkwm.title(ttViewRNATargets,"maSigPro edesign"))
# Try(n <- evalq(TclVarCount <- TclVarCount + 1, .TkRoot$env))
# Try(tclArrayName <- paste("::RTcl", n, sep = ""))
Try(tclArrayVar1 <- tclArrayVar())
Try(tclArrayName <- ls(tclArrayVar1$env))
# onClose <- function() {Try(tkgrab.release(ttViewRNATargets));Try(tkdestroy(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}
onClose <- function() {Try(tkdestroy(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}
Try(NumCols <- ncol(Targets))
Try(NumRows <- nrow(Targets))
Try(myRarray <- c())
if(NumCols>0)
for (j in (1:NumCols))
{
Try(myRarray <- c(myRarray,paste(colnames(Targets)[j])))
for (i in (1:NumRows))
{
Try(myRarray <- c(myRarray,paste(Targets[i,j])))
}
}
Try(dim(myRarray) <- c(NumRows+1,NumCols))
# This will give an error if tclArray doesn't exist.
# .Tcl("unset tclArray")
if(NumRows>0 && NumCols>0)
for (i in (0:NumRows))
for (j in (1:NumCols))
# Try(.Tcl(paste("set ",tclArrayName,"(",i,",",j-1,") ",myRarray[i+1,j],sep="")))
Try(tcl("set",paste(tclArrayName,"(",i,",",j-1,")",sep=""),paste(myRarray[i+1,j])))
# Below, I should just use tkwidget(ttViewRNATargets,"table",...)
Try(table1 <- .Tk.subwin(ttViewRNATargets))
Try(.Tcl(paste("table",.Tk.ID(table1),.Tcl.args(variable=tclArrayName,rows=paste(NumRows+1),cols=paste(NumCols),titlerows="0",titlecols="0",selectmode="extended",colwidth="13",background="white",rowseparator="\"\n\"",colseparator="\"\t\"",resizeborders="col",multiline="0",
titlerows=1,colstretchmode="unset",
xscrollcommand=function(...) tkset(xscr,...),yscrollcommand=function(...) tkset(yscr,...),state="disabled"))))
Try(xscr <- tkscrollbar(ttViewRNATargets,orient="horizontal", command=function(...)tkxview(table1,...)))
Try(yscr <- tkscrollbar(ttViewRNATargets,command=function(...)tkyview(table1,...)))
Try(tkgrid(table1,yscr))
Try(tkgrid.configure(yscr,sticky="nsw"))
Try(tkgrid(xscr))
Try(tkgrid.configure(xscr,sticky="new"))
Try(tkconfigure(table1,font=.affylmGUIglobals$affylmGUIfontTable))
for (j in (1:NumCols))
Try(tcl(.Tk.ID(table1),"width",paste(j-1),paste(max(4,nchar(colnames(Targets)[j])+2,max(nchar(Targets[,j]))+2))))
Try(copyFcn <- function() .Tcl(paste("event","generate",.Tcl.args(.Tk.ID(table1),"<<Copy>>"))))
saveTargetsFile <- function()
{
Try(TargetsFileNameText <- tclvalue(tkgetSaveFile(filetypes="{{RNA Targets Files} {.txt}} {{All files} *}")))
Try(if(!nchar(TargetsFileNameText)) return())
Try(len <- nchar(TargetsFileNameText))
if(len<=4)
Try( TargetsFileNameText <- paste(TargetsFileNameText,".txt",sep=""))
else if(substring(TargetsFileNameText,len-3,len)!=".txt")
Try(TargetsFileNameText <- paste(TargetsFileNameText,".txt",sep=""))
Try(Targets <- matrix(nrow=NumRows,ncol=NumCols))
Try(colnamesTargets <- c())
if(NumCols>0)
Try(for (j in (1:NumCols))
colnamesTargets[j] <- tclvalue(paste(tclArrayName,"(0,",j-1,")",sep="")))
Try(colnames(Targets) <- colnamesTargets)
if(NumRows>0 && NumCols>0)
Try(for (i in (1:NumRows))
for (j in (1:NumCols))
Targets[i,j] <- tclvalue(paste(tclArrayName,"(",i,",",j-1,")",sep="")))
Try(write.table(Targets,file=TargetsFileNameText,sep="\t",quote=FALSE,col.names=TRUE,row.names=FALSE))
}
Try(topMenu <- tkmenu(ttViewRNATargets, tearoff=FALSE))
Try(topMenu <- tkmenu(ttViewRNATargets, tearoff=FALSE))
Try(fileMenu <- tkmenu(topMenu, tearoff=FALSE))
Try(tkadd(fileMenu, "command", label="Save As", command=saveTargetsFile)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(fileMenu, "command", label="Close", command=onClose)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(topMenu, "cascade", label="File",menu=fileMenu)) # ) # ,font=affylmGUIfontMenu))
Try(editMenu <- tkmenu(topMenu, tearoff=FALSE))
Try(tkadd(editMenu, "command", label="Copy <Ctrl-C>", command=copyFcn)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(topMenu, "cascade", label="Edit",menu=editMenu)) # ) # ,font=affylmGUIfontMenu))
Try(tkconfigure(ttViewRNATargets,menu=topMenu))
Try(tkfocus(ttViewRNATargets))
# Try(tkbind(ttViewRNATargets, "<Destroy>", function() {Try(tkgrab.release(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}))
Try(tkbind(ttViewRNATargets, "<Destroy>", function() {Try(tkfocus(.affylmGUIglobals$ttMain))}))
# Try(tkwait.window(ttViewRNATargets))
}
################################################################################
#The function generate a data.frame containing the clinica parameters to be used for classification
#the column will look like:
# Target
#0_1_1_0_0
#0_1_1_0_0
#0_1_1_0_0
#24_2_0_1_0
#24_2_0_1_0
#24_2_0_1_0
#24_3_0_0_1
#24_3_0_0_1
#24_3_0_0_1
#to get more info about the structure of edesign see maSigPro package
################################################################################
"delete.ML" <- function(){
Try(MLdesign.Available <- get("MLdesign.Available",envir=affylmGUIenvironment))
if(MLdesign.Available){
Try(assign("MLdesign.Available", FALSE, envir=affylmGUIenvironment))
Try(tkdelete(.affylmGUIglobals$mainTree,"classification.Status"))
Try(tkinsert(.affylmGUIglobals$mainTree,"end","classification","classification.Status" ,text="Not Available",font=.affylmGUIglobals$affylmGUIfontTree))
}
}
###############################################################################
"ML.edesign"<-function(){
# require(pamr) || stop("library pamr could not be found !")
Try(whichArrayPlatform <- get("whichArrayPlatform",envir=affylmGUIenvironment))
if(whichArrayPlatform ==""){
Try(tkmessageBox(title="RNA Targets",message="No arrays have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
Try(return())
}
Try(MLdesign.Available <- get("MLdesign.Available",envir=affylmGUIenvironment))
if(MLdesign.Available){
#checking the large set target structure
Try(NumSlides <- get("NumSlides",envir=affylmGUIenvironment))
Try(Targets <- get("MLdesign",envir=affylmGUIenvironment))
Try(ArraysLoaded <- get("ArraysLoaded", envir=affylmGUIenvironment))
if(ArraysLoaded==FALSE)
{
Try(tkmessageBox(title="RNA Targets",message="No arrays have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
return()
}
if(nrow(Targets)==0)
{
Try(tkmessageBox(title="RNA Targets",message="No RNA targets have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
return()
}
Try(TclRequire("Tktable"))
Try(ttViewRNATargets <- tktoplevel(.affylmGUIglobals$ttMain))
Try(tkwm.deiconify(ttViewRNATargets))
# Try(tkgrab.set(ttViewRNATargets))
Try(tkfocus(ttViewRNATargets))
Try(tkwm.title(ttViewRNATargets,"Classification parameters"))
# Try(n <- evalq(TclVarCount <- TclVarCount + 1, .TkRoot$env))
# Try(tclArrayName <- paste("::RTcl", n, sep = ""))
Try(tclArrayVar1 <- tclArrayVar())
Try(tclArrayName <- ls(tclArrayVar1$env))
# onClose <- function() {Try(tkgrab.release(ttViewRNATargets));Try(tkdestroy(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}
onClose <- function() {Try(tkdestroy(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}
Try(NumCols <- ncol(Targets))
Try(NumRows <- nrow(Targets))
Try(myRarray <- c())
if(NumCols>0)
for (j in (1:NumCols))
{
Try(myRarray <- c(myRarray,paste(colnames(Targets)[j])))
for (i in (1:NumRows))
{
Try(myRarray <- c(myRarray,paste(Targets[i,j])))
}
}
Try(dim(myRarray) <- c(NumRows+1,NumCols))
# This will give an error if tclArray doesn't exist.
# .Tcl("unset tclArray")
if(NumRows>0 && NumCols>0)
for (i in (0:NumRows))
for (j in (1:NumCols))
# Try(.Tcl(paste("set ",tclArrayName,"(",i,",",j-1,") ",myRarray[i+1,j],sep="")))
Try(tcl("set",paste(tclArrayName,"(",i,",",j-1,")",sep=""),paste(myRarray[i+1,j])))
# Below, I should just use tkwidget(ttViewRNATargets,"table",...)
Try(table1 <- .Tk.subwin(ttViewRNATargets))
Try(.Tcl(paste("table",.Tk.ID(table1),.Tcl.args(variable=tclArrayName,rows=paste(NumRows+1),cols=paste(NumCols),titlerows="0",titlecols="0",selectmode="extended",colwidth="13",background="white",rowseparator="\"\n\"",colseparator="\"\t\"",resizeborders="col",multiline="0",
titlerows=1,colstretchmode="unset",
xscrollcommand=function(...) tkset(xscr,...),yscrollcommand=function(...) tkset(yscr,...),state="disabled"))))
Try(xscr <- tkscrollbar(ttViewRNATargets,orient="horizontal", command=function(...)tkxview(table1,...)))
Try(yscr <- tkscrollbar(ttViewRNATargets,command=function(...)tkyview(table1,...)))
Try(tkgrid(table1,yscr))
Try(tkgrid.configure(yscr,sticky="nsw"))
Try(tkgrid(xscr))
Try(tkgrid.configure(xscr,sticky="new"))
Try(tkconfigure(table1,font=.affylmGUIglobals$affylmGUIfontTable))
for (j in (1:NumCols))
Try(tcl(.Tk.ID(table1),"width",paste(j-1),paste(max(4,nchar(colnames(Targets)[j])+2,max(nchar(Targets[,j]))+2))))
Try(copyFcn <- function() .Tcl(paste("event","generate",.Tcl.args(.Tk.ID(table1),"<<Copy>>"))))
saveTargetsFile <- function()
{
Try(TargetsFileNameText <- tclvalue(tkgetSaveFile(filetypes="{{RNA Targets Files} {.txt}} {{All files} *}")))
Try(if(!nchar(TargetsFileNameText)) return())
Try(len <- nchar(TargetsFileNameText))
if(len<=4)
Try( TargetsFileNameText <- paste(TargetsFileNameText,".txt",sep=""))
else if(substring(TargetsFileNameText,len-3,len)!=".txt")
Try(TargetsFileNameText <- paste(TargetsFileNameText,".txt",sep=""))
Try(Targets <- matrix(nrow=NumRows,ncol=NumCols))
Try(colnamesTargets <- c())
if(NumCols>0)
Try(for (j in (1:NumCols))
colnamesTargets[j] <- tclvalue(paste(tclArrayName,"(0,",j-1,")",sep="")))
Try(colnames(Targets) <- colnamesTargets)
if(NumRows>0 && NumCols>0)
Try(for (i in (1:NumRows))
for (j in (1:NumCols))
Targets[i,j] <- tclvalue(paste(tclArrayName,"(",i,",",j-1,")",sep="")))
Try(write.table(Targets,file=TargetsFileNameText,sep="\t",quote=FALSE,col.names=TRUE,row.names=FALSE))
}
Try(topMenu <- tkmenu(ttViewRNATargets, tearoff=FALSE))
Try(topMenu <- tkmenu(ttViewRNATargets, tearoff=FALSE))
Try(fileMenu <- tkmenu(topMenu, tearoff=FALSE))
Try(tkadd(fileMenu, "command", label="Save As", command=saveTargetsFile)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(fileMenu, "command", label="Close", command=onClose)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(topMenu, "cascade", label="File",menu=fileMenu)) # ) # ,font=affylmGUIfontMenu))
Try(editMenu <- tkmenu(topMenu, tearoff=FALSE))
Try(tkadd(editMenu, "command", label="Copy <Ctrl-C>", command=copyFcn)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(topMenu, "cascade", label="Edit",menu=editMenu)) # ) # ,font=affylmGUIfontMenu))
Try(tkconfigure(ttViewRNATargets,menu=topMenu))
Try(tkfocus(ttViewRNATargets))
# Try(tkbind(ttViewRNATargets, "<Destroy>", function() {Try(tkgrab.release(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}))
Try(tkbind(ttViewRNATargets, "<Destroy>", function() {Try(tkfocus(.affylmGUIglobals$ttMain))}))
# Try(tkwait.window(ttViewRNATargets))
} else{
Try(targets <- affylmGUIenvironment$Targets$Target)
Try(targets <- strsplit(targets, "_"))
Try(targets <- t(as.data.frame(targets)))
Try(targets <- as.data.frame(targets))
#defining the conditions evaluated
#3 represent Time, replicates control
Try(mycond <- dim(targets)[2])
Try(mycond.num <- seq(from=1, to= mycond))
Try(mycond.names <- rep("covar", mycond))
Try(mycond <- paste(mycond.names, mycond.num, sep=""))
#qui va caricato un file con la definizione delle condizioni
# Try(dimnames(targets)[[2]] <- c("Time","Replicate", "Control", mycond))
Try(dimnames(targets)[[1]] <- sampleNames(affylmGUIenvironment$NormalizedAffyData))
Try(dimnames(targets)[[2]] <- mycond)
#assigning a slot in the affylmenvironment to the masigpro design
######################
Try(x <- get("NormalizedAffyData", env=affylmGUIenvironment))
# Try(MLdesign <- get("MLdesign",envir=affylmGUIenvironment))
Try(pd <- phenoData(x)@data)
Try(pd <- cbind(pd[,1:2], targets))
# Try(tkmessageBox(title="Clinical parameters",message="Open the file containing the definition of the clinical parameters\n Names should be separated by carriage return"))
Try(mbVal <- tkmessageBox(title="Clinical parameters",
message="Open the file containing clinical parameters header\n Names should be separated by carriage return",
icon="question",type="okcancel",default="ok"
)#end of tkmessageBox
)#end of Try(mbVal..
if(tclvalue(mbVal)=="ok"){
Try(assign("MLdesign.Available",TRUE,affylmGUIenvironment))
Try(assign("MLdesign" , targets, affylmGUIenvironment))
Try(tkdelete(.affylmGUIglobals$mainTree,"classification.Status"))
Try(tkinsert(.affylmGUIglobals$mainTree,"end","classification","classification.Status" ,text="Available",font=.affylmGUIglobals$affylmGUIfontTree))
Try(tempFileName <- tclvalue(tkgetOpenFile(filetypes="{{Text Files} {.txt}} {{All files} *}")))
if(!nchar(tempFileName))
{
tkfocus(.affylmGUIglobals$ttMain)
return()
}
Try(clinNames<-read.table(tempFileName, sep="\t", header=F, as.is=TRUE))
if(dim(clinNames)[2]>1){
Try(tkmessageBox(title="Clinical parameters",message="Clinical parameter name file should contain only one column!"))
Try(return())
} else{
names(pd)[3:dim(pd)[2]] <- clinNames[,1]
Try(var.tmp.pd<-data.frame(names(pd)))
Try(names(var.tmp.pd)<-"labelDescription" )
Try(rownames(var.tmp.pd)<-names(pd))
Try(tmp1.pd<-new("AnnotatedDataFrame", data=pd, varMetadata=var.tmp.pd))
Try(phenoData(x) <- tmp1.pd)
Try(assign("NormalizedAffyData" , x, affylmGUIenvironment))
}
} else {Try(return())}
#####################
#checking the masigpro target
Try(NumSlides <- get("NumSlides",envir=affylmGUIenvironment))
Try(Targets <- get("MLdesign",envir=affylmGUIenvironment))
Try(ArraysLoaded <- get("ArraysLoaded", envir=affylmGUIenvironment))
if(ArraysLoaded==FALSE)
{
Try(tkmessageBox(title="RNA Targets",message="No arrays have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
return()
}
if(nrow(Targets)==0)
{
Try(tkmessageBox(title="RNA Targets",message="No RNA targets have been loaded. Please try New or Open from the File menu.",type="ok",icon="error"))
Try(tkfocus(.affylmGUIglobals$ttMain))
return()
}
Try(TclRequire("Tktable"))
Try(ttViewRNATargets <- tktoplevel(.affylmGUIglobals$ttMain))
Try(tkwm.deiconify(ttViewRNATargets))
# Try(tkgrab.set(ttViewRNATargets))
Try(tkfocus(ttViewRNATargets))
Try(tkwm.title(ttViewRNATargets,"Classification parameters"))
# Try(n <- evalq(TclVarCount <- TclVarCount + 1, .TkRoot$env))
# Try(tclArrayName <- paste("::RTcl", n, sep = ""))
Try(tclArrayVar1 <- tclArrayVar())
Try(tclArrayName <- ls(tclArrayVar1$env))
# onClose <- function() {Try(tkgrab.release(ttViewRNATargets));Try(tkdestroy(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}
onClose <- function() {Try(tkdestroy(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}
Try(NumCols <- ncol(Targets))
Try(NumRows <- nrow(Targets))
Try(myRarray <- c())
if(NumCols>0)
for (j in (1:NumCols))
{
Try(myRarray <- c(myRarray,paste(colnames(Targets)[j])))
for (i in (1:NumRows))
{
Try(myRarray <- c(myRarray,paste(Targets[i,j])))
}
}
Try(dim(myRarray) <- c(NumRows+1,NumCols))
# This will give an error if tclArray doesn't exist.
# .Tcl("unset tclArray")
if(NumRows>0 && NumCols>0)
for (i in (0:NumRows))
for (j in (1:NumCols))
# Try(.Tcl(paste("set ",tclArrayName,"(",i,",",j-1,") ",myRarray[i+1,j],sep="")))
Try(tcl("set",paste(tclArrayName,"(",i,",",j-1,")",sep=""),paste(myRarray[i+1,j])))
# Below, I should just use tkwidget(ttViewRNATargets,"table",...)
Try(table1 <- .Tk.subwin(ttViewRNATargets))
Try(.Tcl(paste("table",.Tk.ID(table1),.Tcl.args(variable=tclArrayName,rows=paste(NumRows+1),cols=paste(NumCols),titlerows="0",titlecols="0",selectmode="extended",colwidth="13",background="white",rowseparator="\"\n\"",colseparator="\"\t\"",resizeborders="col",multiline="0",
titlerows=1,colstretchmode="unset",
xscrollcommand=function(...) tkset(xscr,...),yscrollcommand=function(...) tkset(yscr,...),state="disabled"))))
Try(xscr <- tkscrollbar(ttViewRNATargets,orient="horizontal", command=function(...)tkxview(table1,...)))
Try(yscr <- tkscrollbar(ttViewRNATargets,command=function(...)tkyview(table1,...)))
Try(tkgrid(table1,yscr))
Try(tkgrid.configure(yscr,sticky="nsw"))
Try(tkgrid(xscr))
Try(tkgrid.configure(xscr,sticky="new"))
Try(tkconfigure(table1,font=.affylmGUIglobals$affylmGUIfontTable))
for (j in (1:NumCols))
Try(tcl(.Tk.ID(table1),"width",paste(j-1),paste(max(4,nchar(colnames(Targets)[j])+2,max(nchar(Targets[,j]))+2))))
Try(copyFcn <- function() .Tcl(paste("event","generate",.Tcl.args(.Tk.ID(table1),"<<Copy>>"))))
saveTargetsFile <- function()
{
Try(TargetsFileNameText <- tclvalue(tkgetSaveFile(filetypes="{{RNA Targets Files} {.txt}} {{All files} *}")))
Try(if(!nchar(TargetsFileNameText)) return())
Try(len <- nchar(TargetsFileNameText))
if(len<=4)
Try( TargetsFileNameText <- paste(TargetsFileNameText,".txt",sep=""))
else if(substring(TargetsFileNameText,len-3,len)!=".txt")
Try(TargetsFileNameText <- paste(TargetsFileNameText,".txt",sep=""))
Try(Targets <- matrix(nrow=NumRows,ncol=NumCols))
Try(colnamesTargets <- c())
if(NumCols>0)
Try(for (j in (1:NumCols))
colnamesTargets[j] <- tclvalue(paste(tclArrayName,"(0,",j-1,")",sep="")))
Try(colnames(Targets) <- colnamesTargets)
if(NumRows>0 && NumCols>0)
Try(for (i in (1:NumRows))
for (j in (1:NumCols))
Targets[i,j] <- tclvalue(paste(tclArrayName,"(",i,",",j-1,")",sep="")))
Try(write.table(Targets,file=TargetsFileNameText,sep="\t",quote=FALSE,col.names=TRUE,row.names=FALSE))
}
Try(topMenu <- tkmenu(ttViewRNATargets, tearoff=FALSE))
Try(topMenu <- tkmenu(ttViewRNATargets, tearoff=FALSE))
Try(fileMenu <- tkmenu(topMenu, tearoff=FALSE))
Try(tkadd(fileMenu, "command", label="Save As", command=saveTargetsFile)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(fileMenu, "command", label="Close", command=onClose)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(topMenu, "cascade", label="File",menu=fileMenu)) # ) # ,font=affylmGUIfontMenu))
Try(editMenu <- tkmenu(topMenu, tearoff=FALSE))
Try(tkadd(editMenu, "command", label="Copy <Ctrl-C>", command=copyFcn)) # ) # ,font=affylmGUIfontMenu))
Try(tkadd(topMenu, "cascade", label="Edit",menu=editMenu)) # ) # ,font=affylmGUIfontMenu))
Try(tkconfigure(ttViewRNATargets,menu=topMenu))
Try(tkfocus(ttViewRNATargets))
# Try(tkbind(ttViewRNATargets, "<Destroy>", function() {Try(tkgrab.release(ttViewRNATargets));Try(tkfocus(.affylmGUIglobals$ttMain))}))
Try(tkbind(ttViewRNATargets, "<Destroy>", function() {Try(tkfocus(.affylmGUIglobals$ttMain))}))
# Try(tkwait.window(ttViewRNATargets))
}
}
################################################################################
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.