Changeset 20766


Ignore:
Timestamp:
02/03/10 14:54:41 (2 years ago)
Author:
julie
Message:

only return orthologues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bio/tools/main/src/org/intermine/bio/logic/OrthologueLinkManager.java

    r20764 r20766  
    3737import org.intermine.objectstore.query.QueryClass; 
    3838import org.intermine.objectstore.query.QueryCollectionReference; 
     39import org.intermine.objectstore.query.QueryExpression; 
    3940import org.intermine.objectstore.query.QueryField; 
    4041import org.intermine.objectstore.query.QueryObjectReference; 
     42import org.intermine.objectstore.query.QueryValue; 
    4143import org.intermine.objectstore.query.Results; 
    4244import org.intermine.objectstore.query.ResultsRow; 
     45import org.intermine.objectstore.query.SimpleConstraint; 
    4346import org.intermine.util.PropertiesUtil; 
    4447 
     
    235238 
    236239            if (mineName.equals(localMineName)) { 
    237                 localMine.setUrl(url); 
    238                 localMine.setLogo(logo); 
    239                 setLocalOrthologues(); 
     240                if (localMine.getUrl() == null) { 
     241                    localMine.setUrl(url); 
     242                    localMine.setLogo(logo); 
     243                    setLocalOrthologues(); 
     244                } 
    240245                // skip, this is the local intermine. 
    241246                continue; 
     
    302307            QueryField qfDataset = new QueryField(qcDataset, "title"); 
    303308            QueryField qfHomologueOrganismName = new QueryField(qcHomologueOrganism, "shortName"); 
    304  
     309            QueryField qfType = new QueryField(qcHomologue, "type"); 
     310             
    305311            q.setDistinct(true); 
    306312 
     
    340346            q.setConstraint(cs); 
    341347 
     348            // gene.homologues.type = 'orthologue' 
     349            QueryExpression c6 = new QueryExpression(QueryExpression.LOWER, qfType); 
     350            cs.addConstraint(new SimpleConstraint(c6, ConstraintOp.EQUALS,  
     351                    new QueryValue("orthologue"))); 
     352             
     353            q.addToOrderBy(qfGeneOrganismName); 
     354             
    342355            Results results = im.getObjectStore().execute(q); 
    343356            Iterator it = results.iterator(); 
     
    348361                String geneOrganismName = (String) row.get(0); 
    349362                String dataset = (String) row.get(1); 
    350                 String homologueOrganismName = (String) row.get(1); 
     363                String homologueOrganismName = (String) row.get(2); 
    351364 
    352365                /** 
Note: See TracChangeset for help on using the changeset viewer.