diff --git a/batchmapper.bat b/batchmapper.bat index 4539b7bad..b504db7ad 100644 --- a/batchmapper.bat +++ b/batchmapper.bat @@ -1 +1 @@ -java -jar dist/bridgedb-batchmapper.jar %* \ No newline at end of file +java -jar dist/org.bridgedb.tools.batchmapper.jar %* \ No newline at end of file diff --git a/org.bridgedb.tools.batchmapper/src/org/bridgedb/tools/batchmapper/BatchMapper.java b/org.bridgedb.tools.batchmapper/src/org/bridgedb/tools/batchmapper/BatchMapper.java index 46cdd87fa..7667d77d4 100644 --- a/org.bridgedb.tools.batchmapper/src/org/bridgedb/tools/batchmapper/BatchMapper.java +++ b/org.bridgedb.tools.batchmapper/src/org/bridgedb/tools/batchmapper/BatchMapper.java @@ -92,7 +92,8 @@ public void printUsage() " [-c ]\n" + " [-r ] \n" + "\n" + - "You should specify at least one -g or -t option \n"); + "You should specify at least one -g or -t option.\n" + + "Multiple -g or -t options will be combined transitively.\n"); } public String parseArgs(Settings settings, String[] args) @@ -245,6 +246,7 @@ private void connectGdb() throws IDMapperException { gdb.addIDMapper(connectionString); } + gdb.setTransitive(true); } public void writeMapping() throws IOException, IDMapperException diff --git a/org.bridgedb/src/org/bridgedb/IDMapperStack.java b/org.bridgedb/src/org/bridgedb/IDMapperStack.java index 58db3aa1a..b03eae6c4 100644 --- a/org.bridgedb/src/org/bridgedb/IDMapperStack.java +++ b/org.bridgedb/src/org/bridgedb/IDMapperStack.java @@ -17,6 +17,7 @@ package org.bridgedb; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -437,13 +438,21 @@ private Set mapIDtransitive(Xref ref, DataSource... resultDs) throws IDMap { // first round Set result = new HashSet(); + Set dsFilter = new HashSet(Arrays.asList(resultDs)); for (IDMapper i : gdbs) { if (i == null || !i.isConnected()) continue; // map ref in IDMapper i Set round1 = i.mapID(ref); - result.addAll (round1); + + for (Xref r1 : round1) + { + if (resultDs.length == 0 || dsFilter.contains(r1.getDataSource())) + { + result.add (r1); + } + } // then map the result of that in all IDMappers j (j != i) for (IDMapper j : gdbs)