This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Snipsift synonymous variant extraction

Hi everyone,

I want to filter synonymous variant from my vcf. What can I do?

I have used this command but I have seen that filtered file has also included synonymous variant;

java -jar SnpSift.jar filter "ANN[*].EFFECT != 'synonymous_variant'"

Thanks!

filtering snipsift

instead of =, try using has

I have tried that as

"ANN[*].EFFECT !has 'synonymous_variant'"
-bash: !has: event not found

Is it like that "ANN[*].EFFECT !has "synonymous_variant""

It can not work

'ANN[*].EFFECT !has "synonymous_variant"'

Bash uses "!" expression in its history substitution command. So it confuses your command with history substitution function and throws an error that it didn't find such a command in its history.

Try temporarily turning off history substitution feature and turning it back on when you're done with your operations involving "!" :

set +H
<do your operations>
set -H

1 answer

line 1:14 no viable alternative at input '[*].EFFECT!'
line 1:19 token recognition error at: '"'
java.lang.RuntimeException: java.lang.RuntimeException: LexerNoViableAltException('"')
        at ca.mcgill.mcb.pcingola.snpSift.lang.LangFactory.compile(LangFactory.java:128)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdFilter.parseExpression(SnpSiftCmdFilter.java:255)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdFilter.run(SnpSiftCmdFilter.java:282)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSiftCmdFilter.run(SnpSiftCmdFilter.java:268)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSift.run(SnpSift.java:360)
        at ca.mcgill.mcb.pcingola.snpSift.SnpSift.main(SnpSift.java:69)
Caused by: java.lang.RuntimeException: LexerNoViableAltException('"')
        at ca.mcgill.mcb.pcingola.snpSift.lang.LangFactory$1.recover(LangFactory.java:117)
        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.Parser.consume(Parser.java:588)
        at org.antlr.v4.runtime.DefaultErrorStrategy.consumeUntil(DefaultErrorStrategy.java:758)
        at org.antlr.v4.runtime.DefaultErrorStrategy.recover(DefaultErrorStrategy.java:191)
        at ca.mcgill.mcb.pcingola.snpSift.antlr.SnpSiftParser.expression(SnpSiftParser.java:778)
        at ca.mcgill.mcb.pcingola.snpSift.antlr.SnpSiftParser.compilationUnit(SnpSiftParser.java:89)
        at ca.mcgill.mcb.pcingola.snpSift.lang.LangFactory.compile(LangFactory.java:125)
        ... 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)
        ... 14 more

It can not work again :(

Just try "ANN[*].EFFECT ! 'synonymous_variant'"

line 1:14 no viable alternative at input '[*].EFFECT!'

Ok, thanks. I have use = again

Hi basalganglia,

I'm having a similar problem (SNPSift - Token Recognition Error). I've tried the suggestions in this thread, but it hasn't worked for me. My error is a result of the "@" being in my ID name.

I was wondering if you could post your final command line so I could try to imitate it and see if it works for me? (I realize you've said "I have used "=" again", but I want to ensure I'm using the "=" correctly like you).

Cheers.

Hi anon123,

"ANN[*].EFFECT != 'synonymous_variant'" is my command. But it is not work efficiently. Then I have translate my data to excel file then extract synonymous variants

Cheers, thanks for your help. :)

Check my reply to basalganglia.

Log in to answer this question.