Package org.bridgedb
Class DataSourcePatterns
- java.lang.Object
-
- org.bridgedb.DataSourcePatterns
-
public final class DataSourcePatterns extends Object
Contains regular expression patterns for identifiers Can be used to guess the BioDataSource of an identifier of unknown origin.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<DataSource>getDataSourceMatches(String id)Look for all DataSource patterns that match a given input.static Map<DataSource,Pattern>getPatterns()static voidregisterPattern(DataSource key, Pattern value)Register a regex Pattern for recognizing a DataSource.
-
-
-
Method Detail
-
registerPattern
public static void registerPattern(DataSource key, Pattern value)
Register a regex Pattern for recognizing a DataSource.- Parameters:
key- the DataSource that may be recognized.value- the Pattern to look for.
-
getDataSourceMatches
public static Set<DataSource> getDataSourceMatches(String id)
Look for all DataSource patterns that match a given input.- Parameters:
id- to compare with registered patterns- Returns:
- set of patterns which matches the given id.
-
getPatterns
public static Map<DataSource,Pattern> getPatterns()
- Returns:
- all known data patterns, mapped to
their BioDataSource.
For example, this map will contain:
BioDataSource.ENSEMBL_HUMAN -> Pattern.compile("ENSG\d+")There is not guaranteed to be a Pattern for every BioDataSource constant.
-
-