Changeset 161 for trunk/corelib/test/org/bridgedb/TestBiomart.java
- Timestamp:
- 08/19/09 05:53:32 (3 years ago)
- Files:
-
- 1 modified
-
trunk/corelib/test/org/bridgedb/TestBiomart.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/corelib/test/org/bridgedb/TestBiomart.java
r156 r161 17 17 package org.bridgedb; 18 18 19 import org.bridgedb.webservice.biomart.util.BiomartClient; 19 20 import buildsystem.Measure; 20 21 … … 30 31 import junit.framework.TestCase; 31 32 32 import org.bridgedb.webservice. IDMapperBiomart;33 import org.bridgedb.webservice.biomart.IDMapperBiomart; 33 34 import org.bridgedb.webservice.biomart.*; 34 35 … … 41 42 BiomartStub biomartStub = BiomartStub.getInstance(); 42 43 43 Map<String, Database> reg = null; 44 try { 45 reg = biomartStub.getRegistry(); 46 } catch (Exception e) { 47 e.printStackTrace(); 48 } 44 Set<String> marts = biomartStub.availableMarts(); 49 45 50 Set<Database> dbs = new HashSet(reg.size()); 51 for (Database db : reg.values()) { 52 //if (db.visible()) { 53 dbs.add(db); 54 //} 55 } 56 57 for (Database db : dbs) { 58 System.out.println (db.getName()); 59 Set<Dataset> datasets = new HashSet(biomartStub.getAvailableDatasets(db.getName())); 46 for (String mart : marts) { 47 System.out.println (mart); 48 Set<String> datasets = biomartStub.availableDatasets(mart); 60 49 int nds = datasets.size(); 61 for ( Datasetds : datasets) {62 System.out.println ("\t" + ds .getName());63 IDMapperBiomart idMapper = new IDMapperBiomart( db.getName(),ds.getName());50 for (String ds : datasets) { 51 System.out.println ("\t" + ds); 52 IDMapperBiomart idMapper = new IDMapperBiomart(mart, ds); 64 53 //IDMapper idMapper = BridgeDb.connect("idmapper-biomart:dataset="+ds.getName()); 65 54 IDMapperCapabilities cap = idMapper.getCapabilities(); … … 83 72 } 84 73 } 85 74 86 75 public void testBioMartConnector() throws IOException, IDMapperException 87 76 { … … 101 90 // } 102 91 //BiomartStub biomartStub = BiomartStub.getInstance(); 103 92 104 93 //Set<Dataset> datasets = new HashSet(biomartStub.getAvailableDatasets("ensembl")); 105 94 106 95 IDMapperBiomart mapper = new IDMapperBiomart("ensembl", "hsapiens_gene_ensembl"); 107 96 System.out.println("\n===Supported source data sources==="); … … 120 109 public void testBioMartConnector2() throws IOException, IDMapperException, ClassNotFoundException 121 110 { 122 BiomartStub biomartStub = BiomartStub.getInstance();123 111 124 Class.forName("org.bridgedb.webservice.IDMapperBiomart"); 125 126 biomartStub.getAvailableDatasets("ensembl"); 112 Class.forName("org.bridgedb.webservice.biomart.IDMapperBiomart"); 127 113 128 114 //IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); 129 IDMapper mapper = BridgeDb.connect ("idmapper-biomart: mart=ensembl&dataset=hsapiens_gene_ensembl");115 IDMapper mapper = BridgeDb.connect ("idmapper-biomart:id-type-filter=false@http://www.biomart.org/biomart/martservice?mart=ensembl&dataset=hsapiens_gene_ensembl"); 130 116 System.out.println("\n===Supported source data sources==="); 131 117 for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources())
