title: How to validate user input in shiny
body: <p>I'm working on a very simple Shiny app that takes in a DNA codon and returns the corresponding amino acid. My issue is that I want to validate the user input so that it can only accept 3 letter (a single codon), must be capital letters, and only accept the DNA bases ( A, C, T, or G). I've had a look at <a href="https://shiny.rstudio.com/articles/validation.html" rel="nofollow noreferrer">Shiny's validation article</a>, but keep on running into errors. 
  Here is the code I have so far:</p>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  library(shinythemes)
  
  shinyUI(fluidPage(
  
    theme = shinytheme("slate"),
  
    # Application title
    titlePanel("Codon lookup"),
  
    # 
    sidebarLayout(
      sidebarPanel(
        textInput(
          inputId = "codon",
          label = "Enter a codon",
          value = ""),
        actionButton(inputId = "go", label = "Search")
      ),
  
      # 
      mainPanel(
        verbatimTextOutput("aminoacid")
      )
    )
  ))
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>library(shiny)
  library(Biostrings)
  
  shinyServer(function(input, output) {
  
    data &lt;- eventReactive(input$go, {
  
      #validate somehow
        input$codon
  
  
    })
  
  
    output$aminoacid &lt;- renderText({
  
      GENETIC_CODE[[as.character(data())]]
  
    })
  
  })
  </code></pre>
  
  <p>Also, if anyone know of an easy way to retrieve the amino acid's full name, rather than just the single letter notation, that would be helpful. Any other suggestions are welcomed. </p>