Package org.biopax.paxtools.query
Class QueryExecuter
java.lang.Object
org.biopax.paxtools.query.QueryExecuter
This class provides static methods to execute graph queries. These cover only the most frequent
use cases. Users can use these methods as example for executing the query they need.
- Author:
- Ozgun Babur
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<PhysicalEntity>getRelatedPhysicalEntities(BioPAXElement element, Set<PhysicalEntity> pes) Gets the related PhysicalEntity objects of the given BioPAXElement, in level 3 models.static Map<BioPAXElement,Set<PhysicalEntity>> getRelatedPhysicalEntityMap(Collection<BioPAXElement> elements) Maps each BioPAXElement to its related PhysicalEntity objects.getSeedInteractions(Collection<BioPAXElement> elements, Graph graph) Extracts the querible interactions from the elements.prepareSingleNodeSet(Set<BioPAXElement> elements, Graph graph) Gets the related wrappers of the given elements in a set.prepareSingleNodeSetFromSets(Set<Set<BioPAXElement>> sets, Graph graph) Gets the related wrappers of the given elements in the sets.protected static voidreplaceXrefsWithRelatedER(Collection<BioPAXElement> elements) Replaces Xref objects with the related EntityReference objects.static Set<BioPAXElement>runCommonStream(Set<BioPAXElement> sourceSet, Model model, Direction direction, int limit, Filter... filters) Gets the elements in the common upstream or downstream of the seedstatic Set<BioPAXElement>runCommonStreamMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, Direction direction, int limit, Filter... filters) Gets the elements in the common upstream or downstream of the seedstatic Set<BioPAXElement>runCommonStreamWithPOI(Set<BioPAXElement> sourceSet, Model model, Direction direction, int limit, Filter... filters) First finds the common stream, then completes it with the paths between seed and common stream.static Set<BioPAXElement>runCommonStreamWithPOIMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, Direction direction, int limit, Filter... filters) First finds the common stream, then completes it with the paths between seed and common stream.static Set<BioPAXElement>runGOI(Set<BioPAXElement> sourceSet, Model model, int limit, Filter... filters) Deprecated.Use runPathsBetween insteadstatic Set<BioPAXElement>runNeighborhood(Set<BioPAXElement> sourceSet, Model model, int limit, Direction direction, Filter... filters) Gets neighborhood of the source set.static Set<BioPAXElement>runNeighborhoodMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, int limit, Direction direction, Filter... filters) Gets neighborhood of the source set.static Set<BioPAXElement>runPathsBetween(Set<BioPAXElement> sourceSet, Model model, int limit, Filter... filters) Gets the graph constructed by the paths between the given seed nodes.static Set<BioPAXElement>runPathsBetweenMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, int limit, Filter... filters) Gets the graph constructed by the paths between the given seed nodes.static Set<BioPAXElement>runPathsFromTo(Set<BioPAXElement> sourceSet, Set<BioPAXElement> targetSet, Model model, LimitType limitType, int limit, Filter... filters) Gets paths the graph composed of the paths from a source node, and ends at a target node.static Set<BioPAXElement>runPathsFromToMultiSet(Set<Set<BioPAXElement>> sourceSets, Set<Set<BioPAXElement>> targetSets, Model model, LimitType limitType, int limit, Filter... filters) Gets paths the graph composed of the paths from a source node, and ends at a target node.
-
Constructor Details
-
QueryExecuter
public QueryExecuter()
-
-
Method Details
-
runNeighborhood
public static Set<BioPAXElement> runNeighborhood(Set<BioPAXElement> sourceSet, Model model, int limit, Direction direction, Filter... filters) Gets neighborhood of the source set.- Parameters:
sourceSet- seed to the querymodel- BioPAX modellimit- neigborhood distance to getdirection- UPSTREAM, DOWNSTREAM or BOTHSTREAMfilters- for filtering graph elements- Returns:
- BioPAX elements in the result set
-
runNeighborhoodMultiSet
public static Set<BioPAXElement> runNeighborhoodMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, int limit, Direction direction, Filter... filters) Gets neighborhood of the source set.- Parameters:
sourceSets- seed to the querymodel- BioPAX modellimit- neigborhood distance to getdirection- UPSTREAM, DOWNSTREAM or BOTHSTREAMfilters- for filtering graph elements- Returns:
- BioPAX elements in the result set
-
runPathsBetween
public static Set<BioPAXElement> runPathsBetween(Set<BioPAXElement> sourceSet, Model model, int limit, Filter... filters) 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.- Parameters:
sourceSet- Seed to the querymodel- BioPAX modellimit- Length limit for the paths to be foundfilters- optional filters - for filtering graph elements- Returns:
- BioPAX elements in the result
-
runPathsBetweenMultiSet
public static Set<BioPAXElement> runPathsBetweenMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, int limit, Filter... filters) 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.- Parameters:
sourceSets- Seed to the querymodel- BioPAX modellimit- Length limit for the paths to be foundfilters- optional filters - for filtering graph elements- Returns:
- BioPAX elements in the result
-
runGOI
public static Set<BioPAXElement> runGOI(Set<BioPAXElement> sourceSet, Model model, int limit, Filter... filters) Deprecated.Use runPathsBetween insteadGets paths between the seed nodes.- Parameters:
sourceSet- Seed to the querymodel- BioPAX modellimit- Length limit for the paths to be foundfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
runPathsFromTo
public static Set<BioPAXElement> runPathsFromTo(Set<BioPAXElement> sourceSet, Set<BioPAXElement> targetSet, Model model, LimitType limitType, int limit, Filter... filters) Gets paths the graph composed of the paths from a source node, and ends at a target node.- Parameters:
sourceSet- Seeds for start points of pathstargetSet- Seeds for end points of pathsmodel- BioPAX modellimitType- either NORMAL or SHORTEST_PLUS_Klimit- Length limit fothe paths to be foundfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
runPathsFromToMultiSet
public static Set<BioPAXElement> runPathsFromToMultiSet(Set<Set<BioPAXElement>> sourceSets, Set<Set<BioPAXElement>> targetSets, Model model, LimitType limitType, int limit, Filter... filters) Gets paths the graph composed of the paths from a source node, and ends at a target node.- Parameters:
sourceSets- Seeds for start points of pathstargetSets- Seeds for end points of pathsmodel- BioPAX modellimitType- either NORMAL or SHORTEST_PLUS_Klimit- Length limit fothe paths to be foundfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
runCommonStream
public static Set<BioPAXElement> runCommonStream(Set<BioPAXElement> sourceSet, Model model, Direction direction, int limit, Filter... filters) Gets the elements in the common upstream or downstream of the seed- Parameters:
sourceSet- Seed to the querymodel- BioPAX modeldirection- UPSTREAM or DOWNSTREAMlimit- Length limit for the searchfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
runCommonStreamMultiSet
public static Set<BioPAXElement> runCommonStreamMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, Direction direction, int limit, Filter... filters) Gets the elements in the common upstream or downstream of the seed- Parameters:
sourceSets- Seed to the querymodel- BioPAX modeldirection- UPSTREAM or DOWNSTREAMlimit- Length limit for the searchfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
runCommonStreamWithPOI
public static Set<BioPAXElement> runCommonStreamWithPOI(Set<BioPAXElement> sourceSet, Model model, Direction direction, int limit, Filter... filters) First finds the common stream, then completes it with the paths between seed and common stream.- Parameters:
sourceSet- Seed to the querymodel- BioPAX modeldirection- UPSTREAM or DOWNSTREAMlimit- Length limit for the searchfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
runCommonStreamWithPOIMultiSet
public static Set<BioPAXElement> runCommonStreamWithPOIMultiSet(Set<Set<BioPAXElement>> sourceSets, Model model, Direction direction, int limit, Filter... filters) First finds the common stream, then completes it with the paths between seed and common stream.- Parameters:
sourceSets- Seed to the querymodel- BioPAX modeldirection- UPSTREAM or DOWNSTREAMlimit- Length limit for the searchfilters- for filtering graph elements- Returns:
- BioPAX elements in the result
-
prepareSingleNodeSet
Gets the related wrappers of the given elements in a set.- Parameters:
elements- Elements to get the related wrappersgraph- Owner graph- Returns:
- Related wrappers in a set
-
prepareSingleNodeSetFromSets
Gets the related wrappers of the given elements in the sets.- Parameters:
sets- Sets of elements to get the related wrappersgraph- Owner graph- Returns:
- Related wrappers in a set
-
getRelatedPhysicalEntityMap
public static Map<BioPAXElement,Set<PhysicalEntity>> getRelatedPhysicalEntityMap(Collection<BioPAXElement> elements) Maps each BioPAXElement to its related PhysicalEntity objects.- Parameters:
elements- Elements to map- Returns:
- The mapping
-
replaceXrefsWithRelatedER
Replaces Xref objects with the related EntityReference objects. This is required for the use case when user provides multiple xrefs that point to the same ER.- Parameters:
elements- elements to send to a query as source or target
-
getRelatedPhysicalEntities
public static Set<PhysicalEntity> getRelatedPhysicalEntities(BioPAXElement element, Set<PhysicalEntity> pes) Gets the related PhysicalEntity objects of the given BioPAXElement, in level 3 models.- Parameters:
element- Element to get related PhysicalEntity objectspes- Result set. If not supplied, a new set will be initialized.- Returns:
- Related PhysicalEntity objects
-
getSeedInteractions
Extracts the querible interactions from the elements.- Parameters:
elements- BioPAX elements to searchgraph- graph model- Returns:
- Querible Interactions (nodes)
-