Skip to content

Commit 75cfa14

Browse files
committed
Update exomiser install to add a ~/.exomiser and ~/.exomiser/data directories and automatically setup the application.properties to read from this location.
1 parent ad58c3c commit 75cfa14

1 file changed

Lines changed: 76 additions & 60 deletions

File tree

Formula/exomiser.rb

Lines changed: 76 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,98 +3,114 @@ class Exomiser < Formula
33
homepage "https://github.com/exomiser/Exomiser/"
44
version "14.1.0"
55

6-
# Distribution zip from the Monarch Initiative data repository.
6+
# Data release version is independent of the application version.
7+
# Update both constants when releasing a new version.
8+
DATA_VERSION = "2512"
9+
#DATA_BASE_URL = "https://data.monarchinitiative.org/exomiser/latest"
10+
DATA_BASE_URL = "https://g-879a9f.f5dc97.75bc.dn.glob.us/data"
11+
12+
# Distribution zip from GitHub
713
# Update the URL and sha256 checksum when a new version is released.
814
url "https://github.com/exomiser/Exomiser/releases/download/#{version}/exomiser-cli-#{version}-distribution.zip"
915
sha256 "fb9705017000b448b1331cfd5e1b17c8941713b8c29e4ac30524e96869224db6"
1016

1117
license "AGPL-3.0"
1218

1319
# Exomiser requires Java 21 or above.
14-
depends_on "openjdk@25"
20+
depends_on "openjdk"
1521

1622
# No compiled code — Exomiser ships as a pre-built JAR.
1723
def install
18-
# Install the JAR and bundled configuration/example files.
19-
libexec.install Dir["*"]
20-
# Create a wrapper script using Homebrew's idiomatic method.
21-
# --sun-misc-unsafe-memory-access=allow suppresses JVM warnings from native libraries that use internal Java APIs.
22-
bin.write_jar_script libexec/"exomiser-cli-#{version}.jar", "exomiser",
23-
"-Dspring.config.location=#{libexec}/application.properties"
24-
end
24+
libexec.install Dir["*"]
2525

26-
def caveats
27-
<<~EOS
28-
Exomiser has been installed, but it requires large data files to run.
26+
# Set up ~/.exomiser/data and seed application.properties at install time.
27+
exomiser_home = Pathname.new(Dir.home)/".exomiser"
28+
exomiser_data = exomiser_home/"data"
29+
exomiser_config = exomiser_home/"application.properties"
2930

30-
─────────────────────────────────────────────────────────────────────
31-
NEXT STEPS: Download the Exomiser data files
32-
─────────────────────────────────────────────────────────────────────
31+
exomiser_data.mkpath unless exomiser_data.exist?
3332

