Skip to content

Commit 2f1384a

Browse files
authored
Update digestR.R
Test new splashScreen
1 parent 72a7588 commit 2f1384a

File tree

1 file changed

+73
-73
lines changed

1 file changed

+73
-73
lines changed

R/digestR.R

+73-73
Original file line numberDiff line numberDiff line change
@@ -1327,98 +1327,98 @@ popupGui <- function(dev){
13271327
}
13281328

13291329
# Displays the digestR splash screen
1330-
splashScreen <- function(){
1330+
# splashScreen <- function(){
13311331

1332-
par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
1333-
cex.main=defaultSettings$cex.main, bg='black')
1334-
colMain <- '#b4d0f3'
1335-
colBack <- '#0065ca'
1336-
plot(0, 0, type='n', xlab='', ylab='', col.axis='black')
1337-
# Define your color palette
1338-
#colMain <- '#FF5733' # A warm main color
1339-
#colBack <- '#2E86C1' # A contrasting background color
1332+
# par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
1333+
# cex.main=defaultSettings$cex.main, bg='black')
1334+
# colMain <- '#b4d0f3'
1335+
# colBack <- '#0065ca'
1336+
# plot(0, 0, type='n', xlab='', ylab='', col.axis='black')
1337+
# # Define your color palette
1338+
# #colMain <- '#FF5733' # A warm main color
1339+
# #colBack <- '#2E86C1' # A contrasting background color
13401340

1341-
# Letter positions and colors
1342-
letters <- c('D', 'I', 'G', 'E', 'S', 'T', 'R')
1343-
colors <- c(colMain, colMain, colMain, colMain, colMain, colMain, colBack)
1344-
cex_values <- c(7, 7, 7, 7, 7, 7, 6.5)
1345-
offset_values <- c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.4)
1341+
# # Letter positions and colors
1342+
# letters <- c('D', 'I', 'G', 'E', 'S', 'T', 'R')
1343+
# colors <- c(colMain, colMain, colMain, colMain, colMain, colMain, colBack)
1344+
# cex_values <- c(7, 7, 7, 7, 7, 7, 6.5)
1345+
# offset_values <- c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.4)
13461346

1347-
# Loop to create and position letters
1348-
for (i in 1:length(letters)) {
1349-
text(-0.75 + (i-1)*0.25, 0.2, letters[i], col=colors[i], cex=cex_values[i], pos=3, offset=offset_values[i])
1350-
}
1347+
# # Loop to create and position letters
1348+
# for (i in 1:length(letters)) {
1349+
# text(-0.75 + (i-1)*0.25, 0.2, letters[i], col=colors[i], cex=cex_values[i], pos=3, offset=offset_values[i])
1350+
# }
13511351

1352-
# Add a decorative 'R' in a different color
1353-
text(0.70, 0.2, 'R', col='#E74C3C', cex=5.5, pos=3, offset=0.4)
1352+
# # Add a decorative 'R' in a different color
1353+
# text(0.70, 0.2, 'R', col='#E74C3C', cex=5.5, pos=3, offset=0.4)
13541354

1355-
# Other text elements (modify as needed)
1356-
text(0, 0.08, 'Digestomics Analyzer', col=colMain, cex=2.5, font=1)
1357-
text(0, -0.15, paste('version 1.0.0', pkgVar$version), col=colMain, font=3)
1358-
text(0, -0.25, 'gp() - Generate New Proteome', col=colMain)
1359-
text(0, -0.35, 'pm() - Process Mascot files', col=colMain)
1360-
text(0, -0.45, 'fo() - Open *.dcf files', col=colMain)
1355+
# # Other text elements (modify as needed)
1356+
# text(0, 0.08, 'Digestomics Analyzer', col=colMain, cex=2.5, font=1)
1357+
# text(0, -0.15, paste('version 1.0.0', pkgVar$version), col=colMain, font=3)
1358+
# text(0, -0.25, 'gp() - Generate New Proteome', col=colMain)
1359+
# text(0, -0.35, 'pm() - Process Mascot files', col=colMain)
1360+
# text(0, -0.45, 'fo() - Open *.dcf files', col=colMain)
13611361

1362-
# Force the graphics device to refresh
1363-
dev.flush()
1364-
}
1362+
# # Force the graphics device to refresh
1363+
# dev.flush()
1364+
# }
13651365
##################################################################################
1366-
# library(png)
1366+
library(png)
13671367

1368-
# splashScreen <- function() {
1368+
splashScreen <- function() {
1369+
library(png)
13691370

1371+
par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
1372+
cex.main=defaultSettings$cex.main, bg='black')
1373+
colMain <- '#b4d0f3'
1374+
colBack <- '#0065ca'
1375+
plot(0, 0, type='n', xlab='', ylab='', col.axis='black')
1376+
1377+
# Load the image and get its dimensions
1378+
img_path <- system.file("extdata", "DigestRpicture.png", package = "digestR")
1379+
img <- readPNG(img_path)
13701380

1371-
# par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
1372-
# cex.main=defaultSettings$cex.main, bg='black')
1373-
# colMain <- '#b4d0f3'
1374-
# colBack <- '#0065ca'
1375-
# plot(0, 0, type='n', xlab='', ylab='', col.axis='black')
1381+
# Define plot area without axis
1382+
plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=c(-1.5, 1.5), ylim=c(-1.5, 1.5))
13761383

