Class Normalizer

java.lang.Object
org.biopax.paxtools.normalizer.Normalizer

public final class Normalizer extends Object
BioPAX (Level 3) Normalizer, an advanced BioPAX utility to help pathway data integrating and linking.
Author:
rodche
  • Field Details

  • Constructor Details

    • Normalizer

      public Normalizer()
      Constructor
  • Method Details

    • normalizeXrefs

      public void normalizeXrefs(Model model, boolean usePrefixAsDbName)
      Normalizes xrefs to ease normalizing or merging other BioPAX objects later on, and also because some original xref URIs should in fact be used for different BioPAX types (for CV or ProteinReference instead); so, this will also replace URIs of xrefs having bad 'db' or 'id'.
      Parameters:
      model - biopax model to update
      usePrefixAsDbName - if possible, use CURIE prefix as xref.db instead of preferred name
    • uri

      public static String uri(String xmlBase, String dbName, String idPart, Class<? extends BioPAXElement> type)
      Generates a new BioPAX element URI using given URI namespace (xml:base), BioPAX class, and two different identifiers (at least one is required). ID registry data is used to get the standard db name and URI, if possible, for relationship type vocabulary, publication xref, entity reference, and bio source types.
      Parameters:
      xmlBase - xml:base (common URI prefix for a BioPAX model), case-sensitive
      dbName - a bio data collection name or synonym, case-insensitive
      idPart - optional (can be null), e.g., xref.id, case-sensitive
      type - BioPAX class
      Returns:
      URI
      Throws:
      IllegalArgumentException - if either type is null or both 'dbName' and 'idPart' are all nulls.
    • uri

      public static String uri(String xmlBase, String dbName, String idPart, Class<? extends BioPAXElement> type, boolean useRegistry)
      Generates a new BioPAX element URI using given URI namespace (xml:base), BioPAX class, and two different identifiers (at least one is required). Registry is optionally used to get the standard db name and URI, if possible.
      Parameters:
      xmlBase - xml:base (common URI prefix for a BioPAX model), case-sensitive
      dbName - a bio data collection name or synonym, case-insensitive
      idPart - optional (can be null), e.g., xref.id, case-sensitive
      type - BioPAX class
      useRegistry - use or not the ID types registry data
      Returns:
      URI
      Throws:
      IllegalArgumentException - if either type is null or both 'dbName' and 'idPart' are all nulls.
    • getDescription

      public String getDescription()
      Description of the model to normalize.
      Returns:
      info about the BioPAX model
    • setDescription

      public void setDescription(String description)
      Parameters:
      description - the description to set
    • normalize

      public void normalize(Model model)
      BioPAX normalization (modifies the original Model)
      Parameters:
      model - BioPAX model to normalize
      Throws:
      NullPointerException - if model is null
      IllegalArgumentException - if model is not Level3 BioPAX
    • normalize

      public void normalize(Model model, boolean usePrefixAsDbName)
      BioPAX normalization (modifies the original Model)
      Parameters:
      model - BioPAX model to normalize
      usePrefixAsDbName - if possible, use CURIE prefix as xref.db instead of preferred name
      Throws:
      NullPointerException - if model is null
      IllegalArgumentException - if model is not Level3 BioPAX
    • autoName

      public static void autoName(Provenance pro)
      Auto-generates standard and other names for the datasource from either its URI or one of the names (preferably - standard name)
      Parameters:
      pro - data source (BioPAX Provenance)
    • convertToLevel3

      public static String convertToLevel3(String biopaxData)
      Converts BioPAX L1 or L2 RDF/XML string data to BioPAX L3 string. WARN: this is not for huge (larger than 1GB) BioPAX RDF/XML data due to use of (UTF-8) String and Byte Array internally. This can be and is used by online web apps, such as the BioPAX Validator.
      Parameters:
      biopaxData - String
      Returns:
      BioPAX Level3 RDF/XML string
    • isFixDisplayName

      public boolean isFixDisplayName()
    • setFixDisplayName

      public void setFixDisplayName(boolean fixDisplayName)
    • getXmlBase

      public String getXmlBase()
    • setXmlBase

      public void setXmlBase(String xmlBase)