Skip to content

Commit 198c6e1

Browse files
authored
Update digestR.R
1 parent e98ac7e commit 198c6e1

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

R/digestR.R

+57
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,63 @@ splashScreen <- function(){
13631363
dev.flush()
13641364
}
13651365

1366+
##################################################################################
1367+
# New splashScreen to display when loading DigestR
1368+
1369+
1370+
splashScreen1 <- function(){
1371+
library(png)
1372+
# Load the image and get its dimensions
1373+
img_path <- system.file("extdata", "DigestRpicture.png", package = "digestR")
1374+
img <- readPNG(img_path)
1375+
# Define the plot limits (xlim, ylim) based on the image dimensions or the desired screen size
1376+
xlim <- c(-1.5, 1.5) # Adjust the x-axis limits as needed
1377+
ylim <- c(-1.5, 1.5) # Adjust the y-axis limits as needed
1378+
1379+
# Create plot with no margins and appropriate limits
1380+
par(mar=c(0,0,0,0), bg='#0d0d0d')
1381+
plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=xlim, ylim=ylim)
1382+
1383+
# Display the image, stretched to fit the plot region
1384+
rasterImage(img, xlim[1], ylim[1], xlim[2], ylim[2])
1385+
1386+
# Letter positions and modern color scheme for "PANDAS"
1387+
letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1388+
x_positions <- c(-0.9, -0.6, -0.3, 0.0, 0.3, 0.6) # Custom X positions for each letter
1389+
y_positions <- c(0.62, 0.62, 0.62, 0.62, 0.62, 0.62) # Use different y positions as needed
1390+
colors <- rep('#4da6ff', 6) #
1391+
cex_values <- rep(5, 6) # Reduced font size for smaller splash screen
1392+
1393+
# Add shadow effect to the letters for depth
1394+
shadow_col <- '#00000050' # Semi-transparent black shadow
1395+
for (i in 1:length(letters)) {
1396+
text(x_positions[i] + 0.02, y_positions[i] - 0.02, letters[i], col=shadow_col, cex=cex_values[i], pos=3)
1397+
text(x_positions[i], y_positions[i], letters[i], col=colors[i], cex=cex_values[i], pos=3)
1398+
}
1399+
1400+
# Add black shadow for the title "Peptide Analyzer of Naturally Digested Amino acid Sequences"
1401+
# Shadow for "Peptide Analyzer of"
1402+
text(0, -0.4, 'Peptide Analyzer of', col='black', cex=1.80, font=2.3) # Black shadow
1403+
# Main text for "Peptide Analyzer of"
1404+
text(0, -0.4, 'Peptide Analyzer of', col='#4da6ff', cex=1.8, font=2) # Main text
1405+
1406+
# Shadow for "Naturally Digested Amino acid sequences"
1407+
text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='black', cex=1.80, font=2.3) # Black shadow
1408+
# Main text for "Naturally Digested Amino acid sequences"
1409+
text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='#4da6ff', cex=1.8, font=2) # Main text
1410+
1411+
# Version and command text, shifted further downwards
1412+
text(0, -0.75, paste('version 1.0.0', pkgVar$version), col='#00b3b3', font=2) # Dynamic color
1413+
1414+
# Clean, minimal function list with better spacing and shifted downwards
1415+
text(0, -0.86, 'gp() - Generate New Proteome', col='#00b3b3', cex=1.1, font = 2) # Light blue
1416+
text(0, -0.94, 'pm() - Process Mascot files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1417+
text(0, -1.02, 'fo() - Open *.dcf files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1418+
1419+
# Force the graphics device to refresh
1420+
dev.flush()
1421+
}
1422+
13661423
##################################################################################
13671424

13681425
about <- function(){

0 commit comments

Comments
 (0)