Class Blacklist

java.lang.Object
org.biopax.paxtools.pattern.util.Blacklist

public class Blacklist extends Object
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 Details

    • Blacklist

      public Blacklist()
      Constructor for a blank blacklist.
    • Blacklist

      public Blacklist(String filename)
      Constructor with resource file name.
      Parameters:
      filename - file path to import the blacklist entries from
    • Blacklist

      public Blacklist(InputStream is)
      Constructor with resource input stream.
      Parameters:
      is - input stream to read/init the blacklist from
  • Method Details

    • addEntry

      public void addEntry(String id, int score, RelType context)
      Adds a new blacklisted ID.
      Parameters:
      id - ID of the blacklisted molecule
      score - the ubiquity score
      context - context of ubiquity
    • getListed

      public Set<String> getListed()
      Gets the IDs of the blacklisted molecules.
      Returns:
      IDs
    • write

      public void write(String filename)
      Dumps data to the given file.
      Parameters:
      filename - output file name
    • write

      public void write(OutputStream os)
      Dumps data to the given output stream.
      Parameters:
      os - output stream
    • getContext

      public RelType getContext(String id)
      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

      public boolean isUbique(PhysicalEntity pe)
      Checks if the given entity is blacklisted in at least one context.
      Parameters:
      pe - physical entity BioPAX object
      Returns:
      true/false
    • isUbiqueInBothContexts

      public boolean isUbiqueInBothContexts(PhysicalEntity pe)
      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 object
      conv - conversion interaction (BioPAX)
      dir - conversion direction
      context - relationship type - context
      Returns:
      true/false
    • getUbiques

      public Collection<SmallMolecule> getUbiques(Set<PhysicalEntity> entities, RelType context)
      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 conversion
      context - are these entities input or output
      Returns:
      ubiquitous small molecules in the given context
    • getNonUbiques

      public Set<PhysicalEntity> getNonUbiques(Set<PhysicalEntity> entities, RelType ctx)
      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 conversion
      ctx - are these entities input or output
      Returns:
      non-ubiquitous physical entities in the given context
    • getNonUbiqueObjects

      public Set getNonUbiqueObjects(Set objects)