- Timestamp:
- 08/19/09 17:47:05 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/corelib/src/org/bridgedb/webservice/biomart/BiomartStub.java
r161 r166 23 23 import java.util.HashMap; 24 24 import java.util.HashSet; 25 import java.util.Iterator;26 25 import java.util.Map; 27 26 import java.util.Set; 28 import java.util.Vector;29 27 30 28 import javax.xml.parsers.ParserConfigurationException; 31 29 32 import org.bridgedb.DataSource;33 30 import org.bridgedb.IDMapperException; 34 import org.bridgedb.Xref;35 import org.bridgedb.file.IDMappingReaderFromDelimitedReader;36 31 import org.bridgedb.webservice.biomart.util.Attribute; 37 32 import org.bridgedb.webservice.biomart.util.BiomartClient; … … 44 39 45 40 /** 46 * Cache for SynergizerClient41 * Wrapp-up for BiomartClient. 47 42 * @author gjj 48 43 */ 49 public class BiomartStub {44 public final class BiomartStub { 50 45 public static final String defaultBaseURL 51 46 = BiomartClient.defaultBaseURL; 52 47 53 // cache data54 // private Map<String,Map<String,Map<String,Set<String>>>>55 // mapAuthSpeciesDomainRange = null;56 57 48 // one instance per url 58 49 private static Map<String, BiomartStub> instances = new HashMap(); … … 60 51 /** 61 52 * 62 * @return SynergizerStub with the default server url53 * @return BiomartStub with the default server url 63 54 * @throws IOException if failed to connect 64 55 */ … … 70 61 * 71 62 * @param baseUrl server url 72 * @return SynergizerStub from the server63 * @return BiomartStub from the server 73 64 * @throws IOException if failed to connect 74 65 */ … … 129 120 * @param mart mart name 130 121 * @return mart display name or null if not exist 131 * @throws IDMapperException if failed to connect132 122 */ 133 123 public String martDisplayName(String mart) { … … 142 132 /** 143 133 * 144 * @param authoritymart name134 * @param mart mart name 145 135 * @return available datasets from this mart 146 * @throws IDMapperException if failed147 136 */ 148 137 public Set<String> availableDatasets(String mart) … … 170 159 * @param dataset dataset name 171 160 * @return dataset display name or null if not exist 172 * @throws IDMapperException if failed to connect173 161 */ 174 162 public String datasetDisplayName(String dataset) { … … 211 199 /** 212 200 * 213 * @param mart mart name 214 * @param dataset dataset name 201 * @param mart mart name. 202 * @param dataset dataset name. 203 * @param idOnly filter the attributes ending with "ID" or "Accession" 204 * if true; no filter otherwise. 215 205 * @return attribute names / target id types of the dataset from this 216 * mart 206 * mart. 217 207 * @throws IDMapperException if failed. 218 208 */ … … 239 229 result = new HashSet(); 240 230 for (String name : attributes.keySet()) { 241 String displayName = client.getAttribute(dataset, name).getDisplayName(); 231 String displayName = client.getAttribute(dataset, name) 232 .getDisplayName(); 242 233 if (displayName.endsWith("ID") 243 234 || displayName.endsWith("Accession") … … 264 255 * key: source id 265 256 * value: corresponding target ids 266 * @throws IDMapperException 257 * @throws IDMapperException if failed to connect 267 258 */ 268 259 public Map<String,Set<String>[]> translate(final String mart,
