Skip to content

Commit d54c358

Browse files
authored
Update digestR.R
1 parent 36ab85b commit d54c358

File tree

1 file changed

+78
-78
lines changed

1 file changed

+78
-78
lines changed

R/digestR.R

+78-78
Original file line numberDiff line numberDiff line change
@@ -18980,80 +18980,6 @@ ps <- function(dispPane='co'){
1898018980
# }
1898118981
# displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
1898218982

18983-
# onDisplayGene <- function() {
18984-
# # Generate a temporary dialog window
18985-
# geneDialog <- tktoplevel()
18986-
# tkwm.title(geneDialog, "Gene Name Entry")
18987-
18988-
# # Instruction label
18989-
# geneLabel <- ttklabel(geneDialog, text = 'Enter the name of the gene you wish to view in detail:')
18990-
# tkgrid(geneLabel, padx = 10, pady = 5)
18991-
18992-
# # Create tclVars for both the entry and dropdown
18993-
# geneEntryVar <- tclVar("")
18994-
# geneDropdownVar <- tclVar("")
18995-
18996-
# # Entry box for manual gene name input
18997-
# geneEntry <- tkentry(geneDialog, textvariable=geneEntryVar, width = 30)
18998-
# tkgrid(geneEntry, padx = 10, pady = 5)
18999-
19000-
# # Dropdown (combobox) populated with available gene names from species$genes$name
19001-
# geneNamesList <- species$genes$name # Assuming this is a list of available gene names
19002-
19003-
# if (length(geneNamesList) == 0) {
19004-
# tkmessageBox(message = "No gene names available.", icon = "error")
19005-
# tkdestroy(geneDialog)
19006-
# return()
19007-
# }
19008-
19009-
# geneDropdown <- ttkcombobox(geneDialog, textvariable=geneDropdownVar, values = geneNamesList, width = 27)
19010-
# tkgrid(geneDropdown, padx = 10, pady = 5)
19011-
19012-
# # Function to handle the 'OK' button click
19013-
# onOK <- function() {
19014-
# # Get the gene name from either the entry box or dropdown
19015-
# geneName <- tclvalue(geneEntryVar)
19016-
# if (nchar(geneName) == 0) {
19017-
# geneName <- tclvalue(geneDropdownVar) # Fall back to dropdown selection
19018-
# }
19019-
19020-
# if (nchar(geneName) == 0) {
19021-
# # No gene entered or selected, analyze full proteome
19022-
# analyze_genes('')
19023-
# } else if (geneName %in% species$genes$name) {
19024-
# # Valid gene name, analyze the selected gene
19025-
# analyze_genes(geneName)
19026-
# } else {
19027-
# # Invalid gene name, display error message
19028-
# log_message(paste0(geneName, ' is not a valid gene of ', species$name))
19029-
# }
19030-
19031-
# tkdestroy(geneDialog) # Close the dialog box
19032-
# }
19033-
19034-
# # OK button
19035-
# okButton <- ttkbutton(geneDialog, text = 'OK', command = onOK)
19036-
# tkgrid(okButton, padx = 10, pady = 10)
19037-
19038-
# # Cancel button
19039-
# onCancel <- function() {
19040-
# tkdestroy(geneDialog) # Close the dialog box without action
19041-
# }
19042-
# cancelButton <- ttkbutton(geneDialog, text = 'Cancel', command = onCancel)
19043-
# tkgrid(cancelButton, padx = 10, pady = 10)
19044-
19045-
# # Keep focus on the dialog
19046-
# tkfocus(geneDialog)
19047-
# tcl("update") # Ensure focus and window visibility is updated
19048-
# }
19049-
# displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
19050-
19051-
onDisplayProteome <- function()
19052-
{
19053-
analyze_genes('')
19054-
}
19055-
displayGenomeButton <- ttkbutton(genePlotTypeFrame, text='Display Full Proteome', width=21, command=onDisplayProteome)
19056-
1905718983
onDisplayGene <- function() {
1905818984
# Generate a temporary dialog window
1905918985
geneDialog <- tktoplevel()
@@ -19063,17 +18989,24 @@ onDisplayGene <- function() {
1906318989
geneLabel <- ttklabel(geneDialog, text = 'Enter the name of the gene you wish to view in detail:')
1906418990
tkgrid(geneLabel, padx = 10, pady = 5)
1906518991

19066-
# Create Tcl variables to hold the gene name values
18992+
# Create tclVars for both the entry and dropdown
1906718993
geneEntryVar <- tclVar("")
1906818994
geneDropdownVar <- tclVar("")
1906918995

1907018996
# Entry box for manual gene name input
19071-
geneEntry <- tkentry(geneDialog, width = 30, textvariable = geneEntryVar)
18997+
geneEntry <- tkentry(geneDialog, textvariable=geneEntryVar, width = 30)
1907218998
tkgrid(geneEntry, padx = 10, pady = 5)
1907318999

1907419000
# Dropdown (combobox) populated with available gene names from species$genes$name
1907519001
geneNamesList <- species$genes$name # Assuming this is a list of available gene names
19076-
geneDropdown <- ttkcombobox(geneDialog, values = geneNamesList, width = 27, textvariable = geneDropdownVar)
19002+
19003+
if (length(geneNamesList) == 0) {
19004+
tkmessageBox(message = "No gene names available.", icon = "error")
19005+
tkdestroy(geneDialog)
19006+
return()
19007+
}
19008+
19009+
geneDropdown <- ttkcombobox(geneDialog, textvariable=geneDropdownVar, values = geneNamesList, width = 27)
1907719010
tkgrid(geneDropdown, padx = 10, pady = 5)
1907819011

1907919012
# Function to handle the 'OK' button click
@@ -19111,9 +19044,76 @@ onDisplayGene <- function() {
1911119044

1911219045
# Keep focus on the dialog
1911319046
tkfocus(geneDialog)
19047+
tcl("update") # Ensure focus and window visibility is updated
1911419048
}
1911519049
displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
1911619050

19051+
onDisplayProteome <- function()
19052+
{
19053+
analyze_genes('')
19054+
}
19055+
displayGenomeButton <- ttkbutton(genePlotTypeFrame, text='Display Full Proteome', width=21, command=onDisplayProteome)
19056+
19057+
# onDisplayGene <- function() {
19058+
# # Generate a temporary dialog window
19059+
# geneDialog <- tktoplevel()
19060+
# tkwm.title(geneDialog, "Gene Name Entry")
19061+
19062+
# # Instruction label
19063+
# geneLabel <- ttklabel(geneDialog, text = 'Enter the name of the gene you wish to view in detail:')
19064+
# tkgrid(geneLabel, padx = 10, pady = 5)
19065+
19066+
# # Create Tcl variables to hold the gene name values
19067+
# geneEntryVar <- tclVar("")
19068+
# geneDropdownVar <- tclVar("")
19069+
19070+
# # Entry box for manual gene name input
19071+
# geneEntry <- tkentry(geneDialog, width = 30, textvariable = geneEntryVar)
19072+
# tkgrid(geneEntry, padx = 10, pady = 5)
19073+
19074+
# # Dropdown (combobox) populated with available gene names from species$genes$name
19075+
# geneNamesList <- species$genes$name # Assuming this is a list of available gene names
19076+
# geneDropdown <- ttkcombobox(geneDialog, values = geneNamesList, width = 27, textvariable = geneDropdownVar)
19077+
# tkgrid(geneDropdown, padx = 10, pady = 5)
19078+
19079+
# # Function to handle the 'OK' button click
19080+
# onOK <- function() {
19081+
# # Get the gene name from either the entry box or dropdown
19082+
# geneName <- tclvalue(geneEntryVar)
19083+
# if (nchar(geneName) == 0) {
19084+
# geneName <- tclvalue(geneDropdownVar) # Fall back to dropdown selection
19085+
# }
19086+
19087+
# if (nchar(geneName) == 0) {
19088+
# # No gene entered or selected, analyze full proteome
19089+
# analyze_genes('')
19090+
# } else if (geneName %in% species$genes$name) {
19091+
# # Valid gene name, analyze the selected gene
19092+
# analyze_genes(geneName)
19093+
# } else {
19094+
# # Invalid gene name, display error message
19095+
# log_message(paste0(geneName, ' is not a valid gene of ', species$name))
19096+
# }
19097+
19098+
# tkdestroy(geneDialog) # Close the dialog box
19099+
# }
19100+
19101+
# # OK button
19102+
# okButton <- ttkbutton(geneDialog, text = 'OK', command = onOK)
19103+
# tkgrid(okButton, padx = 10, pady = 10)
19104+
19105+
# # Cancel button
19106+
# onCancel <- function() {
19107+
# tkdestroy(geneDialog) # Close the dialog box without action
19108+
# }
19109+
# cancelButton <- ttkbutton(geneDialog, text = 'Cancel', command = onCancel)
19110+
# tkgrid(cancelButton, padx = 10, pady = 10)
19111+
19112+
# # Keep focus on the dialog
19113+
# tkfocus(geneDialog)
19114+
# }
19115+
# displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
19116+
1911719117
##add widgets to fileFrame
1911819118
tkgrid(onedFileFrame, column=1, row=1, sticky='nswe', pady=c(6, 4), padx=8)
1911919119
tkgrid(onedFileBox, column=1, row=1, sticky='nswe')
@@ -19239,7 +19239,7 @@ displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', wi
1923919239
## Now that the window is set up, deiconify it to show the window properly
1924019240
tkwm.deiconify(dlg)
1924119241
tcl("update") # Ensure the window is fully drawn and updated
19242-
refresh(...)
19242+
refresh()
1924319243

1924419244
invisible()
1924519245
}

0 commit comments

Comments
 (0)