Problems using SnpEff

[ Mirrored from a support ticket received ]

Problem Loading SnpEff

Error Received

After running module load snpEff, the following command does not work.

module load snpEff/5.1
java -jar snpEff.jar
Error: Unable to access jarfile snpEff.jar

Resolution

Because of how SnpEff is installed on the cluster, the “snpEff.jar” must be referenced via it’s absolute path. Loading the snpEff module will set 3 environment variables: $SNPEFFJAR, $SNPEFFDIR, and $SNPSIFTJAR.

To run SnpEff, use the following command:

java -jar $SNPEFFJAR

Problem With Database Download

Error Received

When running SnpEff it might attempt to download some files. Without setting some extra variables, you might receive an error similar to the following:

java.lang.RuntimeException: java.lang.RuntimeException: Cannot create directory '/bigdata/operations/pkgadmin/opt/linux/centos/8.x/x86_64/pkgs/snpEff/5.1/snpEff/data/xx'
at org.snpeff.util.Download.unzip(Download.java:374)
at org.snpeff.snpEffect.commandLine.SnpEffCmdDownload.downloadAndInstall(SnpEffCmdDownload.java:41)
at org.snpeff.snpEffect.commandLine.SnpEffCmdDownload.downloadAndInstall(SnpEffCmdDownload.java:61)
at org.snpeff.snpEffect.commandLine.SnpEffCmdDownload.runDownloadGenome(SnpEffCmdDownload.java:110)
at org.snpeff.snpEffect.commandLine.SnpEffCmdDownload.run(SnpEffCmdDownload.java:97)
at org.snpeff.SnpEff.run(SnpEff.java:1180)
at org.snpeff.SnpEff.loadDb(SnpEff.java:494)
at org.snpeff.snpEffect.commandLine.SnpEffCmdEff.run(SnpEffCmdEff.java:890)
at org.snpeff.snpEffect.commandLine.SnpEffCmdEff.run(SnpEffCmdEff.java:875)
at org.snpeff.SnpEff.run(SnpEff.java:1141)
at org.snpeff.SnpEff.main(SnpEff.java:160)
Caused by: java.lang.RuntimeException: Cannot create directory '/bigdata/operations/pkgadmin/opt/linux/centos/8.x/x86_64/pkgs/snpEff/5.1/snpEff/data/xx'
at org.snpeff.util.Download.unzip(Download.java:342)
... 10 more
java.lang.RuntimeException: Genome download failed!
at org.snpeff.SnpEff.loadDb(SnpEff.java:495)
at org.snpeff.snpEffect.commandLine.SnpEffCmdEff.run(SnpEffCmdEff.java:890)
at org.snpeff.snpEffect.commandLine.SnpEffCmdEff.run(SnpEffCmdEff.java:875)
at org.snpeff.SnpEff.run(SnpEff.java:1141)
at org.snpeff.SnpEff.main(SnpEff.java:160)

Resolution

By default SnpEff will attempt to download files relative to where the .jar file is located. Because users do not have permissions to this folder, the program fails. Users will need to change the location that these files are downloaded using the -dataDir flag.

For example:

java -jar $SNPEFFJAR -dataDir ~/bigdata/data ....