Class LinkedPE
java.lang.Object
org.biopax.paxtools.pattern.constraint.ConstraintAdapter
org.biopax.paxtools.pattern.constraint.LinkedPE
- All Implemented Interfaces:
Constraint
Many times we want to link PhysicalEntities (PE) while traversing a relation. For instance when
we have a PE and want to go the Interactions that it participates, we may also want to consider
the complexes that the PE is in. Or we also want to traverse homologies (parent or member PEs)
This generative constraint gets related generics (member or parent) and either complexes or
members recursively.
Linking process is a bit confusing. There two modes: TO_COMPLEX and TO_MEMBER. Linking homologies
is identical for both cases. IT is either parent PEs recursively, or member PEs recursively. But
not parent of a member (recursion do not alternate between parent and member).
In TO_COMPLEX mode, only parent complexes are linked recursively, and in TO_MEMBER mode, only the
complex member PEs are linked recursively.
Homology linking and complex-relation linking can alternate recursively.
- Author:
- Ozgun Babur
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTwo type of linking between PhysicalEntity. -
Field Summary
Fields inherited from class org.biopax.paxtools.pattern.constraint.ConstraintAdapter
blacklist, size -
Constructor Summary
ConstructorsConstructorDescriptionLinkedPE(LinkedPE.Type type) Constructor with the linking type.LinkedPE(LinkedPE.Type type, Blacklist blacklist) Constructor with the linking type. -
Method Summary
Modifier and TypeMethodDescriptionprotected Setaccess(PathAccessor pa, Set<BioPAXElement> seed, Set<BioPAXElement> all) Uses the given PathAccessor to access fields of the seed and return only new elements that is not in the given element set (all).booleanThis is a generative constraint.protected voidenrichWithCM(Set<BioPAXElement> seed, Set<BioPAXElement> all) Gets parent complexes or complex members recursively according to the type of the linkage.protected voidenrichWithGenerics(Set<BioPAXElement> seed, Set<BioPAXElement> all) Gets the linked homologies and then switches to complex-relationship mode.Gets to the linked PhysicalEntity.Methods inherited from class org.biopax.paxtools.pattern.constraint.ConstraintAdapter
assertIndLength, convertStepDirection, findDirectionInCatalysis, findDirectionInPathways, getCatalysisDirection, getControlChain, getConvParticipants, getDirection, getDirection, getDirection, getDirection, getVariableSize, satisfies, setSize
-
Constructor Details
-
LinkedPE
Constructor with the linking type.- Parameters:
type- type of desired linking
-
LinkedPE
Constructor with the linking type.- Parameters:
type- type of desired linkingblacklist- a skip-list of ubiquitous molecules
-
-
Method Details
-
canGenerate
public boolean canGenerate()This is a generative constraint.- Specified by:
canGeneratein interfaceConstraint- Overrides:
canGeneratein classConstraintAdapter- Returns:
- true
-
generate
Gets to the linked PhysicalEntity.- Specified by:
generatein interfaceConstraint- Overrides:
generatein classConstraintAdapter- Parameters:
match- current pattern matchind- mapped indices- Returns:
- linked PhysicalEntity
-
getLinkedElements
-
enrichWithGenerics
Gets the linked homologies and then switches to complex-relationship mode. These two enrich methods call each other recursively.- Parameters:
seed- to get the linked elements fromall- already found links
-
enrichWithCM
Gets parent complexes or complex members recursively according to the type of the linkage.- Parameters:
seed- elements to linkall- already found links
-
access
Uses the given PathAccessor to access fields of the seed and return only new elements that is not in the given element set (all).- Parameters:
pa- accessor to the filedseed- entities to get their fieldsall- already found values- Returns:
- new values
-