Changeset 17102

Show
Ignore:
Timestamp:
10/10/08 16:11:16 (2 months ago)
Author:
kmr
Message:

Merge trunk changes into flybasemine branch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/kmr/flybasemine_branch

    • Property svn:mergeinfo changed from
      /branches/flymine_release_14_0_branch:16842-16843,16848-16849,16851-16855
      /tickets/ticket-1676:16929
      /tickets/ticket-1712:16914-16943
      /tickets/ticket-1752:16872-16886
      /trunk:17033
      to
      /branches/flymine_release_14_0_branch:16842-16843,16848-16849,16851-16855
      /tickets/ticket-1676:16929
      /tickets/ticket-1712:16914-16943
      /tickets/ticket-1752:16872-16886
      /trunk:17007-17101
  • branches/kmr/flybasemine_branch/bio-source-flybase-identifiers

    • Property svn:mergeinfo set
  • branches/kmr/flybasemine_branch/bio/core/main/resources/log4j.properties

    r16859 r17102  
    55#logger ROOT 
    66log4j.rootLogger=INFO, A1 
    7  
    8 #logger bioJava mapping 
    9 log4j.logger.org.flymine.bj=ERROR, BJ 
    10  
    11 #logger bioJava mapping utils 
    12 log4j.logger.org.flymine.bj.utils=ERROR, BJ 
    137 
    148################# 
     
    2923log4j.appender.A1.layout.ConversionPattern=%d{dd/MM/yy,HH:mm:ss} %-5p %37c %3x - %m%n 
    3024 
    31 #appender bj 
    32 #log4j.appender.BJ=org.apache.log4j.RollingFileAppender 
    33 #log4j.appender.BJ.File=bioJavaMapping.log 
    34 #log4j.appender.BJ.Append=false 
    35 #log4j.appender.BJ.MaxFileSize=5MB 
    36 #log4j.appender.BJ.layout=org.apache.log4j.PatternLayout 
    37 #log4j.appender.BJ.layout.ConversionPattern=%d{HH:mm:ss} %-5p %l - %m%n 
    38 #log4j.appender.BJ.layout.ConversionPattern=%d{HH:mm:ss} %25F:%L %5p - %m%n 
    3925 
     26 
  • branches/kmr/flybasemine_branch/bio/scripts/project_build

    r16948 r17102  
    44# The project.xml in the current directory controls which actions to 
    55# run/merge/postprocess. 
    6 # The database to dump will be found by reading the properties from $HOME/<mine_name>.properties 
     6# The database to dump will be found by reading the properties from $HOME/.intermine/<mine_name>.properties 
    77# where <mine_name> is the name of the directory where the script is run 
    88 
     
    169169my $current_directory = (getcwd() =~ m:.*/(.*):)[0]; 
    170170 
    171 my $properties_file = "$ENV{HOME}/$current_directory.properties"; 
     171my $properties_file = "$ENV{HOME}/.intermine/$current_directory.properties"; 
    172172if (defined $release) { 
    173173  $properties_file .= ".$release"; 
     
    336336  # such file or directory" error because some table/index files 
    337337  # (temporary tables maybe) disappear while being copied 
    338   for (my $i = 1; $i <= 25; $i++) { 
     338# Switching off retry for now - this way we get an error message to send to Postgres. 
     339#  for (my $i = 1; $i <= 25; $i++) { 
    339340    eval { 
    340341      spawn($pass, @createdb_command, @params); 
    341342    }; 
    342     if ($@) { 
    343       my $pause = $i * 5; 
    344       warn "failure ($@) - will try again in $pause seconds ...\n"; 
    345       sleep($pause); 
    346     } else { 
    347       last; 
    348     } 
    349   } 
    350  
    351   die "$@\n" if $@; 
     343#    if ($@) { 
     344#      my $pause = $i * 5; 
     345#      warn "failure ($@) - will try again in $pause seconds ...\n"; 
     346#      sleep($pause); 
     347#    } else { 
     348#      last; 
     349#    } 
     350#  } 
     351 
     352  die "Please report this error to Matthew, so he can send an error report to Postgres\n$@\n" if $@; 
    352353} 
    353354 
  • branches/kmr/flybasemine_branch/bio/sources/chado-db/chado-db_additions.xml

    r16942 r17102  
    1111    <collection name="CDSs" referenced-type="org.flymine.model.genomic.CDS" reverse-reference="gene" ordered="true"/> 
    1212    <collection name="alleles" referenced-type="org.flymine.model.genomic.Allele" reverse-reference="gene" ordered="true"/> 
     13    <collection name="clones" referenced-type="org.flymine.model.genomic.CDNAClone" reverse-reference="gene"/> 
    1314  </class> 
    1415  <class name="org.flymine.model.genomic.InsertionSite" extends="org.flymine.model.genomic.BioEntity" is-interface="true"> 
     
    7576  </class> 
    7677  <class name="org.flymine.model.genomic.CDNAClone" extends="org.flymine.model.genomic.BioEntity" is-interface="true"> 
    77     <reference name="gene" referenced-type="org.flymine.model.genomic.Gene"/> 
     78    <reference name="gene" referenced-type="org.flymine.model.genomic.Gene" reverse-reference="clones"/> 
    7879    <reference name="MRNA" referenced-type="org.flymine.model.genomic.MRNA"/> 
    7980    <reference name="EST" referenced-type="org.flymine.model.genomic.EST"/> 
  • branches/kmr/flybasemine_branch/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ChadoSequenceProcessor.java

    r16831 r17102  
    153153        processFeaturePropTable(connection); 
    154154        extraProcessing(connection, featureMap); 
     155        finishedProcessing(connection, featureMap); 
    155156    } 
    156157 
     
    426427     * @param connection the Connection 
    427428     */ 
    428     @SuppressWarnings("unused") 
    429429    protected void earlyExtraProcessing(Connection connection) { 
    430         // empt
     430        // override in subclasses as necessar
    431431    } 
    432432 
     
    438438     * @throws SQLException if there is a problem 
    439439     */ 
    440     @SuppressWarnings("unused") 
    441440    protected void extraProcessing(Connection connection, 
    442441                                   Map<Integer, FeatureData> featureDataMap) 
     442        throws ObjectStoreException, SQLException { 
     443        // override in subclasses as necessary 
     444    } 
     445 
     446    /** 
     447     * Perform any actions needed after all processing is finished. 
     448     * @param connection the Connection 
     449     * @param featureDataMap a map from chado feature_id to data for that feature 
     450     * @throws ObjectStoreException if there is a problem while storing 
     451     * @throws SQLException if there is a problem 
     452     */ 
     453    protected void finishedProcessing(Connection connection, 
     454                                    Map<Integer, FeatureData> featureDataMap) 
    443455        throws ObjectStoreException, SQLException { 
    444456        // override in subclasses as necessary 
     
    535547     * @throws ObjectStoreException if there is a problem while storing 
    536548     */ 
    537     @SuppressWarnings("unused") 
    538549    protected Item makeLocation(int start, int end, int strand, FeatureData srcFeatureData, 
    539550                                FeatureData featureData, int taxonId) 
  • branches/kmr/flybasemine_branch/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeFeatureProcessor.java

    r16831 r17102  
    4747         "five_prime_untranslated_region", 
    4848         "five_prime_UTR", "three_prime_untranslated_region", 
    49          "three_prime_UTR", "origin_of_replication",  
     49         "three_prime_UTR", "origin_of_replication", 
    5050         "binding_site", "protein_binding_site", "transcript_region" 
    5151    ); 
     
    8282     * (see createFeatureTempTable in ChadoSequenceProcessor) 
    8383     * queryList?? 
    84      *  
     84     * 
    8585     */ 
    8686    /** 
     
    9191        String queryList = forINclause(); 
    9292 
    93         return "cvterm.name = 'chromosome' OR cvterm.name = 'chromosome_arm' OR feature_id IN " 
    94             + " (SELECT feature_id " 
     93        return "(cvterm.name = 'chromosome' OR cvterm.name = 'chromosome_arm') AND " 
     94            + "  feature_id IN (select srcfeature_id from featureloc WHERE " 
     95            + "               featureloc.feature_id IN " 
     96            + " (SELECT data_feature.feature_id " 
     97            + "   FROM data_feature " 
     98            + "   WHERE data_id IN (" + queryList + ")))" 
     99            + "OR feature_id IN " 
     100            + " (SELECT data_feature.feature_id " 
    95101            + "   FROM data_feature " 
    96102            + "   WHERE data_id IN (" + queryList + "))"; 
     
    194200    } 
    195201 
    196      
     202 
    197203 
    198204    /** 
  • branches/kmr/flybasemine_branch/bio/sources/uniprot/main/src/org/intermine/bio/dataconversion/UniprotConverter.java

    r16761 r17102  
    476476                    } else if (qName.equals("property") && stack.peek().equals("dbReference") 
    477477                                    && attrs.getValue("type").equals("organism name") 
    478                                     && (attrs.getValue("value").equals("Homo sapiens") 
    479                                     || attrs.getValue("value").equals("Apis mellifera"))) { 
     478                                    && attrs.getValue("value").equals("Apis mellifera")) { 
    480479                        if ((possibleGeneIdSource != null) && (possibleGeneId != null)) { 
    481480                            // we probably don't have a <gene> reference 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ChromosomeDistributionDataSetLdr.java

    r15898 r17102  
    1919 
    2020import org.flymine.model.genomic.Chromosome; 
    21 import org.flymine.model.genomic.LocatedSequenceFeature; 
    2221import org.flymine.model.genomic.Organism; 
    2322import org.intermine.bio.web.logic.BioUtil; 
     
    7978        chromosomeList = BioUtil.getChromosomes(os, Arrays.asList(organismName.toLowerCase()), 
    8079                                                false); 
    81  
     80        // used for not analysed figure 
    8281        calcTotal(bag, organismName); 
    8382 
    84         /* initialise results list - so all chromosomes are displayed */ 
     83        // initialise results list - so all chromosomes are displayed 
    8584        for (Iterator<String> chrIter = chromosomeList.iterator(); chrIter.hasNext();) { 
    8685            String chromosomeName = chrIter.next(); 
    8786            int[] count = new int[3]; 
    88             count[0] = 0;   // actual 
     87            count[0] = 0;   // actual - total in bag 
    8988            count[1] = 0;   // expected 
    90             count[2] = 0;   // total 
     89            count[2] = 0;   // total in database 
    9190            resultsTable.put(chromosomeName, count); 
    9291        } 
    9392 
     93        // calculate chromsome, gene.count for genes in list 
     94        int totalInBagWithLocation = addActual(resultsTable, organismName, bag); 
     95 
     96        // calculate chromsome, gene.count for genes in database 
     97        int totalInDBWithLocation = addExpected(resultsTable, organismName); 
     98 
     99        // calculate expected gene.count for each chromosome 
     100        for (String chromosome : resultsTable.keySet()) { 
     101            double expectedValue = 0; 
     102            double proportion = 0.0000000000; 
     103            double totalInDBWithChromosome = (resultsTable.get(chromosome))[2]; 
     104 
     105            if (totalInDBWithChromosome > 0) { 
     106                proportion = totalInDBWithChromosome / totalInDBWithLocation; 
     107            } 
     108            expectedValue = totalInBagWithLocation * proportion; 
     109            if (resultsTable.get(chromosome) != null) { 
     110                (resultsTable.get(chromosome))[1] = (int) Math.round(expectedValue); 
     111            } 
     112        } 
     113 
     114        // put all data in dataset rendered in graph 
     115        dataSet = new DefaultCategoryDataset(); 
     116        for (Iterator<String> iterator = resultsTable.keySet().iterator(); iterator.hasNext();) { 
     117            String chromosome = iterator.next(); 
     118            dataSet.addValue((resultsTable.get(chromosome))[0], "Actual", chromosome); 
     119            dataSet.addValue((resultsTable.get(chromosome))[1], "Expected", chromosome); 
     120        } 
     121    } 
     122 
     123    /** 
     124     * {@inheritDoc} 
     125     */ 
     126    public CategoryDataset getDataSet() { 
     127        return dataSet; 
     128    } 
     129 
     130    @SuppressWarnings("unchecked") 
     131    private int addExpected(HashMap<String, int[]> resultsTable, String organismName) 
     132        throws ClassNotFoundException { 
     133 
     134        // get counts of gene in database for gene 
     135        Query q = getQuery(organismName, "expected", null); 
     136        if (q == null) { 
     137            return 0; 
     138        } 
     139        Results res = os.execute(q); 
     140        Iterator iter = res.iterator(); 
     141        int grandTotal = 0; 
     142 
     143        while (iter.hasNext()) { 
     144            ResultsRow resRow = (ResultsRow) iter.next(); 
     145 
     146            String chromosome = (String) resRow.get(0);         // chromosome 
     147            Long geneCount = (java.lang.Long) resRow.get(1);    // genecount 
     148 
     149            // record total number of genes for this chromosome 
     150            (resultsTable.get(chromosome))[2] = geneCount.intValue(); 
     151            // increase total amount of genes with chromosomes 
     152            grandTotal += geneCount.intValue(); 
     153        } 
     154 
     155        return grandTotal; 
     156    } 
     157 
     158    @SuppressWarnings("unchecked") 
     159    private int addActual(HashMap<String, int[]> resultsTable, String organismName, 
     160                          InterMineBag bag) 
     161        throws ClassNotFoundException { 
     162        // query for chromosome, gene.count for genes in list 
    94163        Query q = getQuery(organismName, "actual", bag); 
    95  
    96         if (q == null) { 
    97             return; 
    98         } 
    99  
    100164        results = os.execute(q); 
    101165        results.setBatchSize(50000); 
     
    112176            String chromosome = (String) resRow.get(0); 
    113177            Long geneCount = (java.lang.Long) resRow.get(1); 
     178            // set the gene.count for genes in this bag with this chromosome 
    114179            (resultsTable.get(chromosome))[0] = geneCount.intValue(); 
     180            // increase total 
    115181            totalInBagWithLocation += geneCount.intValue(); 
    116182        } 
    117  
    118         int grandTotal = addExpected(resultsTable, organismName); 
    119  
    120         for (String chromosome : resultsTable.keySet()) { 
    121  
    122             double expectedValue = 0; 
    123             double proportion = 0.0000000000; 
    124             double totalWithChromosome = (resultsTable.get(chromosome))[2]; 
    125  
    126             if (totalWithChromosome > 0) { 
    127                 proportion = totalWithChromosome / grandTotal; 
    128             } 
    129             expectedValue = totalInBagWithLocation * proportion; 
    130             if (resultsTable.get(chromosome) != null) { 
    131                 (resultsTable.get(chromosome))[1] = (int) Math.round(expectedValue); 
    132             } 
    133         } 
    134  
    135         dataSet = new DefaultCategoryDataset(); 
    136         for (Iterator<String> iterator = resultsTable.keySet().iterator(); iterator.hasNext();) { 
    137             String chromosome = iterator.next(); 
    138             dataSet.addValue((resultsTable.get(chromosome))[0], "Actual", chromosome); 
    139             dataSet.addValue((resultsTable.get(chromosome))[1], "Expected", chromosome); 
    140         } 
    141     } 
    142  
    143     /** 
    144      * {@inheritDoc} 
    145      */ 
    146     public CategoryDataset getDataSet() { 
    147         return dataSet; 
    148     } 
    149  
    150     @SuppressWarnings("unchecked") 
    151     private int addExpected(HashMap<String, int[]> resultsTable, String organismName) 
    152         throws ClassNotFoundException { 
    153  
    154         // get counts of gene in database for gene 
    155         Query q = getQuery(organismName, "expected", null); 
    156         if (q == null) { 
    157             return 0; 
    158         } 
    159         Results res = os.execute(q); 
    160         Iterator iter = res.iterator(); 
    161         int grandTotal = 0; 
    162  
    163         while (iter.hasNext()) { 
    164             ResultsRow resRow = (ResultsRow) iter.next(); 
    165  
    166             String chromosome = (String) resRow.get(0);         // chromosome 
    167             Long geneCount = (java.lang.Long) resRow.get(1);    // genecount 
    168  
    169             (resultsTable.get(chromosome))[2] = geneCount.intValue(); 
    170             grandTotal += geneCount.intValue(); 
    171         } 
    172  
    173         return grandTotal; 
     183        return totalInBagWithLocation; 
    174184    } 
    175185 
     
    180190        QueryClass chromosomeQC = new QueryClass(Chromosome.class); 
    181191        Class<?> bagCls = Class.forName(model.getPackageName() + "." + bagType); 
    182         QueryClass featureQC; 
    183  
     192        QueryClass featureQC = new QueryClass(bagCls); 
     193 
     194        /* TODO we need to figure out another way to do this, this returns the wrong data */ 
    184195        // query LocatedSequenceFeature if possible for better chance of using precompute 
    185         if (LocatedSequenceFeature.class.isAssignableFrom(bagCls)) { 
    186             featureQC = new QueryClass(LocatedSequenceFeature.class); 
    187         } else { 
    188             featureQC = new QueryClass(bagCls); 
    189         } 
     196//        if (LocatedSequenceFeature.class.isAssignableFrom(bagCls)) { 
     197//            featureQC = new QueryClass(LocatedSequenceFeature.class); 
     198//        } else { 
     199//            featureQC = new QueryClass(bagCls); 
     200//        } 
    190201 
    191202        QueryField chromoQF = new QueryField(chromosomeQC, "primaryIdentifier"); 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ChromosomeDistributionGraphURLGenerator.java

    r16586 r17102  
    2525public class ChromosomeDistributionGraphURLGenerator implements GraphCategoryURLGenerator 
    2626{ 
    27     String bagName; 
    28     String organism = null; 
     27    private String bagName; 
     28    private String organism = null; 
    2929 
    3030    /** 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/HomologueURLQuery.java

    r16586 r17102  
    1111 */ 
    1212 
    13 import java.util.ArrayList; 
    14 import java.util.Collection; 
    15  
    16 import org.intermine.model.InterMineObject; 
    1713import org.intermine.objectstore.ObjectStore; 
    1814import org.intermine.pathquery.Constraints; 
     
    2925{ 
    3026 
    31     InterMineBag bag; 
    32     String key; 
    33     ObjectStore os; 
     27    private InterMineBag bag; 
     28    private String key; 
     29    private ObjectStore os; 
    3430 
    3531    /** 
     
    4743     * {@inheritDoc} 
    4844     */ 
    49     public PathQuery generatePathQuery(Collection<InterMineObject> keys) { 
     45    public PathQuery generatePathQuery() { 
    5046        PathQuery q = new PathQuery(os.getModel()); 
    51         q.setView("Gene.primaryIdentifier,Gene.symbol,Gene.organism.name," 
    52                   + "Gene.homologues.homologue.primaryIdentifier," 
    53                   + "Gene.homologues.homologue.symbol," 
    54                   + "Gene.homologues.homologue.organism.name," 
    55                   + "Gene.homologues.type"); 
    56         String bagType = bag.getType(); 
    57         q.addConstraint(bagType,  Constraints.in(bag.getName())); 
    58         if (keys != null) { 
    59             q.addConstraint(bagType,  Constraints.notIn(new ArrayList(keys))); 
    60             q.setConstraintLogic("A and B"); 
    61         } else { 
    62             q.addConstraint("Gene.homologues.homologue.organism",  Constraints.lookup(key)); 
    63             q.addConstraint("Gene.homologues.type",  Constraints.eq("orthologue")); 
    64             q.setConstraintLogic("A and B and C"); 
    65         } 
     47        String paths = "Gene.primaryIdentifier,Gene.symbol,Gene.organism.name," 
     48                + "Gene.homologues.homologue.primaryIdentifier,Gene.homologues.homologue.symbol," 
     49                + "Gene.homologues.homologue.organism.name,Gene.homologues.type"; 
     50        q.setView(paths); 
     51        q.addConstraint(bag.getType(), Constraints.in(bag.getName())); 
     52        q.addConstraint("Gene.homologues.homologue.organism", Constraints.lookup(key)); 
     53        q.addConstraint("Gene.homologues.type", Constraints.eq("orthologue")); 
     54        q.setConstraintLogic("A and B and C"); 
    6655        q.syncLogicExpression("and"); 
    67         q.setOrderBy("Gene.organism.name,Gene.primaryIdentifier," 
    68                      + "Gene.homologues.homologue.organism.name," 
    69                      + "Gene.homologues.homologue.primaryIdentifier"); 
     56        String orderby = "Gene.organism.name,Gene.primaryIdentifier," 
     57            + "Gene.homologues.homologue.organism.name,Gene.homologues.homologue.primaryIdentifier"; 
     58        q.setOrderBy(orderby); 
    7059        return q; 
    7160    } 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/PathwayURLQuery.java

    r16586 r17102  
    1111 */ 
    1212 
    13 import java.util.ArrayList; 
    14 import java.util.Collection; 
    15  
    16 import org.intermine.model.InterMineObject; 
    1713import org.intermine.objectstore.ObjectStore; 
    1814import org.intermine.pathquery.Constraints; 
     
    2925{ 
    3026 
    31     InterMineBag bag; 
    32     String key; 
    33     ObjectStore os; 
     27    private InterMineBag bag; 
     28    private String key; 
     29    private ObjectStore os; 
    3430 
    3531    /** 
     
    4743     * {@inheritDoc} 
    4844     */ 
    49     public PathQuery generatePathQuery(Collection<InterMineObject> keys) { 
     45    public PathQuery generatePathQuery() { 
    5046        PathQuery q = new PathQuery(os.getModel()); 
    5147        q.setView("Gene.secondaryIdentifier,Gene.primaryIdentifier,Gene.name,Gene.organism.name," 
    5248                  + "Gene.pathways.identifier,Gene.pathways.name"); 
    53         String bagType = bag.getType(); 
    54         q.addConstraint(bagType,  Constraints.in(bag.getName())); 
    55         if (keys != null) { 
    56             q.addConstraint(bagType,  Constraints.notIn(new ArrayList(keys))); 
    57         } else { 
    58             q.addConstraint("Gene.pathways",  Constraints.lookup(key)); 
    59         } 
     49        q.addConstraint(bag.getType(), Constraints.in(bag.getName())); 
     50        q.addConstraint("Gene.pathways", Constraints.lookup(key)); 
    6051        q.setConstraintLogic("A and B"); 
    6152        q.syncLogicExpression("and"); 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ProteinInteractionURLQuery.java

    r16586 r17102  
    1111 */ 
    1212 
    13 import java.util.ArrayList; 
    14 import java.util.Collection; 
    15  
    16 import org.intermine.model.InterMineObject; 
    1713import org.intermine.objectstore.ObjectStore; 
    1814import org.intermine.pathquery.Constraints; 
     
    2824{ 
    2925 
    30     InterMineBag bag; 
    31     String key; 
    32     ObjectStore os; 
     26    private InterMineBag bag; 
     27    private String key; 
     28    private ObjectStore os; 
    3329 
    3430    /** 
     
    4642     * {@inheritDoc} 
    4743     */ 
    48     public PathQuery generatePathQuery(Collection<InterMineObject> keys) { 
    49  
    50  
     44    public PathQuery generatePathQuery() { 
    5145        PathQuery q = new PathQuery(os.getModel()); 
    52  
    5346        q.setView("Protein.primaryIdentifier, Protein.primaryAccession," 
    5447                  + "Protein.proteinInteractions.interactingProteins.primaryIdentifier," 
     
    5851                  + "Protein.proteinInteractions.proteinRole," 
    5952                  + "Protein.proteinInteractions.experiment.publication.pubMedId"); 
    60  
    61         String bagType = bag.getType(); 
    62  
    63         q.addConstraint(bagType,  Constraints.in(bag.getName())); 
    64  
    65         if (keys != null) { 
    66             q.addConstraint(bagType,  Constraints.notIn(new ArrayList(keys))); 
    67         } else { 
    68             q.addConstraint("Protein.proteinInteractions.interactingProteins", 
    69                             Constraints.lookup(key)); 
    70         } 
     53        q.addConstraint(bag.getType(), Constraints.in(bag.getName())); 
     54        q.addConstraint("Protein.proteinInteractions.interactingProteins", Constraints.lookup(key)); 
    7155        q.setConstraintLogic("A and B"); 
    7256        q.syncLogicExpression("and"); 
    73  
    7457        q.setOrderBy("Protein.primaryIdentifier, Protein.primaryAccession," 
    7558                     + "Protein.proteinInteractions.interactingProteins.name"); 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/PublicationURLQuery.java

    r16586 r17102  
    1111 */ 
    1212 
    13 import java.util.ArrayList; 
    14 import java.util.Collection; 
    15  
    16 import org.intermine.model.InterMineObject; 
    1713import org.intermine.objectstore.ObjectStore; 
    1814import org.intermine.pathquery.Constraints; 
     
    2824{ 
    2925 
    30     InterMineBag bag; 
    31     String key; 
    32     ObjectStore os; 
     26    private InterMineBag bag; 
     27    private String key; 
     28    private ObjectStore os; 
    3329 
    3430    /** 
     
    4642     * {@inheritDoc} 
    4743     */ 
    48     public PathQuery generatePathQuery(Collection<InterMineObject> keys) { 
     44    public PathQuery generatePathQuery() { 
    4945        PathQuery q = new PathQuery(os.getModel()); 
    50         q.setView("Gene.secondaryIdentifier,Gene.primaryIdentifier,Gene.name,Gene.organism.name"); 
    51         if (keys == null) { 
    52             q.addView("Gene.publications.title,Gene.publications.firstAuthor," 
     46        q.setView("Gene.secondaryIdentifier,Gene.primaryIdentifier,Gene.name,Gene.organism.name" 
     47                      + "Gene.publications.title,Gene.publications.firstAuthor," 
    5348                      + "Gene.publications.journal,Gene.publications.year," 
    5449                      + "Gene.publications.pubMedId"); 
    55             q.setOrderBy("Gene.publications.pubMedId"); 
    56         } 
    57         q.setOrderBy("Gene.primaryIdentifier"); 
    58         String bagType = bag.getType(); 
    59         q.addConstraint(bagType,  Constraints.in(bag.getName())); 
    60         if (keys != null) { 
    61             q.addConstraint(bagType,  Constraints.notIn(new ArrayList(keys))); 
    62         } else { 
    63             q.addConstraint("Gene.publications",  Constraints.lookup(key)); 
    64         } 
     50        q.setOrderBy("Gene.publications.pubMedId, Gene.primaryIdentifier"); 
     51        q.addConstraint(bag.getType(), Constraints.in(bag.getName())); 
     52        q.addConstraint("Gene.publications", Constraints.lookup(key)); 
    6553        q.setConstraintLogic("A and B"); 
    6654        q.syncLogicExpression("and"); 
  • branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/UniProtFeaturesURLQuery.java

    r16586 r17102  
    1111 */ 
    1212 
    13 import java.util.ArrayList; 
    14 import java.util.Collection; 
    15  
    16 import org.intermine.model.InterMineObject; 
    1713import org.intermine.objectstore.ObjectStore; 
    1814import org.intermine.pathquery.Constraints; 
     
    2824{ 
    2925 
    30     InterMineBag bag; 
    31     String key; 
    32     ObjectStore os; 
     26    private InterMineBag bag; 
     27    private String key; 
     28    private ObjectStore os; 
    3329 
    3430    /** 
     
    4642     * {@inheritDoc} 
    4743     */ 
    48     public PathQuery generatePathQuery(Collection<InterMineObject> keys) { 
    49        PathQuery q = new PathQuery(os.getModel()); 
    50        q.setView("Protein.primaryIdentifier,Protein.primaryAccession,Protein.organism.name"); 
    51         if (keys == null) { 
    52             q.addView("Protein.features.feature.name,Protein.features.description," 
     44    public PathQuery generatePathQuery() { 
     45        PathQuery q = new PathQuery(os.getModel()); 
     46        q.setView("Protein.primaryIdentifier,Protein.primaryAccession,Protein.organism.name" 
     47                      + "Protein.features.feature.name,Protein.features.description," 
    5348                      + "Protein.features.begin,Protein.features.end"); 
    54             q.setOrderBy("Protein.features.feature.name"); 
    55         } 
    56         q.addOrderBy("Protein.primaryAccession"); 
    57         String bagType = bag.getType(); 
    58         q.addConstraint(bagType,  Constraints.in(bag.getName())); 
    59         if (keys != null) { 
    60             q.addConstraint(bagType,  Constraints.notIn(new ArrayList(keys))); 
    61         } else { 
    62             q.addConstraint("Protein.features.feature",  Constraints.lookup(key)); 
    63         } 
     49        q.setOrderBy("Protein.features.feature.name, Protein.primaryAccession"); 
     50        q.addConstraint(bag.getType(), Constraints.in(bag.getName())); 
     51        q.addConstraint("Protein.features.feature", Constraints.lookup(key)); 
    6452        q.setConstraintLogic("A and B"); 
    6553        q.syncLogicExpression("and"); 
  • branches/kmr/flybasemine_branch/flybase-gene-names

    • Property svn:mergeinfo set
  • branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/Dependencies.java

    r15510 r17102  
    155155        String executePathId = type + ".execute.path"; 
    156156        String artifactPathId = type + ".artifact.path"; 
    157  
     157        String extraDependenciesId = "extra.dependencies"; 
     158         
    158159        // Don't run twice if target not specified. 
    159160        if (getProject().getReference(compilePathId) != null && target == null) { 
     
    206207        executeFileSet.setDir(new File(workspaceBaseDir.replace('/', File.separatorChar))); 
    207208        executeFileSet.setProject(getProject()); 
    208  
     209         
    209210        String compileIncludes = ""; 
    210211        String dependIncludes = ""; 
    211212        String executeIncludes = ""; 
     213        String extraDependenciesIncludes = ""; 
    212214 
    213215        FileSet artifactFileSet = new FileSet(); 
     
    220222        getProject().addReference(executePathId, executePath); 
    221223        getProject().addReference(artifactPathId, artifactPath); 
    222  
     224         
    223225        String projName = calcThisProjectName(); 
    224226 
     
    260262        dependIncludes += projName + "/lib/*.jar "; 
    261263        executeIncludes += projName + "/lib/*.jar "; 
    262  
     264         
    263265        for (int i = 0; i < allProjectNames.size(); i++) { 
    264266            String depName = (String) allProjectNames.get(i); 
     
    336338 
    337339                artifactIncludes += depName + "/dist/* "; 
     340            } else { 
     341                extraDependenciesIncludes += depName + "/dist/* "; 
     342                extraDependenciesIncludes += depName + "/lib/*.jar "; 
    338343            } 
    339344        } 
     
    353358            getProject().addReference(executePathId + ".fileset.text", executeIncludes); 
    354359        } 
     360 
     361 
     362        // add the extra dependencies fileset even if it is empty 
     363        getProject().addReference(extraDependenciesId  
     364                + ".fileset.text", extraDependenciesIncludes); 
     365        //String key = extraDependenciesPathId + ".fileset.text"; 
     366        //System.out.println("KEY " + key); 
     367        //getProject().addReference("monkey"  
     368        //          + ".fileset.text", extraDependenciesIncludes); 
    355369 
    356370        if (artifactIncludes.length() > 0) { 
  • branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/Integrate.java

    r14641 r17102  
    5555    private File projectXml; 
    5656    private Project intermineProject; 
    57     private String action, source
     57    private String action, sourceAttribute
    5858    private File workspaceBaseDir; 
    5959 
     
    7979     */ 
    8080    public void setSource(String source) { 
    81         this.source = source; 
     81        this.sourceAttribute = source; 
    8282    } 
    8383 
     
    102102            throw new BuildException("no workspaceBaseDir specified"); 
    103103        } 
    104         if (source == null || source.trim().equals("")) { 
     104        if (sourceAttribute == null || sourceAttribute.trim().equals("")) { 
    105105            throw new BuildException("no source set, try \"ant -Dsource=all\" or " 
    106106                                     + "\"ant -Dsource=source1,source2\""); 
     
    123123        System.out.print("Found " + intermineProject.getSources().size() + " sources" + "\n"); 
    124124 
    125         List<String> sources = new ArrayList<String>(); 
    126  
    127         if (source.equals("") || source.equals("all")) { 
     125        List<String> sourceNames = new ArrayList<String>(); 
     126 
     127        if (sourceAttribute.equals("") || sourceAttribute.equals("all")) { 
    128128            Iterator iter = intermineProject.getSources().entrySet().iterator(); 
    129129            while (iter.hasNext()) { 
    130130                String thisSource = (String) ((Map.Entry) iter.next()).getKey(); 
    131                 sources.add(thisSource); 
     131                sourceNames.add(thisSource); 
    132132            } 
    133133        } else { 
    134             Vector<String> bits = StringUtils.split(source, ','); 
     134            Vector<String> bits = StringUtils.split(sourceAttribute, ','); 
    135135            for (String bit: bits) { 
    136                 sources.add(bit); 
    137             } 
    138         } 
    139  
    140         for (String thisSource: sources) { 
    141             if (intermineProject.getSources().get(thisSource) == null) { 
     136                sourceNames.add(bit); 
     137            } 
     138        } 
     139 
     140        for (String thisSourceName: sourceNames) { 
     141            Source sourceObject = intermineProject.getSources().get(thisSourceName); 
     142            if (sourceObject == null) { 
    142143                throw new BuildException("can't find source in project definition file: " 
    143                                          + thisSource); 
     144                                         + thisSourceName); 
    144145            } 
    145146 
    146147            if (action.equals("")) { 
    147                 performAction(thisSource); 
    148             } else { 
    149                 performAction(action, thisSource); 
    150             } 
    151         } 
    152     } 
    153  
    154     private void performAction(String sourceName) { 
    155         performAction("retrieve", sourceName); 
    156         performAction("translate", sourceName); 
    157         performAction("load", sourceName); 
    158     } 
    159  
    160     private void performAction(String actionName, String sourceName) { 
     148                performAction(thisSourceName, sourceObject.getType()); 
     149            } else { 
     150                performAction