Changeset 149

Show
Ignore:
Timestamp:
08/09/09 05:23:13 (2 years ago)
Author:
jgao
Message:

Checkstype fix

Location:
trunk/corelib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/corelib/src/org/bridgedb/webservice/IDMapperBiomart.java

    r146 r149  
    8181        } 
    8282 
    83     protected String datasetName; 
    84     protected BiomartStub stub; 
    85     protected boolean transitivity; 
    86     protected boolean idOnlyForTgtDataSource; 
    87  
    88     protected String baseURL; 
     83    private String datasetName; 
     84    private BiomartStub stub; 
     85    private boolean transitivity; 
     86    private boolean idOnlyForTgtDataSource; 
     87 
     88    private String baseURL; 
    8989 
    9090    private Map<DataSource, Filter> mapSrcDSFilter; 
     
    242242    } 
    243243 
     244    /** 
     245     * 
     246     * @return URL of the dataset 
     247     */ 
    244248    public String toString() { 
    245249        return getBaseURL()+"?dataset="+getDataset(); 
     
    249253     * {@inheritDoc} 
    250254     */ 
    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"); 
    254260        } 
    255261 
     
    257263 
    258264        // remove unsupported source datasources 
    259         Set<DataSource> supportedSrcDatasources = cap.getSupportedSrcDataSources(); 
     265        Set<DataSource> supportedSrcDatasources 
     266                    = cap.getSupportedSrcDataSources(); 
    260267        Map<DataSource, String> queryFilters = getQueryFilters(srcXrefs); 
    261268        Iterator<DataSource> it = queryFilters.keySet().iterator(); 
     
    345352    /** 
    346353     * Create filters from the source xrefs. 
    347      * @param srcXrefs 
     354     * @param srcXrefs source xrefs 
    348355     * @return map from data source to IDs 
    349356     */ 
     
    382389    /** 
    383390     * This code is bollowed from IDMapperClient from Cytoscape. 
    384      * @param tgtDataSources 
     391     * @param tgtDataSources target data sources 
     392     * @param filterName filter name 
    385393     * @return attributes 
    386394     */ 
     
    435443    } 
    436444 
     445    /** 
     446     * Get supported source data sources 
     447     * @return supported source data sources 
     448     * @throws IOException if failed to read the filters 
     449     */ 
    437450    protected Set<DataSource> getSupportedSrcDataSources() throws IOException { 
    438451        Set<DataSource> dss = new HashSet(); 
     
    452465    } 
    453466 
     467    /** 
     468     * Get supported target data sources 
     469     * @return supported target data sources 
     470     * @throws IOException if failed to read the filters 
     471     */ 
    454472    protected Set<DataSource> getSupportedTgtDataSources() throws IOException { 
    455473        Map<String, Attribute> attributeVals = stub.getAttributes(datasetName); 
  • trunk/corelib/test/org/bridgedb/TestBiomart.java

    r146 r149  
    6262                System.out.println ("\t" + ds.getName()); 
    6363                IDMapperBiomart idMapper = new IDMapperBiomart(ds.getName()); 
     64                //IDMapper idMapper = BridgeDb.connect("idmapper-biomart:dataset="+ds.getName()); 
    6465                IDMapperCapabilities cap = idMapper.getCapabilities(); 
    6566                if (cap.getSupportedSrcDataSources().isEmpty() 
     
    104105         
    105106         IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); 
     107         System.out.println("\n===Supported source data sources==="); 
    106108         for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources()) 
    107109         { 
    108110                 System.out.println (ds); 
    109111         } 
     112 
     113         System.out.println("\n===Supported target data sources==="); 
    110114         for (DataSource ds : mapper.getCapabilities().getSupportedTgtDataSources()) 
    111115         { 
     
    124128         //IDMapperBiomart mapper = new IDMapperBiomart("hsapiens_gene_ensembl"); 
    125129        IDMapper mapper = BridgeDb.connect ("idmapper-biomart:dataset=hsapiens_gene_ensembl"); 
     130        System.out.println("\n===Supported source data sources==="); 
    126131         for (DataSource ds : mapper.getCapabilities().getSupportedSrcDataSources()) 
    127132         { 
    128133                 System.out.println (ds); 
    129134         } 
     135 
     136         System.out.println("\n===Supported target data sources==="); 
    130137         for (DataSource ds : mapper.getCapabilities().getSupportedTgtDataSources()) 
    131138         {