idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
6,100
public static Constraint isHuman ( ) { return new OR ( new MappedConst ( new Field ( "SequenceEntityReference/organism/displayName" , Field . Operation . INTERSECT , "Homo sapiens" ) , 0 ) , new MappedConst ( new Field ( "PhysicalEntity/entityReference/organism/displayName" , Field . Operation . INTERSECT , "Homo sapie...
Makes sure the EntityReference or the PhysicalEntity belongs to human . Please note that this check depends on the display name of the related BioSource object to be Homo sapiens . If that is not the case the constraint won t work .
6,101
public static Constraint modificationConstraint ( String modifTerm ) { return new FieldOfMultiple ( new MappedConst ( new LinkedPE ( LinkedPE . Type . TO_SPECIFIC ) , 0 ) , "PhysicalEntity/feature:ModificationFeature/modificationType/term" , Field . Operation . INTERSECT , modifTerm ) ; }
Makes sure that the PhysicalEntity or any linked PE contains the modification term . Size = 1 .
6,102
public static Constraint inSamePathway ( ) { String s1 = "Interaction/stepProcessOf/pathwayOrderOf" ; String s2 = "Interaction/pathwayComponentOf" ; return new OR ( new MappedConst ( new Field ( s1 , s1 , Field . Operation . INTERSECT ) , 0 , 1 ) , new MappedConst ( new Field ( s2 , s2 , Field . Operation . INTERSECT )...
Makes sure that the two interactions are members of the same pathway .
6,103
public static Constraint hasDifferentCompartments ( ) { String acStr = "PhysicalEntity/cellularLocation/term" ; return new Field ( acStr , acStr , Field . Operation . NOT_EMPTY_AND_NOT_INTERSECT ) ; }
Checks if two physical entities have non - empty and different compartments .
6,104
protected void initMaps ( ) { dist = new HashMap < GraphObject , Integer > ( ) ; colors = new HashMap < GraphObject , Integer > ( ) ; queue = new LinkedList < Node > ( ) ; }
Initializes maps used during query .
6,105
protected void processNode ( Node current ) { if ( current . isUbique ( ) ) { setColor ( current , BLACK ) ; return ; } for ( Edge edge : direction == Direction . DOWNSTREAM ? current . getDownstream ( ) : current . getUpstream ( ) ) { assert edge != null ; if ( direction == Direction . DOWNSTREAM || ! current . isBrea...
Processes a node .
6,106
protected void labelEquivRecursive ( Node node , boolean up , int dist , boolean enqueue , boolean head ) { if ( node == null ) { LOG . error ( "labelEquivRecursive: null (Node)" ) ; return ; } for ( Node equiv : up ? node . getUpperEquivalent ( ) : node . getLowerEquivalent ( ) ) { if ( getColor ( equiv ) == WHITE ) {...
Labels equivalent nodes recursively .
6,107
protected int getColor ( Node node ) { if ( ! colors . containsKey ( node ) ) { return WHITE ; } else { return colors . get ( node ) ; } }
Gets color tag of the node
6,108
public int getLabel ( GraphObject go ) { if ( ! dist . containsKey ( go ) ) { return Integer . MAX_VALUE - ( limit * 2 ) ; } else { return dist . get ( go ) ; } }
Gets the distance label of the object .
6,109
public boolean satisfies ( Match match , int ... ind ) { Control ctrl = ( Control ) match . get ( ind [ 0 ] ) ; for ( Process process : ctrl . getControlled ( ) ) { if ( process instanceof Interaction ) { Interaction inter = ( Interaction ) process ; Set < Entity > participant = inter . getParticipant ( ) ; for ( Contr...
Checks if the controlled Interaction contains a controller as a participant . This constraint filters out such cases .
6,110
public void setBindsTo ( BindingFeature bindsTo ) { if ( this . bindsTo != bindsTo ) { BindingFeature old = this . bindsTo ; this . bindsTo = bindsTo ; if ( old != null && old . getBindsTo ( ) == this ) { old . setBindsTo ( null ) ; } if ( ! ( this . bindsTo == null || this . bindsTo . getBindsTo ( ) == this ) ) { this...
This method will set the paired binding feature that binds to this feature . This method will preserve the symmetric bidirectional semantics . If not - null old feature s bindsTo will be set to null and if not null new feature s binds to will set to this
6,111
public < T extends LocalizableResource > T create ( Class < T > cls , String locale ) { Locale l = null ; if ( locale != null ) { String [ ] parts = locale . split ( "_" , 3 ) ; l = new Locale ( parts [ 0 ] , parts . length > 1 ? parts [ 1 ] : "" , parts . length > 2 ? parts [ 2 ] : "" ) ; } return LocaleProxy . create...
Create the resource using the Locale provided . If the locale is null the locale is retrieved from the LocaleProvider in LocaleProxy .
6,112
public boolean atEquivalentLocation ( EntityFeature that ) { return getEntityFeatureOf ( ) != null && getEntityFeatureOf ( ) . isEquivalent ( that . getEntityFeatureOf ( ) ) && getFeatureLocation ( ) != null && getFeatureLocation ( ) . isEquivalent ( that . getFeatureLocation ( ) ) ; }
This method returns true if and only if two entity features are on the same known location on a known ER . Unknown location or ER on any one of the features results in a false .
6,113
public static List < Match > search ( Match m , Pattern pattern ) { assert pattern . getStartingClass ( ) . isAssignableFrom ( m . get ( 0 ) . getModelInterface ( ) ) ; return searchRecursive ( m , pattern . getConstraints ( ) , 0 ) ; }
Searches the pattern starting from the given match . The first element of the match should be assigned . Others are optional .
6,114
public static List < Match > search ( BioPAXElement ele , Pattern pattern ) { assert pattern . getStartingClass ( ) . isAssignableFrom ( ele . getModelInterface ( ) ) ; Match m = new Match ( pattern . size ( ) ) ; m . set ( ele , 0 ) ; return search ( m , pattern ) ; }
Searches the pattern starting from the given element .
6,115
public static List < Match > searchRecursive ( Match match , List < MappedConst > mc , int index ) { List < Match > result = new ArrayList < Match > ( ) ; Constraint con = mc . get ( index ) . getConstr ( ) ; int [ ] ind = mc . get ( index ) . getInds ( ) ; int lastInd = ind [ ind . length - 1 ] ; if ( con . canGenerat...
Continues searching with the mapped constraint at the given index .
6,116
public static List < Match > searchPlain ( Model model , Pattern pattern ) { List < Match > list = new LinkedList < Match > ( ) ; Map < BioPAXElement , List < Match > > map = search ( model , pattern ) ; for ( List < Match > matches : map . values ( ) ) { list . addAll ( matches ) ; } return list ; }
Searches the pattern in a given model but instead of a match map returns all matches in a list .
6,117
public static List < Match > searchPlain ( Collection < ? extends BioPAXElement > eles , Pattern pattern ) { List < Match > list = new LinkedList < Match > ( ) ; Map < BioPAXElement , List < Match > > map = search ( eles , pattern ) ; for ( List < Match > matches : map . values ( ) ) { list . addAll ( matches ) ; } ret...
Searches the pattern starting from given elements but instead of a match map returns all matches in a list .
6,118
public static Map < BioPAXElement , List < Match > > search ( final Collection < ? extends BioPAXElement > eles , final Pattern pattern ) { final Map < BioPAXElement , List < Match > > map = new ConcurrentHashMap < BioPAXElement , List < Match > > ( ) ; final ExecutorService exec = Executors . newFixedThreadPool ( 10 )...
Searches the given pattern starting from the given elements .
6,119
public static < T extends BioPAXElement > Set < T > searchAndCollect ( Model model , Pattern pattern , int index , Class < T > c ) { return searchAndCollect ( model . getObjects ( pattern . getStartingClass ( ) ) , pattern , index , c ) ; }
Searches a model for the given pattern then collects the specified elements of the matches and returns .
6,120
public static < T extends BioPAXElement > Set < T > searchAndCollect ( Collection < ? extends BioPAXElement > eles , Pattern pattern , int index , Class < T > c ) { Set < T > set = new HashSet < T > ( ) ; for ( Match match : searchPlain ( eles , pattern ) ) { set . add ( ( T ) match . get ( index ) ) ; } return set ; }
Searches the given pattern starting from the given elements then collects the specified elements of the matches and returns .
6,121
public static < T extends BioPAXElement > Set < T > searchAndCollect ( BioPAXElement ele , Pattern pattern , int index , Class < T > c ) { Set < T > set = new HashSet < T > ( ) ; for ( Match match : search ( ele , pattern ) ) { set . add ( ( T ) match . get ( index ) ) ; } return set ; }
Searches the given pattern starting from the given element then collects the specified elements of the matches and returns .
6,122
public boolean hasSolution ( Pattern p , BioPAXElement ... ele ) { Match m = new Match ( p . size ( ) ) ; for ( int i = 0 ; i < ele . length ; i ++ ) { m . set ( ele [ i ] , i ) ; } return ! search ( m , p ) . isEmpty ( ) ; }
Checks if there is any match for the given pattern if search starts from the given element .
6,123
public static void searchInFile ( Pattern p , String inFile , String outFile ) throws FileNotFoundException { searchInFile ( p , inFile , outFile , Integer . MAX_VALUE , Integer . MAX_VALUE ) ; }
Searches a pattern reading the model from the given file and creates another model that is excised using the matching patterns .
6,124
public static void searchInFile ( Pattern p , String inFile , String outFile , int seedLimit , int graphPerSeed ) throws FileNotFoundException { SimpleIOHandler h = new SimpleIOHandler ( ) ; Model model = h . convertFromOWL ( new FileInputStream ( inFile ) ) ; Map < BioPAXElement , List < Match > > matchMap = Searcher ...
Searches a pattern reading the model from the given file and creates another model that is excised using the matching patterns . Users can limit the max number of starting element and max number of matches for any starting element . These parameters is good for limiting the size of the result graph .
6,125
private static String getLeadingZeros ( int i , int size ) { assert i <= size ; int w1 = ( int ) Math . floor ( Math . log10 ( size ) ) ; int w2 = ( int ) Math . floor ( Math . log10 ( i ) ) ; String s = "" ; for ( int j = w2 ; j < w1 ; j ++ ) { s += "0" ; } return s ; }
Prepares an int for printing with leading zeros for the given size .
6,126
private static Model excise ( Set < BioPAXElement > result ) { Completer c = new Completer ( EM ) ; result = c . complete ( result ) ; Cloner cln = new Cloner ( EM , BioPAXLevel . L3 . getDefaultFactory ( ) ) ; return cln . clone ( result ) ; }
Excises a model to the given elements .
6,127
private static Set < Interaction > getInter ( Match match ) { Set < Interaction > set = new HashSet < Interaction > ( ) ; for ( BioPAXElement ele : match . getVariables ( ) ) { if ( ele instanceof Interaction ) { set . add ( ( Interaction ) ele ) ; addControlsRecursive ( ( Interaction ) ele , set ) ; } } return set ; }
Gets all interactions in a match .
6,128
private static void addControlsRecursive ( Interaction inter , Set < Interaction > set ) { for ( Control ctrl : inter . getControlledOf ( ) ) { set . add ( ctrl ) ; addControlsRecursive ( ctrl , set ) ; } }
Adds controls of the given interactions recursively to the given set .
6,129
private static Integer hashSum ( Set < Interaction > set ) { int x = 0 ; for ( Interaction inter : set ) { x += inter . hashCode ( ) ; } return x ; }
Creates a hash code for a set of interactions .
6,130
public boolean satisfies ( Match match , int ... ind ) { assertIndLength ( ind ) ; return con . generate ( match , ind ) . isEmpty ( ) ; }
Checks if the wrapped Constraint can generate any elements . This satisfies if it cannot .
6,131
protected void addToUpstream ( BioPAXElement ele , Graph graph ) { AbstractNode node = ( AbstractNode ) graph . getGraphObject ( ele ) ; if ( node == null ) return ; Edge edge = new EdgeL3 ( node , this , graph ) ; if ( isTranscription ( ) ) { if ( node instanceof ControlWrapper ) { ( ( ControlWrapper ) node ) . setTra...
Bind the wrapper of the given element to the upstream .
6,132
private boolean passesFilters ( Level3Element ele ) { if ( filters == null ) return true ; for ( Filter filter : filters ) { if ( ! filter . okToTraverse ( ele ) ) return false ; } return true ; }
There must be no filter opposing to traverse this object to traverse it .
6,133
public String getKey ( Object wrapped ) { if ( wrapped instanceof BioPAXElement ) { return ( ( BioPAXElement ) wrapped ) . getUri ( ) ; } throw new IllegalArgumentException ( "Object cannot be wrapped: " + wrapped ) ; }
RDF IDs of elements is used as key in the object map .
6,134
public Set < Node > getWrapperSet ( Set < ? > objects ) { Set < Node > wrapped = new HashSet < Node > ( ) ; for ( Object object : objects ) { Node node = ( Node ) getGraphObject ( object ) ; if ( node != null ) { wrapped . add ( node ) ; } } return wrapped ; }
Gets wrappers of given elements
6,135
public Map < Object , Node > getWrapperMap ( Set < ? > objects ) { Map < Object , Node > map = new HashMap < Object , Node > ( ) ; for ( Object object : objects ) { Node node = ( Node ) getGraphObject ( object ) ; if ( node != null ) { map . put ( object , node ) ; } } return map ; }
Gets an element - to - wrapper map for the given elements .
6,136
public Collection < BioPAXElement > generate ( Match match , int ... ind ) { Collection < BioPAXElement > gen = new HashSet < BioPAXElement > ( con [ 0 ] . generate ( match , ind ) ) ; for ( int i = 1 ; i < con . length ; i ++ ) { if ( gen . isEmpty ( ) ) break ; gen . retainAll ( con [ i ] . generate ( match , ind ) )...
Gets intersection of the generated elements by the member constraints .
6,137
public Collection < BioPAXElement > generate ( Match match , int ... ind ) { PhysicalEntity pe = ( PhysicalEntity ) match . get ( ind [ 0 ] ) ; Set < BioPAXElement > set = getLinkedElements ( pe ) ; return set ; }
Gets to the linked PhysicalEntity .
6,138
protected void enrichWithGenerics ( Set < BioPAXElement > seed , Set < BioPAXElement > all ) { Set addition ; if ( type == Type . TO_GENERAL ) addition = access ( upperGenAcc , seed , all ) ; else addition = access ( lowerGenAcc , seed , all ) ; all . addAll ( addition ) ; seed . addAll ( addition ) ; enrichWithCM ( se...
Gets the linked homologies and then switches to complex - relationship mode . These two enrich methods call each other recursively .
6,139
protected void enrichWithCM ( Set < BioPAXElement > seed , Set < BioPAXElement > all ) { Set addition = access ( type == Type . TO_GENERAL ? complexAcc : memberAcc , seed , all ) ; if ( blacklist != null ) addition = blacklist . getNonUbiqueObjects ( addition ) ; if ( ! addition . isEmpty ( ) ) { all . addAll ( additio...
Gets parent complexes or complex members recursively according to the type of the linkage .
6,140
public static < D extends BioPAXElement , R > PropertyEditor < D , R > createPropertyEditor ( Class < D > domain , String property ) { PropertyEditor editor = null ; try { Method getMethod = detectGetMethod ( domain , property ) ; boolean multipleCardinality = isMultipleCardinality ( getMethod ) ; Class < R > range = d...
This method creates a property reflecting on the domain and property . Proper subclass is chosen based on the range of the property .
6,141
private static String getJavaName ( String owlName ) { String s = owlName . replaceAll ( "-" , "_" ) ; s = s . substring ( 0 , 1 ) . toUpperCase ( ) + s . substring ( 1 ) ; return s ; }
Given the name of a property s name as indicated in the OWL file this method converts the name to a Java compatible name .
6,142
public static String getDataTypeDef ( String datatypeKey ) { Datatype datatype = getDatatype ( datatypeKey ) ; return datatype . getDefinition ( ) ; }
Retrieves the definition of a data type .
6,143
public static String [ ] getDataResources ( String datatypeKey ) { Set < String > locations = new HashSet < String > ( ) ; Datatype datatype = getDatatype ( datatypeKey ) ; for ( Resource resource : getResources ( datatype ) ) { String link = resource . getDataResource ( ) ; locations . add ( link ) ; } return location...
Retrieves home page URLs of a datatype .
6,144
public static boolean isDeprecated ( String uri ) { Datatype datatype = datatypesHash . get ( uri ) ; String urn = getOfficialDataTypeURI ( datatype ) ; return ! uri . equalsIgnoreCase ( urn ) ; }
To know if a URI of a data type is deprecated .
6,145
public static String getName ( String datatypeKey ) { Datatype datatype = getDatatype ( datatypeKey ) ; return datatype . getName ( ) ; }
Retrieves the preferred name of a data type .
6,146
public static String [ ] getDataTypesName ( ) { Set < String > dataTypeNames = new HashSet < String > ( ) ; for ( Datatype datatype : miriam . getDatatype ( ) ) { dataTypeNames . add ( datatype . getName ( ) ) ; } return dataTypeNames . toArray ( ARRAY_OF_STRINGS ) ; }
Retrieves the list of preferred names of all the data types available .
6,147
public static String convertUrn ( String urn ) { String [ ] tokens = urn . split ( ":" ) ; return "http://identifiers.org/" + tokens [ tokens . length - 2 ] + "/" + URLDecoder . decode ( tokens [ tokens . length - 1 ] ) ; }
Converts a MIRIAM URN into its equivalent Identifiers . org URL .
6,148
public boolean satisfies ( Match match , int ... ind ) { int x = - 1 ; for ( MappedConst mc : con ) { if ( mc . satisfies ( match , ind ) ) x *= - 1 ; } return x == 1 ; }
Checks if constraints satisfy in xor pattern .
6,149
public Collection < BioPAXElement > generate ( Match match , int ... ind ) { Collection < BioPAXElement > gen = new HashSet < BioPAXElement > ( con [ 0 ] . generate ( match , ind ) ) ; for ( int i = 1 ; i < con . length ; i ++ ) { if ( gen . isEmpty ( ) ) break ; Collection < BioPAXElement > subset = con [ i ] . genera...
Gets xor of the generated elements by the member constraints .
6,150
public boolean satisfies ( Match match , int ... ind ) { assert ind . length == 1 ; return clazz . isAssignableFrom ( match . get ( ind [ 0 ] ) . getModelInterface ( ) ) ; }
Checks if the element is assignable to a variable of the desired type .
6,151
public void run ( Entry entry ) { final Set < String > avail = new HashSet < String > ( ) ; if ( entry . hasAvailabilities ( ) ) { for ( Availability a : entry . getAvailabilities ( ) ) if ( a . hasValue ( ) ) avail . add ( a . getValue ( ) ) ; } final Provenance pro = createProvenance ( entry . getSource ( ) ) ; Set <...
Convert a PSIMI entry to BioPAX interactions participants etc . objects and add to the target BioPAX model .
6,152
public Collection < BioPAXElement > generate ( Match match , int ... ind ) { Interaction inter = ( Interaction ) match . get ( ind [ 0 ] ) ; Set < Entity > taboo = new HashSet < Entity > ( ) ; for ( int i = 1 ; i < getVariableSize ( ) - 1 ; i ++ ) { taboo . add ( ( Entity ) match . get ( ind [ i ] ) ) ; } if ( directio...
Iterated over non - taboo participants and collectes related ER .
6,153
protected Collection < BioPAXElement > generate ( Interaction inter , Set < Entity > taboo ) { Set < BioPAXElement > simples = new HashSet < BioPAXElement > ( ) ; for ( Entity part : inter . getParticipant ( ) ) { if ( part instanceof PhysicalEntity && ! taboo . contains ( part ) ) { simples . addAll ( linker . getLink...
Gets the related entity references of the given interaction .
6,154
protected Collection < BioPAXElement > generate ( Conversion conv , Direction direction , Set < Entity > taboo ) { if ( direction == null ) throw new IllegalArgumentException ( "Direction cannot be null" ) ; if ( ! ( direction == Direction . BOTHSIDERS || direction == Direction . ONESIDERS ) ) { Set < BioPAXElement > s...
Gets the related entity references of the given interaction
6,155
public static < D extends BioPAXElement , R > PropertyAccessor < D , R > create ( PropertyAccessor < D , R > pa , Class filter ) { return new FilteredPropertyAccessor < D , R > ( pa , filter ) ; }
FactoryMethod that creates a filtered property accessor by decorating a given accessor with a class filter .
6,156
public void visit ( BioPAXElement domain , Object range , Model model , PropertyEditor < ? , ? > editor ) { visit ( range , domain , model , editor ) ; }
Calls the protected abstract method visit that is to be implemented in subclasses of this abstract class .
6,157
private void bindValue ( Triple triple , Model model ) { if ( log . isDebugEnabled ( ) ) log . debug ( String . valueOf ( triple ) ) ; BioPAXElement domain = model . getByID ( triple . domain ) ; PropertyEditor editor = this . getEditorMap ( ) . getEditorForProperty ( triple . property , domain . getModelInterface ( ) ...
Binds property .
6,158
public boolean satisfies ( Match match , int ... ind ) { PhysicalEntity pe1 = ( PhysicalEntity ) match . get ( ind [ 0 ] ) ; PhysicalEntity pe2 = ( PhysicalEntity ) match . get ( ind [ 1 ] ) ; Set < ModificationFeature > [ ] mods = DifferentialModificationUtil . getChangedModifications ( pe1 , pe2 ) ; Set < String > te...
Checks the any of the changed modifications match to any of the desired modifications .
6,159
public boolean satisfies ( Match match , int ... ind ) { for ( MappedConst mc : con ) { if ( mc . satisfies ( match , ind ) ) return true ; } return false ; }
Checks if any of the wrapped constraints satisfy .
6,160
public int getVariableSize ( ) { int size = 0 ; for ( MappedConst mc : con ) { int m = max ( mc . getInds ( ) ) ; if ( m > size ) size = m ; } return size + 1 ; }
Checks the inner mapping of the wrapped constraints and figures the size .
6,161
protected int max ( int [ ] v ) { int x = 0 ; for ( int i : v ) { if ( i > x ) x = i ; } return x ; }
Gets the max value .
6,162
public Collection < BioPAXElement > generate ( Match match , int ... ind ) { Collection < BioPAXElement > gen = new HashSet < BioPAXElement > ( ) ; for ( MappedConst mc : con ) { gen . addAll ( mc . generate ( match , ind ) ) ; } return gen ; }
Gets the intersection of the generated values of wrapped constraints .
6,163
public static Pattern controlsStateChange ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "controller ER" ) ; p . add ( linkedER ( true ) , "controller ER" , "generic controller ER" ) ; p . add ( erToPE ( ) , "generic controller ER" , "controller simple PE" ) ; p . add ( linkToComplex ( ) , "controlle...
Pattern for a EntityReference has a member PhysicalEntity that is controlling a state change reaction of another EntityReference .
6,164
public static Pattern controlsTransport ( ) { Pattern p = controlsStateChange ( ) ; p . add ( new OR ( new MappedConst ( hasDifferentCompartments ( ) , 0 , 1 ) , new MappedConst ( hasDifferentCompartments ( ) , 2 , 3 ) ) , "input simple PE" , "output simple PE" , "input PE" , "output PE" ) ; return p ; }
Pattern for a ProteinReference has a member PhysicalEntity that is controlling a transportation of another ProteinReference .
6,165
public static Pattern controlsTransportOfChemical ( Blacklist blacklist ) { Pattern p = new Pattern ( SequenceEntityReference . class , "controller ER" ) ; p . add ( linkedER ( true ) , "controller ER" , "controller generic ER" ) ; p . add ( erToPE ( ) , "controller generic ER" , "controller simple PE" ) ; p . add ( li...
Pattern for a ProteinReference has a member PhysicalEntity that is controlling a reaction that changes cellular location of a small molecule .
6,166
public static Pattern controlsStateChangeBothControlAndPart ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "controller ER" ) ; p . add ( linkedER ( true ) , "controller ER" , "controller generic ER" ) ; p . add ( erToPE ( ) , "controller generic ER" , "controller simple PE" ) ; p . add ( linkToComple...
Pattern for a EntityReference has a member PhysicalEntity that is controlling a state change reaction of another EntityReference . In this case the controller is also an input to the reaction . The affected protein is the one that is represented with different non - generic physical entities at left and right of the re...
6,167
public static Pattern controlsStateChangeButIsParticipant ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "controller ER" ) ; p . add ( linkedER ( true ) , "controller ER" , "controller generic ER" ) ; p . add ( erToPE ( ) , "controller generic ER" , "controller simple PE" ) ; p . add ( linkToComplex ...
Pattern for a EntityReference has a member PhysicalEntity that is controlling a state change reaction of another EntityReference . This pattern is different from the original controls - state - change . The controller in this case is not modeled as a controller but as a participant of the conversion and it is at both s...
6,168
public static Pattern stateChange ( Pattern p , String ctrlLabel ) { if ( p == null ) p = new Pattern ( Conversion . class , "Conversion" ) ; if ( ctrlLabel == null ) p . add ( new Participant ( RelType . INPUT ) , "Conversion" , "input PE" ) ; else p . add ( new Participant ( RelType . INPUT , true ) , ctrlLabel , "Co...
Pattern for a Conversion has an input PhysicalEntity and another output PhysicalEntity that belongs to the same EntityReference .
6,169
public static Pattern controlsStateChangeThroughControllerSmallMolecule ( Blacklist blacklist ) { Pattern p = new Pattern ( SequenceEntityReference . class , "upper controller ER" ) ; p . add ( linkedER ( true ) , "upper controller ER" , "upper controller generic ER" ) ; p . add ( erToPE ( ) , "upper controller generic...
Pattern for an entity is producing a small molecule and the small molecule controls state change of another molecule .
6,170
public static Pattern controlsStateChangeThroughDegradation ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "upstream ER" ) ; p . add ( linkedER ( true ) , "upstream ER" , "upstream generic ER" ) ; p . add ( erToPE ( ) , "upstream generic ER" , "upstream SPE" ) ; p . add ( linkToComplex ( ) , "upstrea...
Finds cases where proteins affect their degradation .
6,171
public static Pattern controlsMetabolicCatalysis ( Blacklist blacklist , boolean consumption ) { Pattern p = new Pattern ( SequenceEntityReference . class , "controller ER" ) ; p . add ( linkedER ( true ) , "controller ER" , "controller generic ER" ) ; p . add ( erToPE ( ) , "controller generic ER" , "controller simple...
Pattern for a Protein controlling a reaction whose participant is a small molecule .
6,172
public static Pattern controlsExpressionWithTemplateReac ( ) { 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 ( peToCont...
Finds transcription factors that trans - activate or trans - inhibit an entity .
6,173
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 ( peToContro...
Finds the cases where transcription relation is shown using a Conversion instead of a TemplateReaction .
6,174
public static Pattern controlsDegradationIndirectly ( ) { Pattern p = controlsStateChange ( ) ; p . add ( new Size ( new ParticipatesInConv ( RelType . INPUT ) , 1 , Size . Type . EQUAL ) , "output PE" ) ; p . add ( new Empty ( peToControl ( ) ) , "output PE" ) ; p . add ( new ParticipatesInConv ( RelType . INPUT ) , "...
Finds cases where protein A changes state of B and B is then degraded .
6,175
public static Pattern inComplexWith ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "Protein 1" ) ; p . add ( linkedER ( true ) , "Protein 1" , "generic Protein 1" ) ; p . add ( erToPE ( ) , "generic Protein 1" , "SPE1" ) ; p . add ( linkToComplex ( ) , "SPE1" , "PE1" ) ; p . add ( new PathConstraint ...
Two proteins have states that are members of the same complex . Handles nested complexes and homologies . Also guarantees that relationship to the complex is through different direct complex members .
6,176
public static Pattern chemicalAffectsProteinThroughBinding ( Blacklist blacklist ) { Pattern p = new Pattern ( SmallMoleculeReference . class , "SMR" ) ; p . add ( erToPE ( ) , "SMR" , "SPE1" ) ; p . add ( notGeneric ( ) , "SPE1" ) ; if ( blacklist != null ) p . add ( new NonUbique ( blacklist ) , "SPE1" ) ; p . add ( ...
A small molecule is in a complex with a protein .
6,177
public static Pattern chemicalAffectsProteinThroughControl ( ) { Pattern p = new Pattern ( SmallMoleculeReference . class , "controller SMR" ) ; p . add ( erToPE ( ) , "controller SMR" , "controller simple PE" ) ; p . add ( notGeneric ( ) , "controller simple PE" ) ; p . add ( linkToComplex ( ) , "controller simple PE"...
A small molecule controls an interaction of which the protein is a participant .
6,178
public static Pattern neighborOf ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "Protein 1" ) ; p . add ( linkedER ( true ) , "Protein 1" , "generic Protein 1" ) ; p . add ( erToPE ( ) , "generic Protein 1" , "SPE1" ) ; p . add ( linkToComplex ( ) , "SPE1" , "PE1" ) ; p . add ( peToInter ( ) , "PE1" ...
Constructs a pattern where first and last proteins are related through an interaction . They can be participants or controllers . No limitation .
6,179
public static Pattern reactsWith ( Blacklist blacklist ) { Pattern p = new Pattern ( SmallMoleculeReference . class , "SMR1" ) ; p . add ( erToPE ( ) , "SMR1" , "SPE1" ) ; p . add ( notGeneric ( ) , "SPE1" ) ; p . add ( linkToComplex ( blacklist ) , "SPE1" , "PE1" ) ; p . add ( new ParticipatesInConv ( RelType . INPUT ...
Constructs a pattern where first and last small molecules are substrates to the same biochemical reaction .
6,180
public static Pattern usedToProduce ( Blacklist blacklist ) { Pattern p = new Pattern ( SmallMoleculeReference . class , "SMR1" ) ; p . add ( erToPE ( ) , "SMR1" , "SPE1" ) ; p . add ( notGeneric ( ) , "SPE1" ) ; p . add ( linkToComplex ( blacklist ) , "SPE1" , "PE1" ) ; p . add ( new ParticipatesInConv ( RelType . INP...
Constructs a pattern where first small molecule is an input a biochemical reaction that produces the second small molecule . biochemical reaction .
6,181
public static Pattern molecularInteraction ( ) { Pattern p = new Pattern ( SequenceEntityReference . class , "Protein 1" ) ; p . add ( linkedER ( true ) , "Protein 1" , "generic Protein 1" ) ; p . add ( erToPE ( ) , "generic Protein 1" , "SPE1" ) ; p . add ( linkToComplex ( ) , "SPE1" , "PE1" ) ; p . add ( new PathCons...
Constructs a pattern where first and last molecules are participants of a MolecularInteraction .
6,182
public static Pattern relatedProteinRefOfInter ( Class < ? extends Interaction > ... seedType ) { Pattern p = new Pattern ( Interaction . class , "Interaction" ) ; if ( seedType . length == 1 ) { p . add ( new Type ( seedType [ 0 ] ) , "Interaction" ) ; } else if ( seedType . length > 1 ) { MappedConst [ ] mc = new Map...
Finds ProteinsReference related to an interaction . If specific types of interactions are desired they should be sent as parameter otherwise leave the parameter empty .
6,183
public static Pattern modifiedPESimple ( ) { Pattern p = new Pattern ( EntityReference . class , "modified ER" ) ; p . add ( erToPE ( ) , "modified ER" , "first PE" ) ; p . add ( participatesInConv ( ) , "first PE" , "Conversion" ) ; p . add ( new ConversionSide ( ConversionSide . Type . OTHER_SIDE ) , "first PE" , "Co...
Pattern for an EntityReference has distinct PhysicalEntities associated with both left and right of a Conversion .
6,184
public static Pattern actChange ( boolean activating , Map < EntityReference , Set < ModificationFeature > > activityFeat , Map < EntityReference , Set < ModificationFeature > > inactivityFeat ) { Pattern p = peInOut ( ) ; p . add ( new OR ( new MappedConst ( differentialActivity ( activating ) , 0 , 1 ) , new MappedCo...
Pattern for the activity of an EntityReference is changed through a Conversion .
6,185
public static Pattern modifierConv ( ) { Pattern p = new Pattern ( EntityReference . class , "ER" ) ; p . add ( erToPE ( ) , "ER" , "SPE" ) ; p . add ( linkToComplex ( ) , "SPE" , "PE" ) ; p . add ( participatesInConv ( ) , "PE" , "Conversion" ) ; return p ; }
Pattern for finding Conversions that an EntityReference is participating .
6,186
public static Pattern hasNonSelfEffect ( ) { Pattern p = new Pattern ( PhysicalEntity . class , "SPE" ) ; p . add ( peToER ( ) , "SPE" , "ER" ) ; p . add ( linkToComplex ( ) , "SPE" , "PE" ) ; p . add ( peToControl ( ) , "PE" , "Control" ) ; p . add ( controlToInter ( ) , "Control" , "Inter" ) ; p . add ( new NOT ( par...
Pattern for detecting PhysicalEntity that controls a Conversion whose participants are not associated with the EntityReference of the initial PhysicalEntity .
6,187
public static Pattern bindsTo ( ) { Pattern p = new Pattern ( ProteinReference . class , "first PR" ) ; p . add ( erToPE ( ) , "first PR" , "first simple PE" ) ; p . add ( linkToComplex ( ) , "first simple PE" , "Complex" ) ; p . add ( new Type ( Complex . class ) , "Complex" ) ; p . add ( linkToSpecific ( ) , "Complex...
Finds two Protein that appear together in a Complex .
6,188
public static void listUnificationXrefsPerPathway ( Model model ) { Visitor visitor = new Visitor ( ) { public void visit ( BioPAXElement domain , Object range , Model model , PropertyEditor editor ) { if ( range instanceof physicalEntity ) { physicalEntity pe = ( physicalEntity ) range ; ClassFilterSet < xref , unific...
Here is a more elegant way of doing the previous method!
6,189
public boolean satisfies ( Match match , int ... ind ) { PhysicalEntity pe0 = ( PhysicalEntity ) match . get ( ind [ 0 ] ) ; PhysicalEntity pe1 = ( PhysicalEntity ) match . get ( ind [ 1 ] ) ; PhysicalEntity pe2 = ( PhysicalEntity ) match . get ( ind [ 2 ] ) ; PhysicalEntity pe3 = ( PhysicalEntity ) match . get ( ind [...
Creates two PhysicalEntity chains with the given endpoints and checks if they are intersecting .
6,190
public Collection < BioPAXElement > generate ( Match match , int ... ind ) { assertIndLength ( ind ) ; PhysicalEntity pe1 = ( PhysicalEntity ) match . get ( ind [ 0 ] ) ; Conversion conv = ( Conversion ) match . get ( ind [ 1 ] ) ; Set < PhysicalEntity > parts ; if ( conv . getLeft ( ) . contains ( pe1 ) ) { parts = si...
Checks which side is the first PhysicalEntity and gathers participants on either the other side or the same side .
6,191
protected void registerEditorsWithSubClasses ( PropertyEditor editor , Class < ? extends BioPAXElement > domain ) { for ( Class < ? extends BioPAXElement > c : classToEditorMap . keySet ( ) ) { if ( domain . isAssignableFrom ( c ) ) { if ( ( editor . getProperty ( ) . equals ( "PARTICIPANTS" ) && ( conversion . class ....
This method registers an editor with sub classes - i . e . inserts the editor to the proper value in editor maps .
6,192
protected void registerModelClass ( String localName ) { try { Class < ? extends BioPAXElement > domain = this . getLevel ( ) . getInterfaceForName ( localName ) ; HashMap < String , PropertyEditor > peMap = new HashMap < String , PropertyEditor > ( ) ; classToEditorMap . put ( domain , peMap ) ; classToInverseEditorMa...
This method inserts the class into internal hashmaps and initializes the value collections .
6,193
private void checkNodeRecursive ( Node node ) { if ( isDangling ( node ) ) { removeNode ( node ) ; for ( Edge edge : node . getUpstream ( ) ) { checkNodeRecursive ( edge . getSourceNode ( ) ) ; } for ( Edge edge : node . getDownstream ( ) ) { checkNodeRecursive ( edge . getTargetNode ( ) ) ; } for ( Node parent : node ...
Recursively checks if a node is dangling .
6,194
private void removeNode ( Node node ) { result . remove ( node ) ; for ( Edge edge : node . getUpstream ( ) ) { result . remove ( edge ) ; } for ( Edge edge : node . getDownstream ( ) ) { result . remove ( edge ) ; } }
Removes the dangling node and its edges .
6,195
private boolean isDangling ( Node node ) { if ( ! result . contains ( node ) ) return false ; if ( ST . contains ( node ) ) return false ; boolean hasIncoming = false ; for ( Edge edge : node . getUpstream ( ) ) { if ( result . contains ( edge ) ) { hasIncoming = true ; break ; } } boolean hasOutgoing = false ; for ( E...
Checks if the node is dangling .
6,196
public Model filter ( Model model ) { if ( model == null || model . getLevel ( ) != BioPAXLevel . L2 ) return model ; preparePep2PEIDMap ( model ) ; final Model newModel = factory . createModel ( ) ; newModel . getNameSpacePrefixMap ( ) . putAll ( model . getNameSpacePrefixMap ( ) ) ; newModel . setXmlBase ( model . ge...
Converts a BioPAX Model Level 1 or 2 to the Level 3 .
6,197
private Level3Element mapClass ( BioPAXElement bpe ) { Level3Element newElement = null ; if ( bpe instanceof physicalEntityParticipant ) { String id = pep2PE . get ( bpe . getUri ( ) ) ; if ( id == null ) { log . warn ( "No mapping possible for " + bpe . getUri ( ) ) ; return null ; } else if ( id . equals ( bpe . getU...
creates L3 classes and sets IDs
6,198
static public String getLocalId ( BioPAXElement bpe ) { String id = bpe . getUri ( ) ; return ( id != null ) ? id . replaceFirst ( "^.+[#/]" , "" ) : null ; }
Gets the local part of the BioPAX element ID .
6,199
public boolean satisfies ( Match match , int ... ind ) { PhysicalEntity pe = ( PhysicalEntity ) match . get ( ind [ 0 ] ) ; return pe . getControllerOf ( ) . isEmpty ( ) == active ; }
Checks if the PhysicalEntity controls anything .