egenn commited on
Commit
17e03a6
·
1 Parent(s): efcf5dd
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. globals.R +15 -6
Dockerfile CHANGED
@@ -15,10 +15,10 @@ RUN install2.r --error \
15
 
16
  # Install GitHub packages
17
  RUN installGithub.r \
18
- egenn/rtemis \
19
- egenn/rtemisbio \
20
  rstudio/bslib \
21
- rstudio/httpuv
 
 
22
 
23
  COPY . .
24
 
 
15
 
16
  # Install GitHub packages
17
  RUN installGithub.r \
 
 
18
  rstudio/bslib \
19
+ rstudio/httpuv \
20
+ egenn/rtemis \
21
+ egenn/rtemisbio
22
 
23
  COPY . .
24
 
globals.R CHANGED
@@ -64,6 +64,10 @@ hilite <- function(x) {
64
  paste0("<span style='color: #72CDF4;font-weight: bold;'>", x, "</span>")
65
  }
66
 
 
 
 
 
67
  #' Summarize a3 object in HTML
68
  #'
69
  #' @param x a3 object
@@ -71,23 +75,28 @@ hilite <- function(x) {
71
  #' @return HTML string
72
  #' @author EDG
73
  summarize_a3 <- function(x) {
 
 
 
 
 
74
  htmltools::HTML(
75
  paste0(
 
76
  if (!is.null(x$UniprotID)) paste0("Uniprot ID: ", hilite(x$UniprotID), "<br>"),
77
  paste0("Sequence length: ", hilite(length(x$Sequence)), "<br>"),
78
  "<ul>",
79
- if (length(x$Annotations$Site) > 0) paste("<li>", hilite(length(x$Annotations$Site)), "site annotations<br>"),
80
- if (length(x$Annotations$Region) > 0) paste("<li>", hilite(length(x$Annotations$Region)), "region annotations<br>"),
81
- if (length(x$Annotations$PTM) > 0) paste("<li>", hilite(length(x$Annotations$PTM)), "PTM annotations<br>"),
82
- if (length(x$Annotations$Cleavage_site) > 0) paste("<li>", hilite(length(x$Annotations$Cleavage_site)), " cleavage site annotations<br>"),
83
- if (length(x$Annotations$Variant) > 0) paste("<li>", hilite(length(x$Annotations$Variant)), "variant annotations<br>"),
84
  "</ul>",
85
  if (!is.null(x$Reference)) a("Reference", href = x$Reference, target = "_blank")
86
  )
87
  )
88
  } # seqvizlive::summarize_a3
89
 
90
-
91
  # Create list using custom bullet
92
  rhelplist <- function(x, bullet = bsicons::bs_icon("arrow-right-short")) {
93
  htmltools::HTML(
 
64
  paste0("<span style='color: #72CDF4;font-weight: bold;'>", x, "</span>")
65
  }
66
 
67
+ nannot <- function(n) {
68
+ ngettext(n, "annotation", "annotations")
69
+ }
70
+
71
  #' Summarize a3 object in HTML
72
  #'
73
  #' @param x a3 object
 
75
  #' @return HTML string
76
  #' @author EDG
77
  summarize_a3 <- function(x) {
78
+ n_site <- length(x$Annotations$Site)
79
+ n_region <- length(x$Annotations$Region)
80
+ n_ptm <- length(x$Annotations$PTM)
81
+ n_cleavage <- length(x$Annotations$Cleavage_site)
82
+ n_variant <- length(x$Annotations$Variant)
83
  htmltools::HTML(
84
  paste0(
85
+ if (!is.null(x$Description)) paste0("Description: ", hilite(x$Description), "<br>"),
86
  if (!is.null(x$UniprotID)) paste0("Uniprot ID: ", hilite(x$UniprotID), "<br>"),
87
  paste0("Sequence length: ", hilite(length(x$Sequence)), "<br>"),
88
  "<ul>",
89
+ if (n_site > 0) paste("<li>", hilite(n_site), "site", nannot(n_site), "<br>"),
90
+ if (n_region > 0) paste("<li>", hilite(n_region), "region", nannot(n_region), "<br>"),
91
+ if (n_ptm > 0) paste("<li>", hilite(n_ptm), "PTM", nannot(n_ptm), "<br>"),
92
+ if (n_cleavage > 0) paste("<li>", hilite(n_cleavage), " cleavage site", nannot(n_cleavage), "<br>"),
93
+ if (n_variant > 0) paste("<li>", hilite(n_variant), "variant", nannot(n_variant), "<br>"),
94
  "</ul>",
95
  if (!is.null(x$Reference)) a("Reference", href = x$Reference, target = "_blank")
96
  )
97
  )
98
  } # seqvizlive::summarize_a3
99
 
 
100
  # Create list using custom bullet
101
  rhelplist <- function(x, bullet = bsicons::bs_icon("arrow-right-short")) {
102
  htmltools::HTML(