id
int32 0
165k
| repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
list | docstring
stringlengths 3
16k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 105
339
|
|---|---|---|---|---|---|---|---|---|---|---|---|
10,800
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java
|
BFS.processNode
|
protected void processNode(Node current)
{
// Do not process the node if it is ubique
if (current.isUbique())
{
setColor(current, BLACK);
return;
}
// System.out.println("processing = " + current);
// Process edges towards the direction
for (Edge edge : direction == Direction.DOWNSTREAM ?
current.getDownstream() : current.getUpstream())
{
assert edge != null;
// Label the edge considering direction of traversal and type of current node
if (direction == Direction.DOWNSTREAM || !current.isBreadthNode())
{
setLabel(edge, getLabel(current));
}
else
{
setLabel(edge, getLabel(current) + 1);
}
// Get the other end of the edge
Node neigh = direction == Direction.DOWNSTREAM ?
edge.getTargetNode() : edge.getSourceNode();
assert neigh != null;
// Decide neighbor label according to the search direction and node type
int dist = getLabel(edge);
if (neigh.isBreadthNode() && direction == Direction.DOWNSTREAM) dist++;
// Check if we need to stop traversing the neighbor, enqueue otherwise
boolean further = (stopSet == null || !isEquivalentInTheSet(neigh, stopSet)) &&
(!neigh.isBreadthNode() || dist < limit) && !neigh.isUbique();
// Process the neighbor if not processed or not in queue
if (getColor(neigh) == WHITE)
{
// Label the neighbor
setLabel(neigh, dist);
if (further)
{
setColor(neigh, GRAY);
// Enqueue the node according to its type
if (neigh.isBreadthNode())
{
queue.addLast(neigh);
}
else
{
// Non-breadth nodes are added in front of the queue
queue.addFirst(neigh);
}
}
else
{
// If we do not want to traverse this neighbor, we paint it black
setColor(neigh, BLACK);
}
}
labelEquivRecursive(neigh, UPWARD, getLabel(neigh), further, !neigh.isBreadthNode());
labelEquivRecursive(neigh, DOWNWARD, getLabel(neigh), further, !neigh.isBreadthNode());
}
}
|
java
|
protected void processNode(Node current)
{
// Do not process the node if it is ubique
if (current.isUbique())
{
setColor(current, BLACK);
return;
}
// System.out.println("processing = " + current);
// Process edges towards the direction
for (Edge edge : direction == Direction.DOWNSTREAM ?
current.getDownstream() : current.getUpstream())
{
assert edge != null;
// Label the edge considering direction of traversal and type of current node
if (direction == Direction.DOWNSTREAM || !current.isBreadthNode())
{
setLabel(edge, getLabel(current));
}
else
{
setLabel(edge, getLabel(current) + 1);
}
// Get the other end of the edge
Node neigh = direction == Direction.DOWNSTREAM ?
edge.getTargetNode() : edge.getSourceNode();
assert neigh != null;
// Decide neighbor label according to the search direction and node type
int dist = getLabel(edge);
if (neigh.isBreadthNode() && direction == Direction.DOWNSTREAM) dist++;
// Check if we need to stop traversing the neighbor, enqueue otherwise
boolean further = (stopSet == null || !isEquivalentInTheSet(neigh, stopSet)) &&
(!neigh.isBreadthNode() || dist < limit) && !neigh.isUbique();
// Process the neighbor if not processed or not in queue
if (getColor(neigh) == WHITE)
{
// Label the neighbor
setLabel(neigh, dist);
if (further)
{
setColor(neigh, GRAY);
// Enqueue the node according to its type
if (neigh.isBreadthNode())
{
queue.addLast(neigh);
}
else
{
// Non-breadth nodes are added in front of the queue
queue.addFirst(neigh);
}
}
else
{
// If we do not want to traverse this neighbor, we paint it black
setColor(neigh, BLACK);
}
}
labelEquivRecursive(neigh, UPWARD, getLabel(neigh), further, !neigh.isBreadthNode());
labelEquivRecursive(neigh, DOWNWARD, getLabel(neigh), further, !neigh.isBreadthNode());
}
}
|
[
"protected",
"void",
"processNode",
"(",
"Node",
"current",
")",
"{",
"// Do not process the node if it is ubique\r",
"if",
"(",
"current",
".",
"isUbique",
"(",
")",
")",
"{",
"setColor",
"(",
"current",
",",
"BLACK",
")",
";",
"return",
";",
"}",
"//\t\tSystem.out.println(\"processing = \" + current);\r",
"// Process edges towards the direction\r",
"for",
"(",
"Edge",
"edge",
":",
"direction",
"==",
"Direction",
".",
"DOWNSTREAM",
"?",
"current",
".",
"getDownstream",
"(",
")",
":",
"current",
".",
"getUpstream",
"(",
")",
")",
"{",
"assert",
"edge",
"!=",
"null",
";",
"// Label the edge considering direction of traversal and type of current node\r",
"if",
"(",
"direction",
"==",
"Direction",
".",
"DOWNSTREAM",
"||",
"!",
"current",
".",
"isBreadthNode",
"(",
")",
")",
"{",
"setLabel",
"(",
"edge",
",",
"getLabel",
"(",
"current",
")",
")",
";",
"}",
"else",
"{",
"setLabel",
"(",
"edge",
",",
"getLabel",
"(",
"current",
")",
"+",
"1",
")",
";",
"}",
"// Get the other end of the edge\r",
"Node",
"neigh",
"=",
"direction",
"==",
"Direction",
".",
"DOWNSTREAM",
"?",
"edge",
".",
"getTargetNode",
"(",
")",
":",
"edge",
".",
"getSourceNode",
"(",
")",
";",
"assert",
"neigh",
"!=",
"null",
";",
"// Decide neighbor label according to the search direction and node type\r",
"int",
"dist",
"=",
"getLabel",
"(",
"edge",
")",
";",
"if",
"(",
"neigh",
".",
"isBreadthNode",
"(",
")",
"&&",
"direction",
"==",
"Direction",
".",
"DOWNSTREAM",
")",
"dist",
"++",
";",
"// Check if we need to stop traversing the neighbor, enqueue otherwise\r",
"boolean",
"further",
"=",
"(",
"stopSet",
"==",
"null",
"||",
"!",
"isEquivalentInTheSet",
"(",
"neigh",
",",
"stopSet",
")",
")",
"&&",
"(",
"!",
"neigh",
".",
"isBreadthNode",
"(",
")",
"||",
"dist",
"<",
"limit",
")",
"&&",
"!",
"neigh",
".",
"isUbique",
"(",
")",
";",
"// Process the neighbor if not processed or not in queue\r",
"if",
"(",
"getColor",
"(",
"neigh",
")",
"==",
"WHITE",
")",
"{",
"// Label the neighbor\r",
"setLabel",
"(",
"neigh",
",",
"dist",
")",
";",
"if",
"(",
"further",
")",
"{",
"setColor",
"(",
"neigh",
",",
"GRAY",
")",
";",
"// Enqueue the node according to its type\r",
"if",
"(",
"neigh",
".",
"isBreadthNode",
"(",
")",
")",
"{",
"queue",
".",
"addLast",
"(",
"neigh",
")",
";",
"}",
"else",
"{",
"// Non-breadth nodes are added in front of the queue\r",
"queue",
".",
"addFirst",
"(",
"neigh",
")",
";",
"}",
"}",
"else",
"{",
"// If we do not want to traverse this neighbor, we paint it black\r",
"setColor",
"(",
"neigh",
",",
"BLACK",
")",
";",
"}",
"}",
"labelEquivRecursive",
"(",
"neigh",
",",
"UPWARD",
",",
"getLabel",
"(",
"neigh",
")",
",",
"further",
",",
"!",
"neigh",
".",
"isBreadthNode",
"(",
")",
")",
";",
"labelEquivRecursive",
"(",
"neigh",
",",
"DOWNWARD",
",",
"getLabel",
"(",
"neigh",
")",
",",
"further",
",",
"!",
"neigh",
".",
"isBreadthNode",
"(",
")",
")",
";",
"}",
"}"
] |
Processes a node.
@param current The current node
|
[
"Processes",
"a",
"node",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L142-L220
|
10,801
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java
|
BFS.labelEquivRecursive
|
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)
{
setLabel(equiv, dist);
if (enqueue)
{
setColor(equiv, GRAY);
if (head) queue.addFirst(equiv);
else queue.add(equiv);
}
else
{
setColor(equiv, BLACK);
}
}
labelEquivRecursive(equiv, up, dist, enqueue, head);
}
}
|
java
|
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)
{
setLabel(equiv, dist);
if (enqueue)
{
setColor(equiv, GRAY);
if (head) queue.addFirst(equiv);
else queue.add(equiv);
}
else
{
setColor(equiv, BLACK);
}
}
labelEquivRecursive(equiv, up, dist, enqueue, head);
}
}
|
[
"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",
")",
"{",
"setLabel",
"(",
"equiv",
",",
"dist",
")",
";",
"if",
"(",
"enqueue",
")",
"{",
"setColor",
"(",
"equiv",
",",
"GRAY",
")",
";",
"if",
"(",
"head",
")",
"queue",
".",
"addFirst",
"(",
"equiv",
")",
";",
"else",
"queue",
".",
"add",
"(",
"equiv",
")",
";",
"}",
"else",
"{",
"setColor",
"(",
"equiv",
",",
"BLACK",
")",
";",
"}",
"}",
"labelEquivRecursive",
"(",
"equiv",
",",
"up",
",",
"dist",
",",
"enqueue",
",",
"head",
")",
";",
"}",
"}"
] |
Labels equivalent nodes recursively.
@param node Node to label equivalents
@param up Traversing direction. Up means towards parents, if false then towards children
@param dist The label
@param enqueue Whether to enqueue equivalents
@param head Where to enqueue. Head or tail.
|
[
"Labels",
"equivalent",
"nodes",
"recursively",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L230-L259
|
10,802
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java
|
BFS.getColor
|
protected int getColor(Node node)
{
if (!colors.containsKey(node))
{
// Absence of color is interpreted as white
return WHITE;
}
else
{
return colors.get(node);
}
}
|
java
|
protected int getColor(Node node)
{
if (!colors.containsKey(node))
{
// Absence of color is interpreted as white
return WHITE;
}
else
{
return colors.get(node);
}
}
|
[
"protected",
"int",
"getColor",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"!",
"colors",
".",
"containsKey",
"(",
"node",
")",
")",
"{",
"// Absence of color is interpreted as white\r",
"return",
"WHITE",
";",
"}",
"else",
"{",
"return",
"colors",
".",
"get",
"(",
"node",
")",
";",
"}",
"}"
] |
Gets color tag of the node
@param node Node to get color tag
@return color tag
|
[
"Gets",
"color",
"tag",
"of",
"the",
"node"
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L296-L307
|
10,803
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java
|
BFS.getLabel
|
public int getLabel(GraphObject go)
{
if (!dist.containsKey(go))
{
// Absence of label is interpreted as infinite
return Integer.MAX_VALUE-(limit*2);
}
else
{
return dist.get(go);
}
}
|
java
|
public int getLabel(GraphObject go)
{
if (!dist.containsKey(go))
{
// Absence of label is interpreted as infinite
return Integer.MAX_VALUE-(limit*2);
}
else
{
return dist.get(go);
}
}
|
[
"public",
"int",
"getLabel",
"(",
"GraphObject",
"go",
")",
"{",
"if",
"(",
"!",
"dist",
".",
"containsKey",
"(",
"go",
")",
")",
"{",
"// Absence of label is interpreted as infinite\r",
"return",
"Integer",
".",
"MAX_VALUE",
"-",
"(",
"limit",
"*",
"2",
")",
";",
"}",
"else",
"{",
"return",
"dist",
".",
"get",
"(",
"go",
")",
";",
"}",
"}"
] |
Gets the distance label of the object.
@param go object to get the distance
@return the distance label
|
[
"Gets",
"the",
"distance",
"label",
"of",
"the",
"object",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L324-L335
|
10,804
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ControlsNotParticipant.java
|
ControlsNotParticipant.satisfies
|
@Override
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 (Controller controller : ctrl.getController())
{
if (participant.contains(controller)) return false;
}
}
}
return true;
}
|
java
|
@Override
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 (Controller controller : ctrl.getController())
{
if (participant.contains(controller)) return false;
}
}
}
return true;
}
|
[
"@",
"Override",
"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",
"(",
"Controller",
"controller",
":",
"ctrl",
".",
"getController",
"(",
")",
")",
"{",
"if",
"(",
"participant",
".",
"contains",
"(",
"controller",
")",
")",
"return",
"false",
";",
"}",
"}",
"}",
"return",
"true",
";",
"}"
] |
Checks if the controlled Interaction contains a controller as a participant. This constraint
filters out such cases.
@param match current pattern match
@param ind mapped indices
@return true if participants of teh controlled Interactions not also a controller of the
Control.
|
[
"Checks",
"if",
"the",
"controlled",
"Interaction",
"contains",
"a",
"controller",
"as",
"a",
"participant",
".",
"This",
"constraint",
"filters",
"out",
"such",
"cases",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ControlsNotParticipant.java#L35-L53
|
10,805
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/impl/level3/BindingFeatureImpl.java
|
BindingFeatureImpl.setBindsTo
|
public void setBindsTo(BindingFeature bindsTo)
{
//Check if we need to update
if (this.bindsTo != bindsTo)
{
//ok go ahead - first get a pointer to the old binds to as we will swap this soon.
BindingFeature old = this.bindsTo;
//swap it
this.bindsTo = bindsTo;
//make sure old feature no longer points to this
if (old != null && old.getBindsTo() == this)
{
old.setBindsTo(null);
}
//make sure new feature points to this
if (!(this.bindsTo == null || this.bindsTo.getBindsTo() == this))
{
this.bindsTo.setBindsTo(this);
}
}
}
|
java
|
public void setBindsTo(BindingFeature bindsTo)
{
//Check if we need to update
if (this.bindsTo != bindsTo)
{
//ok go ahead - first get a pointer to the old binds to as we will swap this soon.
BindingFeature old = this.bindsTo;
//swap it
this.bindsTo = bindsTo;
//make sure old feature no longer points to this
if (old != null && old.getBindsTo() == this)
{
old.setBindsTo(null);
}
//make sure new feature points to this
if (!(this.bindsTo == null || this.bindsTo.getBindsTo() == this))
{
this.bindsTo.setBindsTo(this);
}
}
}
|
[
"public",
"void",
"setBindsTo",
"(",
"BindingFeature",
"bindsTo",
")",
"{",
"//Check if we need to update",
"if",
"(",
"this",
".",
"bindsTo",
"!=",
"bindsTo",
")",
"{",
"//ok go ahead - first get a pointer to the old binds to as we will swap this soon.",
"BindingFeature",
"old",
"=",
"this",
".",
"bindsTo",
";",
"//swap it",
"this",
".",
"bindsTo",
"=",
"bindsTo",
";",
"//make sure old feature no longer points to this",
"if",
"(",
"old",
"!=",
"null",
"&&",
"old",
".",
"getBindsTo",
"(",
")",
"==",
"this",
")",
"{",
"old",
".",
"setBindsTo",
"(",
"null",
")",
";",
"}",
"//make sure new feature points to this",
"if",
"(",
"!",
"(",
"this",
".",
"bindsTo",
"==",
"null",
"||",
"this",
".",
"bindsTo",
".",
"getBindsTo",
"(",
")",
"==",
"this",
")",
")",
"{",
"this",
".",
"bindsTo",
".",
"setBindsTo",
"(",
"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
@param bindsTo paired binding feature.
|
[
"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"
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/impl/level3/BindingFeatureImpl.java#L46-L67
|
10,806
|
lightoze/gwt-i18n-server
|
src/main/java/net/lightoze/gwt/i18n/LocaleFactoryProvider.java
|
LocaleFactoryProvider.create
|
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(cls, l);
}
|
java
|
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(cls, l);
}
|
[
"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",
"(",
"cls",
",",
"l",
")",
";",
"}"
] |
Create the resource using the Locale provided. If the locale is null, the locale is retrieved from the
LocaleProvider in LocaleProxy.
@param cls localization interface class
@param <T> localization interface class
@param locale locale string
@return object implementing specified class
|
[
"Create",
"the",
"resource",
"using",
"the",
"Locale",
"provided",
".",
"If",
"the",
"locale",
"is",
"null",
"the",
"locale",
"is",
"retrieved",
"from",
"the",
"LocaleProvider",
"in",
"LocaleProxy",
"."
] |
96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83
|
https://github.com/lightoze/gwt-i18n-server/blob/96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83/src/main/java/net/lightoze/gwt/i18n/LocaleFactoryProvider.java#L25-L36
|
10,807
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/impl/level3/EntityFeatureImpl.java
|
EntityFeatureImpl.atEquivalentLocation
|
public boolean atEquivalentLocation(EntityFeature that) {
return getEntityFeatureOf() != null &&
getEntityFeatureOf().isEquivalent(that.getEntityFeatureOf()) &&
getFeatureLocation() != null &&
getFeatureLocation().isEquivalent(that.getFeatureLocation());
}
|
java
|
public boolean atEquivalentLocation(EntityFeature that) {
return getEntityFeatureOf() != null &&
getEntityFeatureOf().isEquivalent(that.getEntityFeatureOf()) &&
getFeatureLocation() != null &&
getFeatureLocation().isEquivalent(that.getFeatureLocation());
}
|
[
"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.
|
[
"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",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/impl/level3/EntityFeatureImpl.java#L125-L130
|
10,808
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.search
|
public static List<Match> search(Match m, Pattern pattern)
{
assert pattern.getStartingClass().isAssignableFrom(m.get(0).getModelInterface());
return searchRecursive(m, pattern.getConstraints(), 0);
}
|
java
|
public static List<Match> search(Match m, Pattern pattern)
{
assert pattern.getStartingClass().isAssignableFrom(m.get(0).getModelInterface());
return searchRecursive(m, pattern.getConstraints(), 0);
}
|
[
"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.
@param m match to start from
@param pattern pattern to search
@return result matches
|
[
"Searches",
"the",
"pattern",
"starting",
"from",
"the",
"given",
"match",
".",
"The",
"first",
"element",
"of",
"the",
"match",
"should",
"be",
"assigned",
".",
"Others",
"are",
"optional",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L38-L43
|
10,809
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.search
|
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);
}
|
java
|
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);
}
|
[
"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.
@param ele element to start from
@param pattern pattern to search
@return matching results
|
[
"Searches",
"the",
"pattern",
"starting",
"from",
"the",
"given",
"element",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L51-L58
|
10,810
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchRecursive
|
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.canGenerate() && match.get(lastInd) == null)
{
Collection<BioPAXElement> elements = con.generate(match, ind);
for (BioPAXElement ele : elements)
{
match.set(ele, lastInd);
if (mc.size() == index + 1)
{
result.add((Match) match.clone());
}
else
{
result.addAll(searchRecursive(match, mc, index + 1));
}
match.set(null, lastInd);
}
}
else
{
if (con.satisfies(match, ind))
{
if (mc.size() == index + 1)
{
result.add((Match) match.clone());
}
else
{
result.addAll(searchRecursive(match, mc, index + 1));
}
}
}
return result;
}
|
java
|
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.canGenerate() && match.get(lastInd) == null)
{
Collection<BioPAXElement> elements = con.generate(match, ind);
for (BioPAXElement ele : elements)
{
match.set(ele, lastInd);
if (mc.size() == index + 1)
{
result.add((Match) match.clone());
}
else
{
result.addAll(searchRecursive(match, mc, index + 1));
}
match.set(null, lastInd);
}
}
else
{
if (con.satisfies(match, ind))
{
if (mc.size() == index + 1)
{
result.add((Match) match.clone());
}
else
{
result.addAll(searchRecursive(match, mc, index + 1));
}
}
}
return result;
}
|
[
"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",
".",
"canGenerate",
"(",
")",
"&&",
"match",
".",
"get",
"(",
"lastInd",
")",
"==",
"null",
")",
"{",
"Collection",
"<",
"BioPAXElement",
">",
"elements",
"=",
"con",
".",
"generate",
"(",
"match",
",",
"ind",
")",
";",
"for",
"(",
"BioPAXElement",
"ele",
":",
"elements",
")",
"{",
"match",
".",
"set",
"(",
"ele",
",",
"lastInd",
")",
";",
"if",
"(",
"mc",
".",
"size",
"(",
")",
"==",
"index",
"+",
"1",
")",
"{",
"result",
".",
"add",
"(",
"(",
"Match",
")",
"match",
".",
"clone",
"(",
")",
")",
";",
"}",
"else",
"{",
"result",
".",
"addAll",
"(",
"searchRecursive",
"(",
"match",
",",
"mc",
",",
"index",
"+",
"1",
")",
")",
";",
"}",
"match",
".",
"set",
"(",
"null",
",",
"lastInd",
")",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"con",
".",
"satisfies",
"(",
"match",
",",
"ind",
")",
")",
"{",
"if",
"(",
"mc",
".",
"size",
"(",
")",
"==",
"index",
"+",
"1",
")",
"{",
"result",
".",
"add",
"(",
"(",
"Match",
")",
"match",
".",
"clone",
"(",
")",
")",
";",
"}",
"else",
"{",
"result",
".",
"addAll",
"(",
"searchRecursive",
"(",
"match",
",",
"mc",
",",
"index",
"+",
"1",
")",
")",
";",
"}",
"}",
"}",
"return",
"result",
";",
"}"
] |
Continues searching with the mapped constraint at the given index.
@param match match to start from
@param mc mapped constraints of the pattern
@param index index of the current mapped constraint
@return matching results
|
[
"Continues",
"searching",
"with",
"the",
"mapped",
"constraint",
"at",
"the",
"given",
"index",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L67-L110
|
10,811
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchPlain
|
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;
}
|
java
|
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;
}
|
[
"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.
@param model model to search in
@param pattern pattern to search for
@return matching results
|
[
"Searches",
"the",
"pattern",
"in",
"a",
"given",
"model",
"but",
"instead",
"of",
"a",
"match",
"map",
"returns",
"all",
"matches",
"in",
"a",
"list",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L119-L129
|
10,812
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchPlain
|
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);
}
return list;
}
|
java
|
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);
}
return list;
}
|
[
"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",
")",
";",
"}",
"return",
"list",
";",
"}"
] |
Searches the pattern starting from given elements, but instead of a match map, returns all
matches in a list.
@param eles elements to start from
@param pattern pattern to search for
@return matching results
|
[
"Searches",
"the",
"pattern",
"starting",
"from",
"given",
"elements",
"but",
"instead",
"of",
"a",
"match",
"map",
"returns",
"all",
"matches",
"in",
"a",
"list",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L138-L148
|
10,813
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.search
|
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);
for (final BioPAXElement ele : eles)
{
if (!pattern.getStartingClass().isAssignableFrom(ele.getModelInterface())) continue;
exec.execute(new Runnable() {
@Override
public void run() {
List<Match> matches = search(ele, pattern);
if (!matches.isEmpty()) {
map.put(ele, matches);
}
}
});
}
exec.shutdown();
try {
exec.awaitTermination(10, TimeUnit.MINUTES);
} catch (InterruptedException e) {
throw new RuntimeException("search, failed due to exec timed out.", e);
}
return Collections.unmodifiableMap(new HashMap<BioPAXElement, List<Match>>(map));
}
|
java
|
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);
for (final BioPAXElement ele : eles)
{
if (!pattern.getStartingClass().isAssignableFrom(ele.getModelInterface())) continue;
exec.execute(new Runnable() {
@Override
public void run() {
List<Match> matches = search(ele, pattern);
if (!matches.isEmpty()) {
map.put(ele, matches);
}
}
});
}
exec.shutdown();
try {
exec.awaitTermination(10, TimeUnit.MINUTES);
} catch (InterruptedException e) {
throw new RuntimeException("search, failed due to exec timed out.", e);
}
return Collections.unmodifiableMap(new HashMap<BioPAXElement, List<Match>>(map));
}
|
[
"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",
")",
";",
"for",
"(",
"final",
"BioPAXElement",
"ele",
":",
"eles",
")",
"{",
"if",
"(",
"!",
"pattern",
".",
"getStartingClass",
"(",
")",
".",
"isAssignableFrom",
"(",
"ele",
".",
"getModelInterface",
"(",
")",
")",
")",
"continue",
";",
"exec",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"List",
"<",
"Match",
">",
"matches",
"=",
"search",
"(",
"ele",
",",
"pattern",
")",
";",
"if",
"(",
"!",
"matches",
".",
"isEmpty",
"(",
")",
")",
"{",
"map",
".",
"put",
"(",
"ele",
",",
"matches",
")",
";",
"}",
"}",
"}",
")",
";",
"}",
"exec",
".",
"shutdown",
"(",
")",
";",
"try",
"{",
"exec",
".",
"awaitTermination",
"(",
"10",
",",
"TimeUnit",
".",
"MINUTES",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"search, failed due to exec timed out.\"",
",",
"e",
")",
";",
"}",
"return",
"Collections",
".",
"unmodifiableMap",
"(",
"new",
"HashMap",
"<",
"BioPAXElement",
",",
"List",
"<",
"Match",
">",
">",
"(",
"map",
")",
")",
";",
"}"
] |
Searches the given pattern starting from the given elements.
@param eles elements to start from
@param pattern pattern to search for
@return map from starting element to the matching results
|
[
"Searches",
"the",
"given",
"pattern",
"starting",
"from",
"the",
"given",
"elements",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L208-L237
|
10,814
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchAndCollect
|
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);
}
|
java
|
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);
}
|
[
"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.
@param <T> BioPAX type
@param model model to search in
@param pattern pattern to search for
@param index index of the element in the match to collect
@param c type of the element to collect
@return set of the elements at the specified index of the matching results
|
[
"Searches",
"a",
"model",
"for",
"the",
"given",
"pattern",
"then",
"collects",
"the",
"specified",
"elements",
"of",
"the",
"matches",
"and",
"returns",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L250-L254
|
10,815
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchAndCollect
|
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;
}
|
java
|
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;
}
|
[
"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.
@param <T> BioPAX type
@param eles elements to start from
@param pattern pattern to search for
@param index index of the element in the match to collect
@param c type of the element to collect
@return set of the elements at the specified index of the matching results
|
[
"Searches",
"the",
"given",
"pattern",
"starting",
"from",
"the",
"given",
"elements",
"then",
"collects",
"the",
"specified",
"elements",
"of",
"the",
"matches",
"and",
"returns",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L267-L277
|
10,816
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchAndCollect
|
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;
}
|
java
|
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;
}
|
[
"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.
@param <T> BioPAX type
@param ele element to start from
@param pattern pattern to search for
@param index index of the element in the match to collect
@param c type of the element to collect
@return set of the elements at the specified index of the matching results
|
[
"Searches",
"the",
"given",
"pattern",
"starting",
"from",
"the",
"given",
"element",
"then",
"collects",
"the",
"specified",
"elements",
"of",
"the",
"matches",
"and",
"returns",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L290-L300
|
10,817
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.hasSolution
|
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();
}
|
java
|
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();
}
|
[
"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.
@param p pattern to search for
@param ele element to start from
@return true if there is a match
|
[
"Checks",
"if",
"there",
"is",
"any",
"match",
"for",
"the",
"given",
"pattern",
"if",
"search",
"starts",
"from",
"the",
"given",
"element",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L308-L317
|
10,818
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchInFile
|
public static void searchInFile(Pattern p, String inFile, String outFile) throws FileNotFoundException
{
searchInFile(p, inFile, outFile, Integer.MAX_VALUE, Integer.MAX_VALUE);
}
|
java
|
public static void searchInFile(Pattern p, String inFile, String outFile) throws FileNotFoundException
{
searchInFile(p, inFile, outFile, Integer.MAX_VALUE, Integer.MAX_VALUE);
}
|
[
"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.
@param p pattern to search for
@param inFile filename for the model to search in
@param outFile filename for the result model
@throws FileNotFoundException when no file exists
|
[
"Searches",
"a",
"pattern",
"reading",
"the",
"model",
"from",
"the",
"given",
"file",
"and",
"creates",
"another",
"model",
"that",
"is",
"excised",
"using",
"the",
"matching",
"patterns",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L327-L330
|
10,819
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.searchInFile
|
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.search(model, p);
System.out.println("matching groups size = " + matchMap.size());
List<Set<Interaction>> inters = new LinkedList<Set<Interaction>>();
Set<Integer> encountered = new HashSet<Integer>();
Set<BioPAXElement> toExise = new HashSet<BioPAXElement>();
int seedCounter = 0;
for (BioPAXElement ele : matchMap.keySet())
{
if (seedCounter >= seedLimit) break;
int matchCounter = 0;
List<Match> matches = matchMap.get(ele);
if (!matches.isEmpty()) seedCounter++;
for (Match match : matches)
{
matchCounter++;
if (matchCounter > graphPerSeed) break;
Set<Interaction> ints = getInter(match);
toExise.addAll(Arrays.asList(match.getVariables()));
toExise.addAll(ints);
Integer hash = hashSum(ints);
if (!encountered.contains(hash))
{
encountered.add(hash);
inters.add(ints);
}
}
}
System.out.println("created pathways = " + inters.size());
Model clonedModel = excise(toExise);
int i = 0;
for (Set<Interaction> ints : inters)
{
Pathway pathway = clonedModel.addNew(Pathway.class,
System.currentTimeMillis() + "PaxtoolsPatternGeneratedMatch" + (++i));
pathway.setDisplayName("Match " + getLeadingZeros(i, inters.size()) + i);
for (Interaction anInt : ints)
{
pathway.addPathwayComponent((Process) clonedModel.getByID(anInt.getUri()));
}
}
handler.convertToOWL(clonedModel, new FileOutputStream(outFile));
}
|
java
|
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.search(model, p);
System.out.println("matching groups size = " + matchMap.size());
List<Set<Interaction>> inters = new LinkedList<Set<Interaction>>();
Set<Integer> encountered = new HashSet<Integer>();
Set<BioPAXElement> toExise = new HashSet<BioPAXElement>();
int seedCounter = 0;
for (BioPAXElement ele : matchMap.keySet())
{
if (seedCounter >= seedLimit) break;
int matchCounter = 0;
List<Match> matches = matchMap.get(ele);
if (!matches.isEmpty()) seedCounter++;
for (Match match : matches)
{
matchCounter++;
if (matchCounter > graphPerSeed) break;
Set<Interaction> ints = getInter(match);
toExise.addAll(Arrays.asList(match.getVariables()));
toExise.addAll(ints);
Integer hash = hashSum(ints);
if (!encountered.contains(hash))
{
encountered.add(hash);
inters.add(ints);
}
}
}
System.out.println("created pathways = " + inters.size());
Model clonedModel = excise(toExise);
int i = 0;
for (Set<Interaction> ints : inters)
{
Pathway pathway = clonedModel.addNew(Pathway.class,
System.currentTimeMillis() + "PaxtoolsPatternGeneratedMatch" + (++i));
pathway.setDisplayName("Match " + getLeadingZeros(i, inters.size()) + i);
for (Interaction anInt : ints)
{
pathway.addPathwayComponent((Process) clonedModel.getByID(anInt.getUri()));
}
}
handler.convertToOWL(clonedModel, new FileOutputStream(outFile));
}
|
[
"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",
".",
"search",
"(",
"model",
",",
"p",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"matching groups size = \"",
"+",
"matchMap",
".",
"size",
"(",
")",
")",
";",
"List",
"<",
"Set",
"<",
"Interaction",
">",
">",
"inters",
"=",
"new",
"LinkedList",
"<",
"Set",
"<",
"Interaction",
">",
">",
"(",
")",
";",
"Set",
"<",
"Integer",
">",
"encountered",
"=",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
")",
";",
"Set",
"<",
"BioPAXElement",
">",
"toExise",
"=",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
")",
";",
"int",
"seedCounter",
"=",
"0",
";",
"for",
"(",
"BioPAXElement",
"ele",
":",
"matchMap",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"seedCounter",
">=",
"seedLimit",
")",
"break",
";",
"int",
"matchCounter",
"=",
"0",
";",
"List",
"<",
"Match",
">",
"matches",
"=",
"matchMap",
".",
"get",
"(",
"ele",
")",
";",
"if",
"(",
"!",
"matches",
".",
"isEmpty",
"(",
")",
")",
"seedCounter",
"++",
";",
"for",
"(",
"Match",
"match",
":",
"matches",
")",
"{",
"matchCounter",
"++",
";",
"if",
"(",
"matchCounter",
">",
"graphPerSeed",
")",
"break",
";",
"Set",
"<",
"Interaction",
">",
"ints",
"=",
"getInter",
"(",
"match",
")",
";",
"toExise",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"match",
".",
"getVariables",
"(",
")",
")",
")",
";",
"toExise",
".",
"addAll",
"(",
"ints",
")",
";",
"Integer",
"hash",
"=",
"hashSum",
"(",
"ints",
")",
";",
"if",
"(",
"!",
"encountered",
".",
"contains",
"(",
"hash",
")",
")",
"{",
"encountered",
".",
"add",
"(",
"hash",
")",
";",
"inters",
".",
"add",
"(",
"ints",
")",
";",
"}",
"}",
"}",
"System",
".",
"out",
".",
"println",
"(",
"\"created pathways = \"",
"+",
"inters",
".",
"size",
"(",
")",
")",
";",
"Model",
"clonedModel",
"=",
"excise",
"(",
"toExise",
")",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"Set",
"<",
"Interaction",
">",
"ints",
":",
"inters",
")",
"{",
"Pathway",
"pathway",
"=",
"clonedModel",
".",
"addNew",
"(",
"Pathway",
".",
"class",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"\"PaxtoolsPatternGeneratedMatch\"",
"+",
"(",
"++",
"i",
")",
")",
";",
"pathway",
".",
"setDisplayName",
"(",
"\"Match \"",
"+",
"getLeadingZeros",
"(",
"i",
",",
"inters",
".",
"size",
"(",
")",
")",
"+",
"i",
")",
";",
"for",
"(",
"Interaction",
"anInt",
":",
"ints",
")",
"{",
"pathway",
".",
"addPathwayComponent",
"(",
"(",
"Process",
")",
"clonedModel",
".",
"getByID",
"(",
"anInt",
".",
"getUri",
"(",
")",
")",
")",
";",
"}",
"}",
"handler",
".",
"convertToOWL",
"(",
"clonedModel",
",",
"new",
"FileOutputStream",
"(",
"outFile",
")",
")",
";",
"}"
] |
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.
@param p pattern to search for
@param inFile filename for the model to search in
@param outFile filename for the result model
@param seedLimit max number of starting elements
@param graphPerSeed max number of matches for a starting element
@throws FileNotFoundException when no file exists
|
[
"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",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L344-L409
|
10,820
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.getLeadingZeros
|
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;
}
|
java
|
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;
}
|
[
"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.
@param i the int to prepare
@param size max value for i
@return printable string for i with leading zeros
|
[
"Prepares",
"an",
"int",
"for",
"printing",
"with",
"leading",
"zeros",
"for",
"the",
"given",
"size",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L417-L430
|
10,821
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.excise
|
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);
}
|
java
|
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);
}
|
[
"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.
@param result elements to excise to
@return excised model
|
[
"Excises",
"a",
"model",
"to",
"the",
"given",
"elements",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L459-L465
|
10,822
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.getInter
|
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;
}
|
java
|
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;
}
|
[
"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.
@param match match to search
@return all interaction in the match
|
[
"Gets",
"all",
"interactions",
"in",
"a",
"match",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L472-L484
|
10,823
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.addControlsRecursive
|
private static void addControlsRecursive(Interaction inter, Set<Interaction> set)
{
for (Control ctrl : inter.getControlledOf())
{
set.add(ctrl);
addControlsRecursive(ctrl, set);
}
}
|
java
|
private static void addControlsRecursive(Interaction inter, Set<Interaction> set)
{
for (Control ctrl : inter.getControlledOf())
{
set.add(ctrl);
addControlsRecursive(ctrl, set);
}
}
|
[
"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.
@param inter interaction to add its controls
@param set set to add to
|
[
"Adds",
"controls",
"of",
"the",
"given",
"interactions",
"recursively",
"to",
"the",
"given",
"set",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L491-L498
|
10,824
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
|
Searcher.hashSum
|
private static Integer hashSum(Set<Interaction> set)
{
int x = 0;
for (Interaction inter : set)
{
x += inter.hashCode();
}
return x;
}
|
java
|
private static Integer hashSum(Set<Interaction> set)
{
int x = 0;
for (Interaction inter : set)
{
x += inter.hashCode();
}
return x;
}
|
[
"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.
@param set interactions
@return sum of hashes
|
[
"Creates",
"a",
"hash",
"code",
"for",
"a",
"set",
"of",
"interactions",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L505-L513
|
10,825
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/Empty.java
|
Empty.satisfies
|
@Override
public boolean satisfies(Match match, int... ind)
{
assertIndLength(ind);
return con.generate(match, ind).isEmpty();
}
|
java
|
@Override
public boolean satisfies(Match match, int... ind)
{
assertIndLength(ind);
return con.generate(match, ind).isEmpty();
}
|
[
"@",
"Override",
"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.
@param match current pattern match
@param ind mapped indices
@return true if the wrapped Constraint generates nothing
|
[
"Checks",
"if",
"the",
"wrapped",
"Constraint",
"can",
"generate",
"any",
"elements",
".",
"This",
"satisfies",
"if",
"it",
"cannot",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/Empty.java#L56-L62
|
10,826
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3/EventWrapper.java
|
EventWrapper.addToUpstream
|
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).setTranscription(true);
}
}
node.getDownstreamNoInit().add(edge);
this.getUpstreamNoInit().add(edge);
}
|
java
|
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).setTranscription(true);
}
}
node.getDownstreamNoInit().add(edge);
this.getUpstreamNoInit().add(edge);
}
|
[
"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",
")",
".",
"setTranscription",
"(",
"true",
")",
";",
"}",
"}",
"node",
".",
"getDownstreamNoInit",
"(",
")",
".",
"add",
"(",
"edge",
")",
";",
"this",
".",
"getUpstreamNoInit",
"(",
")",
".",
"add",
"(",
"edge",
")",
";",
"}"
] |
Bind the wrapper of the given element to the upstream.
@param ele Element to bind
@param graph Owner graph.
|
[
"Bind",
"the",
"wrapper",
"of",
"the",
"given",
"element",
"to",
"the",
"upstream",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3/EventWrapper.java#L67-L84
|
10,827
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java
|
GraphL3Undirected.passesFilters
|
private boolean passesFilters(Level3Element ele)
{
if (filters == null) return true;
for (Filter filter : filters)
{
if (!filter.okToTraverse(ele)) return false;
}
return true;
}
|
java
|
private boolean passesFilters(Level3Element ele)
{
if (filters == null) return true;
for (Filter filter : filters)
{
if (!filter.okToTraverse(ele)) return false;
}
return true;
}
|
[
"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.
@param ele element to check
@return true if ok to traverse
|
[
"There",
"must",
"be",
"no",
"filter",
"opposing",
"to",
"traverse",
"this",
"object",
"to",
"traverse",
"it",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java#L57-L66
|
10,828
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java
|
GraphL3Undirected.getKey
|
@Override
public String getKey(Object wrapped)
{
if (wrapped instanceof BioPAXElement)
{
return ((BioPAXElement) wrapped).getUri();
}
throw new IllegalArgumentException("Object cannot be wrapped: " + wrapped);
}
|
java
|
@Override
public String getKey(Object wrapped)
{
if (wrapped instanceof BioPAXElement)
{
return ((BioPAXElement) wrapped).getUri();
}
throw new IllegalArgumentException("Object cannot be wrapped: " + wrapped);
}
|
[
"@",
"Override",
"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.
@param wrapped Object to wrap
@return Key
|
[
"RDF",
"IDs",
"of",
"elements",
"is",
"used",
"as",
"key",
"in",
"the",
"object",
"map",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java#L112-L121
|
10,829
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java
|
GraphL3Undirected.getWrapperSet
|
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;
}
|
java
|
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;
}
|
[
"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
@param objects Wrapped objects
@return wrappers
|
[
"Gets",
"wrappers",
"of",
"given",
"elements"
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java#L128-L141
|
10,830
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java
|
GraphL3Undirected.getWrapperMap
|
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;
}
|
java
|
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;
}
|
[
"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.
@param objects Wrapped objects
@return object-to-wrapper map
|
[
"Gets",
"an",
"element",
"-",
"to",
"-",
"wrapper",
"map",
"for",
"the",
"given",
"elements",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3undirected/GraphL3Undirected.java#L148-L161
|
10,831
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/AND.java
|
AND.generate
|
@Override
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));
}
return gen;
}
|
java
|
@Override
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));
}
return gen;
}
|
[
"@",
"Override",
"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",
")",
")",
";",
"}",
"return",
"gen",
";",
"}"
] |
Gets intersection of the generated elements by the member constraints.
@param match match to process
@param ind mapped indices
@return satisfying elements
|
[
"Gets",
"intersection",
"of",
"the",
"generated",
"elements",
"by",
"the",
"member",
"constraints",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/AND.java#L48-L61
|
10,832
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java
|
LinkedPE.generate
|
@Override
public Collection<BioPAXElement> generate(Match match, int... ind)
{
PhysicalEntity pe = (PhysicalEntity) match.get(ind[0]);
Set<BioPAXElement> set = getLinkedElements(pe);
return set;
}
|
java
|
@Override
public Collection<BioPAXElement> generate(Match match, int... ind)
{
PhysicalEntity pe = (PhysicalEntity) match.get(ind[0]);
Set<BioPAXElement> set = getLinkedElements(pe);
return set;
}
|
[
"@",
"Override",
"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.
@param match current pattern match
@param ind mapped indices
@return linked PhysicalEntity
|
[
"Gets",
"to",
"the",
"linked",
"PhysicalEntity",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java#L94-L101
|
10,833
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java
|
LinkedPE.enrichWithGenerics
|
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(seed, all);
}
|
java
|
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(seed, all);
}
|
[
"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",
"(",
"seed",
",",
"all",
")",
";",
"}"
] |
Gets the linked homologies and then switches to complex-relationship mode. These two enrich
methods call each other recursively.
@param seed to get the linked elements from
@param all already found links
|
[
"Gets",
"the",
"linked",
"homologies",
"and",
"then",
"switches",
"to",
"complex",
"-",
"relationship",
"mode",
".",
"These",
"two",
"enrich",
"methods",
"call",
"each",
"other",
"recursively",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java#L117-L127
|
10,834
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java
|
LinkedPE.enrichWithCM
|
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(addition);
enrichWithGenerics(addition, all);
}
}
|
java
|
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(addition);
enrichWithGenerics(addition, all);
}
}
|
[
"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",
"(",
"addition",
")",
";",
"enrichWithGenerics",
"(",
"addition",
",",
"all",
")",
";",
"}",
"}"
] |
Gets parent complexes or complex members recursively according to the type of the linkage.
@param seed elements to link
@param all already found links
|
[
"Gets",
"parent",
"complexes",
"or",
"complex",
"members",
"recursively",
"according",
"to",
"the",
"type",
"of",
"the",
"linkage",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java#L134-L145
|
10,835
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java
|
AbstractPropertyEditor.createPropertyEditor
|
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 = detectRange(getMethod);
if (range.isPrimitive() || range.equals(Boolean.class))
{
editor = new PrimitivePropertyEditor<D, R>(property, getMethod, domain, range, multipleCardinality);
} else if (range.isEnum())
{
editor = new EnumeratedPropertyEditor(property, getMethod, domain, range, multipleCardinality);
} else if (range.equals(String.class))
{
editor = new StringPropertyEditor(property, getMethod, domain, multipleCardinality);
} else
{
editor = new ObjectPropertyEditor(property, getMethod, domain, range, multipleCardinality);
}
}
catch (NoSuchMethodException e)
{
if (log.isWarnEnabled()) log.warn("Failed creating the controller for " + property + " on " + domain);
}
return editor;
}
|
java
|
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 = detectRange(getMethod);
if (range.isPrimitive() || range.equals(Boolean.class))
{
editor = new PrimitivePropertyEditor<D, R>(property, getMethod, domain, range, multipleCardinality);
} else if (range.isEnum())
{
editor = new EnumeratedPropertyEditor(property, getMethod, domain, range, multipleCardinality);
} else if (range.equals(String.class))
{
editor = new StringPropertyEditor(property, getMethod, domain, multipleCardinality);
} else
{
editor = new ObjectPropertyEditor(property, getMethod, domain, range, multipleCardinality);
}
}
catch (NoSuchMethodException e)
{
if (log.isWarnEnabled()) log.warn("Failed creating the controller for " + property + " on " + domain);
}
return editor;
}
|
[
"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",
"=",
"detectRange",
"(",
"getMethod",
")",
";",
"if",
"(",
"range",
".",
"isPrimitive",
"(",
")",
"||",
"range",
".",
"equals",
"(",
"Boolean",
".",
"class",
")",
")",
"{",
"editor",
"=",
"new",
"PrimitivePropertyEditor",
"<",
"D",
",",
"R",
">",
"(",
"property",
",",
"getMethod",
",",
"domain",
",",
"range",
",",
"multipleCardinality",
")",
";",
"}",
"else",
"if",
"(",
"range",
".",
"isEnum",
"(",
")",
")",
"{",
"editor",
"=",
"new",
"EnumeratedPropertyEditor",
"(",
"property",
",",
"getMethod",
",",
"domain",
",",
"range",
",",
"multipleCardinality",
")",
";",
"}",
"else",
"if",
"(",
"range",
".",
"equals",
"(",
"String",
".",
"class",
")",
")",
"{",
"editor",
"=",
"new",
"StringPropertyEditor",
"(",
"property",
",",
"getMethod",
",",
"domain",
",",
"multipleCardinality",
")",
";",
"}",
"else",
"{",
"editor",
"=",
"new",
"ObjectPropertyEditor",
"(",
"property",
",",
"getMethod",
",",
"domain",
",",
"range",
",",
"multipleCardinality",
")",
";",
"}",
"}",
"catch",
"(",
"NoSuchMethodException",
"e",
")",
"{",
"if",
"(",
"log",
".",
"isWarnEnabled",
"(",
")",
")",
"log",
".",
"warn",
"(",
"\"Failed creating the controller for \"",
"+",
"property",
"+",
"\" on \"",
"+",
"domain",
")",
";",
"}",
"return",
"editor",
";",
"}"
] |
This method creates a property reflecting on the domain and property. Proper subclass is chosen
based on the range of the property.
@param domain paxtools level2 interface that maps to the corresponding owl level2.
@param property to be managed by the constructed controller.
@param <D> domain
@param <R> range
@return a property controller to manipulate the beans for the given property.
|
[
"This",
"method",
"creates",
"a",
"property",
"reflecting",
"on",
"the",
"domain",
"and",
"property",
".",
"Proper",
"subclass",
"is",
"chosen",
"based",
"on",
"the",
"range",
"of",
"the",
"property",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java#L120-L149
|
10,836
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java
|
AbstractPropertyEditor.getJavaName
|
private static String getJavaName(String owlName)
{
// Since java does not allow '-' replace them all with '_'
String s = owlName.replaceAll("-", "_");
s = s.substring(0, 1).toUpperCase() + s.substring(1);
return s;
}
|
java
|
private static String getJavaName(String owlName)
{
// Since java does not allow '-' replace them all with '_'
String s = owlName.replaceAll("-", "_");
s = s.substring(0, 1).toUpperCase() + s.substring(1);
return s;
}
|
[
"private",
"static",
"String",
"getJavaName",
"(",
"String",
"owlName",
")",
"{",
"// Since java does not allow '-' replace them all with '_'",
"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.
@param owlName the property name as a string
@return the Java compatible name of the property
|
[
"Given",
"the",
"name",
"of",
"a",
"property",
"s",
"name",
"as",
"indicated",
"in",
"the",
"OWL",
"file",
"this",
"method",
"converts",
"the",
"name",
"to",
"a",
"Java",
"compatible",
"name",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java#L170-L176
|
10,837
|
BioPAX/Paxtools
|
normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java
|
MiriamLink.getDataTypeDef
|
public static String getDataTypeDef(String datatypeKey)
{
Datatype datatype = getDatatype(datatypeKey);
return datatype.getDefinition();
}
|
java
|
public static String getDataTypeDef(String datatypeKey)
{
Datatype datatype = getDatatype(datatypeKey);
return datatype.getDefinition();
}
|
[
"public",
"static",
"String",
"getDataTypeDef",
"(",
"String",
"datatypeKey",
")",
"{",
"Datatype",
"datatype",
"=",
"getDatatype",
"(",
"datatypeKey",
")",
";",
"return",
"datatype",
".",
"getDefinition",
"(",
")",
";",
"}"
] |
Retrieves the definition of a data type.
@param datatypeKey - ID, name or URI (URN or URL) of a data type
@return definition of the data type
@throws IllegalArgumentException when datatype not found
|
[
"Retrieves",
"the",
"definition",
"of",
"a",
"data",
"type",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L217-L221
|
10,838
|
BioPAX/Paxtools
|
normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java
|
MiriamLink.getDataResources
|
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 locations.toArray(ARRAY_OF_STRINGS);
}
|
java
|
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 locations.toArray(ARRAY_OF_STRINGS);
}
|
[
"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",
"locations",
".",
"toArray",
"(",
"ARRAY_OF_STRINGS",
")",
";",
"}"
] |
Retrieves home page URLs of a datatype.
@param datatypeKey - name (can be a synonym), ID, or URI (URL or URN) of a data type
@return array of strings containing all the address of the main page of the resources of the data type
@throws IllegalArgumentException when datatype not found
|
[
"Retrieves",
"home",
"page",
"URLs",
"of",
"a",
"datatype",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L258-L267
|
10,839
|
BioPAX/Paxtools
|
normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java
|
MiriamLink.isDeprecated
|
public static boolean isDeprecated(String uri)
{
Datatype datatype = datatypesHash.get(uri);
String urn = getOfficialDataTypeURI(datatype);
return !uri.equalsIgnoreCase(urn);
}
|
java
|
public static boolean isDeprecated(String uri)
{
Datatype datatype = datatypesHash.get(uri);
String urn = getOfficialDataTypeURI(datatype);
return !uri.equalsIgnoreCase(urn);
}
|
[
"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.
@param uri (URN or URL) of a data type
@return answer ("true" or "false") to the question: is this URI deprecated?
|
[
"To",
"know",
"if",
"a",
"URI",
"of",
"a",
"data",
"type",
"is",
"deprecated",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L276-L281
|
10,840
|
BioPAX/Paxtools
|
normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java
|
MiriamLink.getName
|
public static String getName(String datatypeKey)
{
Datatype datatype = getDatatype(datatypeKey);
return datatype.getName();
}
|
java
|
public static String getName(String datatypeKey)
{
Datatype datatype = getDatatype(datatypeKey);
return datatype.getName();
}
|
[
"public",
"static",
"String",
"getName",
"(",
"String",
"datatypeKey",
")",
"{",
"Datatype",
"datatype",
"=",
"getDatatype",
"(",
"datatypeKey",
")",
";",
"return",
"datatype",
".",
"getName",
"(",
")",
";",
"}"
] |
Retrieves the preferred name of a data type.
@param datatypeKey URI (URL or URN), ID, or nickname of a data type
@return the common name of the data type
@throws IllegalArgumentException when not found
|
[
"Retrieves",
"the",
"preferred",
"name",
"of",
"a",
"data",
"type",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L307-L311
|
10,841
|
BioPAX/Paxtools
|
normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java
|
MiriamLink.getDataTypesName
|
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);
}
|
java
|
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);
}
|
[
"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.
@return list of names of all the data types
|
[
"Retrieves",
"the",
"list",
"of",
"preferred",
"names",
"of",
"all",
"the",
"data",
"types",
"available",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L339-L346
|
10,842
|
BioPAX/Paxtools
|
normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java
|
MiriamLink.convertUrn
|
public static String convertUrn(String urn) {
String[] tokens = urn.split(":");
return "http://identifiers.org/" + tokens[tokens.length-2]
+ "/" + URLDecoder.decode(tokens[tokens.length-1]);
}
|
java
|
public static String convertUrn(String urn) {
String[] tokens = urn.split(":");
return "http://identifiers.org/" + tokens[tokens.length-2]
+ "/" + URLDecoder.decode(tokens[tokens.length-1]);
}
|
[
"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.
@see #getURI(String, String) - use this to get the URN
@see #getIdentifiersOrgURI(String, String) - prefered URI
@param urn - an existing Miriam URN, e.g., "urn:miriam:obo.go:GO%3A0045202"
@return the Identifiers.org URL corresponding to the data URN, e.g., "http://identifiers.org/obo.go/GO:0045202"
@deprecated this method applies {@link URLDecoder#decode(String)} to the last part of the URN, which may not always work as expected (test yours!)
|
[
"Converts",
"a",
"MIRIAM",
"URN",
"into",
"its",
"equivalent",
"Identifiers",
".",
"org",
"URL",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/normalizer/src/main/java/org/biopax/paxtools/normalizer/MiriamLink.java#L553-L557
|
10,843
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/XOR.java
|
XOR.satisfies
|
@Override
public boolean satisfies(Match match, int... ind)
{
int x = -1;
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) x *= -1;
}
return x == 1;
}
|
java
|
@Override
public boolean satisfies(Match match, int... ind)
{
int x = -1;
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) x *= -1;
}
return x == 1;
}
|
[
"@",
"Override",
"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.
@param match match to validate
@param ind mapped indices
@return true if all satisfy
|
[
"Checks",
"if",
"constraints",
"satisfy",
"in",
"xor",
"pattern",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/XOR.java#L34-L43
|
10,844
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/XOR.java
|
XOR.generate
|
@Override
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].generate(match, ind);
Set<BioPAXElement> copy = new HashSet<BioPAXElement>(subset);
copy.removeAll(gen);
gen.removeAll(subset);
gen.addAll(copy);
}
return gen;
}
|
java
|
@Override
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].generate(match, ind);
Set<BioPAXElement> copy = new HashSet<BioPAXElement>(subset);
copy.removeAll(gen);
gen.removeAll(subset);
gen.addAll(copy);
}
return gen;
}
|
[
"@",
"Override",
"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",
"]",
".",
"generate",
"(",
"match",
",",
"ind",
")",
";",
"Set",
"<",
"BioPAXElement",
">",
"copy",
"=",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
"subset",
")",
";",
"copy",
".",
"removeAll",
"(",
"gen",
")",
";",
"gen",
".",
"removeAll",
"(",
"subset",
")",
";",
"gen",
".",
"addAll",
"(",
"copy",
")",
";",
"}",
"return",
"gen",
";",
"}"
] |
Gets xor of the generated elements by the member constraints.
@param match match to process
@param ind mapped indices
@return satisfying elements
|
[
"Gets",
"xor",
"of",
"the",
"generated",
"elements",
"by",
"the",
"member",
"constraints",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/XOR.java#L51-L69
|
10,845
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/Type.java
|
Type.satisfies
|
@Override
public boolean satisfies(Match match, int... ind)
{
assert ind.length == 1;
return clazz.isAssignableFrom(match.get(ind[0]).getModelInterface());
}
|
java
|
@Override
public boolean satisfies(Match match, int... ind)
{
assert ind.length == 1;
return clazz.isAssignableFrom(match.get(ind[0]).getModelInterface());
}
|
[
"@",
"Override",
"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.
@param match current pattern match
@param ind mapped indices
@return true if the element is assignable to a variable of the desired type
|
[
"Checks",
"if",
"the",
"element",
"is",
"assignable",
"to",
"a",
"variable",
"of",
"the",
"desired",
"type",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/Type.java#L34-L40
|
10,846
|
BioPAX/Paxtools
|
psimi-converter/src/main/java/org/biopax/paxtools/converter/psi/EntryMapper.java
|
EntryMapper.run
|
public void run(Entry entry) {
// get availabilities
final Set<String> avail = new HashSet<String>();
if(entry.hasAvailabilities()) {
for (Availability a : entry.getAvailabilities())
if (a.hasValue())
avail.add(a.getValue());
}
// get data source
final Provenance pro = createProvenance(entry.getSource());
//build a skip-set of "interactions" linked by participant.interactionRef element;
//we'll then create Complex type participants from these in-participant interactions.
Set<Interaction> participantInteractions = new HashSet<Interaction>();
for(Interaction interaction : entry.getInteractions()) {
for(Participant participant : interaction.getParticipants()) {
//checking for hasInteraction()==true only is sufficient;
//i.e., we ignore hasInteractionRef(), getInteractionRefs(),
//because these in fact get cleared by the PSI-MI parser:
if(participant.hasInteraction()) {
participantInteractions.add(participant.getInteraction());
}
}
}
// iterate through the "root" psimi interactions only and create biopax interactions or complexes
for (Interaction interaction : entry.getInteractions()) {
if(!participantInteractions.contains(interaction)) {
// TODO future (hard): make a Complex or Interaction based on the interaction type ('direct interaction' or 'physical association' (IntAct) -> complex)
processInteraction(interaction, avail, pro, false);
}
}
}
|
java
|
public void run(Entry entry) {
// get availabilities
final Set<String> avail = new HashSet<String>();
if(entry.hasAvailabilities()) {
for (Availability a : entry.getAvailabilities())
if (a.hasValue())
avail.add(a.getValue());
}
// get data source
final Provenance pro = createProvenance(entry.getSource());
//build a skip-set of "interactions" linked by participant.interactionRef element;
//we'll then create Complex type participants from these in-participant interactions.
Set<Interaction> participantInteractions = new HashSet<Interaction>();
for(Interaction interaction : entry.getInteractions()) {
for(Participant participant : interaction.getParticipants()) {
//checking for hasInteraction()==true only is sufficient;
//i.e., we ignore hasInteractionRef(), getInteractionRefs(),
//because these in fact get cleared by the PSI-MI parser:
if(participant.hasInteraction()) {
participantInteractions.add(participant.getInteraction());
}
}
}
// iterate through the "root" psimi interactions only and create biopax interactions or complexes
for (Interaction interaction : entry.getInteractions()) {
if(!participantInteractions.contains(interaction)) {
// TODO future (hard): make a Complex or Interaction based on the interaction type ('direct interaction' or 'physical association' (IntAct) -> complex)
processInteraction(interaction, avail, pro, false);
}
}
}
|
[
"public",
"void",
"run",
"(",
"Entry",
"entry",
")",
"{",
"// get availabilities",
"final",
"Set",
"<",
"String",
">",
"avail",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"entry",
".",
"hasAvailabilities",
"(",
")",
")",
"{",
"for",
"(",
"Availability",
"a",
":",
"entry",
".",
"getAvailabilities",
"(",
")",
")",
"if",
"(",
"a",
".",
"hasValue",
"(",
")",
")",
"avail",
".",
"add",
"(",
"a",
".",
"getValue",
"(",
")",
")",
";",
"}",
"// get data source",
"final",
"Provenance",
"pro",
"=",
"createProvenance",
"(",
"entry",
".",
"getSource",
"(",
")",
")",
";",
"//build a skip-set of \"interactions\" linked by participant.interactionRef element;",
"//we'll then create Complex type participants from these in-participant interactions.",
"Set",
"<",
"Interaction",
">",
"participantInteractions",
"=",
"new",
"HashSet",
"<",
"Interaction",
">",
"(",
")",
";",
"for",
"(",
"Interaction",
"interaction",
":",
"entry",
".",
"getInteractions",
"(",
")",
")",
"{",
"for",
"(",
"Participant",
"participant",
":",
"interaction",
".",
"getParticipants",
"(",
")",
")",
"{",
"//checking for hasInteraction()==true only is sufficient; ",
"//i.e., we ignore hasInteractionRef(), getInteractionRefs(), ",
"//because these in fact get cleared by the PSI-MI parser:",
"if",
"(",
"participant",
".",
"hasInteraction",
"(",
")",
")",
"{",
"participantInteractions",
".",
"add",
"(",
"participant",
".",
"getInteraction",
"(",
")",
")",
";",
"}",
"}",
"}",
"// iterate through the \"root\" psimi interactions only and create biopax interactions or complexes",
"for",
"(",
"Interaction",
"interaction",
":",
"entry",
".",
"getInteractions",
"(",
")",
")",
"{",
"if",
"(",
"!",
"participantInteractions",
".",
"contains",
"(",
"interaction",
")",
")",
"{",
"// TODO future (hard): make a Complex or Interaction based on the interaction type ('direct interaction' or 'physical association' (IntAct) -> complex)",
"processInteraction",
"(",
"interaction",
",",
"avail",
",",
"pro",
",",
"false",
")",
";",
"}",
"}",
"}"
] |
Convert a PSIMI entry to BioPAX
interactions, participants, etc. objects
and add to the target BioPAX model.
@param entry
|
[
"Convert",
"a",
"PSIMI",
"entry",
"to",
"BioPAX",
"interactions",
"participants",
"etc",
".",
"objects",
"and",
"add",
"to",
"the",
"target",
"BioPAX",
"model",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/psimi-converter/src/main/java/org/biopax/paxtools/converter/psi/EntryMapper.java#L128-L162
|
10,847
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java
|
InterToPartER.generate
|
@Override
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 (direction == null) return generate(inter, taboo);
else return generate((Conversion) inter, direction, taboo);
}
|
java
|
@Override
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 (direction == null) return generate(inter, taboo);
else return generate((Conversion) inter, direction, taboo);
}
|
[
"@",
"Override",
"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",
"(",
"direction",
"==",
"null",
")",
"return",
"generate",
"(",
"inter",
",",
"taboo",
")",
";",
"else",
"return",
"generate",
"(",
"(",
"Conversion",
")",
"inter",
",",
"direction",
",",
"taboo",
")",
";",
"}"
] |
Iterated over non-taboo participants and collectes related ER.
@param match current pattern match
@param ind mapped indices
@return related participants
|
[
"Iterated",
"over",
"non",
"-",
"taboo",
"participants",
"and",
"collectes",
"related",
"ER",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java#L106-L120
|
10,848
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java
|
InterToPartER.generate
|
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.getLinkedElements((PhysicalEntity) part));
}
}
return pe2ER.getValueFromBeans(simples);
}
|
java
|
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.getLinkedElements((PhysicalEntity) part));
}
}
return pe2ER.getValueFromBeans(simples);
}
|
[
"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",
".",
"getLinkedElements",
"(",
"(",
"PhysicalEntity",
")",
"part",
")",
")",
";",
"}",
"}",
"return",
"pe2ER",
".",
"getValueFromBeans",
"(",
"simples",
")",
";",
"}"
] |
Gets the related entity references of the given interaction.
@param inter interaction
@param taboo entities to ignore/skip
@return entity references
|
[
"Gets",
"the",
"related",
"entity",
"references",
"of",
"the",
"given",
"interaction",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java#L128-L141
|
10,849
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java
|
InterToPartER.generate
|
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> simples = new HashSet<BioPAXElement>();
for (Entity part : direction == Direction.ANY ? conv.getParticipant() :
direction == Direction.LEFT ? conv.getLeft() : conv.getRight())
{
if (part instanceof PhysicalEntity && !taboo.contains(part))
{
simples.addAll(linker.getLinkedElements((PhysicalEntity) part));
}
}
return pe2ER.getValueFromBeans(simples);
}
else
{
Set<BioPAXElement> leftSimples = new HashSet<BioPAXElement>();
Set<BioPAXElement> rightSimples = new HashSet<BioPAXElement>();
for (PhysicalEntity pe : conv.getLeft())
{
if (!taboo.contains(pe)) leftSimples.addAll(linker.getLinkedElements(pe));
}
for (PhysicalEntity pe : conv.getRight())
{
if (!taboo.contains(pe)) rightSimples.addAll(linker.getLinkedElements(pe));
}
Set leftERs = pe2ER.getValueFromBeans(leftSimples);
Set rightERs = pe2ER.getValueFromBeans(rightSimples);
if (direction == Direction.ONESIDERS)
{
// get all but intersection
Set temp = new HashSet(leftERs);
leftERs.removeAll(rightERs);
rightERs.removeAll(temp);
leftERs.addAll(rightERs);
}
else // BOTHSIDERS
{
// get intersection
leftERs.retainAll(rightERs);
}
return leftERs;
}
}
|
java
|
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> simples = new HashSet<BioPAXElement>();
for (Entity part : direction == Direction.ANY ? conv.getParticipant() :
direction == Direction.LEFT ? conv.getLeft() : conv.getRight())
{
if (part instanceof PhysicalEntity && !taboo.contains(part))
{
simples.addAll(linker.getLinkedElements((PhysicalEntity) part));
}
}
return pe2ER.getValueFromBeans(simples);
}
else
{
Set<BioPAXElement> leftSimples = new HashSet<BioPAXElement>();
Set<BioPAXElement> rightSimples = new HashSet<BioPAXElement>();
for (PhysicalEntity pe : conv.getLeft())
{
if (!taboo.contains(pe)) leftSimples.addAll(linker.getLinkedElements(pe));
}
for (PhysicalEntity pe : conv.getRight())
{
if (!taboo.contains(pe)) rightSimples.addAll(linker.getLinkedElements(pe));
}
Set leftERs = pe2ER.getValueFromBeans(leftSimples);
Set rightERs = pe2ER.getValueFromBeans(rightSimples);
if (direction == Direction.ONESIDERS)
{
// get all but intersection
Set temp = new HashSet(leftERs);
leftERs.removeAll(rightERs);
rightERs.removeAll(temp);
leftERs.addAll(rightERs);
}
else // BOTHSIDERS
{
// get intersection
leftERs.retainAll(rightERs);
}
return leftERs;
}
}
|
[
"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",
">",
"simples",
"=",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
")",
";",
"for",
"(",
"Entity",
"part",
":",
"direction",
"==",
"Direction",
".",
"ANY",
"?",
"conv",
".",
"getParticipant",
"(",
")",
":",
"direction",
"==",
"Direction",
".",
"LEFT",
"?",
"conv",
".",
"getLeft",
"(",
")",
":",
"conv",
".",
"getRight",
"(",
")",
")",
"{",
"if",
"(",
"part",
"instanceof",
"PhysicalEntity",
"&&",
"!",
"taboo",
".",
"contains",
"(",
"part",
")",
")",
"{",
"simples",
".",
"addAll",
"(",
"linker",
".",
"getLinkedElements",
"(",
"(",
"PhysicalEntity",
")",
"part",
")",
")",
";",
"}",
"}",
"return",
"pe2ER",
".",
"getValueFromBeans",
"(",
"simples",
")",
";",
"}",
"else",
"{",
"Set",
"<",
"BioPAXElement",
">",
"leftSimples",
"=",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
")",
";",
"Set",
"<",
"BioPAXElement",
">",
"rightSimples",
"=",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
")",
";",
"for",
"(",
"PhysicalEntity",
"pe",
":",
"conv",
".",
"getLeft",
"(",
")",
")",
"{",
"if",
"(",
"!",
"taboo",
".",
"contains",
"(",
"pe",
")",
")",
"leftSimples",
".",
"addAll",
"(",
"linker",
".",
"getLinkedElements",
"(",
"pe",
")",
")",
";",
"}",
"for",
"(",
"PhysicalEntity",
"pe",
":",
"conv",
".",
"getRight",
"(",
")",
")",
"{",
"if",
"(",
"!",
"taboo",
".",
"contains",
"(",
"pe",
")",
")",
"rightSimples",
".",
"addAll",
"(",
"linker",
".",
"getLinkedElements",
"(",
"pe",
")",
")",
";",
"}",
"Set",
"leftERs",
"=",
"pe2ER",
".",
"getValueFromBeans",
"(",
"leftSimples",
")",
";",
"Set",
"rightERs",
"=",
"pe2ER",
".",
"getValueFromBeans",
"(",
"rightSimples",
")",
";",
"if",
"(",
"direction",
"==",
"Direction",
".",
"ONESIDERS",
")",
"{",
"// get all but intersection",
"Set",
"temp",
"=",
"new",
"HashSet",
"(",
"leftERs",
")",
";",
"leftERs",
".",
"removeAll",
"(",
"rightERs",
")",
";",
"rightERs",
".",
"removeAll",
"(",
"temp",
")",
";",
"leftERs",
".",
"addAll",
"(",
"rightERs",
")",
";",
"}",
"else",
"// BOTHSIDERS",
"{",
"// get intersection",
"leftERs",
".",
"retainAll",
"(",
"rightERs",
")",
";",
"}",
"return",
"leftERs",
";",
"}",
"}"
] |
Gets the related entity references of the given interaction,
@param conv conversion interaction
@param direction which side(s) participants of the conversion to consider
@param taboo skip list of entities
@return entity references
|
[
"Gets",
"the",
"related",
"entity",
"references",
"of",
"the",
"given",
"interaction"
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/InterToPartER.java#L150-L203
|
10,850
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/FilteredPropertyAccessor.java
|
FilteredPropertyAccessor.create
|
public static <D extends BioPAXElement, R> PropertyAccessor<D,R> create(PropertyAccessor<D,R> pa,
Class filter)
{
return new FilteredPropertyAccessor<D, R>(pa, filter);
}
|
java
|
public static <D extends BioPAXElement, R> PropertyAccessor<D,R> create(PropertyAccessor<D,R> pa,
Class filter)
{
return new FilteredPropertyAccessor<D, R>(pa, filter);
}
|
[
"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.
@param pa to be decorated
@param filter Class to be filtered, must extend from R.
@param <D> Domain of the original accessor
@param <R> Range of the original accessor
@return A filtered accessor.
|
[
"FactoryMethod",
"that",
"creates",
"a",
"filtered",
"property",
"accessor",
"by",
"decorating",
"a",
"given",
"accessor",
"with",
"a",
"class",
"filter",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/FilteredPropertyAccessor.java#L36-L40
|
10,851
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractTraverser.java
|
AbstractTraverser.visit
|
public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor<?,?> editor) {
// actions
visit(range, domain, model, editor);
}
|
java
|
public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor<?,?> editor) {
// actions
visit(range, domain, model, editor);
}
|
[
"public",
"void",
"visit",
"(",
"BioPAXElement",
"domain",
",",
"Object",
"range",
",",
"Model",
"model",
",",
"PropertyEditor",
"<",
"?",
",",
"?",
">",
"editor",
")",
"{",
"// actions",
"visit",
"(",
"range",
",",
"domain",
",",
"model",
",",
"editor",
")",
";",
"}"
] |
Calls the protected abstract method visit that is to be
implemented in subclasses of this abstract class.
@param domain BioPAX Element
@param range property value (can be BioPAX element, primitive, enum, string)
@param model the BioPAX model of interest
@param editor parent's property PropertyEditor
|
[
"Calls",
"the",
"protected",
"abstract",
"method",
"visit",
"that",
"is",
"to",
"be",
"implemented",
"in",
"subclasses",
"of",
"this",
"abstract",
"class",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractTraverser.java#L61-L64
|
10,852
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java
|
SimpleIOHandler.bindValue
|
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());
bindValue(triple.range, editor, domain, model);
}
|
java
|
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());
bindValue(triple.range, editor, domain, model);
}
|
[
"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",
"(",
")",
")",
";",
"bindValue",
"(",
"triple",
".",
"range",
",",
"editor",
",",
"domain",
",",
"model",
")",
";",
"}"
] |
Binds property.
This method also throws exceptions related to binding.
@param triple A java object that represents an RDF Triple - domain-property-range.
@param model that is being populated.
|
[
"Binds",
"property",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java#L338-L348
|
10,853
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ModificationChangeConstraint.java
|
ModificationChangeConstraint.satisfies
|
@Override
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> terms;
if (type == Type.GAIN) terms = collectTerms(mods[0]);
else if (type == Type.LOSS) terms = collectTerms(mods[1]);
else terms = collectTerms(mods);
return termsContainDesired(terms);
}
|
java
|
@Override
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> terms;
if (type == Type.GAIN) terms = collectTerms(mods[0]);
else if (type == Type.LOSS) terms = collectTerms(mods[1]);
else terms = collectTerms(mods);
return termsContainDesired(terms);
}
|
[
"@",
"Override",
"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",
">",
"terms",
";",
"if",
"(",
"type",
"==",
"Type",
".",
"GAIN",
")",
"terms",
"=",
"collectTerms",
"(",
"mods",
"[",
"0",
"]",
")",
";",
"else",
"if",
"(",
"type",
"==",
"Type",
".",
"LOSS",
")",
"terms",
"=",
"collectTerms",
"(",
"mods",
"[",
"1",
"]",
")",
";",
"else",
"terms",
"=",
"collectTerms",
"(",
"mods",
")",
";",
"return",
"termsContainDesired",
"(",
"terms",
")",
";",
"}"
] |
Checks the any of the changed modifications match to any of the desired modifications.
@param match current pattern match
@param ind mapped indices
@return true if a modification change is among desired modifications
|
[
"Checks",
"the",
"any",
"of",
"the",
"changed",
"modifications",
"match",
"to",
"any",
"of",
"the",
"desired",
"modifications",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ModificationChangeConstraint.java#L59-L75
|
10,854
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java
|
OR.satisfies
|
@Override
public boolean satisfies(Match match, int... ind)
{
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) return true;
}
return false;
}
|
java
|
@Override
public boolean satisfies(Match match, int... ind)
{
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) return true;
}
return false;
}
|
[
"@",
"Override",
"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.
@param match current pattern match
@param ind mapped indices
@return true if any of the wrapped constraints satisfy
|
[
"Checks",
"if",
"any",
"of",
"the",
"wrapped",
"constraints",
"satisfy",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java#L39-L47
|
10,855
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java
|
OR.getVariableSize
|
@Override
public int getVariableSize()
{
int size = 0;
for (MappedConst mc : con)
{
int m = max(mc.getInds());
if (m > size) size = m;
}
return size + 1;
}
|
java
|
@Override
public int getVariableSize()
{
int size = 0;
for (MappedConst mc : con)
{
int m = max(mc.getInds());
if (m > size) size = m;
}
return size + 1;
}
|
[
"@",
"Override",
"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.
@return the size
|
[
"Checks",
"the",
"inner",
"mapping",
"of",
"the",
"wrapped",
"constraints",
"and",
"figures",
"the",
"size",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java#L67-L77
|
10,856
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java
|
OR.max
|
protected int max(int[] v)
{
int x = 0;
for (int i : v)
{
if (i > x) x = i;
}
return x;
}
|
java
|
protected int max(int[] v)
{
int x = 0;
for (int i : v)
{
if (i > x) x = i;
}
return x;
}
|
[
"protected",
"int",
"max",
"(",
"int",
"[",
"]",
"v",
")",
"{",
"int",
"x",
"=",
"0",
";",
"for",
"(",
"int",
"i",
":",
"v",
")",
"{",
"if",
"(",
"i",
">",
"x",
")",
"x",
"=",
"i",
";",
"}",
"return",
"x",
";",
"}"
] |
Gets the max value.
@param v array to check
@return max value
|
[
"Gets",
"the",
"max",
"value",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java#L84-L92
|
10,857
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java
|
OR.generate
|
@Override
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;
}
|
java
|
@Override
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;
}
|
[
"@",
"Override",
"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.
@param match current pattern match
@param ind mapped indices
@return intersection of the generated values of wrapped constraints
|
[
"Gets",
"the",
"intersection",
"of",
"the",
"generated",
"values",
"of",
"wrapped",
"constraints",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/OR.java#L100-L110
|
10,858
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsStateChange
|
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(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new NOT(participantER()), "Conversion", "controller ER");
p.add(new Participant(RelType.INPUT, true), "Control", "Conversion", "input PE");
p.add(new NOT(new ConversionSide(ConversionSide.Type.OTHER_SIDE)), "input PE", "Conversion", "input PE");
p.add(linkToSpecific(), "input PE", "input simple PE");
p.add(new Type(SequenceEntity.class), "input simple PE");
p.add(peToER(), "input simple PE", "changed generic ER");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE), "input PE", "Conversion", "output PE");
p.add(new NOT(new ConversionSide(ConversionSide.Type.OTHER_SIDE)), "output PE", "Conversion", "output PE");
p.add(equal(false), "input PE", "output PE");
p.add(linkToSpecific(), "output PE", "output simple PE");
p.add(peToER(), "output simple PE", "changed generic ER");
p.add(linkedER(false), "changed generic ER", "changed ER");
return p;
}
|
java
|
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(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new NOT(participantER()), "Conversion", "controller ER");
p.add(new Participant(RelType.INPUT, true), "Control", "Conversion", "input PE");
p.add(new NOT(new ConversionSide(ConversionSide.Type.OTHER_SIDE)), "input PE", "Conversion", "input PE");
p.add(linkToSpecific(), "input PE", "input simple PE");
p.add(new Type(SequenceEntity.class), "input simple PE");
p.add(peToER(), "input simple PE", "changed generic ER");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE), "input PE", "Conversion", "output PE");
p.add(new NOT(new ConversionSide(ConversionSide.Type.OTHER_SIDE)), "output PE", "Conversion", "output PE");
p.add(equal(false), "input PE", "output PE");
p.add(linkToSpecific(), "output PE", "output simple PE");
p.add(peToER(), "output simple PE", "changed generic ER");
p.add(linkedER(false), "changed generic ER", "changed ER");
return p;
}
|
[
"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",
"(",
")",
",",
"\"controller simple PE\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"participantER",
"(",
")",
")",
",",
"\"Conversion\"",
",",
"\"controller ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Participant",
"(",
"RelType",
".",
"INPUT",
",",
"true",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
",",
"\"input PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
")",
")",
",",
"\"input PE\"",
",",
"\"Conversion\"",
",",
"\"input PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"input PE\"",
",",
"\"input simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SequenceEntity",
".",
"class",
")",
",",
"\"input simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"input simple PE\"",
",",
"\"changed generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
")",
",",
"\"input PE\"",
",",
"\"Conversion\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
")",
")",
",",
"\"output PE\"",
",",
"\"Conversion\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"input PE\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"output PE\"",
",",
"\"output simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"output simple PE\"",
",",
"\"changed generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"changed generic ER\"",
",",
"\"changed ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for a EntityReference has a member PhysicalEntity that is controlling a state change
reaction of another EntityReference.
@return the pattern
|
[
"Pattern",
"for",
"a",
"EntityReference",
"has",
"a",
"member",
"PhysicalEntity",
"that",
"is",
"controlling",
"a",
"state",
"change",
"reaction",
"of",
"another",
"EntityReference",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L28-L54
|
10,859
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsTransport
|
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;
}
|
java
|
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;
}
|
[
"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.
@return the pattern
|
[
"Pattern",
"for",
"a",
"ProteinReference",
"has",
"a",
"member",
"PhysicalEntity",
"that",
"is",
"controlling",
"a",
"transportation",
"of",
"another",
"ProteinReference",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L61-L70
|
10,860
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsTransportOfChemical
|
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(linkToComplex(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new Participant(RelType.INPUT, blacklist, true), "Control", "Conversion", "input PE");
p.add(linkToSimple(blacklist), "input PE", "input simple PE");
p.add(new Type(SmallMolecule.class), "input simple PE");
p.add(notGeneric(), "input simple PE");
p.add(peToER(), "input simple PE", "changed generic SMR");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE, blacklist, RelType.OUTPUT), "input PE", "Conversion", "output PE");
p.add(equal(false), "input PE", "output PE");
p.add(linkToSimple(blacklist), "output PE", "output simple PE");
p.add(new Type(SmallMolecule.class), "output simple PE");
p.add(notGeneric(), "output simple PE");
p.add(peToER(), "output simple PE", "changed generic SMR");
p.add(linkedER(false), "changed generic SMR", "changed SMR");
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;
}
|
java
|
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(linkToComplex(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new Participant(RelType.INPUT, blacklist, true), "Control", "Conversion", "input PE");
p.add(linkToSimple(blacklist), "input PE", "input simple PE");
p.add(new Type(SmallMolecule.class), "input simple PE");
p.add(notGeneric(), "input simple PE");
p.add(peToER(), "input simple PE", "changed generic SMR");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE, blacklist, RelType.OUTPUT), "input PE", "Conversion", "output PE");
p.add(equal(false), "input PE", "output PE");
p.add(linkToSimple(blacklist), "output PE", "output simple PE");
p.add(new Type(SmallMolecule.class), "output simple PE");
p.add(notGeneric(), "output simple PE");
p.add(peToER(), "output simple PE", "changed generic SMR");
p.add(linkedER(false), "changed generic SMR", "changed SMR");
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;
}
|
[
"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",
"(",
"linkToComplex",
"(",
")",
",",
"\"controller simple PE\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Participant",
"(",
"RelType",
".",
"INPUT",
",",
"blacklist",
",",
"true",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
",",
"\"input PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSimple",
"(",
"blacklist",
")",
",",
"\"input PE\"",
",",
"\"input simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SmallMolecule",
".",
"class",
")",
",",
"\"input simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"notGeneric",
"(",
")",
",",
"\"input simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"input simple PE\"",
",",
"\"changed generic SMR\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
",",
"blacklist",
",",
"RelType",
".",
"OUTPUT",
")",
",",
"\"input PE\"",
",",
"\"Conversion\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"input PE\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSimple",
"(",
"blacklist",
")",
",",
"\"output PE\"",
",",
"\"output simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SmallMolecule",
".",
"class",
")",
",",
"\"output simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"notGeneric",
"(",
")",
",",
"\"output simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"output simple PE\"",
",",
"\"changed generic SMR\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"changed generic SMR\"",
",",
"\"changed SMR\"",
")",
";",
"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 reaction
that changes cellular location of a small molecule.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern
|
[
"Pattern",
"for",
"a",
"ProteinReference",
"has",
"a",
"member",
"PhysicalEntity",
"that",
"is",
"controlling",
"a",
"reaction",
"that",
"changes",
"cellular",
"location",
"of",
"a",
"small",
"molecule",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L79-L105
|
10,861
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsStateChangeBothControlAndPart
|
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(linkToComplex(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
// the controller PE is also an input
p.add(new ParticipatesInConv(RelType.INPUT), "controller PE", "Conversion");
// same controller simple PE is also an output
p.add(linkToComplex(), "controller simple PE", "special output PE");
p.add(equal(false), "special output PE", "controller PE");
p.add(new ParticipatesInConv(RelType.OUTPUT), "special output PE", "Conversion");
stateChange(p, "Control");
// non-generic input and outputs are only associated with one side
p.add(equal(false), "input simple PE", "output simple PE");
p.add(new NOT(simplePEToConv(RelType.OUTPUT)), "input simple PE", "Conversion");
p.add(new NOT(simplePEToConv(RelType.INPUT)), "output simple PE", "Conversion");
p.add(equal(false), "controller ER", "changed ER");
p.add(type(SequenceEntityReference.class), "changed ER");
return p;
}
|
java
|
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(linkToComplex(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
// the controller PE is also an input
p.add(new ParticipatesInConv(RelType.INPUT), "controller PE", "Conversion");
// same controller simple PE is also an output
p.add(linkToComplex(), "controller simple PE", "special output PE");
p.add(equal(false), "special output PE", "controller PE");
p.add(new ParticipatesInConv(RelType.OUTPUT), "special output PE", "Conversion");
stateChange(p, "Control");
// non-generic input and outputs are only associated with one side
p.add(equal(false), "input simple PE", "output simple PE");
p.add(new NOT(simplePEToConv(RelType.OUTPUT)), "input simple PE", "Conversion");
p.add(new NOT(simplePEToConv(RelType.INPUT)), "output simple PE", "Conversion");
p.add(equal(false), "controller ER", "changed ER");
p.add(type(SequenceEntityReference.class), "changed ER");
return p;
}
|
[
"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",
"(",
"linkToComplex",
"(",
")",
",",
"\"controller simple PE\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
")",
";",
"// the controller PE is also an input",
"p",
".",
"add",
"(",
"new",
"ParticipatesInConv",
"(",
"RelType",
".",
"INPUT",
")",
",",
"\"controller PE\"",
",",
"\"Conversion\"",
")",
";",
"// same controller simple PE is also an output",
"p",
".",
"add",
"(",
"linkToComplex",
"(",
")",
",",
"\"controller simple PE\"",
",",
"\"special output PE\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"special output PE\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"ParticipatesInConv",
"(",
"RelType",
".",
"OUTPUT",
")",
",",
"\"special output PE\"",
",",
"\"Conversion\"",
")",
";",
"stateChange",
"(",
"p",
",",
"\"Control\"",
")",
";",
"// non-generic input and outputs are only associated with one side",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"input simple PE\"",
",",
"\"output simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"simplePEToConv",
"(",
"RelType",
".",
"OUTPUT",
")",
")",
",",
"\"input simple PE\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"simplePEToConv",
"(",
"RelType",
".",
"INPUT",
")",
")",
",",
"\"output simple PE\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"controller ER\"",
",",
"\"changed ER\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SequenceEntityReference",
".",
"class",
")",
",",
"\"changed ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
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 reaction.
@return the pattern
|
[
"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",
"reaction",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L114-L142
|
10,862
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsStateChangeButIsParticipant
|
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(), "controller simple PE", "controller PE");
p.add(participatesInConv(), "controller PE", "Conversion");
p.add(left(), "Conversion", "controller PE");
p.add(right(), "Conversion", "controller PE");
// The controller ER is not associated with the Conversion in another way.
p.add(new NOT(new InterToPartER(1)), "Conversion", "controller PE", "controller ER");
stateChange(p, null);
p.add(equal(false), "controller ER", "changed ER");
p.add(equal(false), "controller PE", "input PE");
p.add(equal(false), "controller PE", "output PE");
return p;
}
|
java
|
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(), "controller simple PE", "controller PE");
p.add(participatesInConv(), "controller PE", "Conversion");
p.add(left(), "Conversion", "controller PE");
p.add(right(), "Conversion", "controller PE");
// The controller ER is not associated with the Conversion in another way.
p.add(new NOT(new InterToPartER(1)), "Conversion", "controller PE", "controller ER");
stateChange(p, null);
p.add(equal(false), "controller ER", "changed ER");
p.add(equal(false), "controller PE", "input PE");
p.add(equal(false), "controller PE", "output PE");
return p;
}
|
[
"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",
"(",
")",
",",
"\"controller simple PE\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"participatesInConv",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"left",
"(",
")",
",",
"\"Conversion\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"right",
"(",
")",
",",
"\"Conversion\"",
",",
"\"controller PE\"",
")",
";",
"// The controller ER is not associated with the Conversion in another way.",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"new",
"InterToPartER",
"(",
"1",
")",
")",
",",
"\"Conversion\"",
",",
"\"controller PE\"",
",",
"\"controller ER\"",
")",
";",
"stateChange",
"(",
"p",
",",
"null",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"controller ER\"",
",",
"\"changed ER\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"controller PE\"",
",",
"\"input PE\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"controller PE\"",
",",
"\"output PE\"",
")",
";",
"return",
"p",
";",
"}"
] |
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 sides.
@return the pattern
|
[
"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",
"sides",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L151-L170
|
10,863
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.stateChange
|
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, "Conversion", "input PE");
p.add(linkToSpecific(), "input PE", "input simple PE");
p.add(peToER(), "input simple PE", "changed generic ER");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE), "input PE", "Conversion", "output PE");
p.add(equal(false), "input PE", "output PE");
p.add(linkToSpecific(), "output PE", "output simple PE");
p.add(peToER(), "output simple PE", "changed generic ER");
p.add(linkedER(false), "changed generic ER", "changed ER");
return p;
}
|
java
|
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, "Conversion", "input PE");
p.add(linkToSpecific(), "input PE", "input simple PE");
p.add(peToER(), "input simple PE", "changed generic ER");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE), "input PE", "Conversion", "output PE");
p.add(equal(false), "input PE", "output PE");
p.add(linkToSpecific(), "output PE", "output simple PE");
p.add(peToER(), "output simple PE", "changed generic ER");
p.add(linkedER(false), "changed generic ER", "changed ER");
return p;
}
|
[
"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",
",",
"\"Conversion\"",
",",
"\"input PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"input PE\"",
",",
"\"input simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"input simple PE\"",
",",
"\"changed generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
")",
",",
"\"input PE\"",
",",
"\"Conversion\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"input PE\"",
",",
"\"output PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"output PE\"",
",",
"\"output simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"output simple PE\"",
",",
"\"changed generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"changed generic ER\"",
",",
"\"changed ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for a Conversion has an input PhysicalEntity and another output PhysicalEntity that
belongs to the same EntityReference.
@param p pattern to update
@param ctrlLabel label
@return the pattern
|
[
"Pattern",
"for",
"a",
"Conversion",
"has",
"an",
"input",
"PhysicalEntity",
"and",
"another",
"output",
"PhysicalEntity",
"that",
"belongs",
"to",
"the",
"same",
"EntityReference",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L180-L195
|
10,864
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsStateChangeThroughControllerSmallMolecule
|
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 ER", "upper controller simple PE");
p.add(linkToComplex(), "upper controller simple PE", "upper controller PE");
p.add(peToControl(), "upper controller PE", "upper Control");
p.add(controlToConv(), "upper Control", "upper Conversion");
p.add(new NOT(participantER()), "upper Conversion", "upper controller ER");
p.add(new Participant(RelType.OUTPUT, blacklist), "upper Conversion", "controller PE");
p.add(type(SmallMolecule.class), "controller PE");
if (blacklist != null) p.add(new NonUbique(blacklist), "controller PE");
// the linker small mol is at also an input
p.add(new NOT(new ConstraintChain(
new ConversionSide(ConversionSide.Type.OTHER_SIDE), linkToSpecific())),
"controller PE", "upper Conversion", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(equal(false), "upper Conversion", "Conversion");
// p.add(nextInteraction(), "upper Conversion", "Conversion");
stateChange(p, "Control");
p.add(type(SequenceEntityReference.class), "changed ER");
p.add(equal(false), "upper controller ER", "changed ER");
p.add(new NOT(participantER()), "Conversion", "upper controller ER");
return p;
}
|
java
|
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 ER", "upper controller simple PE");
p.add(linkToComplex(), "upper controller simple PE", "upper controller PE");
p.add(peToControl(), "upper controller PE", "upper Control");
p.add(controlToConv(), "upper Control", "upper Conversion");
p.add(new NOT(participantER()), "upper Conversion", "upper controller ER");
p.add(new Participant(RelType.OUTPUT, blacklist), "upper Conversion", "controller PE");
p.add(type(SmallMolecule.class), "controller PE");
if (blacklist != null) p.add(new NonUbique(blacklist), "controller PE");
// the linker small mol is at also an input
p.add(new NOT(new ConstraintChain(
new ConversionSide(ConversionSide.Type.OTHER_SIDE), linkToSpecific())),
"controller PE", "upper Conversion", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(equal(false), "upper Conversion", "Conversion");
// p.add(nextInteraction(), "upper Conversion", "Conversion");
stateChange(p, "Control");
p.add(type(SequenceEntityReference.class), "changed ER");
p.add(equal(false), "upper controller ER", "changed ER");
p.add(new NOT(participantER()), "Conversion", "upper controller ER");
return p;
}
|
[
"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 ER\"",
",",
"\"upper controller simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToComplex",
"(",
")",
",",
"\"upper controller simple PE\"",
",",
"\"upper controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"upper controller PE\"",
",",
"\"upper Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"upper Control\"",
",",
"\"upper Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"participantER",
"(",
")",
")",
",",
"\"upper Conversion\"",
",",
"\"upper controller ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Participant",
"(",
"RelType",
".",
"OUTPUT",
",",
"blacklist",
")",
",",
"\"upper Conversion\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SmallMolecule",
".",
"class",
")",
",",
"\"controller PE\"",
")",
";",
"if",
"(",
"blacklist",
"!=",
"null",
")",
"p",
".",
"add",
"(",
"new",
"NonUbique",
"(",
"blacklist",
")",
",",
"\"controller PE\"",
")",
";",
"// the linker small mol is at also an input",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"new",
"ConstraintChain",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
")",
",",
"linkToSpecific",
"(",
")",
")",
")",
",",
"\"controller PE\"",
",",
"\"upper Conversion\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"upper Conversion\"",
",",
"\"Conversion\"",
")",
";",
"//\t\tp.add(nextInteraction(), \"upper Conversion\", \"Conversion\");",
"stateChange",
"(",
"p",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SequenceEntityReference",
".",
"class",
")",
",",
"\"changed ER\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"upper controller ER\"",
",",
"\"changed ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"participantER",
"(",
")",
")",
",",
"\"Conversion\"",
",",
"\"upper controller ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for an entity is producing a small molecule, and the small molecule controls state
change of another molecule.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern
|
[
"Pattern",
"for",
"an",
"entity",
"is",
"producing",
"a",
"small",
"molecule",
"and",
"the",
"small",
"molecule",
"controls",
"state",
"change",
"of",
"another",
"molecule",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L204-L235
|
10,865
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsStateChangeThroughDegradation
|
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(), "upstream SPE", "upstream PE");
p.add(peToControl(), "upstream PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new NOT(participantER()), "Conversion", "upstream ER");
p.add(new Empty(new Participant(RelType.OUTPUT)), "Conversion");
p.add(new Participant(RelType.INPUT), "Conversion", "input PE");
p.add(linkToSpecific(), "input PE", "input SPE");
p.add(peToER(), "input SPE", "downstream generic ER");
p.add(type(SequenceEntityReference.class), "downstream generic ER");
p.add(linkedER(false), "downstream generic ER", "downstream ER");
return p;
}
|
java
|
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(), "upstream SPE", "upstream PE");
p.add(peToControl(), "upstream PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new NOT(participantER()), "Conversion", "upstream ER");
p.add(new Empty(new Participant(RelType.OUTPUT)), "Conversion");
p.add(new Participant(RelType.INPUT), "Conversion", "input PE");
p.add(linkToSpecific(), "input PE", "input SPE");
p.add(peToER(), "input SPE", "downstream generic ER");
p.add(type(SequenceEntityReference.class), "downstream generic ER");
p.add(linkedER(false), "downstream generic ER", "downstream ER");
return p;
}
|
[
"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",
"(",
")",
",",
"\"upstream SPE\"",
",",
"\"upstream PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"upstream PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"participantER",
"(",
")",
")",
",",
"\"Conversion\"",
",",
"\"upstream ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Empty",
"(",
"new",
"Participant",
"(",
"RelType",
".",
"OUTPUT",
")",
")",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Participant",
"(",
"RelType",
".",
"INPUT",
")",
",",
"\"Conversion\"",
",",
"\"input PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"input PE\"",
",",
"\"input SPE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"input SPE\"",
",",
"\"downstream generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SequenceEntityReference",
".",
"class",
")",
",",
"\"downstream generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"downstream generic ER\"",
",",
"\"downstream ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Finds cases where proteins affect their degradation.
@return the pattern
|
[
"Finds",
"cases",
"where",
"proteins",
"affect",
"their",
"degradation",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L282-L298
|
10,866
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsMetabolicCatalysis
|
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 PE");
p.add(linkToComplex(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new NOT(participantER()), "Conversion", "controller ER");
p.add(new Participant(consumption ? RelType.INPUT : RelType.OUTPUT, blacklist, true),
"Control", "Conversion", "part PE");
p.add(linkToSimple(blacklist), "part PE", "part SM");
p.add(notGeneric(), "part SM");
p.add(type(SmallMolecule.class), "part SM");
p.add(peToER(), "part SM", "part SMR");
// The small molecule is associated only with left or right, but not both.
p.add(new XOR(
new MappedConst(new InterToPartER(InterToPartER.Direction.LEFT), 0, 1),
new MappedConst(new InterToPartER(InterToPartER.Direction.RIGHT), 0, 1)),
"Conversion", "part SMR");
return p;
}
|
java
|
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 PE");
p.add(linkToComplex(), "controller simple PE", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToConv(), "Control", "Conversion");
p.add(new NOT(participantER()), "Conversion", "controller ER");
p.add(new Participant(consumption ? RelType.INPUT : RelType.OUTPUT, blacklist, true),
"Control", "Conversion", "part PE");
p.add(linkToSimple(blacklist), "part PE", "part SM");
p.add(notGeneric(), "part SM");
p.add(type(SmallMolecule.class), "part SM");
p.add(peToER(), "part SM", "part SMR");
// The small molecule is associated only with left or right, but not both.
p.add(new XOR(
new MappedConst(new InterToPartER(InterToPartER.Direction.LEFT), 0, 1),
new MappedConst(new InterToPartER(InterToPartER.Direction.RIGHT), 0, 1)),
"Conversion", "part SMR");
return p;
}
|
[
"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 PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToComplex",
"(",
")",
",",
"\"controller simple PE\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToConv",
"(",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"participantER",
"(",
")",
")",
",",
"\"Conversion\"",
",",
"\"controller ER\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Participant",
"(",
"consumption",
"?",
"RelType",
".",
"INPUT",
":",
"RelType",
".",
"OUTPUT",
",",
"blacklist",
",",
"true",
")",
",",
"\"Control\"",
",",
"\"Conversion\"",
",",
"\"part PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSimple",
"(",
"blacklist",
")",
",",
"\"part PE\"",
",",
"\"part SM\"",
")",
";",
"p",
".",
"add",
"(",
"notGeneric",
"(",
")",
",",
"\"part SM\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SmallMolecule",
".",
"class",
")",
",",
"\"part SM\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"part SM\"",
",",
"\"part SMR\"",
")",
";",
"// The small molecule is associated only with left or right, but not both.",
"p",
".",
"add",
"(",
"new",
"XOR",
"(",
"new",
"MappedConst",
"(",
"new",
"InterToPartER",
"(",
"InterToPartER",
".",
"Direction",
".",
"LEFT",
")",
",",
"0",
",",
"1",
")",
",",
"new",
"MappedConst",
"(",
"new",
"InterToPartER",
"(",
"InterToPartER",
".",
"Direction",
".",
"RIGHT",
")",
",",
"0",
",",
"1",
")",
")",
",",
"\"Conversion\"",
",",
"\"part SMR\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for a Protein controlling a reaction whose participant is a small molecule.
@param blacklist a skip-list of ubiquitous molecules
@param consumption true/false (TODO explain)
@return the pattern
|
[
"Pattern",
"for",
"a",
"Protein",
"controlling",
"a",
"reaction",
"whose",
"participant",
"is",
"a",
"small",
"molecule",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L317-L342
|
10,867
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsExpressionWithTemplateReac
|
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(peToControl(), "TF PE", "Control");
p.add(controlToTempReac(), "Control", "TempReac");
p.add(product(), "TempReac", "product PE");
p.add(linkToSpecific(), "product PE", "product SPE");
p.add(new Type(SequenceEntity.class), "product SPE");
p.add(peToER(), "product SPE", "product generic ER");
p.add(linkedER(false), "product generic ER", "product ER");
p.add(equal(false), "TF ER", "product ER");
return p;
}
|
java
|
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(peToControl(), "TF PE", "Control");
p.add(controlToTempReac(), "Control", "TempReac");
p.add(product(), "TempReac", "product PE");
p.add(linkToSpecific(), "product PE", "product SPE");
p.add(new Type(SequenceEntity.class), "product SPE");
p.add(peToER(), "product SPE", "product generic ER");
p.add(linkedER(false), "product generic ER", "product ER");
p.add(equal(false), "TF ER", "product ER");
return p;
}
|
[
"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",
"(",
"peToControl",
"(",
")",
",",
"\"TF PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToTempReac",
"(",
")",
",",
"\"Control\"",
",",
"\"TempReac\"",
")",
";",
"p",
".",
"add",
"(",
"product",
"(",
")",
",",
"\"TempReac\"",
",",
"\"product PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"product PE\"",
",",
"\"product SPE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SequenceEntity",
".",
"class",
")",
",",
"\"product SPE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"product SPE\"",
",",
"\"product generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"product generic ER\"",
",",
"\"product ER\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"TF ER\"",
",",
"\"product ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Finds transcription factors that trans-activate or trans-inhibit an entity.
@return the pattern
|
[
"Finds",
"transcription",
"factors",
"that",
"trans",
"-",
"activate",
"or",
"trans",
"-",
"inhibit",
"an",
"entity",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L419-L434
|
10,868
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsExpressionWithConversion
|
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;
}
|
java
|
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;
}
|
[
"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.
@return the pattern
|
[
"Finds",
"the",
"cases",
"where",
"transcription",
"relation",
"is",
"shown",
"using",
"a",
"Conversion",
"instead",
"of",
"a",
"TemplateReaction",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L441-L475
|
10,869
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.controlsDegradationIndirectly
|
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), "output PE", "degrading Conv");
p.add(new NOT(type(ComplexAssembly.class)), "degrading Conv");
p.add(new Size(participant(), 1, Size.Type.EQUAL), "degrading Conv");
p.add(new Empty(new Participant(RelType.OUTPUT)), "degrading Conv");
p.add(new Empty(convToControl()), "degrading Conv");
p.add(equal(false), "degrading Conv", "Conversion");
return p;
}
|
java
|
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), "output PE", "degrading Conv");
p.add(new NOT(type(ComplexAssembly.class)), "degrading Conv");
p.add(new Size(participant(), 1, Size.Type.EQUAL), "degrading Conv");
p.add(new Empty(new Participant(RelType.OUTPUT)), "degrading Conv");
p.add(new Empty(convToControl()), "degrading Conv");
p.add(equal(false), "degrading Conv", "Conversion");
return p;
}
|
[
"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",
")",
",",
"\"output PE\"",
",",
"\"degrading Conv\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"type",
"(",
"ComplexAssembly",
".",
"class",
")",
")",
",",
"\"degrading Conv\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Size",
"(",
"participant",
"(",
")",
",",
"1",
",",
"Size",
".",
"Type",
".",
"EQUAL",
")",
",",
"\"degrading Conv\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Empty",
"(",
"new",
"Participant",
"(",
"RelType",
".",
"OUTPUT",
")",
")",
",",
"\"degrading Conv\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Empty",
"(",
"convToControl",
"(",
")",
")",
",",
"\"degrading Conv\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"degrading Conv\"",
",",
"\"Conversion\"",
")",
";",
"return",
"p",
";",
"}"
] |
Finds cases where protein A changes state of B, and B is then degraded.
NOTE: THIS PATTERN DOES NOT WORK. KEEPING ONLY FOR HISTORICAL REASONS.
@return the pattern
|
[
"Finds",
"cases",
"where",
"protein",
"A",
"changes",
"state",
"of",
"B",
"and",
"B",
"is",
"then",
"degraded",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L484-L496
|
10,870
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.inComplexWith
|
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("PhysicalEntity/componentOf"), "PE1", "Complex");
p.add(new PathConstraint("Complex/component"), "Complex", "PE2");
p.add(equal(false), "PE1", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(peToER(), "SPE2", "generic Protein 2");
p.add(linkedER(false), "generic Protein 2", "Protein 2");
p.add(equal(false), "Protein 1", "Protein 2");
p.add(new Type(SequenceEntityReference.class), "Protein 2");
return p;
}
|
java
|
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("PhysicalEntity/componentOf"), "PE1", "Complex");
p.add(new PathConstraint("Complex/component"), "Complex", "PE2");
p.add(equal(false), "PE1", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(peToER(), "SPE2", "generic Protein 2");
p.add(linkedER(false), "generic Protein 2", "Protein 2");
p.add(equal(false), "Protein 1", "Protein 2");
p.add(new Type(SequenceEntityReference.class), "Protein 2");
return p;
}
|
[
"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",
"(",
"\"PhysicalEntity/componentOf\"",
")",
",",
"\"PE1\"",
",",
"\"Complex\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"PathConstraint",
"(",
"\"Complex/component\"",
")",
",",
"\"Complex\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"PE1\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"PE2\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE2\"",
",",
"\"generic Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"generic Protein 2\"",
",",
"\"Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"Protein 1\"",
",",
"\"Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SequenceEntityReference",
".",
"class",
")",
",",
"\"Protein 2\"",
")",
";",
"return",
"p",
";",
"}"
] |
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.
@return pattern
|
[
"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",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L504-L519
|
10,871
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.chemicalAffectsProteinThroughBinding
|
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(linkToComplex(), "SPE1", "PE1");
p.add(new PathConstraint("PhysicalEntity/componentOf"), "PE1", "Complex");
p.add(new PathConstraint("Complex/component"), "Complex", "PE2");
p.add(equal(false), "PE1", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(new Type(SequenceEntity.class), "SPE2");
p.add(peToER(), "SPE2", "generic ER");
p.add(linkedER(false), "generic ER", "ER");
return p;
}
|
java
|
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(linkToComplex(), "SPE1", "PE1");
p.add(new PathConstraint("PhysicalEntity/componentOf"), "PE1", "Complex");
p.add(new PathConstraint("Complex/component"), "Complex", "PE2");
p.add(equal(false), "PE1", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(new Type(SequenceEntity.class), "SPE2");
p.add(peToER(), "SPE2", "generic ER");
p.add(linkedER(false), "generic ER", "ER");
return p;
}
|
[
"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",
"(",
"linkToComplex",
"(",
")",
",",
"\"SPE1\"",
",",
"\"PE1\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"PathConstraint",
"(",
"\"PhysicalEntity/componentOf\"",
")",
",",
"\"PE1\"",
",",
"\"Complex\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"PathConstraint",
"(",
"\"Complex/component\"",
")",
",",
"\"Complex\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"PE1\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"PE2\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SequenceEntity",
".",
"class",
")",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE2\"",
",",
"\"generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"generic ER\"",
",",
"\"ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
A small molecule is in a complex with a protein.
@param blacklist a skip-list of ubiquitous molecules
@return pattern
|
[
"A",
"small",
"molecule",
"is",
"in",
"a",
"complex",
"with",
"a",
"protein",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L527-L542
|
10,872
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.chemicalAffectsProteinThroughControl
|
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", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToInter(), "Control", "Interaction");
p.add(new NOT(participantER()), "Interaction", "controller SMR");
p.add(participant(), "Interaction", "affected PE");
p.add(linkToSpecific(), "affected PE", "affected simple PE");
p.add(new Type(SequenceEntity.class), "affected simple PE");
p.add(peToER(), "affected simple PE", "affected generic ER");
p.add(linkedER(false), "affected generic ER", "affected ER");
return p;
}
|
java
|
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", "controller PE");
p.add(peToControl(), "controller PE", "Control");
p.add(controlToInter(), "Control", "Interaction");
p.add(new NOT(participantER()), "Interaction", "controller SMR");
p.add(participant(), "Interaction", "affected PE");
p.add(linkToSpecific(), "affected PE", "affected simple PE");
p.add(new Type(SequenceEntity.class), "affected simple PE");
p.add(peToER(), "affected simple PE", "affected generic ER");
p.add(linkedER(false), "affected generic ER", "affected ER");
return p;
}
|
[
"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\"",
",",
"\"controller PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToControl",
"(",
")",
",",
"\"controller PE\"",
",",
"\"Control\"",
")",
";",
"p",
".",
"add",
"(",
"controlToInter",
"(",
")",
",",
"\"Control\"",
",",
"\"Interaction\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"participantER",
"(",
")",
")",
",",
"\"Interaction\"",
",",
"\"controller SMR\"",
")",
";",
"p",
".",
"add",
"(",
"participant",
"(",
")",
",",
"\"Interaction\"",
",",
"\"affected PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"affected PE\"",
",",
"\"affected simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"SequenceEntity",
".",
"class",
")",
",",
"\"affected simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"affected simple PE\"",
",",
"\"affected generic ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"affected generic ER\"",
",",
"\"affected ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
A small molecule controls an interaction of which the protein is a participant.
@return pattern
|
[
"A",
"small",
"molecule",
"controls",
"an",
"interaction",
"of",
"which",
"the",
"protein",
"is",
"a",
"participant",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L548-L563
|
10,873
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.neighborOf
|
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", "Inter");
p.add(interToPE(), "Inter", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(equal(false), "SPE1", "SPE2");
p.add(type(SequenceEntity.class), "SPE2");
p.add(peToER(), "SPE2", "generic Protein 2");
p.add(linkedER(false), "generic Protein 2", "Protein 2");
p.add(equal(false), "Protein 1", "Protein 2");
return p;
}
|
java
|
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", "Inter");
p.add(interToPE(), "Inter", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(equal(false), "SPE1", "SPE2");
p.add(type(SequenceEntity.class), "SPE2");
p.add(peToER(), "SPE2", "generic Protein 2");
p.add(linkedER(false), "generic Protein 2", "Protein 2");
p.add(equal(false), "Protein 1", "Protein 2");
return p;
}
|
[
"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\"",
",",
"\"Inter\"",
")",
";",
"p",
".",
"add",
"(",
"interToPE",
"(",
")",
",",
"\"Inter\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"PE2\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"SPE1\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SequenceEntity",
".",
"class",
")",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE2\"",
",",
"\"generic Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"generic Protein 2\"",
",",
"\"Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"Protein 1\"",
",",
"\"Protein 2\"",
")",
";",
"return",
"p",
";",
"}"
] |
Constructs a pattern where first and last proteins are related through an interaction. They
can be participants or controllers. No limitation.
@return the pattern
|
[
"Constructs",
"a",
"pattern",
"where",
"first",
"and",
"last",
"proteins",
"are",
"related",
"through",
"an",
"interaction",
".",
"They",
"can",
"be",
"participants",
"or",
"controllers",
".",
"No",
"limitation",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L570-L585
|
10,874
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.reactsWith
|
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, blacklist), "PE1", "Conv");
p.add(type(BiochemicalReaction.class), "Conv");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR1");
p.add(new ConversionSide(ConversionSide.Type.SAME_SIDE, blacklist, RelType.INPUT), "PE1", "Conv", "PE2");
p.add(type(SmallMolecule.class), "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(notGeneric(), "SPE2");
p.add(new PEChainsIntersect(false), "SPE1", "PE1", "SPE2", "PE2");
p.add(peToER(), "SPE2", "SMR2");
p.add(equal(false), "SMR1", "SMR2");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR2");
return p;
}
|
java
|
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, blacklist), "PE1", "Conv");
p.add(type(BiochemicalReaction.class), "Conv");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR1");
p.add(new ConversionSide(ConversionSide.Type.SAME_SIDE, blacklist, RelType.INPUT), "PE1", "Conv", "PE2");
p.add(type(SmallMolecule.class), "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(notGeneric(), "SPE2");
p.add(new PEChainsIntersect(false), "SPE1", "PE1", "SPE2", "PE2");
p.add(peToER(), "SPE2", "SMR2");
p.add(equal(false), "SMR1", "SMR2");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR2");
return p;
}
|
[
"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",
",",
"blacklist",
")",
",",
"\"PE1\"",
",",
"\"Conv\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"BiochemicalReaction",
".",
"class",
")",
",",
"\"Conv\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"InterToPartER",
"(",
"InterToPartER",
".",
"Direction",
".",
"ONESIDERS",
")",
",",
"\"Conv\"",
",",
"\"SMR1\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"SAME_SIDE",
",",
"blacklist",
",",
"RelType",
".",
"INPUT",
")",
",",
"\"PE1\"",
",",
"\"Conv\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SmallMolecule",
".",
"class",
")",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"PE2\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"notGeneric",
"(",
")",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"PEChainsIntersect",
"(",
"false",
")",
",",
"\"SPE1\"",
",",
"\"PE1\"",
",",
"\"SPE2\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE2\"",
",",
"\"SMR2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"SMR1\"",
",",
"\"SMR2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"InterToPartER",
"(",
"InterToPartER",
".",
"Direction",
".",
"ONESIDERS",
")",
",",
"\"Conv\"",
",",
"\"SMR2\"",
")",
";",
"return",
"p",
";",
"}"
] |
Constructs a pattern where first and last small molecules are substrates to the same
biochemical reaction.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern
|
[
"Constructs",
"a",
"pattern",
"where",
"first",
"and",
"last",
"small",
"molecules",
"are",
"substrates",
"to",
"the",
"same",
"biochemical",
"reaction",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L594-L612
|
10,875
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.usedToProduce
|
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.INPUT, blacklist), "PE1", "Conv");
p.add(type(BiochemicalReaction.class), "Conv");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR1");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE, blacklist, RelType.OUTPUT), "PE1", "Conv", "PE2");
p.add(type(SmallMolecule.class), "PE2");
p.add(linkToSimple(blacklist), "PE2", "SPE2");
p.add(notGeneric(), "SPE2");
p.add(equal(false), "SPE1", "SPE2");
p.add(peToER(), "SPE2", "SMR2");
p.add(equal(false), "SMR1", "SMR2");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR2");
return p;
}
|
java
|
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.INPUT, blacklist), "PE1", "Conv");
p.add(type(BiochemicalReaction.class), "Conv");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR1");
p.add(new ConversionSide(ConversionSide.Type.OTHER_SIDE, blacklist, RelType.OUTPUT), "PE1", "Conv", "PE2");
p.add(type(SmallMolecule.class), "PE2");
p.add(linkToSimple(blacklist), "PE2", "SPE2");
p.add(notGeneric(), "SPE2");
p.add(equal(false), "SPE1", "SPE2");
p.add(peToER(), "SPE2", "SMR2");
p.add(equal(false), "SMR1", "SMR2");
p.add(new InterToPartER(InterToPartER.Direction.ONESIDERS), "Conv", "SMR2");
return p;
}
|
[
"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",
".",
"INPUT",
",",
"blacklist",
")",
",",
"\"PE1\"",
",",
"\"Conv\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"BiochemicalReaction",
".",
"class",
")",
",",
"\"Conv\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"InterToPartER",
"(",
"InterToPartER",
".",
"Direction",
".",
"ONESIDERS",
")",
",",
"\"Conv\"",
",",
"\"SMR1\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"ConversionSide",
"(",
"ConversionSide",
".",
"Type",
".",
"OTHER_SIDE",
",",
"blacklist",
",",
"RelType",
".",
"OUTPUT",
")",
",",
"\"PE1\"",
",",
"\"Conv\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SmallMolecule",
".",
"class",
")",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSimple",
"(",
"blacklist",
")",
",",
"\"PE2\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"notGeneric",
"(",
")",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"SPE1\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE2\"",
",",
"\"SMR2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"SMR1\"",
",",
"\"SMR2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"InterToPartER",
"(",
"InterToPartER",
".",
"Direction",
".",
"ONESIDERS",
")",
",",
"\"Conv\"",
",",
"\"SMR2\"",
")",
";",
"return",
"p",
";",
"}"
] |
Constructs a pattern where first small molecule is an input a biochemical reaction that
produces the second small molecule.
biochemical reaction.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern
|
[
"Constructs",
"a",
"pattern",
"where",
"first",
"small",
"molecule",
"is",
"an",
"input",
"a",
"biochemical",
"reaction",
"that",
"produces",
"the",
"second",
"small",
"molecule",
".",
"biochemical",
"reaction",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L622-L640
|
10,876
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.molecularInteraction
|
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 PathConstraint("PhysicalEntity/participantOf:MolecularInteraction"), "PE1", "MI");
p.add(participant(), "MI", "PE2");
p.add(equal(false), "PE1", "PE2");
// participants are not both baits or preys
p.add(new NOT(new AND(new MappedConst(isPrey(), 0), new MappedConst(isPrey(), 1))), "PE1", "PE2");
p.add(new NOT(new AND(new MappedConst(isBait(), 0), new MappedConst(isBait(), 1))), "PE1", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(type(SequenceEntity.class), "SPE2");
p.add(new PEChainsIntersect(false), "SPE1", "PE1", "SPE2", "PE2");
p.add(peToER(), "SPE2", "generic Protein 2");
p.add(linkedER(false), "generic Protein 2", "Protein 2");
p.add(equal(false), "Protein 1", "Protein 2");
return p;
}
|
java
|
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 PathConstraint("PhysicalEntity/participantOf:MolecularInteraction"), "PE1", "MI");
p.add(participant(), "MI", "PE2");
p.add(equal(false), "PE1", "PE2");
// participants are not both baits or preys
p.add(new NOT(new AND(new MappedConst(isPrey(), 0), new MappedConst(isPrey(), 1))), "PE1", "PE2");
p.add(new NOT(new AND(new MappedConst(isBait(), 0), new MappedConst(isBait(), 1))), "PE1", "PE2");
p.add(linkToSpecific(), "PE2", "SPE2");
p.add(type(SequenceEntity.class), "SPE2");
p.add(new PEChainsIntersect(false), "SPE1", "PE1", "SPE2", "PE2");
p.add(peToER(), "SPE2", "generic Protein 2");
p.add(linkedER(false), "generic Protein 2", "Protein 2");
p.add(equal(false), "Protein 1", "Protein 2");
return p;
}
|
[
"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",
"PathConstraint",
"(",
"\"PhysicalEntity/participantOf:MolecularInteraction\"",
")",
",",
"\"PE1\"",
",",
"\"MI\"",
")",
";",
"p",
".",
"add",
"(",
"participant",
"(",
")",
",",
"\"MI\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"PE1\"",
",",
"\"PE2\"",
")",
";",
"// participants are not both baits or preys",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"new",
"AND",
"(",
"new",
"MappedConst",
"(",
"isPrey",
"(",
")",
",",
"0",
")",
",",
"new",
"MappedConst",
"(",
"isPrey",
"(",
")",
",",
"1",
")",
")",
")",
",",
"\"PE1\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"NOT",
"(",
"new",
"AND",
"(",
"new",
"MappedConst",
"(",
"isBait",
"(",
")",
",",
"0",
")",
",",
"new",
"MappedConst",
"(",
"isBait",
"(",
")",
",",
"1",
")",
")",
")",
",",
"\"PE1\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"PE2\"",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"type",
"(",
"SequenceEntity",
".",
"class",
")",
",",
"\"SPE2\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"PEChainsIntersect",
"(",
"false",
")",
",",
"\"SPE1\"",
",",
"\"PE1\"",
",",
"\"SPE2\"",
",",
"\"PE2\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE2\"",
",",
"\"generic Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"generic Protein 2\"",
",",
"\"Protein 2\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"Protein 1\"",
",",
"\"Protein 2\"",
")",
";",
"return",
"p",
";",
"}"
] |
Constructs a pattern where first and last molecules are participants of a
MolecularInteraction.
@return the pattern
|
[
"Constructs",
"a",
"pattern",
"where",
"first",
"and",
"last",
"molecules",
"are",
"participants",
"of",
"a",
"MolecularInteraction",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L647-L668
|
10,877
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.relatedProteinRefOfInter
|
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 MappedConst[seedType.length];
for (int i = 0; i < mc.length; i++)
{
mc[i] = new MappedConst(new Type(seedType[i]), 0);
}
p.add(new OR(mc), "Interaction");
}
p.add(new OR(new MappedConst(participant(), 0, 1),
new MappedConst(new PathConstraint(
"Interaction/controlledOf*/controller:PhysicalEntity"), 0, 1)),
"Interaction", "PE");
p.add(linkToSpecific(), "PE", "SPE");
p.add(peToER(), "SPE", "generic PR");
p.add(new Type(ProteinReference.class), "generic PR");
p.add(linkedER(false), "generic PR", "PR");
return p;
}
|
java
|
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 MappedConst[seedType.length];
for (int i = 0; i < mc.length; i++)
{
mc[i] = new MappedConst(new Type(seedType[i]), 0);
}
p.add(new OR(mc), "Interaction");
}
p.add(new OR(new MappedConst(participant(), 0, 1),
new MappedConst(new PathConstraint(
"Interaction/controlledOf*/controller:PhysicalEntity"), 0, 1)),
"Interaction", "PE");
p.add(linkToSpecific(), "PE", "SPE");
p.add(peToER(), "SPE", "generic PR");
p.add(new Type(ProteinReference.class), "generic PR");
p.add(linkedER(false), "generic PR", "PR");
return p;
}
|
[
"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",
"MappedConst",
"[",
"seedType",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mc",
".",
"length",
";",
"i",
"++",
")",
"{",
"mc",
"[",
"i",
"]",
"=",
"new",
"MappedConst",
"(",
"new",
"Type",
"(",
"seedType",
"[",
"i",
"]",
")",
",",
"0",
")",
";",
"}",
"p",
".",
"add",
"(",
"new",
"OR",
"(",
"mc",
")",
",",
"\"Interaction\"",
")",
";",
"}",
"p",
".",
"add",
"(",
"new",
"OR",
"(",
"new",
"MappedConst",
"(",
"participant",
"(",
")",
",",
"0",
",",
"1",
")",
",",
"new",
"MappedConst",
"(",
"new",
"PathConstraint",
"(",
"\"Interaction/controlledOf*/controller:PhysicalEntity\"",
")",
",",
"0",
",",
"1",
")",
")",
",",
"\"Interaction\"",
",",
"\"PE\"",
")",
";",
"p",
".",
"add",
"(",
"linkToSpecific",
"(",
")",
",",
"\"PE\"",
",",
"\"SPE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"SPE\"",
",",
"\"generic PR\"",
")",
";",
"p",
".",
"add",
"(",
"new",
"Type",
"(",
"ProteinReference",
".",
"class",
")",
",",
"\"generic PR\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"false",
")",
",",
"\"generic PR\"",
",",
"\"PR\"",
")",
";",
"return",
"p",
";",
"}"
] |
Finds ProteinsReference related to an interaction. If specific types of interactions are
desired, they should be sent as parameter, otherwise leave the parameter empty.
@param seedType specific BioPAX interaction sub-types (interface classes)
@return pattern
|
[
"Finds",
"ProteinsReference",
"related",
"to",
"an",
"interaction",
".",
"If",
"specific",
"types",
"of",
"interactions",
"are",
"desired",
"they",
"should",
"be",
"sent",
"as",
"parameter",
"otherwise",
"leave",
"the",
"parameter",
"empty",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L680-L709
|
10,878
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.modifiedPESimple
|
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", "Conversion", "second PE");
p.add(equal(false), "first PE", "second PE");
p.add(peToER(), "second PE", "modified ER");
return p;
}
|
java
|
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", "Conversion", "second PE");
p.add(equal(false), "first PE", "second PE");
p.add(peToER(), "second PE", "modified ER");
return p;
}
|
[
"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\"",
",",
"\"Conversion\"",
",",
"\"second PE\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"first PE\"",
",",
"\"second PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"second PE\"",
",",
"\"modified ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for an EntityReference has distinct PhysicalEntities associated with both left and
right of a Conversion.
@return the pattern
|
[
"Pattern",
"for",
"an",
"EntityReference",
"has",
"distinct",
"PhysicalEntities",
"associated",
"with",
"both",
"left",
"and",
"right",
"of",
"a",
"Conversion",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L795-L804
|
10,879
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.actChange
|
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 MappedConst(new ActivityModificationChangeConstraint(
activating, activityFeat, inactivityFeat), 0, 1)),
"input simple PE", "output simple PE");
return p;
}
|
java
|
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 MappedConst(new ActivityModificationChangeConstraint(
activating, activityFeat, inactivityFeat), 0, 1)),
"input simple PE", "output simple PE");
return p;
}
|
[
"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",
"MappedConst",
"(",
"new",
"ActivityModificationChangeConstraint",
"(",
"activating",
",",
"activityFeat",
",",
"inactivityFeat",
")",
",",
"0",
",",
"1",
")",
")",
",",
"\"input simple PE\"",
",",
"\"output simple PE\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for the activity of an EntityReference is changed through a Conversion.
@param activating desired change
@param activityFeat modification features associated with activity
@param inactivityFeat modification features associated with inactivity
@return the pattern
|
[
"Pattern",
"for",
"the",
"activity",
"of",
"an",
"EntityReference",
"is",
"changed",
"through",
"a",
"Conversion",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L813-L824
|
10,880
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.modifierConv
|
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;
}
|
java
|
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;
}
|
[
"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.
@return the pattern
|
[
"Pattern",
"for",
"finding",
"Conversions",
"that",
"an",
"EntityReference",
"is",
"participating",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L830-L837
|
10,881
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.hasNonSelfEffect
|
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(participantER()), "Inter", "ER");
return p;
}
|
java
|
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(participantER()), "Inter", "ER");
return p;
}
|
[
"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",
"(",
"participantER",
"(",
")",
")",
",",
"\"Inter\"",
",",
"\"ER\"",
")",
";",
"return",
"p",
";",
"}"
] |
Pattern for detecting PhysicalEntity that controls a Conversion whose participants are not
associated with the EntityReference of the initial PhysicalEntity.
@return the pattern
|
[
"Pattern",
"for",
"detecting",
"PhysicalEntity",
"that",
"controls",
"a",
"Conversion",
"whose",
"participants",
"are",
"not",
"associated",
"with",
"the",
"EntityReference",
"of",
"the",
"initial",
"PhysicalEntity",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L844-L853
|
10,882
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
|
PatternBox.bindsTo
|
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", "second simple PE");
p.add(peToER(), "second simple PE", "second PR");
p.add(equal(false), "first PR", "second PR");
return p;
}
|
java
|
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", "second simple PE");
p.add(peToER(), "second simple PE", "second PR");
p.add(equal(false), "first PR", "second PR");
return p;
}
|
[
"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\"",
",",
"\"second simple PE\"",
")",
";",
"p",
".",
"add",
"(",
"peToER",
"(",
")",
",",
"\"second simple PE\"",
",",
"\"second PR\"",
")",
";",
"p",
".",
"add",
"(",
"equal",
"(",
"false",
")",
",",
"\"first PR\"",
",",
"\"second PR\"",
")",
";",
"return",
"p",
";",
"}"
] |
Finds two Protein that appear together in a Complex.
@return the pattern
|
[
"Finds",
"two",
"Protein",
"that",
"appear",
"together",
"in",
"a",
"Complex",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L861-L871
|
10,883
|
BioPAX/Paxtools
|
paxtools-console/src/main/java/org/biopax/paxtools/examples/ProteinNameLister.java
|
ProteinNameLister.listUnificationXrefsPerPathway
|
public static void listUnificationXrefsPerPathway(Model model)
{
// This is a visitor for elements in a pathway - direct and indirect
Visitor visitor = new Visitor()
{
public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor editor)
{
if (range instanceof physicalEntity)
{
// Do whatever you want with the pe and xref here
physicalEntity pe = (physicalEntity) range;
ClassFilterSet<xref,unificationXref> unis = new ClassFilterSet<xref,unificationXref>(pe.getXREF(),
unificationXref.class);
for (unificationXref uni : unis)
{
System.out.println("pe.getNAME() = " + pe.getNAME());
System.out.println("uni = " + uni.getID());
}
}
}
};
Traverser traverser = new Traverser(SimpleEditorMap.L2, visitor);
Set<pathway> pathways = model.getObjects(pathway.class);
for (pathway pathway : pathways)
{
traverser.traverse(pathway, model);
}
}
|
java
|
public static void listUnificationXrefsPerPathway(Model model)
{
// This is a visitor for elements in a pathway - direct and indirect
Visitor visitor = new Visitor()
{
public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor editor)
{
if (range instanceof physicalEntity)
{
// Do whatever you want with the pe and xref here
physicalEntity pe = (physicalEntity) range;
ClassFilterSet<xref,unificationXref> unis = new ClassFilterSet<xref,unificationXref>(pe.getXREF(),
unificationXref.class);
for (unificationXref uni : unis)
{
System.out.println("pe.getNAME() = " + pe.getNAME());
System.out.println("uni = " + uni.getID());
}
}
}
};
Traverser traverser = new Traverser(SimpleEditorMap.L2, visitor);
Set<pathway> pathways = model.getObjects(pathway.class);
for (pathway pathway : pathways)
{
traverser.traverse(pathway, model);
}
}
|
[
"public",
"static",
"void",
"listUnificationXrefsPerPathway",
"(",
"Model",
"model",
")",
"{",
"// This is a visitor for elements in a pathway - direct and indirect",
"Visitor",
"visitor",
"=",
"new",
"Visitor",
"(",
")",
"{",
"public",
"void",
"visit",
"(",
"BioPAXElement",
"domain",
",",
"Object",
"range",
",",
"Model",
"model",
",",
"PropertyEditor",
"editor",
")",
"{",
"if",
"(",
"range",
"instanceof",
"physicalEntity",
")",
"{",
"// Do whatever you want with the pe and xref here",
"physicalEntity",
"pe",
"=",
"(",
"physicalEntity",
")",
"range",
";",
"ClassFilterSet",
"<",
"xref",
",",
"unificationXref",
">",
"unis",
"=",
"new",
"ClassFilterSet",
"<",
"xref",
",",
"unificationXref",
">",
"(",
"pe",
".",
"getXREF",
"(",
")",
",",
"unificationXref",
".",
"class",
")",
";",
"for",
"(",
"unificationXref",
"uni",
":",
"unis",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"pe.getNAME() = \"",
"+",
"pe",
".",
"getNAME",
"(",
")",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"uni = \"",
"+",
"uni",
".",
"getID",
"(",
")",
")",
";",
"}",
"}",
"}",
"}",
";",
"Traverser",
"traverser",
"=",
"new",
"Traverser",
"(",
"SimpleEditorMap",
".",
"L2",
",",
"visitor",
")",
";",
"Set",
"<",
"pathway",
">",
"pathways",
"=",
"model",
".",
"getObjects",
"(",
"pathway",
".",
"class",
")",
";",
"for",
"(",
"pathway",
"pathway",
":",
"pathways",
")",
"{",
"traverser",
".",
"traverse",
"(",
"pathway",
",",
"model",
")",
";",
"}",
"}"
] |
Here is a more elegant way of doing the previous method!
@param model BioPAX object Model
|
[
"Here",
"is",
"a",
"more",
"elegant",
"way",
"of",
"doing",
"the",
"previous",
"method!"
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-console/src/main/java/org/biopax/paxtools/examples/ProteinNameLister.java#L136-L165
|
10,884
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/PEChainsIntersect.java
|
PEChainsIntersect.satisfies
|
@Override
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[3]);
PhysicalEntityChain ch1 = new PhysicalEntityChain(pe0, pe1);
PhysicalEntityChain ch2 = new PhysicalEntityChain(pe2, pe3);
return ch1.intersects(ch2, ignoreEndPoints) == intersectionDesired;
}
|
java
|
@Override
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[3]);
PhysicalEntityChain ch1 = new PhysicalEntityChain(pe0, pe1);
PhysicalEntityChain ch2 = new PhysicalEntityChain(pe2, pe3);
return ch1.intersects(ch2, ignoreEndPoints) == intersectionDesired;
}
|
[
"@",
"Override",
"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",
"[",
"3",
"]",
")",
";",
"PhysicalEntityChain",
"ch1",
"=",
"new",
"PhysicalEntityChain",
"(",
"pe0",
",",
"pe1",
")",
";",
"PhysicalEntityChain",
"ch2",
"=",
"new",
"PhysicalEntityChain",
"(",
"pe2",
",",
"pe3",
")",
";",
"return",
"ch1",
".",
"intersects",
"(",
"ch2",
",",
"ignoreEndPoints",
")",
"==",
"intersectionDesired",
";",
"}"
] |
Creates two PhysicalEntity chains with the given endpoints, and checks if they are
intersecting.
@param match current pattern match
@param ind mapped indices
@return true if the chains are intersecting or not intersecting as desired
|
[
"Creates",
"two",
"PhysicalEntity",
"chains",
"with",
"the",
"given",
"endpoints",
"and",
"checks",
"if",
"they",
"are",
"intersecting",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/PEChainsIntersect.java#L57-L69
|
10,885
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ConversionSide.java
|
ConversionSide.generate
|
@Override
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 = sideType == Type.OTHER_SIDE ? conv.getRight() : conv.getLeft();
}
else if (conv.getRight().contains(pe1))
{
parts = sideType == Type.SAME_SIDE ? conv.getRight() : conv.getLeft();
}
else throw new IllegalArgumentException(
"The PhysicalEntity has to be a participant of the Conversion.");
if (blacklist == null) return new HashSet<BioPAXElement>(parts);
else
{
ConversionDirectionType dir = getDirection(conv);
if ((dir == ConversionDirectionType.LEFT_TO_RIGHT && ((relType == RelType.INPUT && parts != conv.getLeft()) || (relType == RelType.OUTPUT && parts != conv.getRight()))) ||
(dir == ConversionDirectionType.RIGHT_TO_LEFT && ((relType == RelType.INPUT && parts != conv.getRight()) || (relType == RelType.OUTPUT && parts != conv.getLeft()))))
return Collections.emptySet();
return new HashSet<BioPAXElement>(blacklist.getNonUbiques(parts, relType));
}
}
|
java
|
@Override
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 = sideType == Type.OTHER_SIDE ? conv.getRight() : conv.getLeft();
}
else if (conv.getRight().contains(pe1))
{
parts = sideType == Type.SAME_SIDE ? conv.getRight() : conv.getLeft();
}
else throw new IllegalArgumentException(
"The PhysicalEntity has to be a participant of the Conversion.");
if (blacklist == null) return new HashSet<BioPAXElement>(parts);
else
{
ConversionDirectionType dir = getDirection(conv);
if ((dir == ConversionDirectionType.LEFT_TO_RIGHT && ((relType == RelType.INPUT && parts != conv.getLeft()) || (relType == RelType.OUTPUT && parts != conv.getRight()))) ||
(dir == ConversionDirectionType.RIGHT_TO_LEFT && ((relType == RelType.INPUT && parts != conv.getRight()) || (relType == RelType.OUTPUT && parts != conv.getLeft()))))
return Collections.emptySet();
return new HashSet<BioPAXElement>(blacklist.getNonUbiques(parts, relType));
}
}
|
[
"@",
"Override",
"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",
"=",
"sideType",
"==",
"Type",
".",
"OTHER_SIDE",
"?",
"conv",
".",
"getRight",
"(",
")",
":",
"conv",
".",
"getLeft",
"(",
")",
";",
"}",
"else",
"if",
"(",
"conv",
".",
"getRight",
"(",
")",
".",
"contains",
"(",
"pe1",
")",
")",
"{",
"parts",
"=",
"sideType",
"==",
"Type",
".",
"SAME_SIDE",
"?",
"conv",
".",
"getRight",
"(",
")",
":",
"conv",
".",
"getLeft",
"(",
")",
";",
"}",
"else",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The PhysicalEntity has to be a participant of the Conversion.\"",
")",
";",
"if",
"(",
"blacklist",
"==",
"null",
")",
"return",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
"parts",
")",
";",
"else",
"{",
"ConversionDirectionType",
"dir",
"=",
"getDirection",
"(",
"conv",
")",
";",
"if",
"(",
"(",
"dir",
"==",
"ConversionDirectionType",
".",
"LEFT_TO_RIGHT",
"&&",
"(",
"(",
"relType",
"==",
"RelType",
".",
"INPUT",
"&&",
"parts",
"!=",
"conv",
".",
"getLeft",
"(",
")",
")",
"||",
"(",
"relType",
"==",
"RelType",
".",
"OUTPUT",
"&&",
"parts",
"!=",
"conv",
".",
"getRight",
"(",
")",
")",
")",
")",
"||",
"(",
"dir",
"==",
"ConversionDirectionType",
".",
"RIGHT_TO_LEFT",
"&&",
"(",
"(",
"relType",
"==",
"RelType",
".",
"INPUT",
"&&",
"parts",
"!=",
"conv",
".",
"getRight",
"(",
")",
")",
"||",
"(",
"relType",
"==",
"RelType",
".",
"OUTPUT",
"&&",
"parts",
"!=",
"conv",
".",
"getLeft",
"(",
")",
")",
")",
")",
")",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"return",
"new",
"HashSet",
"<",
"BioPAXElement",
">",
"(",
"blacklist",
".",
"getNonUbiques",
"(",
"parts",
",",
"relType",
")",
")",
";",
"}",
"}"
] |
Checks which side is the first PhysicalEntity, and gathers participants on either the other
side or the same side.
@param match current pattern match
@param ind mapped indices
@return participants at the desired side
|
[
"Checks",
"which",
"side",
"is",
"the",
"first",
"PhysicalEntity",
"and",
"gathers",
"participants",
"on",
"either",
"the",
"other",
"side",
"or",
"the",
"same",
"side",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ConversionSide.java#L88-L120
|
10,886
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/EditorMapImpl.java
|
EditorMapImpl.registerEditorsWithSubClasses
|
protected void registerEditorsWithSubClasses(PropertyEditor editor, Class<? extends BioPAXElement> domain) {
for (Class<? extends BioPAXElement> c : classToEditorMap.keySet())
{
if (domain.isAssignableFrom(c)) {
//workaround for participants - can be replaced w/ a general
// annotation based system. For the time being, I am just handling it
//as a special case
if ((editor.getProperty().equals("PARTICIPANTS") &&
(conversion.class.isAssignableFrom(c) || control.class.isAssignableFrom(c))) ||
(editor.getProperty().equals("participant") &&
(Conversion.class.isAssignableFrom(c) || Control.class.isAssignableFrom(c)))) {
if (log.isDebugEnabled()) {
log.debug("skipping restricted participant property");
}
} else {
classToEditorMap.get(c).put(editor.getProperty(), editor);
}
}
}
if (editor instanceof ObjectPropertyEditor) {
registerInverseEditors((ObjectPropertyEditor) editor);
}
}
|
java
|
protected void registerEditorsWithSubClasses(PropertyEditor editor, Class<? extends BioPAXElement> domain) {
for (Class<? extends BioPAXElement> c : classToEditorMap.keySet())
{
if (domain.isAssignableFrom(c)) {
//workaround for participants - can be replaced w/ a general
// annotation based system. For the time being, I am just handling it
//as a special case
if ((editor.getProperty().equals("PARTICIPANTS") &&
(conversion.class.isAssignableFrom(c) || control.class.isAssignableFrom(c))) ||
(editor.getProperty().equals("participant") &&
(Conversion.class.isAssignableFrom(c) || Control.class.isAssignableFrom(c)))) {
if (log.isDebugEnabled()) {
log.debug("skipping restricted participant property");
}
} else {
classToEditorMap.get(c).put(editor.getProperty(), editor);
}
}
}
if (editor instanceof ObjectPropertyEditor) {
registerInverseEditors((ObjectPropertyEditor) editor);
}
}
|
[
"protected",
"void",
"registerEditorsWithSubClasses",
"(",
"PropertyEditor",
"editor",
",",
"Class",
"<",
"?",
"extends",
"BioPAXElement",
">",
"domain",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
"extends",
"BioPAXElement",
">",
"c",
":",
"classToEditorMap",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"domain",
".",
"isAssignableFrom",
"(",
"c",
")",
")",
"{",
"//workaround for participants - can be replaced w/ a general",
"// annotation based system. For the time being, I am just handling it",
"//as a special case",
"if",
"(",
"(",
"editor",
".",
"getProperty",
"(",
")",
".",
"equals",
"(",
"\"PARTICIPANTS\"",
")",
"&&",
"(",
"conversion",
".",
"class",
".",
"isAssignableFrom",
"(",
"c",
")",
"||",
"control",
".",
"class",
".",
"isAssignableFrom",
"(",
"c",
")",
")",
")",
"||",
"(",
"editor",
".",
"getProperty",
"(",
")",
".",
"equals",
"(",
"\"participant\"",
")",
"&&",
"(",
"Conversion",
".",
"class",
".",
"isAssignableFrom",
"(",
"c",
")",
"||",
"Control",
".",
"class",
".",
"isAssignableFrom",
"(",
"c",
")",
")",
")",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"skipping restricted participant property\"",
")",
";",
"}",
"}",
"else",
"{",
"classToEditorMap",
".",
"get",
"(",
"c",
")",
".",
"put",
"(",
"editor",
".",
"getProperty",
"(",
")",
",",
"editor",
")",
";",
"}",
"}",
"}",
"if",
"(",
"editor",
"instanceof",
"ObjectPropertyEditor",
")",
"{",
"registerInverseEditors",
"(",
"(",
"ObjectPropertyEditor",
")",
"editor",
")",
";",
"}",
"}"
] |
This method registers an editor with sub classes - i.e. inserts the editor to the proper value in editor maps.
@param editor to be registered
@param domain a subclass of the editor's original domain.
|
[
"This",
"method",
"registers",
"an",
"editor",
"with",
"sub",
"classes",
"-",
"i",
".",
"e",
".",
"inserts",
"the",
"editor",
"to",
"the",
"proper",
"value",
"in",
"editor",
"maps",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/EditorMapImpl.java#L145-L170
|
10,887
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/EditorMapImpl.java
|
EditorMapImpl.registerModelClass
|
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);
classToInverseEditorMap.put(domain, new HashSet<ObjectPropertyEditor>());
classToEditorSet.put(domain, new ValueSet(peMap.values()));
} catch (IllegalBioPAXArgumentException e) {
if (log.isDebugEnabled()) {
log.debug("Skipping (" + e.getMessage() + ")");
}
}
}
|
java
|
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);
classToInverseEditorMap.put(domain, new HashSet<ObjectPropertyEditor>());
classToEditorSet.put(domain, new ValueSet(peMap.values()));
} catch (IllegalBioPAXArgumentException e) {
if (log.isDebugEnabled()) {
log.debug("Skipping (" + e.getMessage() + ")");
}
}
}
|
[
"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",
")",
";",
"classToInverseEditorMap",
".",
"put",
"(",
"domain",
",",
"new",
"HashSet",
"<",
"ObjectPropertyEditor",
">",
"(",
")",
")",
";",
"classToEditorSet",
".",
"put",
"(",
"domain",
",",
"new",
"ValueSet",
"(",
"peMap",
".",
"values",
"(",
")",
")",
")",
";",
"}",
"catch",
"(",
"IllegalBioPAXArgumentException",
"e",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Skipping (\"",
"+",
"e",
".",
"getMessage",
"(",
")",
"+",
"\")\"",
")",
";",
"}",
"}",
"}"
] |
This method inserts the class into internal hashmaps and initializes the value collections.
@param localName of the BioPAX class.
|
[
"This",
"method",
"inserts",
"the",
"class",
"into",
"internal",
"hashmaps",
"and",
"initializes",
"the",
"value",
"collections",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/EditorMapImpl.java#L203-L216
|
10,888
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/Prune.java
|
Prune.checkNodeRecursive
|
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.getUpperEquivalent())
{
checkNodeRecursive(parent);
}
for (Node child : node.getLowerEquivalent())
{
checkNodeRecursive(child);
}
}
}
|
java
|
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.getUpperEquivalent())
{
checkNodeRecursive(parent);
}
for (Node child : node.getLowerEquivalent())
{
checkNodeRecursive(child);
}
}
}
|
[
"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",
".",
"getUpperEquivalent",
"(",
")",
")",
"{",
"checkNodeRecursive",
"(",
"parent",
")",
";",
"}",
"for",
"(",
"Node",
"child",
":",
"node",
".",
"getLowerEquivalent",
"(",
")",
")",
"{",
"checkNodeRecursive",
"(",
"child",
")",
";",
"}",
"}",
"}"
] |
Recursively checks if a node is dangling.
@param node Node to check
|
[
"Recursively",
"checks",
"if",
"a",
"node",
"is",
"dangling",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/Prune.java#L59-L82
|
10,889
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/Prune.java
|
Prune.removeNode
|
private void removeNode(Node node)
{
result.remove(node);
for (Edge edge : node.getUpstream())
{
result.remove(edge);
}
for (Edge edge : node.getDownstream())
{
result.remove(edge);
}
}
|
java
|
private void removeNode(Node node)
{
result.remove(node);
for (Edge edge : node.getUpstream())
{
result.remove(edge);
}
for (Edge edge : node.getDownstream())
{
result.remove(edge);
}
}
|
[
"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.
@param node Node to remove
|
[
"Removes",
"the",
"dangling",
"node",
"and",
"its",
"edges",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/Prune.java#L88-L101
|
10,890
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/Prune.java
|
Prune.isDangling
|
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 (Edge edge : node.getDownstream())
{
if (result.contains(edge))
{
hasOutgoing = true;
break;
}
}
if (hasIncoming && hasOutgoing) return false;
boolean hasParent = false;
for (Node parent : node.getUpperEquivalent())
{
if (result.contains(parent))
{
hasParent = true;
break;
}
}
if (hasParent && (hasIncoming || hasOutgoing)) return false;
boolean hasChild = false;
for (Node child : node.getLowerEquivalent())
{
if (result.contains(child))
{
hasChild = true;
break;
}
}
return !(hasChild && (hasIncoming || hasOutgoing || hasParent));
}
|
java
|
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 (Edge edge : node.getDownstream())
{
if (result.contains(edge))
{
hasOutgoing = true;
break;
}
}
if (hasIncoming && hasOutgoing) return false;
boolean hasParent = false;
for (Node parent : node.getUpperEquivalent())
{
if (result.contains(parent))
{
hasParent = true;
break;
}
}
if (hasParent && (hasIncoming || hasOutgoing)) return false;
boolean hasChild = false;
for (Node child : node.getLowerEquivalent())
{
if (result.contains(child))
{
hasChild = true;
break;
}
}
return !(hasChild && (hasIncoming || hasOutgoing || hasParent));
}
|
[
"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",
"(",
"Edge",
"edge",
":",
"node",
".",
"getDownstream",
"(",
")",
")",
"{",
"if",
"(",
"result",
".",
"contains",
"(",
"edge",
")",
")",
"{",
"hasOutgoing",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"hasIncoming",
"&&",
"hasOutgoing",
")",
"return",
"false",
";",
"boolean",
"hasParent",
"=",
"false",
";",
"for",
"(",
"Node",
"parent",
":",
"node",
".",
"getUpperEquivalent",
"(",
")",
")",
"{",
"if",
"(",
"result",
".",
"contains",
"(",
"parent",
")",
")",
"{",
"hasParent",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"hasParent",
"&&",
"(",
"hasIncoming",
"||",
"hasOutgoing",
")",
")",
"return",
"false",
";",
"boolean",
"hasChild",
"=",
"false",
";",
"for",
"(",
"Node",
"child",
":",
"node",
".",
"getLowerEquivalent",
"(",
")",
")",
"{",
"if",
"(",
"result",
".",
"contains",
"(",
"child",
")",
")",
"{",
"hasChild",
"=",
"true",
";",
"break",
";",
"}",
"}",
"return",
"!",
"(",
"hasChild",
"&&",
"(",
"hasIncoming",
"||",
"hasOutgoing",
"||",
"hasParent",
")",
")",
";",
"}"
] |
Checks if the node is dangling.
@param node Node to check
@return true if dangling
|
[
"Checks",
"if",
"the",
"node",
"is",
"dangling",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/Prune.java#L108-L162
|
10,891
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java
|
LevelUpgrader.filter
|
public Model filter(Model model) {
if(model == null || model.getLevel() != BioPAXLevel.L2)
return model; // nothing to do
preparePep2PEIDMap(model);
final Model newModel = factory.createModel();
newModel.getNameSpacePrefixMap().putAll(model.getNameSpacePrefixMap());
newModel.setXmlBase(model.getXmlBase());
// facilitate the conversion
normalize(model);
// First, map classes (and only set ID) if possible (pre-processing)
for(BioPAXElement bpe : model.getObjects()) {
Level3Element l3element = mapClass(bpe);
if(l3element != null) {
newModel.add(l3element);
} else {
log.debug("Skipping " + bpe + " " + bpe.getModelInterface().getSimpleName());
}
}
/* process each L2 element (mapping properties),
* except for pEPs and oCVs that must be processed as values
* (anyway, we do not want dangling elements)
*/
for(BioPAXElement e : model.getObjects()) {
if(e instanceof physicalEntityParticipant
|| e instanceof openControlledVocabulary) {
continue;
}
// map properties
traverse((Level2Element) e, newModel);
}
log.info("Done: new L3 model contains " + newModel.getObjects().size() + " BioPAX individuals.");
// fix new model (e.g., add PathwayStep's processes to the pathway components ;))
normalize(newModel);
return newModel;
}
|
java
|
public Model filter(Model model) {
if(model == null || model.getLevel() != BioPAXLevel.L2)
return model; // nothing to do
preparePep2PEIDMap(model);
final Model newModel = factory.createModel();
newModel.getNameSpacePrefixMap().putAll(model.getNameSpacePrefixMap());
newModel.setXmlBase(model.getXmlBase());
// facilitate the conversion
normalize(model);
// First, map classes (and only set ID) if possible (pre-processing)
for(BioPAXElement bpe : model.getObjects()) {
Level3Element l3element = mapClass(bpe);
if(l3element != null) {
newModel.add(l3element);
} else {
log.debug("Skipping " + bpe + " " + bpe.getModelInterface().getSimpleName());
}
}
/* process each L2 element (mapping properties),
* except for pEPs and oCVs that must be processed as values
* (anyway, we do not want dangling elements)
*/
for(BioPAXElement e : model.getObjects()) {
if(e instanceof physicalEntityParticipant
|| e instanceof openControlledVocabulary) {
continue;
}
// map properties
traverse((Level2Element) e, newModel);
}
log.info("Done: new L3 model contains " + newModel.getObjects().size() + " BioPAX individuals.");
// fix new model (e.g., add PathwayStep's processes to the pathway components ;))
normalize(newModel);
return newModel;
}
|
[
"public",
"Model",
"filter",
"(",
"Model",
"model",
")",
"{",
"if",
"(",
"model",
"==",
"null",
"||",
"model",
".",
"getLevel",
"(",
")",
"!=",
"BioPAXLevel",
".",
"L2",
")",
"return",
"model",
";",
"// nothing to do",
"preparePep2PEIDMap",
"(",
"model",
")",
";",
"final",
"Model",
"newModel",
"=",
"factory",
".",
"createModel",
"(",
")",
";",
"newModel",
".",
"getNameSpacePrefixMap",
"(",
")",
".",
"putAll",
"(",
"model",
".",
"getNameSpacePrefixMap",
"(",
")",
")",
";",
"newModel",
".",
"setXmlBase",
"(",
"model",
".",
"getXmlBase",
"(",
")",
")",
";",
"// facilitate the conversion",
"normalize",
"(",
"model",
")",
";",
"// First, map classes (and only set ID) if possible (pre-processing)",
"for",
"(",
"BioPAXElement",
"bpe",
":",
"model",
".",
"getObjects",
"(",
")",
")",
"{",
"Level3Element",
"l3element",
"=",
"mapClass",
"(",
"bpe",
")",
";",
"if",
"(",
"l3element",
"!=",
"null",
")",
"{",
"newModel",
".",
"add",
"(",
"l3element",
")",
";",
"}",
"else",
"{",
"log",
".",
"debug",
"(",
"\"Skipping \"",
"+",
"bpe",
"+",
"\" \"",
"+",
"bpe",
".",
"getModelInterface",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
"}",
"}",
"/* process each L2 element (mapping properties), \n\t\t * except for pEPs and oCVs that must be processed as values\n\t\t * (anyway, we do not want dangling elements)\n\t\t */",
"for",
"(",
"BioPAXElement",
"e",
":",
"model",
".",
"getObjects",
"(",
")",
")",
"{",
"if",
"(",
"e",
"instanceof",
"physicalEntityParticipant",
"||",
"e",
"instanceof",
"openControlledVocabulary",
")",
"{",
"continue",
";",
"}",
"// map properties",
"traverse",
"(",
"(",
"Level2Element",
")",
"e",
",",
"newModel",
")",
";",
"}",
"log",
".",
"info",
"(",
"\"Done: new L3 model contains \"",
"+",
"newModel",
".",
"getObjects",
"(",
")",
".",
"size",
"(",
")",
"+",
"\" BioPAX individuals.\"",
")",
";",
"// fix new model (e.g., add PathwayStep's processes to the pathway components ;))",
"normalize",
"(",
"newModel",
")",
";",
"return",
"newModel",
";",
"}"
] |
Converts a BioPAX Model, Level 1 or 2, to the Level 3.
@param model BioPAX model to upgrade
@return new Level3 model
|
[
"Converts",
"a",
"BioPAX",
"Model",
"Level",
"1",
"or",
"2",
"to",
"the",
"Level",
"3",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java#L106-L149
|
10,892
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java
|
LevelUpgrader.mapClass
|
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.getUri()))
{
// create a new simplePhysicalEntity
//(excluding Complex and basic PhysicalEntity that map directly and have no ERs)
newElement = createSimplePhysicalEntity((physicalEntityParticipant)bpe);
}
}
else if(!(bpe instanceof openControlledVocabulary)) // skip oCVs
{
// using classesmap.properties to map other types
String type = bpe.getModelInterface().getSimpleName();
String newType = classesmap.getProperty(type).trim();
if (newType != null && factory.canInstantiate(factory.getLevel().getInterfaceForName(newType)))
{
newElement = (Level3Element) factory.create(newType, bpe.getUri());
} else {
if(log.isDebugEnabled())
log.debug("No mapping found for " + type);
return null;
}
}
return newElement;
}
|
java
|
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.getUri()))
{
// create a new simplePhysicalEntity
//(excluding Complex and basic PhysicalEntity that map directly and have no ERs)
newElement = createSimplePhysicalEntity((physicalEntityParticipant)bpe);
}
}
else if(!(bpe instanceof openControlledVocabulary)) // skip oCVs
{
// using classesmap.properties to map other types
String type = bpe.getModelInterface().getSimpleName();
String newType = classesmap.getProperty(type).trim();
if (newType != null && factory.canInstantiate(factory.getLevel().getInterfaceForName(newType)))
{
newElement = (Level3Element) factory.create(newType, bpe.getUri());
} else {
if(log.isDebugEnabled())
log.debug("No mapping found for " + type);
return null;
}
}
return newElement;
}
|
[
"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",
".",
"getUri",
"(",
")",
")",
")",
"{",
"// create a new simplePhysicalEntity",
"//(excluding Complex and basic PhysicalEntity that map directly and have no ERs)",
"newElement",
"=",
"createSimplePhysicalEntity",
"(",
"(",
"physicalEntityParticipant",
")",
"bpe",
")",
";",
"}",
"}",
"else",
"if",
"(",
"!",
"(",
"bpe",
"instanceof",
"openControlledVocabulary",
")",
")",
"// skip oCVs",
"{",
"// using classesmap.properties to map other types",
"String",
"type",
"=",
"bpe",
".",
"getModelInterface",
"(",
")",
".",
"getSimpleName",
"(",
")",
";",
"String",
"newType",
"=",
"classesmap",
".",
"getProperty",
"(",
"type",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"newType",
"!=",
"null",
"&&",
"factory",
".",
"canInstantiate",
"(",
"factory",
".",
"getLevel",
"(",
")",
".",
"getInterfaceForName",
"(",
"newType",
")",
")",
")",
"{",
"newElement",
"=",
"(",
"Level3Element",
")",
"factory",
".",
"create",
"(",
"newType",
",",
"bpe",
".",
"getUri",
"(",
")",
")",
";",
"}",
"else",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"No mapping found for \"",
"+",
"type",
")",
";",
"return",
"null",
";",
"}",
"}",
"return",
"newElement",
";",
"}"
] |
creates L3 classes and sets IDs
|
[
"creates",
"L3",
"classes",
"and",
"sets",
"IDs"
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java#L207-L241
|
10,893
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java
|
LevelUpgrader.getLocalId
|
static public String getLocalId(BioPAXElement bpe) {
String id = bpe.getUri();
return (id != null) ? id.replaceFirst("^.+[#/]", "") : null; //greedy pattern matches everything up to the last '/' or '#'
}
|
java
|
static public String getLocalId(BioPAXElement bpe) {
String id = bpe.getUri();
return (id != null) ? id.replaceFirst("^.+[#/]", "") : null; //greedy pattern matches everything up to the last '/' or '#'
}
|
[
"static",
"public",
"String",
"getLocalId",
"(",
"BioPAXElement",
"bpe",
")",
"{",
"String",
"id",
"=",
"bpe",
".",
"getUri",
"(",
")",
";",
"return",
"(",
"id",
"!=",
"null",
")",
"?",
"id",
".",
"replaceFirst",
"(",
"\"^.+[#/]\"",
",",
"\"\"",
")",
":",
"null",
";",
"//greedy pattern matches everything up to the last '/' or '#'",
"}"
] |
Gets the local part of the BioPAX element ID.
@param bpe BioPAX object
@return id - local part of the URI
|
[
"Gets",
"the",
"local",
"part",
"of",
"the",
"BioPAX",
"element",
"ID",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java#L492-L495
|
10,894
|
BioPAX/Paxtools
|
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ActivityConstraint.java
|
ActivityConstraint.satisfies
|
@Override
public boolean satisfies(Match match, int... ind)
{
PhysicalEntity pe = (PhysicalEntity) match.get(ind[0]);
return pe.getControllerOf().isEmpty() == active;
}
|
java
|
@Override
public boolean satisfies(Match match, int... ind)
{
PhysicalEntity pe = (PhysicalEntity) match.get(ind[0]);
return pe.getControllerOf().isEmpty() == active;
}
|
[
"@",
"Override",
"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.
@param match current match to validate
@param ind mapped index
@return true if it controls anything
|
[
"Checks",
"if",
"the",
"PhysicalEntity",
"controls",
"anything",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ActivityConstraint.java#L34-L40
|
10,895
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/Merger.java
|
Merger.getIdentical
|
private BioPAXElement getIdentical(BioPAXElement bpe)
{
int key = bpe.hashCode();
List<BioPAXElement> list = equivalenceMap.get(key);
if (list != null)
{
for (BioPAXElement other : list)
{
if (other.equals(bpe))
{
return other;
}
}
}
return null;
}
|
java
|
private BioPAXElement getIdentical(BioPAXElement bpe)
{
int key = bpe.hashCode();
List<BioPAXElement> list = equivalenceMap.get(key);
if (list != null)
{
for (BioPAXElement other : list)
{
if (other.equals(bpe))
{
return other;
}
}
}
return null;
}
|
[
"private",
"BioPAXElement",
"getIdentical",
"(",
"BioPAXElement",
"bpe",
")",
"{",
"int",
"key",
"=",
"bpe",
".",
"hashCode",
"(",
")",
";",
"List",
"<",
"BioPAXElement",
">",
"list",
"=",
"equivalenceMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"for",
"(",
"BioPAXElement",
"other",
":",
"list",
")",
"{",
"if",
"(",
"other",
".",
"equals",
"(",
"bpe",
")",
")",
"{",
"return",
"other",
";",
"}",
"}",
"}",
"return",
"null",
";",
"}"
] |
Searches the target model for an identical of given BioPAX element, and returns this element if
it finds it.
@param bpe BioPAX element for which equivalent will be searched in target.
@return the BioPAX element that is found in target model, if there is none it returns null
|
[
"Searches",
"the",
"target",
"model",
"for",
"an",
"identical",
"of",
"given",
"BioPAX",
"element",
"and",
"returns",
"this",
"element",
"if",
"it",
"finds",
"it",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/Merger.java#L182-L197
|
10,896
|
BioPAX/Paxtools
|
paxtools-core/src/main/java/org/biopax/paxtools/controller/Merger.java
|
Merger.addIntoEquivalanceMap
|
private void addIntoEquivalanceMap(BioPAXElement bpe)
{
int key = bpe.hashCode();
List<BioPAXElement> list = equivalenceMap.get(key);
if (list == null)
{
list = new ArrayList<BioPAXElement>();
equivalenceMap.put(key, list);
}
list.add(bpe);
}
|
java
|
private void addIntoEquivalanceMap(BioPAXElement bpe)
{
int key = bpe.hashCode();
List<BioPAXElement> list = equivalenceMap.get(key);
if (list == null)
{
list = new ArrayList<BioPAXElement>();
equivalenceMap.put(key, list);
}
list.add(bpe);
}
|
[
"private",
"void",
"addIntoEquivalanceMap",
"(",
"BioPAXElement",
"bpe",
")",
"{",
"int",
"key",
"=",
"bpe",
".",
"hashCode",
"(",
")",
";",
"List",
"<",
"BioPAXElement",
">",
"list",
"=",
"equivalenceMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"list",
"=",
"new",
"ArrayList",
"<",
"BioPAXElement",
">",
"(",
")",
";",
"equivalenceMap",
".",
"put",
"(",
"key",
",",
"list",
")",
";",
"}",
"list",
".",
"add",
"(",
"bpe",
")",
";",
"}"
] |
Adds a BioPAX element into the equivalence map.
@param bpe BioPAX element to be added into the map.
|
[
"Adds",
"a",
"BioPAX",
"element",
"into",
"the",
"equivalence",
"map",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/Merger.java#L302-L312
|
10,897
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java
|
QueryExecuter.runNeighborhood
|
public static Set<BioPAXElement> runNeighborhood(
Set<BioPAXElement> sourceSet,
Model model,
int limit,
Direction direction,
Filter... filters)
{
Graph graph;
if (model.getLevel() == BioPAXLevel.L3)
{
if (direction == Direction.UNDIRECTED)
{
graph = new GraphL3Undirected(model, filters);
direction = Direction.BOTHSTREAM;
}
else
{
graph = new GraphL3(model, filters);
}
}
else return Collections.emptySet();
Set<Node> source = prepareSingleNodeSet(sourceSet, graph);
if (sourceSet.isEmpty()) return Collections.emptySet();
NeighborhoodQuery query = new NeighborhoodQuery(source, direction, limit);
Set<GraphObject> resultWrappers = query.run();
return convertQueryResult(resultWrappers, graph, true);
}
|
java
|
public static Set<BioPAXElement> runNeighborhood(
Set<BioPAXElement> sourceSet,
Model model,
int limit,
Direction direction,
Filter... filters)
{
Graph graph;
if (model.getLevel() == BioPAXLevel.L3)
{
if (direction == Direction.UNDIRECTED)
{
graph = new GraphL3Undirected(model, filters);
direction = Direction.BOTHSTREAM;
}
else
{
graph = new GraphL3(model, filters);
}
}
else return Collections.emptySet();
Set<Node> source = prepareSingleNodeSet(sourceSet, graph);
if (sourceSet.isEmpty()) return Collections.emptySet();
NeighborhoodQuery query = new NeighborhoodQuery(source, direction, limit);
Set<GraphObject> resultWrappers = query.run();
return convertQueryResult(resultWrappers, graph, true);
}
|
[
"public",
"static",
"Set",
"<",
"BioPAXElement",
">",
"runNeighborhood",
"(",
"Set",
"<",
"BioPAXElement",
">",
"sourceSet",
",",
"Model",
"model",
",",
"int",
"limit",
",",
"Direction",
"direction",
",",
"Filter",
"...",
"filters",
")",
"{",
"Graph",
"graph",
";",
"if",
"(",
"model",
".",
"getLevel",
"(",
")",
"==",
"BioPAXLevel",
".",
"L3",
")",
"{",
"if",
"(",
"direction",
"==",
"Direction",
".",
"UNDIRECTED",
")",
"{",
"graph",
"=",
"new",
"GraphL3Undirected",
"(",
"model",
",",
"filters",
")",
";",
"direction",
"=",
"Direction",
".",
"BOTHSTREAM",
";",
"}",
"else",
"{",
"graph",
"=",
"new",
"GraphL3",
"(",
"model",
",",
"filters",
")",
";",
"}",
"}",
"else",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"Set",
"<",
"Node",
">",
"source",
"=",
"prepareSingleNodeSet",
"(",
"sourceSet",
",",
"graph",
")",
";",
"if",
"(",
"sourceSet",
".",
"isEmpty",
"(",
")",
")",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"NeighborhoodQuery",
"query",
"=",
"new",
"NeighborhoodQuery",
"(",
"source",
",",
"direction",
",",
"limit",
")",
";",
"Set",
"<",
"GraphObject",
">",
"resultWrappers",
"=",
"query",
".",
"run",
"(",
")",
";",
"return",
"convertQueryResult",
"(",
"resultWrappers",
",",
"graph",
",",
"true",
")",
";",
"}"
] |
Gets neighborhood of the source set.
@param sourceSet seed to the query
@param model BioPAX model
@param limit neigborhood distance to get
@param direction UPSTREAM, DOWNSTREAM or BOTHSTREAM
@param filters for filtering graph elements
@return BioPAX elements in the result set
|
[
"Gets",
"neighborhood",
"of",
"the",
"source",
"set",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L35-L65
|
10,898
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java
|
QueryExecuter.runPathsBetween
|
public static Set<BioPAXElement> runPathsBetween(Set<BioPAXElement> sourceSet, Model model,
int limit, Filter... filters)
{
Graph graph;
if (model.getLevel() == BioPAXLevel.L3)
{
graph = new GraphL3(model, filters);
}
else return Collections.emptySet();
Collection<Set<Node>> sourceWrappers = prepareNodeSets(sourceSet, graph);
if (sourceWrappers.size() < 2) return Collections.emptySet();
PathsBetweenQuery query = new PathsBetweenQuery(sourceWrappers, limit);
Set<GraphObject> resultWrappers = query.run();
return convertQueryResult(resultWrappers, graph, true);
}
|
java
|
public static Set<BioPAXElement> runPathsBetween(Set<BioPAXElement> sourceSet, Model model,
int limit, Filter... filters)
{
Graph graph;
if (model.getLevel() == BioPAXLevel.L3)
{
graph = new GraphL3(model, filters);
}
else return Collections.emptySet();
Collection<Set<Node>> sourceWrappers = prepareNodeSets(sourceSet, graph);
if (sourceWrappers.size() < 2) return Collections.emptySet();
PathsBetweenQuery query = new PathsBetweenQuery(sourceWrappers, limit);
Set<GraphObject> resultWrappers = query.run();
return convertQueryResult(resultWrappers, graph, true);
}
|
[
"public",
"static",
"Set",
"<",
"BioPAXElement",
">",
"runPathsBetween",
"(",
"Set",
"<",
"BioPAXElement",
">",
"sourceSet",
",",
"Model",
"model",
",",
"int",
"limit",
",",
"Filter",
"...",
"filters",
")",
"{",
"Graph",
"graph",
";",
"if",
"(",
"model",
".",
"getLevel",
"(",
")",
"==",
"BioPAXLevel",
".",
"L3",
")",
"{",
"graph",
"=",
"new",
"GraphL3",
"(",
"model",
",",
"filters",
")",
";",
"}",
"else",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"Collection",
"<",
"Set",
"<",
"Node",
">",
">",
"sourceWrappers",
"=",
"prepareNodeSets",
"(",
"sourceSet",
",",
"graph",
")",
";",
"if",
"(",
"sourceWrappers",
".",
"size",
"(",
")",
"<",
"2",
")",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"PathsBetweenQuery",
"query",
"=",
"new",
"PathsBetweenQuery",
"(",
"sourceWrappers",
",",
"limit",
")",
";",
"Set",
"<",
"GraphObject",
">",
"resultWrappers",
"=",
"query",
".",
"run",
"(",
")",
";",
"return",
"convertQueryResult",
"(",
"resultWrappers",
",",
"graph",
",",
"true",
")",
";",
"}"
] |
Gets the graph constructed by the paths between the given seed nodes. Does not get paths
between physical entities that belong the same entity reference.
@param sourceSet Seed to the query
@param model BioPAX model
@param limit Length limit for the paths to be found
@param filters optional filters - for filtering graph elements
@return BioPAX elements in the result
|
[
"Gets",
"the",
"graph",
"constructed",
"by",
"the",
"paths",
"between",
"the",
"given",
"seed",
"nodes",
".",
"Does",
"not",
"get",
"paths",
"between",
"physical",
"entities",
"that",
"belong",
"the",
"same",
"entity",
"reference",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L118-L136
|
10,899
|
BioPAX/Paxtools
|
paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java
|
QueryExecuter.runGOI
|
public static Set<BioPAXElement> runGOI(
Set<BioPAXElement> sourceSet,
Model model,
int limit,
Filter... filters)
{
return runPathsFromTo(sourceSet, sourceSet, model, LimitType.NORMAL, limit, filters);
}
|
java
|
public static Set<BioPAXElement> runGOI(
Set<BioPAXElement> sourceSet,
Model model,
int limit,
Filter... filters)
{
return runPathsFromTo(sourceSet, sourceSet, model, LimitType.NORMAL, limit, filters);
}
|
[
"public",
"static",
"Set",
"<",
"BioPAXElement",
">",
"runGOI",
"(",
"Set",
"<",
"BioPAXElement",
">",
"sourceSet",
",",
"Model",
"model",
",",
"int",
"limit",
",",
"Filter",
"...",
"filters",
")",
"{",
"return",
"runPathsFromTo",
"(",
"sourceSet",
",",
"sourceSet",
",",
"model",
",",
"LimitType",
".",
"NORMAL",
",",
"limit",
",",
"filters",
")",
";",
"}"
] |
Gets paths between the seed nodes.
@param sourceSet Seed to the query
@param model BioPAX model
@param limit Length limit for the paths to be found
@param filters for filtering graph elements
@return BioPAX elements in the result
@deprecated Use runPathsBetween instead
|
[
"Gets",
"paths",
"between",
"the",
"seed",
"nodes",
"."
] |
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
|
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L176-L183
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.