| 74 | | |
| | 84 | |
| | 85 | public void testBioMartConnector() throws IOException, IDMapperException |
| | 86 | { |
| | 87 | // BiomartStub biomartStub = BiomartStub.getInstance(); |
| | 88 | // Map<String, Database> reg = null; |
| | 89 | // try { |
| | 90 | // reg = biomartStub.getRegistry(); |
| | 91 | // } catch (Exception e) { |
| | 92 | // e.printStackTrace(); |
| | 93 | // } |
| | 94 | // Set<Database> dbs = new HashSet(reg.size()); |
| | 95 | // for (Database db : reg.values()) { |
| | 96 | // //if (db.visible()) { |
| | 97 | // dbs.add(db); |
| | 98 | // //} |
| | 99 | // System.out.println (db.getName()); |
| | 100 | // } |
| | 101 | BiomartStub biomartStub = BiomartStub.getInstance(); |
| | 102 | |
| | 103 | Set<Dataset> datasets = new HashSet(biomartStub.getAvailableDatasets("ensembl")); |
| | 104 | |
| | 105 | IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); |
| | 106 | for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources()) |
| | 107 | { |
| | 108 | System.out.println (ds); |
| | 109 | } |
| | 110 | for (DataSource ds : mapper.getCapabilities().getSupportedTgtDataSources()) |
| | 111 | { |
| | 112 | System.out.println (ds); |
| | 113 | } |
| | 114 | } |
| | 115 | |
| | 116 | public void testBioMartConnector2() throws IOException, IDMapperException, ClassNotFoundException |
| | 117 | { |
| | 118 | BiomartStub biomartStub = BiomartStub.getInstance(); |
| | 119 | |
| | 120 | Class.forName("org.bridgedb.webservice.IDMapperBiomart"); |
| | 121 | |
| | 122 | biomartStub.getAvailableDatasets("ensembl"); |
| | 123 | |
| | 124 | //IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); |
| | 125 | IDMapper mapper = BridgeDb.connect ("idmapper-biomart:dataset=hsapiens_gene_ensembl"); |
| | 126 | for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources()) |
| | 127 | { |
| | 128 | System.out.println (ds); |
| | 129 | } |
| | 130 | for (DataSource ds : mapper.getCapabilities().getSupportedTgtDataSources()) |
| | 131 | { |
| | 132 | System.out.println (ds); |
| | 133 | } |
| | 134 | } |
| | 135 | |