* parsed correctly which will result in a test failure
*/
@Test
public void testModificationExpansions()
throws RecognitionException {
final ModificationExpansionRule rule = new ModificationExpansionRule();
Term term;
List<Statement> stmts;
// valid substitution
term = BELParser.parseTerm("p(HGNC:TNF,sub(V,599,E))");
assertThat(rule.match(term), is(true));
stmts = rule.expand(term);
assertThat(stmts.size(), is(1));
assertThat(stmts.get(0).toBELShortForm(),
is("p(HGNC:TNF) hasVariant p(HGNC:TNF,sub(V,599,E))"));
// valid truncation
term = BELParser.parseTerm("p(HGNC:TNF,trunc(S,1099))");
assertThat(rule.match(term), is(true));
stmts = rule.expand(term);
assertThat(stmts.size(), is(1));
assertThat(stmts.get(0).toBELShortForm(),
is("p(HGNC:TNF) hasVariant p(HGNC:TNF,trunc(S,1099))"));
// valid protein modification
term = BELParser.parseTerm("p(HGNC:TNF,pmod(P,Y))");
assertThat(rule.match(term), is(true));
stmts = rule.expand(term);
assertThat(stmts.size(), is(1));
assertThat(stmts.get(0).toBELShortForm(),
is("p(HGNC:TNF) hasModification p(HGNC:TNF,pmod(P,Y))"));
// valid fusion
term = BELParser.parseTerm("p(HGNC:TNF,fus(HGNC:ABL1))");
assertThat(rule.match(term), is(true));
stmts = rule.expand(term);
assertThat(stmts.size(), is(1));
assertThat(stmts.get(0).toBELShortForm(),
is("p(HGNC:TNF) hasVariant p(HGNC:TNF,fus(HGNC:ABL1))"));
// invalid based on outer function
term = BELParser.parseTerm("complex(p(HGNC:TNF),p(HGNC:MAPK1))");
assertThat(rule.match(term), is(false));
// invalid based on missing modification argument
term = BELParser.parseTerm("p(HGNC:TNF)");
assertThat(rule.match(term), is(false));
// invalid based on non-parameter first argument
term = BELParser.parseTerm("p(r(HGNC:TNF),sub(V,599,E))");
assertThat(rule.match(term), is(false));
// invalid based on non-term second argument
term = BELParser.parseTerm("p(HGNC:TNF,\"Substitution at P,Y\")");
assertThat(rule.match(term), is(false));
// invalid protein decorator function for second argument
term = BELParser.parseTerm("p(HGNC:TNF,g(HGNC:AKT1))");
assertThat(rule.match(term), is(false));
}