Changeset 149
- Timestamp:
- 08/09/09 05:23:13 (2 years ago)
- Location:
- trunk/corelib
- Files:
-
- 2 modified
-
src/org/bridgedb/webservice/IDMapperBiomart.java (modified) (8 diffs)
-
test/org/bridgedb/TestBiomart.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/corelib/src/org/bridgedb/webservice/IDMapperBiomart.java
r146 r149 81 81 } 82 82 83 pr otectedString datasetName;84 pr otectedBiomartStub stub;85 pr otectedboolean transitivity;86 pr otectedboolean idOnlyForTgtDataSource;87 88 pr otectedString baseURL;83 private String datasetName; 84 private BiomartStub stub; 85 private boolean transitivity; 86 private boolean idOnlyForTgtDataSource; 87 88 private String baseURL; 89 89 90 90 private Map<DataSource, Filter> mapSrcDSFilter; … … 242 242 } 243 243 244 /** 245 * 246 * @return URL of the dataset 247 */ 244 248 public String toString() { 245 249 return getBaseURL()+"?dataset="+getDataset(); … … 249 253 * {@inheritDoc} 250 254 */ 251 public Map<Xref, Set<Xref>> mapID(Set<Xref> srcXrefs, Set<DataSource> tgtDataSources) throws IDMapperException { 252 if (srcXrefs==null) { 253 throw new java.lang.IllegalArgumentException("srcXrefs cannot be null"); 255 public Map<Xref, Set<Xref>> mapID(Set<Xref> srcXrefs, 256 Set<DataSource> tgtDataSources) throws IDMapperException { 257 if (srcXrefs==null || tgtDataSources==null) { 258 throw new java.lang.IllegalArgumentException( 259 "srcXrefs or tgtDataSources cannot be null"); 254 260 } 255 261 … … 257 263 258 264 // remove unsupported source datasources 259 Set<DataSource> supportedSrcDatasources = cap.getSupportedSrcDataSources(); 265 Set<DataSource> supportedSrcDatasources 266 = cap.getSupportedSrcDataSources(); 260 267 Map<DataSource, String> queryFilters = getQueryFilters(srcXrefs); 261 268 Iterator<DataSource> it = queryFilters.keySet().iterator(); … … 345 352 /** 346 353 * Create filters from the source xrefs. 347 * @param srcXrefs 354 * @param srcXrefs source xrefs 348 355 * @return map from data source to IDs 349 356 */ … … 382 389 /** 383 390 * This code is bollowed from IDMapperClient from Cytoscape. 384 * @param tgtDataSources 391 * @param tgtDataSources target data sources 392 * @param filterName filter name 385 393 * @return attributes 386 394 */ … … 435 443 } 436 444 445 /** 446 * Get supported source data sources 447 * @return supported source data sources 448 * @throws IOException if failed to read the filters 449 */ 437 450 protected Set<DataSource> getSupportedSrcDataSources() throws IOException { 438 451 Set<DataSource> dss = new HashSet(); … … 452 465 } 453 466 467 /** 468 * Get supported target data sources 469 * @return supported target data sources 470 * @throws IOException if failed to read the filters 471 */ 454 472 protected Set<DataSource> getSupportedTgtDataSources() throws IOException { 455 473 Map<String, Attribute> attributeVals = stub.getAttributes(datasetName); -
trunk/corelib/test/org/bridgedb/TestBiomart.java
r146 r149 62 62 System.out.println ("\t" + ds.getName()); 63 63 IDMapperBiomart idMapper = new IDMapperBiomart(ds.getName()); 64 //IDMapper idMapper = BridgeDb.connect("idmapper-biomart:dataset="+ds.getName()); 64 65 IDMapperCapabilities cap = idMapper.getCapabilities(); 65 66 if (cap.getSupportedSrcDataSources().isEmpty() … … 104 105 105 106 IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); 107 System.out.println("\n===Supported source data sources==="); 106 108 for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources()) 107 109 { 108 110 System.out.println (ds); 109 111 } 112 113 System.out.println("\n===Supported target data sources==="); 110 114 for (DataSource ds : mapper.getCapabilities().getSupportedTgtDataSources()) 111 115 { … … 124 128 //IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); 125 129 IDMapper mapper = BridgeDb.connect ("idmapper-biomart:dataset=hsapiens_gene_ensembl"); 130 System.out.println("\n===Supported source data sources==="); 126 131 for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources()) 127 132 { 128 133 System.out.println (ds); 129 134 } 135 136 System.out.println("\n===Supported target data sources==="); 130 137 for (DataSource ds : mapper.getCapabilities().getSupportedTgtDataSources()) 131 138 {
