Skip to content

Commit e8e947c

Browse files
authored
Update digestR.R
1 parent 18ec308 commit e8e947c

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

R/digestR.R

+74-74
Original file line numberDiff line numberDiff line change
@@ -18956,85 +18956,85 @@ ps <- function(dispPane='co'){
1895618956
}
1895718957
applyButton <- ttkbutton(genePlotTypeFrame, text='Apply', width=11, command=onApply)
1895818958

18959-
onDisplayGene <- function()
18960-
{
18961-
geneName <- modalDialog(dlg, 'Gene Name Entry', 'Enter the name of the gene you wish to view in detail:', '')
18962-
if(geneName == 'ID_CANCEL')
18963-
{
18964-
return()
18965-
}else
18966-
{
18967-
if(nchar(geneName) == 0)
18968-
{
18969-
analyze_genes('')
18970-
}
18971-
else if(geneName %in% species$genes$name)
18972-
{
18973-
analyze_genes(geneName)
18974-
}else
18975-
{
18976-
log_message(paste0(geneName, ' is not a valid gene of ', species$name))
18977-
}
18978-
}
18979-
18980-
}
18981-
displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
18982-
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-
# # Entry box for manual gene name input
18993-
# geneEntry <- tkentry(geneDialog, width = 30)
18994-
# tkgrid(geneEntry, padx = 10, pady = 5)
18995-
18996-
# # Dropdown (combobox) populated with available gene names from species$genes$name
18997-
# geneNamesList <- species$genes$name # Assuming this is a list of available gene names
18998-
# geneDropdown <- ttkcombobox(geneDialog, values = geneNamesList, width = 27)
18999-
# tkgrid(geneDropdown, padx = 10, pady = 5)
19000-
19001-
# # Function to handle the 'OK' button click
19002-
# onOK <- function() {
19003-
# # Get the gene name from either the entry box or dropdown
19004-
# geneName <- tclvalue(geneEntry)
19005-
# if (nchar(geneName) == 0) {
19006-
# geneName <- tclvalue(geneDropdown) # Fall back to dropdown selection
19007-
# }
18959+
# onDisplayGene <- function()
18960+
# {
18961+
# geneName <- modalDialog(dlg, 'Gene Name Entry', 'Enter the name of the gene you wish to view in detail:', '')
18962+
# if(geneName == 'ID_CANCEL')
18963+
# {
18964+
# return()
18965+
# }else
18966+
# {
18967+
# if(nchar(geneName) == 0)
18968+
# {
18969+
# analyze_genes('')
18970+
# }
18971+
# else if(geneName %in% species$genes$name)
18972+
# {
18973+
# analyze_genes(geneName)
18974+
# }else
18975+
# {
18976+
# log_message(paste0(geneName, ' is not a valid gene of ', species$name))
18977+
# }
18978+
# }
1900818979

19009-
# if (nchar(geneName) == 0) {
19010-
# # No gene entered or selected, analyze full proteome
19011-
# analyze_genes('')
19012-
# } else if (geneName %in% species$genes$name) {
19013-
# # Valid gene name, analyze the selected gene
19014-
# analyze_genes(geneName)
19015-
# } else {
19016-
# # Invalid gene name, display error message
19017-
# log_message(paste0(geneName, ' is not a valid gene of ', species$name))
19018-
# }
18980+
# }
18981+
# displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
18982+
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+
# Entry box for manual gene name input
18993+
geneEntry <- tkentry(geneDialog, width = 30)
18994+
tkgrid(geneEntry, padx = 10, pady = 5)
18995+
18996+
# Dropdown (combobox) populated with available gene names from species$genes$name
18997+
geneNamesList <- species$genes$name # Assuming this is a list of available gene names
18998+
geneDropdown <- ttkcombobox(geneDialog, values = geneNamesList, width = 27)
18999+
tkgrid(geneDropdown, padx = 10, pady = 5)
19000+
19001+
# Function to handle the 'OK' button click
19002+
onOK <- function() {
19003+
# Get the gene name from either the entry box or dropdown
19004+
geneName <- tclvalue(geneEntry)
19005+
if (nchar(geneName) == 0) {
19006+
geneName <- tclvalue(geneDropdown) # Fall back to dropdown selection
19007+
}
19008+
19009+
if (nchar(geneName) == 0) {
19010+
# No gene entered or selected, analyze full proteome
19011+
analyze_genes('')
19012+
} else if (geneName %in% species$genes$name) {
19013+
# Valid gene name, analyze the selected gene
19014+
analyze_genes(geneName)
19015+
} else {
19016+
# Invalid gene name, display error message
19017+
log_message(paste0(geneName, ' is not a valid gene of ', species$name))
19018+
}
1901919019

19020-
# tkdestroy(geneDialog) # Close the dialog box
19021-
# }
19020+
tkdestroy(geneDialog) # Close the dialog box
19021+
}
1902219022

19023-
# # OK button
19024-
# okButton <- ttkbutton(geneDialog, text = 'OK', command = onOK)
19025-
# tkgrid(okButton, padx = 10, pady = 10)
19023+
# OK button
19024+
okButton <- ttkbutton(geneDialog, text = 'OK', command = onOK)
19025+
tkgrid(okButton, padx = 10, pady = 10)
1902619026

19027-
# # Cancel button
19028-
# onCancel <- function() {
19029-
# tkdestroy(geneDialog) # Close the dialog box without action
19030-
# }
19031-
# cancelButton <- ttkbutton(geneDialog, text = 'Cancel', command = onCancel)
19032-
# tkgrid(cancelButton, padx = 10, pady = 10)
19027+
# Cancel button
19028+
onCancel <- function() {
19029+
tkdestroy(geneDialog) # Close the dialog box without action
19030+
}
19031+
cancelButton <- ttkbutton(geneDialog, text = 'Cancel', command = onCancel)
19032+
tkgrid(cancelButton, padx = 10, pady = 10)
1903319033

19034-
# # Keep focus on the dialog
19035-
# tkfocus(geneDialog)
19036-
# }
19037-
# displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
19034+
# Keep focus on the dialog
19035+
tkfocus(geneDialog)
19036+
}
19037+
displayGeneButton <- ttkbutton(genePlotTypeFrame, text='Display Single Gene', width=21, command=onDisplayGene)
1903819038

1903919039
onDisplayProteome <- function()
1904019040
{

0 commit comments

Comments
 (0)