Package org.biopax.paxtools.normalizer
Class Normalizer
java.lang.Object
org.biopax.paxtools.normalizer.Normalizer
BioPAX (Level 3) Normalizer, an advanced BioPAX utility
to help pathway data integrating and linking.
- Author:
- rodche
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidautoName(Provenance pro) Auto-generates standard and other names for the datasource from either its URI or one of the names (preferably - standard name)static StringconvertToLevel3(String biopaxData) Converts BioPAX L1 or L2 RDF/XML string data to BioPAX L3 string.Description of the model to normalize.booleanvoidBioPAX normalization (modifies the original Model)voidBioPAX normalization (modifies the original Model)voidnormalizeXrefs(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'.voidsetDescription(String description) voidsetFixDisplayName(boolean fixDisplayName) voidsetXmlBase(String xmlBase) static StringGenerates a new BioPAX element URI using given URI namespace (xml:base), BioPAX class, and two different identifiers (at least one is required).static Stringuri(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).
-
Field Details
-
PROPERTY_NORMALIZER_URI_STRATEGY
- See Also:
-
VALUE_NORMALIZER_URI_STRATEGY_SIMPLE
- See Also:
-
VALUE_NORMALIZER_URI_STRATEGY_MD5
- See Also:
-
typeCodes
-
-
Constructor Details
-
Normalizer
public Normalizer()Constructor
-
-
Method Details
-
normalizeXrefs
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 updateusePrefixAsDbName- 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-sensitivedbName- a bio data collection name or synonym, case-insensitiveidPart- optional (can be null), e.g., xref.id, case-sensitivetype- 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-sensitivedbName- a bio data collection name or synonym, case-insensitiveidPart- optional (can be null), e.g., xref.id, case-sensitivetype- BioPAX classuseRegistry- 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
Description of the model to normalize.- Returns:
- info about the BioPAX model
-
setDescription
- Parameters:
description- the description to set
-
normalize
BioPAX normalization (modifies the original Model)- Parameters:
model- BioPAX model to normalize- Throws:
NullPointerException- if model is nullIllegalArgumentException- if model is not Level3 BioPAX
-
normalize
BioPAX normalization (modifies the original Model)- Parameters:
model- BioPAX model to normalizeusePrefixAsDbName- if possible, use CURIE prefix as xref.db instead of preferred name- Throws:
NullPointerException- if model is nullIllegalArgumentException- if model is not Level3 BioPAX
-
autoName
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
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
-
setXmlBase
-