34-
1. Create a directory to hold the data (80+ GB required):
33+
unless exomiser_config.exist?
34+
config = (libexec/"application.properties").read
35+
config = config.sub(/^exomiser\.data-directory=.*$/, "exomiser.data-directory=#{exomiser_data}")
36+
config = config.sub(/^#?\s*exomiser\.hg19\.data-version=.*$/, "exomiser.hg19.data-version=#{DATA_VERSION}")
37+
config = config.sub(/^#?\s*exomiser\.hg38\.data-version=.*$/, "exomiser.hg38.data-version=#{DATA_VERSION}")
38+
config = config.sub(/^#?\s*exomiser\.phenotype\.data-version=.*$/, "exomiser.phenotype.data-version=#{DATA_VERSION}")
39+
exomiser_config.write config
40+
end
3541

36-
mkdir -p ~/exomiser-data
42+
bin.write_jar_script libexec/"exomiser-cli-#{version}.jar", "exomiser",
43+
"--sun-misc-unsafe-memory-access=allow -Dspring.config.location=#{exomiser_home}/application.properties"
44+
end
3745

38-
2. Download the data files (this will take a while):
46+
def caveats
47+
<<~EOS
48+
Exomiser has been installed. ~/.exomiser/application.properties and
49+
~/.exomiser/data have been created and pre-configured for you.
3950
40-
https://github.com/exomiser/Exomiser/discussions/categories/data-release
51+
─────────────────────────────────────────────────────────────────────
52+
NEXT STEPS: Download the Exomiser data files (~80 GB)
53+
─────────────────────────────────────────────────────────────────────
4154
42-
cd ~/exomiser-data
43-
curl -O https://data.monarchinitiative.org/exomiser/latest/2402_phenotype.zip
55+
Download the phenotype data (required for all analyses):
4456
45-
# Download one or both genome assemblies depending on your VCF:
46-
curl -O https://data.monarchinitiative.org/exomiser/latest/2402_hg38.zip
47-
curl -O https://data.monarchinitiative.org/exomiser/latest/2402_hg19.zip
57+
wget #{DATA_BASE_URL}/#{DATA_VERSION}_phenotype.zip -P ~/.exomiser/data
58+
unzip ~/.exomiser/data/#{DATA_VERSION}_phenotype.zip -d ~/.exomiser/data
4859
49-
3. Unzip the data files:
60+
Download the genome assembly data for your VCF file.
61+
If unsure, download both (each ~35 GB):
5062
51-
unzip '2402_*.zip' -d ~/exomiser-data
63+
# hg38 (GRCh38)
64+
wget #{DATA_BASE_URL}/#{DATA_VERSION}_hg38.zip -P ~/.exomiser/data
65+
unzip ~/.exomiser/data/#{DATA_VERSION}_hg38.zip -d ~/.exomiser/data
5266
53-
4. Configure Exomiser to find the data. Open:
67+
# hg19 (GRCh37)
68+
wget #{DATA_BASE_URL}/#{DATA_VERSION}_hg19.zip -P ~/.exomiser/data
69+
unzip ~/.exomiser/data/#{DATA_VERSION}_hg19.zip -d ~/.exomiser/data
5470
55-
#{libexec}/application.properties
71+
Your data directory should then look like this:
5672
57-
and set the data directory and version, for example:
73+
~/.exomiser/data/
74+
├── #{DATA_VERSION}_phenotype
75+
├── #{DATA_VERSION}_hg38
76+
└── #{DATA_VERSION}_hg19
5877
59-
exomiser.data-directory=#{Dir.home}/exomiser-data
60-
exomiser.hg38.data-version=2402
61-
exomiser.phenotype.data-version=2402
78+
─────────────────────────────────────────────────────────────────────
79+
CONFIGURATION
80+
─────────────────────────────────────────────────────────────────────
6281
63-
5. Run a test analysis to confirm everything is working:
82+
~/.exomiser/application.properties is pre-configured to point at
83+
~/.exomiser/data with data version #{DATA_VERSION}. You only need to
84+
edit it if you store data elsewhere or use a different data release.
6485
65-
exomiser analyse --analysis #{libexec}/examples/preset-exome-analysis.yml \
66-
--vcf #{libexec}/examples/Pfeiffer.vcf.gz --assembly hg19 \
67-
--sample #{libexec}/examples/pfeiffer-phenopacket.yml
86+
─────────────────────────────────────────────────────────────────────
87+
TEST YOUR INSTALLATION
88+
─────────────────────────────────────────────────────────────────────
6889
69-
─────────────────────────────────────────────────────────────────────
70-
MEMORY
71-
─────────────────────────────────────────────────────────────────────
90+
Once the data is downloaded, confirm everything is working:
7291
73-
By default the JVM allocates a fraction of available system RAM.
74-
For genome-scale analyses you may need more. Set JAVA_TOOL_OPTIONS
75-
before running exomiser to override this, for example:
92+
exomiser analyse --analysis #{libexec}/examples/test-analysis-exome.yml
7693
77-
export JAVA_TOOL_OPTIONS="-Xmx12g"
94+
─────────────────────────────────────────────────────────────────────
95+
MEMORY
96+
─────────────────────────────────────────────────────────────────────
7897
79-
─────────────────────────────────────────────────────────────────────
80-
FURTHER INFORMATION
81-
─────────────────────────────────────────────────────────────────────
98+
For genome-scale analyses you may need to increase JVM memory.
99+
Set JAVA_TOOL_OPTIONS before running, for example:
82100
83-
Exomiser Homebrew documentation:
84-
https://exomiser.readthedocs.io/en/stable/installation.html#linux-macos-installation-via-homebrew
101+
export JAVA_TOOL_OPTIONS="-Xmx12g"
85102
86-
Full documentation:
87-
https://exomiser.readthedocs.io
103+
─────────────────────────────────────────────────────────────────────
104+
FURTHER INFORMATION
105+
─────────────────────────────────────────────────────────────────────
88106
89-
Data releases and discussions:
90-
https://github.com/exomiser/Exomiser/discussions/categories/data-release
91-
EOS
92-
end
107+
Full documentation : https://exomiser.readthedocs.io
108+
Data releases : https://github.com/exomiser/Exomiser/discussions/categories/data-release
109+
EOS
110+
end
93111

94-
test do
95-
# Verify the wrapper script invokes Java and prints the Exomiser version.
96-
# This does not require data files to be present.
97-
output = shell_output("#{bin}/exomiser --version 2>&1", 0)
98-
assert_match version.to_s, output
112+
test do
113+
output = shell_output("#{bin}/exomiser --version 2>&1", 0)
114+
assert_match version.to_s, output
115+
end
99116
end
100-
end

0 commit comments

Comments
 (0)