This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SNPSift - Token Recognition Error

I'm using Git Bash and SnpSift. The following command line extracts the columns of interest from my VCF file.

java -jar SnpSift.jar extractfields filename.vcf CHROM POS ID REF AL "SampleID@1232" > sample2.vcf

The command line works perfectly until the addition of the "SampleID@1232". I get the following error message:

line 1:7 token recognition error at: '@'
Exception in thread "main" java.lang.RuntimeException: Error parsing expression 
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdExtractFields.parseFields(SnpSiftCmdExtractFields.java:105)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdExtractFields.run(SnpSiftCmdExtractFields.java:124)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdExtractFields.run(SnpSiftCmdExtractFields.java:117)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSift.run(SnpSift.java:364)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSift.main(SnpSift.java:69)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: LexerNoViableAltException('@')
        at ca.mcgill.mcb.pcingola.snpSift.lang.LangFactory.compile(LangFactory.java:129)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdExtractFields.parseFields(SnpSiftCmdExtractFields.java:103)
        ... 4 more
Caused by: java.lang.RuntimeException: LexerNoViableAltException('@')
        at ca.mcgill.mcb.pcingola.snpSift.lang.LangFactory$1.recover(LangFactory.java:118)
        at org.antlr.v4.runtime.Lexer.nextToken(Lexer.java:169)
        at org.antlr.v4.runtime.BufferedTokenStream.fetch(BufferedTokenStream.java:187)
        at org.antlr.v4.runtime.BufferedTokenStream.sync(BufferedTokenStream.java:170)
        at org.antlr.v4.runtime.BufferedTokenStream.consume(BufferedTokenStream.java:154)
        at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:566)
        at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:423)
        at ca.mcgill.mcb.pcingola.snpSift.antlr.SnpSiftParser.expression(SnpSiftParser.java:498)
       at ca.mcgill.mcb.pcingola.snpSift.antlr.SnpSiftParser.compilationUnit(SnpSiftParser.java:90)
        at ca.mcgill.mcb.pcingola.snpSift.lang.LangFactory.compile(LangFactory.java:126)
        ... 5 more
Caused by: LexerNoViableAltException('@')
        at org.antlr.v4.runtime.atn.LexerATNSimulator.failOrAccept(LexerATNSimulator.java:329)
        at org.antlr.v4.runtime.atn.LexerATNSimulator.execATN(LexerATNSimulator.java:250)
        at org.antlr.v4.runtime.atn.LexerATNSimulator.match(LexerATNSimulator.java:143)
        at org.antlr.v4.runtime.Lexer.nextToken(Lexer.java:165)
        ... 13 more

I've tried the following based on the suggest of an alternate thread:

"SampleID@1232!=='synonymous_variant'"

However, I'm still getting the same error.

I'd appreciate any suggestions. Thanks.

snpsift java

0 answers

No answers yet.

Log in to answer this question.