class Gaemr < Formula
  desc "Genome Assembly Evaluation, Metrics and Reporting"
  homepage "https://www.broadinstitute.org/software/gaemr/"
  # tag "bioinformatics"

  url "https://www.broadinstitute.org/software/gaemr/wp-content/uploads/2012/12/GAEMR-1.0.1.tar.gz"
  sha256 "cab1818e33b8ce9db2b25268206d73b5883f6c40843c258a72daba79e841d70a"

  bottle do
    root_url "https://archive.org/download/brewsci/bottles-science"
    sha256 cellar: :any, yosemite:      "95b6230d77b727f963437e3066b2c024054fea6087f145c946c8bcb47316999b"
    sha256 cellar: :any, mavericks:     "afb3ea09dea99f67b72f3395ad81dc3b369cb7c0b2ef29dafe9127b22585b36e"
    sha256 cellar: :any, mountain_lion: "15139afc47141dfd4df15b9ad8f75b6801624b26fadd63be6b5bbd61b7657fda"
  end

  def install
    libexec.install Dir["*"]
    bin.install_symlink "../libexec/bin/GAEMR.py"
  end

  def caveats
    <<~EOS
      After install GAEMR, you must do these 3 things:

      1. Amend your UNIX PATH environmental variable to point to your
         installation of the GAEMR/bin directory:
         export PATH=#{libexec}/bin:$PATH
      2. Amend your UNIX PYTHONPATH environmental variable to point to
         your installation of the GAEMR directory:
         export PYTHONPATH=#{libexec}:$PYTHONPATH
      3. Change the path variables in
         #{libexec}/gaemr/PlatformConstant.py
         to reflect your installation for the various bioinformatics tools.
    EOS
  end

  test do
    assert_match "Usage", shell_output("PYTHONPATH=#{libexec} #{bin}/GAEMR.py --help")
  end
end
