Package org.biopax.paxtools.pattern.util
Class Blacklist
java.lang.Object
org.biopax.paxtools.pattern.util.Blacklist
A blacklist is used for not using ubiquitous small molecules in patterns. This class knows how to
read itself from an InputStream, and can write itself to an OutputStream.
- Author:
- Ozgun Babur
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a blank blacklist.Blacklist(InputStream is) Constructor with resource input stream.Constructor with resource file name. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new blacklisted ID.getContext(String id) Gets the context of the ubiquity of the ID.Gets the IDs of the blacklisted molecules.getNonUbiqueObjects(Set objects) getNonUbiques(Set<PhysicalEntity> entities, RelType ctx) Gets the non-ubiquitous physical entities in the given set and in the given context.getUbiques(Set<PhysicalEntity> entities, RelType context) Gets the ubiquitous small molecules among the given set and in the given context.booleanChecks if the given entity is blacklisted in at least one context.booleanisUbique(PhysicalEntity pe, Conversion conv, ConversionDirectionType dir, RelType context) Checks if the given entity is blacklisted for the given Conversion assuming the Conversion flows towards the given direction, and the entity is in given context.booleanChecks if the given entity is blacklisted in both context together.voidwrite(OutputStream os) Dumps data to the given output stream.voidDumps data to the given file.
-
Constructor Details
-
Blacklist
public Blacklist()Constructor for a blank blacklist. -
Blacklist
Constructor with resource file name.- Parameters:
filename- file path to import the blacklist entries from
-
Blacklist
Constructor with resource input stream.- Parameters:
is- input stream to read/init the blacklist from
-
-
Method Details
-
addEntry
Adds a new blacklisted ID.- Parameters:
id- ID of the blacklisted moleculescore- the ubiquity scorecontext- context of ubiquity
-
getListed
Gets the IDs of the blacklisted molecules.- Returns:
- IDs
-
write
Dumps data to the given file.- Parameters:
filename- output file name
-
write
Dumps data to the given output stream.- Parameters:
os- output stream
-
getContext
Gets the context of the ubiquity of the ID. Be careful with the result. If the result is null, then either the ID may not be ubique, or the ID may be ubique without a context (which means in both contexts).- Parameters:
id- ID to check- Returns:
- context of ubiquity
-
isUbique
Checks if the given entity is blacklisted in at least one context.- Parameters:
pe- physical entity BioPAX object- Returns:
- true/false
-
isUbiqueInBothContexts
Checks if the given entity is blacklisted in both context together.- Parameters:
pe- physical entity BioPAX object- Returns:
- true/false
-
isUbique
public boolean isUbique(PhysicalEntity pe, Conversion conv, ConversionDirectionType dir, RelType context) Checks if the given entity is blacklisted for the given Conversion assuming the Conversion flows towards the given direction, and the entity is in given context.- Parameters:
pe- physical entity BioPAX objectconv- conversion interaction (BioPAX)dir- conversion directioncontext- relationship type - context- Returns:
- true/false
-
getUbiques
Gets the ubiquitous small molecules among the given set and in the given context. It is assumed that the given set is either left or right of a Conversion. If there is no non-ubiquitous element in the set, then the least ubique(s) are removed from the result.- Parameters:
entities- left or right of a conversioncontext- are these entities input or output- Returns:
- ubiquitous small molecules in the given context
-
getNonUbiques
Gets the non-ubiquitous physical entities in the given set and in the given context. It is assumed that the given set is either left or right of a Conversion. If there is no non-ubiquitous element in the set, then the least ubique(s) are added to the result.- Parameters:
entities- left or right of a conversionctx- are these entities input or output- Returns:
- non-ubiquitous physical entities in the given context
-
getNonUbiqueObjects
-