This is a test version of Biostars. For the public version, visit https://www.biostars.org.
snpEFF Database building error

I am using snpEFF for SNP annotation. I am building my own database. I added genome entry to snpEff's configuration. I'm building the database from a GFF file.

When I wrote out this command :

java -jar snpEff.jar build -gff -v Y55

I got this error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: ca/mcgill/mcb/pcingola/snpEffect/commandLine/SnpEff : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: ca.mcgill.mcb.pcingola.snpEffect.commandLine.SnpEff. Program will exit.

How do I fix this?

Thanks in advance! :)

software-error snp

1 answer

Have a look at this thread on stackoverflow. In short, using a more recent version of java will probably fix this issue.

Thank you! I upgraded to a newer version of Java.

Now, I'm facing the following error.

Command:

java -Xmx2g /home/bioratcliff/SPRING-2014/Softwares/snpEff/snpEff.jar -c /home/bioratcliff/SPRING-2014/Softwares/snpEff/snpEff.config saccharomyces_cerevisiae -v LR1_sorted_snp.vcf > LR1_snpEFF.vcf
Error: Could not find or load main class .home.bioratcliff.SPRING-2014.Softwares.snpEff.snpEff.jar

It would seem that you need to set the class path.

I am also trying to build my database as the version I need is unavailable in snpEff.

edited snpEff.config:

# org genome, version org.7
org.7.genome : species
org.7.M.codonTable : Vertebrate_Mitochondrial

build database

>java -Xmx4g -jar snpEff.jar build -gtf22 -v org.7
00:00:00        SnpEff version SnpEff 4.3p (build 2017-06-06 09:55), by Pablo Cingolani
00:00:00        Command: 'build'
00:00:00        Building database for 'org.7'
00:00:00        Reading configuration file 'snpEff.config'. Genome: 'org.7'
00:00:00        Reading config file: C:\cygwin64\home\me\bin\snpEff\snpEff.config
00:00:00        done
Reading GTF22 data file  : 'C:\Users\me/bin/snpEff/data/org.7/genes.gtf'
java.lang.RuntimeException: File not found 'C:\Users\me/bin/snpEff/data/org.7/genes.gtf'
        at org.snpeff.util.Gpr.reader(Gpr.java:531)
        at org.snpeff.util.Gpr.reader(Gpr.java:504)
        at org.snpeff.snpEffect.factory.SnpEffPredictorFactoryGff.readGff(SnpEffPredictorFactoryGff.java:486)
        at org.snpeff.snpEffect.factory.SnpEffPredictorFactoryGff.create(SnpEffPredictorFactoryGff.java:337)
        at org.snpeff.snpEffect.commandLine.SnpEffCmdBuild.createSnpEffPredictor(SnpEffCmdBuild.java:118)
        at org.snpeff.snpEffect.commandLine.SnpEffCmdBuild.run(SnpEffCmdBuild.java:362)
        at org.snpeff.SnpEff.run(SnpEff.java:1183)
        at org.snpeff.SnpEff.main(SnpEff.java:162)
java.lang.RuntimeException: Error reading file 'C:\Users\me/bin/snpEff/data/org.7/genes.gtf'
java.lang.RuntimeException: File not found 'C:\Users\me/bin/snpEff/data/org.7/genes.gtf'
        at org.snpeff.snpEffect.factory.SnpEffPredictorFactoryGff.create(SnpEffPredictorFactoryGff.java:353)
        at org.snpeff.snpEffect.commandLine.SnpEffCmdBuild.createSnpEffPredictor(SnpEffCmdBuild.java:118)
        at org.snpeff.snpEffect.commandLine.SnpEffCmdBuild.run(SnpEffCmdBuild.java:362)
        at org.snpeff.SnpEff.run(SnpEff.java:1183)
        at org.snpeff.SnpEff.main(SnpEff.java:162)
00:00:00        Logging
00:00:01        Checking for updates...
00:00:02        Done.

I know there is no file called gene.gtf under ~/data/org.7/ but its ~/data/org.7/species.org.7.gtf/species.org.7.gtf . I have no idea why its pointing there and not on the real one.

Please guide. Thanks.

As mentioned here Building Snpeff Database, I even renamed my file to genes.gtf, but still same error.

I think its because I am using cygwin.

You forgot the -jar option:

java -Xmx4g -jar snpEff.jar ...

I can't believe I overlooked that in my earlier comment!

Log in to answer this question.