1377-
# # Load the image and get its dimensions
1378-
# img_path <- system.file("extdata", "DigestRpicture.png", package = "digestR")
1379-
# img <- readPNG(img_path)
1380-
1381-
# # Define plot area without axis
1382-
# plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=c(-1.5, 1.5), ylim=c(-1.5, 1.5))
1383-
1384-
# # Display the image
1385-
# rasterImage(img, 3, 3, 3, 3)
1384+
# Display the image
1385+
rasterImage(img, -1.5, -1.5, 1.5, 1.5)
13861386

1387-
# # Letter positions and modern color scheme for "PANDAS"
1388-
# letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1389-
# x_positions <- c(-0.8, -0.5, -0.2, 0.1, 0.4, 0.7) # Custom X positions for each letter
1390-
# y_positions <- c(0.62, 0.62, 0.62, 0.62, 0.62, 0.62) # Same Y position for all
1391-
# colors <- rep('#4da6ff', 6) # Light blue for all letters
1392-
# cex_values <- rep(5, 6) # Font size for letters
1387+
# Letter positions and modern color scheme for "PANDAS"
1388+
letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1389+
x_positions <- c(-0.8, -0.5, -0.2, 0.1, 0.4, 0.7) # Custom X positions for each letter
1390+
y_positions <- c(0.62, 0.62, 0.62, 0.62, 0.62, 0.62) # Same Y position for all
1391+
colors <- rep('#4da6ff', 6) # Light blue for all letters
1392+
cex_values <- rep(5, 6) # Font size for letters
13931393

1394-
# # Add shadow effect to the letters for depth
1395-
# shadow_col <- '#00000050' # Semi-transparent black shadow
1396-
# for (i in 1:length(letters)) {
1397-
# text(x_positions[i] + 0.02, y_positions[i] - 0.02, letters[i], col=shadow_col, cex=cex_values[i], pos=3)
1398-
# text(x_positions[i], y_positions[i], letters[i], col=colors[i], cex=cex_values[i], pos=3)
1399-
# }
1394+
# Add shadow effect to the letters for depth
1395+
shadow_col <- '#00000050' # Semi-transparent black shadow
1396+
for (i in 1:length(letters)) {
1397+
text(x_positions[i] + 0.02, y_positions[i] - 0.02, letters[i], col=shadow_col, cex=cex_values[i], pos=3)
1398+
text(x_positions[i], y_positions[i], letters[i], col=colors[i], cex=cex_values[i], pos=3)
1399+
}
14001400

1401-
# # Add black shadow for the title "Peptide Analyzer of Naturally Digested Amino acid Sequences"
1402-
# text(0, -0.4, 'Peptide Analyzer of', col='black', cex=1.80, font=2.3) # Black shadow
1403-
# text(0, -0.4, 'Peptide Analyzer of', col='#4da6ff', cex=1.8, font=2) # Main text
1401+
# Add black shadow for the title "Peptide Analyzer of Naturally Digested Amino acid Sequences"
1402+
text(0, -0.4, 'Peptide Analyzer of', col='black', cex=1.80, font=2.3) # Black shadow
1403+
text(0, -0.4, 'Peptide Analyzer of', col='#4da6ff', cex=1.8, font=2) # Main text
14041404

1405-
# # Shadow for "Naturally Digested Amino acid Sequences"
1406-
# text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='black', cex=1.80, font=2.3) # Black shadow
1407-
# text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='#4da6ff', cex=1.8, font=2) # Main text
1405+
# Shadow for "Naturally Digested Amino acid Sequences"
1406+
text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='black', cex=1.80, font=2.3) # Black shadow
1407+
text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='#4da6ff', cex=1.8, font=2) # Main text
14081408

1409-
# # Version and command text, shifted further downwards
1410-
# text(0, -0.75, paste('version 1.0.0', pkgVar$version), col='#00b3b3', font=2) # Dynamic color
1409+
# Version and command text, shifted further downwards
1410+
text(0, -0.75, paste('version 1.0.0', pkgVar$version), col='#00b3b3', font=2) # Dynamic color
14111411

1412-
# # Clean, minimal function list with better spacing and shifted downwards
1413-
# text(0, -0.86, 'gp() - Generate New Proteome', col='#00b3b3', cex=1.1, font = 2) # Light blue
1414-
# text(0, -0.94, 'pm() - Process Mascot files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1415-
# text(0, -1.02, 'fo() - Open *.dcf files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1412+
# Clean, minimal function list with better spacing and shifted downwards
1413+
text(0, -0.86, 'gp() - Generate New Proteome', col='#00b3b3', cex=1.1, font = 2) # Light blue
1414+
text(0, -0.94, 'pm() - Process Mascot files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1415+
text(0, -1.02, 'fo() - Open *.dcf files', col='#00b3b3', cex=1.1, font = 2) # Light blue
14161416

1417-
# # Force the graphics device to refresh
1418-
# dev.flush()
1419-
# }
1417+
# Force the graphics device to refresh
1418+
dev.flush()
1419+
}
14201420

1421-
# splashScreen()
1421+
splashScreen()
14221422
##################################################################################
14231423
# library(png) # For PNG images
14241424

0 commit comments

Comments
 (0)