Package org.pathvisio.libgpml.util
Class XrefUtils
java.lang.Object
org.pathvisio.libgpml.util.XrefUtils
public class XrefUtils
extends java.lang.Object
This utils class contains methods for checking DataSource and creating Xref.
- Author:
- finterly
-
Constructor Summary
Constructors Constructor Description XrefUtils()
-
Method Summary
Modifier and Type Method Description static org.bridgedb.Xref
createXref(java.lang.String identifier, java.lang.String dataSource)
Instantiates anXref
given String identifier and dataSource.static org.bridgedb.Xref
createXref(java.lang.String identifier, org.bridgedb.DataSource dataSource)
Instantiates anXref
given String identifier and DataSource dataSource.static boolean
equivalentXrefs(org.bridgedb.Xref xref1, org.bridgedb.Xref xref2)
This method checks whether twoXref
(s) are equal in value.static org.bridgedb.DataSource
getDataSource(org.bridgedb.Xref xref)
Returns the identifier for givenXref
if valid, otherwise returns null.static java.lang.String
getIdentifier(org.bridgedb.Xref xref)
Returns the identifier for givenXref
if valid, otherwise returns empty String.static org.bridgedb.DataSource
getXrefDataSource(java.lang.String dataSourceStr)
ReturnsDataSource
object from given string.static java.lang.String
getXrefDataSourceStr(org.bridgedb.DataSource dataSource)
Returns string for data source givenDataSource
.static java.lang.String
getXrefDataSourceStrGPML2013a(org.bridgedb.DataSource dataSource)
Returns string for data source givenDataSource
for GPML2013a format.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
XrefUtils
public XrefUtils()
-
-
Method Details
-
createXref
public static org.bridgedb.Xref createXref(java.lang.String identifier, java.lang.String dataSource)Instantiates anXref
given String identifier and dataSource.getXrefDataSource(java.lang.String)
returns aDataSource
for string compact identifier prefix, fullName, or systemCode.- Parameters:
identifier
- the identifier of the database entry.dataSource
- the source of database entry.- Returns:
- the xref for given identifier and data source.
-
createXref
public static org.bridgedb.Xref createXref(java.lang.String identifier, org.bridgedb.DataSource dataSource)Instantiates anXref
given String identifier and DataSource dataSource. NB: Temporary Method? BridgeDB as of (15/04/2022) still allows the instantiation of and Xref with null DataSource. This is not desirable for some use cases.- Parameters:
identifier
- the identifier of the database entry.dataSource
- the source of database entry.- Returns:
- the xref for given identifier and data source.
-
getXrefDataSource
public static org.bridgedb.DataSource getXrefDataSource(java.lang.String dataSourceStr)ReturnsDataSource
object from given string. String may be either compact identifier prefix, full name, or system code for a data source. If no data source exists for the given string, registers the string as a new data source.- Parameters:
dataSourceStr
- the string for data source.- Returns:
- dataSource the data source for the given string.
-
getXrefDataSourceStr
public static java.lang.String getXrefDataSourceStr(org.bridgedb.DataSource dataSource)Returns string for data source givenDataSource
. Priority is compact identifier prefix string. If compact identifier prefix null, returns full name. If full name null, returns system code. If no data source exists, return null.- Parameters:
dataSource
- the data source.- Returns:
- dataSourceStr the string for given data source, or null if no valid data source string.
-
getXrefDataSourceStrGPML2013a
public static java.lang.String getXrefDataSourceStrGPML2013a(org.bridgedb.DataSource dataSource)Returns string for data source givenDataSource
for GPML2013a format. Priority is data source full name. If full name null, returns system code. If system code null, returns compact prefix identifier. If no data source exists, return null.- Parameters:
dataSource
- the data source.- Returns:
- dataSourceStr the string for given data source, or null if no valid data source string.
-
equivalentXrefs
public static boolean equivalentXrefs(org.bridgedb.Xref xref1, org.bridgedb.Xref xref2)This method checks whether twoXref
(s) are equal in value. Returns true if the given Xrefs are equal, false otherwise.- Returns:
- true if given xrefs equal, false otherwise.
-
getIdentifier
public static java.lang.String getIdentifier(org.bridgedb.Xref xref)Returns the identifier for givenXref
if valid, otherwise returns empty String.- Parameters:
xref
- the xref.- Returns:
- identifier the id for given xref.
-
getDataSource
public static org.bridgedb.DataSource getDataSource(org.bridgedb.Xref xref)Returns the identifier for givenXref
if valid, otherwise returns null.- Parameters:
xref
- the xref.- Returns:
- dataSource the dataSource for given xref.
-