import org.bridgedb.Xref;
import org.bridgedb.bio.BioDataSource;
import org.bridgedb.*;
import org.bridgedb.IDMapper;
public class BridgedbTest {
public static String[] bridgetest(){
String[] resultlist;
int resultidx = 0;
Class.forName("org.bridgedb.webservice.bridgerest.BridgeRest");
BioDataSource.init();
// now we connect to the driver and create a IDMapper instance.
IDMapper mapper = BridgeDb.connect ("idmapper-bridgerest:http://
webservice.bridgedb.org/Human");
// We create an Xref instance for the identifier that we want to look
up.
// In this case we want to look up Entrez gene 3643.
Xref src = new Xref ("3643", BioDataSource.ENTREZ_GENE);
// let's see if there are cross-references to Ensembl Human
Set<Xref> dests = mapper.mapID(src,
DataSource.getBySystemCode("EnHs"));
// and print the results.
// with getURN we obtain valid MIRIAM urn's if possible.
for (Xref dest : dests){
resultidx ++;
resultlist[resultidx] = " " + dest.getURN();
}
}
}
Errors:
BridgedbTest:22: cannot find symbol
symbol : class Set
location: class BridgedbTest
Set<Xref> dests = mapper.mapID(src,
DataSource.getBySystemCode("EnHs"));
^
1 error
"Set" is in the package java.util. Add the following line to fix the error:
import java.util.Set;
btw, this is not a BridgeDb related problem, this is normal Java coding
mistake.
regards,
Martijn