Skip to content

Commit 6b895bd

Browse files
authored
Update digestR.R
Updated SplashScreen
1 parent 86ee5fe commit 6b895bd

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

R/digestR.R

+37-36
Original file line numberDiff line numberDiff line change
@@ -1362,60 +1362,61 @@ popupGui <- function(dev){
13621362
# # Force the graphics device to refresh
13631363
# dev.flush()
13641364
# }
1365+
##################################################################################
13651366

1366-
# Displays the digestR splash screen
1367-
splashScreen <- function(){
1367+
library(png) # For PNG images
13681368

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

1380-
# Create plot with no margins and no axes (R will auto-scale the plot)
1381-
par(mar=c(0,0,0,0), bg='#0d0d0d')
1382-
plot(1:2, type='n', xlab='', ylab='', axes=FALSE)
1383-
1384-
# Get the dimensions of the image
1385-
img_width <- dim(img)[2]
1386-
img_height <- dim(img)[1]
1387-
1388-
# Display the image, scaled to fit the plot area automatically
1389-
rasterImage(img, 1, 1, 2, 2)
1390-
1375+
par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
1376+
cex.main=defaultSettings$cex.main, bg='black')
1377+
1378+
# Define plot area without axis
1379+
plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=c(-1.5, 1.5), ylim=c(-1.5, 1.5))
1380+
1381+
# Display the image
1382+
rasterImage(img, 3, 3, 3, 3)
1383+
13911384
# Letter positions and modern color scheme for "PANDAS"
1392-
letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1393-
x_positions <- c(1.1, 1.2, 1.3, 1.4, 1.5, 1.6) # Adjust the positions as needed
1394-
y_positions <- rep(1.5, 6) # Use same Y position for all letters
1395-
colors <- rep('#4da6ff', 6) # Color for the letters
1396-
cex_values <- rep(5, 6) # Font size for the letters
1385+
letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1386+
x_positions <- c(-0.8, -0.5, -0.2, 0.1, 0.4, 0.7) # Custom X positions for each letter
1387+
y_positions <- c(0.62, 0.62, 0.62, 0.62, 0.62, 0.62) # Same Y position for all
1388+
colors <- rep('#4da6ff', 6) # Light blue for all letters
1389+
cex_values <- rep(5, 6) # Font size for letters
13971390

1398-
# Add shadow effect to the letters
1391+
# Add shadow effect to the letters for depth
13991392
shadow_col <- '#00000050' # Semi-transparent black shadow
14001393
for (i in 1:length(letters)) {
1401-
text(x_positions[i] + 0.01, y_positions[i] - 0.01, letters[i], col=shadow_col, cex=cex_values[i], pos=3)
1394+
text(x_positions[i] + 0.02, y_positions[i] - 0.02, letters[i], col=shadow_col, cex=cex_values[i], pos=3)
14021395
text(x_positions[i], y_positions[i], letters[i], col=colors[i], cex=cex_values[i], pos=3)
14031396
}
1397+
1398+
# Add black shadow for the title "Peptide Analyzer of Naturally Digested Amino acid Sequences"
1399+
text(0, -0.4, 'Peptide Analyzer of', col='black', cex=1.80, font=2.3) # Black shadow
1400+
text(0, -0.4, 'Peptide Analyzer of', col='#4da6ff', cex=1.8, font=2) # Main text
14041401

1405-
# Add black shadow and main text for title
1406-
text(1.5, 1.2, 'Peptide Analyzer of', col='black', cex=1.80, font=2) # Black shadow
1407-
text(1.5, 1.2, 'Peptide Analyzer of', col='#4da6ff', cex=1.8, font=2) # Main text
1402+
# Shadow for "Naturally Digested Amino acid Sequences"
1403+
text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='black', cex=1.80, font=2.3) # Black shadow
1404+
text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='#4da6ff', cex=1.8, font=2) # Main text
14081405

1409-
text(1.5, 1.0, 'Naturally Digested Amino acid Sequences', col='black', cex=1.80, font=2) # Black shadow
1410-
text(1.5, 1.0, 'Naturally Digested Amino acid Sequences', col='#4da6ff', cex=1.8, font=2) # Main text
1406+
# Version and command text, shifted further downwards
1407+
text(0, -0.75, paste('version 1.0.0', pkgVar$version), col='#00b3b3', font=2) # Dynamic color
14111408

1412-
# Display version and command text
1413-
text(1.5, 0.8, paste('version 1.0.0', pkgVar$version), col='#00b3b3', font=2) # Version
1409+
# Clean, minimal function list with better spacing and shifted downwards
1410+
text(0, -0.86, 'gp() - Generate New Proteome', col='#00b3b3', cex=1.1, font = 2) # Light blue
1411+
text(0, -0.94, 'pm() - Process Mascot files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1412+
text(0, -1.02, 'fo() - Open *.dcf files', col='#00b3b3', cex=1.1, font = 2) # Light blue
14141413

14151414
# Force the graphics device to refresh
14161415
dev.flush()
14171416
}
1418-
1417+
1418+
splashScreen()
1419+
14191420
##################################################################################
14201421

14211422
about <- function(){

0 commit comments

Comments
 (0)