forked from mlist/RPPA-R-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselectSampleNames.R
More file actions
33 lines (26 loc) · 798 Bytes
/
selectSampleNames.R
File metadata and controls
33 lines (26 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
rppa.selectFactors <- function(spots, factor="SampleName")
{
require(tcltk)
tt<-tktoplevel()
tl<-tklistbox(tt,height=10,selectmode="multiple",background="white")
tkgrid(tklabel(tt,text="Please select factors to include."))
tkgrid(tl)
spotNames <- levels(spots[[factor]])
for (i in (1:length(spotNames)))
{
tkinsert(tl,"end",spotNames[i])
}
tkselection.set(tl,0) rm
OKSelection <- function()
{
spotNames <<- as.integer(tkcurselection(tl))
tkdestroy(tt)
}
OK.but <-tkbutton(tt,text=" OK ",command=OKSelection)
tkgrid(tklabel(tt,text=" "))
tkgrid(OK.but)
tkfocus(tt)
tkwait.window(tt)
spotNames <- spotNames + 1
return(spots[spots$SampleName %in% levels(spots$SampleName)[spotNames],])
}