Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow mapping with local databases too
  • Loading branch information
egonw committed Feb 16, 2012
1 parent a1c97b9 commit 56245bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Expand Up @@ -91,6 +91,10 @@ public Set<String> map(String restService, String identifier, String source) thr
return map(restService, identifier, source, null);
}

public Set<String> map(IDMapper database, String identifier, String source) throws BioclipseException {
return map(database, identifier, source, null);
}

public Set<String> map(String restService, String identifier, String source, String target) throws BioclipseException {
logger.debug("doing stuff...");

Expand All @@ -101,7 +105,11 @@ public Set<String> map(String restService, String identifier, String source, Str
} catch (IDMapperException exception) {
throw new BioclipseException("Could not connect to the REST service at: " + restService);
}

return map(mapper, identifier, source, target);
}

public Set<String> map(IDMapper database, String identifier, String source, String target) throws BioclipseException {
// We create an Xref instance for the identifier that we want to look up.
DataSource sourceObj = getSource(source);
Xref src = new Xref(identifier, sourceObj);
Expand All @@ -112,15 +120,15 @@ public Set<String> map(String restService, String identifier, String source, Str
if (target != null) {
DataSource targetObj = getSource(target);
try {
dests = mapper.mapID(src, targetObj);
dests = database.mapID(src, targetObj);
} catch (IDMapperException exception) {
throw new BioclipseException(
"Error while mapping the identifier: " + exception.getMessage()
);
}
} else {
try {
dests = mapper.mapID(src);
dests = database.mapID(src);
} catch (IDMapperException exception) {
throw new BioclipseException(
"Error while mapping the identifier: " + exception.getMessage()
Expand Down
Expand Up @@ -44,6 +44,22 @@ public interface IBridgedbManager extends IBioclipseManager {
)
public Set<String> map(String restService, String identifier, String source) throws BioclipseException;

@Recorded
@PublishedMethod(
methodSummary="Uses a local BridgeDB database service to map something identified into a source database " +
"to a target database.",
params="IDMapper database, String identifier, String source, String target"
)
public Set<String> map(IDMapper database, String identifier, String source, String target) throws BioclipseException;

@Recorded
@PublishedMethod(
methodSummary="Uses a local BridgeDB database to map something identified into a source database " +
"to any other known database.",
params="IDMapper database, String identifier, String source"
)
public Set<String> map(IDMapper database, String identifier, String source) throws BioclipseException;

@Recorded
@PublishedMethod(
methodSummary="Searches a BridgeDB REST service for the given query string, if the service supports searching.",
Expand Down

0 comments on commit 56245bc

Please sign in to comment.