public static Pattern controlsExpressionWithConversion ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "TF ER" ) ; p . add ( linkedER ( true ) , "TF ER" , "TF generic ER" ) ; p . add ( erToPE ( ) , "TF generic ER" , "TF SPE" ) ; p . add ( linkToComplex ( ) , "TF SPE" , "TF PE" ) ; p . add ( peToControl ( ) , "TF PE" , "Control" ) ; p . add ( controlToConv ( ) , "Control" , "Conversion" ) ; p . add ( new Size ( right ( ) , 1 , Size . Type . EQUAL ) , "Conversion" ) ; p . add ( new OR ( new MappedConst ( new Empty ( left ( ) ) , 0 ) , new MappedConst ( new ConstraintAdapter ( 1 ) { @ Override public boolean satisfies ( Match match , int ... ind ) { Conversion cnv = ( Conversion ) match . get ( ind [ 0 ] ) ; Set < PhysicalEntity > left = cnv . getLeft ( ) ; if ( left . size ( ) > 1 ) return false ; if ( left . isEmpty ( ) ) return true ; PhysicalEntity pe = left . iterator ( ) . next ( ) ; if ( pe instanceof NucleicAcid ) { PhysicalEntity rPE = cnv . getRight ( ) . iterator ( ) . next ( ) ; return rPE instanceof Protein ; } return false ; } } , 0 ) ) , "Conversion" ) ; p . add ( right ( ) , "Conversion" , "right PE" ) ; p . add ( linkToSpecific ( ) , "right PE" , "right SPE" ) ; p . add ( new Type ( SequenceEntity . class ) , "right SPE" ) ; p . add ( peToER ( ) , "right SPE" , "product generic ER" ) ; p . add ( linkedER ( false ) , "product generic ER" , "product ER" ) ; p . add ( equal ( false ) , "TF ER" , "product ER" ) ; return p ; }
Finds the cases where transcription relation is shown using a Conversion instead of a TemplateReaction .