Changeset 17102
- Timestamp:
- 10/10/08 16:11:16 (2 months ago)
- Files:
-
- branches/kmr/flybasemine_branch (modified) (1 prop)
- branches/kmr/flybasemine_branch/bio-source-flybase-identifiers (copied) (copied from trunk/bio-source-flybase-identifiers) (1 prop)
- branches/kmr/flybasemine_branch/bio/core/main/resources/log4j.properties (modified) (2 diffs)
- branches/kmr/flybasemine_branch/bio/scripts/project_build (modified) (3 diffs)
- branches/kmr/flybasemine_branch/bio/sources/chado-db/chado-db_additions.xml (modified) (2 diffs)
- branches/kmr/flybasemine_branch/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ChadoSequenceProcessor.java (modified) (4 diffs)
- branches/kmr/flybasemine_branch/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeFeatureProcessor.java (modified) (4 diffs)
- branches/kmr/flybasemine_branch/bio/sources/chado-db/resources/chado-db_keys.properties (copied) (copied from trunk/bio/sources/chado-db/resources/chado-db_keys.properties)
- branches/kmr/flybasemine_branch/bio/sources/chado-db/resources/modencode-metadata_keys.properties (deleted)
- branches/kmr/flybasemine_branch/bio/sources/intermine-items-xml-file/resources/flymine-static_keys.properties (deleted)
- branches/kmr/flybasemine_branch/bio/sources/intermine-items-xml-file/resources/modmine-static_keys.properties (deleted)
- branches/kmr/flybasemine_branch/bio/sources/uniprot/main/src/org/intermine/bio/dataconversion/UniprotConverter.java (modified) (1 diff)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ChromosomeDistributionDataSetLdr.java (modified) (4 diffs)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ChromosomeDistributionGraphURLGenerator.java (modified) (1 diff)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/HomologueURLQuery.java (modified) (3 diffs)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/PathwayURLQuery.java (modified) (3 diffs)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ProteinInteractionURLQuery.java (modified) (4 diffs)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/PublicationURLQuery.java (modified) (3 diffs)
- branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/UniProtFeaturesURLQuery.java (modified) (3 diffs)
- branches/kmr/flybasemine_branch/flybase-gene-names (copied) (copied from trunk/flybase-gene-names) (1 prop)
- branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/Dependencies.java (modified) (6 diffs)
- branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/Integrate.java (modified) (6 diffs)
- branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/project/Project.java (modified) (1 diff)
- branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/project/ProjectXmlBinding.java (modified) (1 diff)
- branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/project/Source.java (modified) (2 diffs)
- branches/kmr/flybasemine_branch/imbuild/lib/im-ant-tasks.jar (modified) (previous)
- branches/kmr/flybasemine_branch/imbuild/source.xml (modified) (4 diffs)
- branches/kmr/flybasemine_branch/imbuild/webapp.xml (modified) (3 diffs)
- branches/kmr/flybasemine_branch/intermine (modified) (1 prop)
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
- Property svn:mergeinfo changed from
branches/kmr/flybasemine_branch/bio-source-flybase-identifiers
- Property svn:mergeinfo set
branches/kmr/flybasemine_branch/bio/core/main/resources/log4j.properties
r16859 r17102 5 5 #logger ROOT 6 6 log4j.rootLogger=INFO, A1 7 8 #logger bioJava mapping9 log4j.logger.org.flymine.bj=ERROR, BJ10 11 #logger bioJava mapping utils12 log4j.logger.org.flymine.bj.utils=ERROR, BJ13 7 14 8 ################# … … 29 23 log4j.appender.A1.layout.ConversionPattern=%d{dd/MM/yy,HH:mm:ss} %-5p %37c %3x - %m%n 30 24 31 #appender bj32 #log4j.appender.BJ=org.apache.log4j.RollingFileAppender33 #log4j.appender.BJ.File=bioJavaMapping.log34 #log4j.appender.BJ.Append=false35 #log4j.appender.BJ.MaxFileSize=5MB36 #log4j.appender.BJ.layout=org.apache.log4j.PatternLayout37 #log4j.appender.BJ.layout.ConversionPattern=%d{HH:mm:ss} %-5p %l - %m%n38 #log4j.appender.BJ.layout.ConversionPattern=%d{HH:mm:ss} %25F:%L %5p - %m%n39 25 26 branches/kmr/flybasemine_branch/bio/scripts/project_build
r16948 r17102 4 4 # The project.xml in the current directory controls which actions to 5 5 # run/merge/postprocess. 6 # The database to dump will be found by reading the properties from $HOME/ <mine_name>.properties6 # The database to dump will be found by reading the properties from $HOME/.intermine/<mine_name>.properties 7 7 # where <mine_name> is the name of the directory where the script is run 8 8 … … 169 169 my $current_directory = (getcwd() =~ m:.*/(.*):)[0]; 170 170 171 my $properties_file = "$ENV{HOME}/ $current_directory.properties";171 my $properties_file = "$ENV{HOME}/.intermine/$current_directory.properties"; 172 172 if (defined $release) { 173 173 $properties_file .= ".$release"; … … 336 336 # such file or directory" error because some table/index files 337 337 # (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++) { 339 340 eval { 340 341 spawn($pass, @createdb_command, @params); 341 342 }; 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 $@; 352 353 } 353 354 branches/kmr/flybasemine_branch/bio/sources/chado-db/chado-db_additions.xml
r16942 r17102 11 11 <collection name="CDSs" referenced-type="org.flymine.model.genomic.CDS" reverse-reference="gene" ordered="true"/> 12 12 <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"/> 13 14 </class> 14 15 <class name="org.flymine.model.genomic.InsertionSite" extends="org.flymine.model.genomic.BioEntity" is-interface="true"> … … 75 76 </class> 76 77 <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"/> 78 79 <reference name="MRNA" referenced-type="org.flymine.model.genomic.MRNA"/> 79 80 <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 153 153 processFeaturePropTable(connection); 154 154 extraProcessing(connection, featureMap); 155 finishedProcessing(connection, featureMap); 155 156 } 156 157 … … 426 427 * @param connection the Connection 427 428 */ 428 @SuppressWarnings("unused")429 429 protected void earlyExtraProcessing(Connection connection) { 430 // empty430 // override in subclasses as necessary 431 431 } 432 432 … … 438 438 * @throws SQLException if there is a problem 439 439 */ 440 @SuppressWarnings("unused")441 440 protected void extraProcessing(Connection connection, 442 441 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) 443 455 throws ObjectStoreException, SQLException { 444 456 // override in subclasses as necessary … … 535 547 * @throws ObjectStoreException if there is a problem while storing 536 548 */ 537 @SuppressWarnings("unused")538 549 protected Item makeLocation(int start, int end, int strand, FeatureData srcFeatureData, 539 550 FeatureData featureData, int taxonId) branches/kmr/flybasemine_branch/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeFeatureProcessor.java
r16831 r17102 47 47 "five_prime_untranslated_region", 48 48 "five_prime_UTR", "three_prime_untranslated_region", 49 "three_prime_UTR", "origin_of_replication", 49 "three_prime_UTR", "origin_of_replication", 50 50 "binding_site", "protein_binding_site", "transcript_region" 51 51 ); … … 82 82 * (see createFeatureTempTable in ChadoSequenceProcessor) 83 83 * queryList?? 84 * 84 * 85 85 */ 86 86 /** … … 91 91 String queryList = forINclause(); 92 92 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 " 95 101 + " FROM data_feature " 96 102 + " WHERE data_id IN (" + queryList + "))"; … … 194 200 } 195 201 196 202 197 203 198 204 /** branches/kmr/flybasemine_branch/bio/sources/uniprot/main/src/org/intermine/bio/dataconversion/UniprotConverter.java
r16761 r17102 476 476 } else if (qName.equals("property") && stack.peek().equals("dbReference") 477 477 && 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")) { 480 479 if ((possibleGeneIdSource != null) && (possibleGeneId != null)) { 481 480 // we probably don't have a <gene> reference branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ChromosomeDistributionDataSetLdr.java
r15898 r17102 19 19 20 20 import org.flymine.model.genomic.Chromosome; 21 import org.flymine.model.genomic.LocatedSequenceFeature;22 21 import org.flymine.model.genomic.Organism; 23 22 import org.intermine.bio.web.logic.BioUtil; … … 79 78 chromosomeList = BioUtil.getChromosomes(os, Arrays.asList(organismName.toLowerCase()), 80 79 false); 81 80 // used for not analysed figure 82 81 calcTotal(bag, organismName); 83 82 84 / * initialise results list - so all chromosomes are displayed */83 // initialise results list - so all chromosomes are displayed 85 84 for (Iterator<String> chrIter = chromosomeList.iterator(); chrIter.hasNext();) { 86 85 String chromosomeName = chrIter.next(); 87 86 int[] count = new int[3]; 88 count[0] = 0; // actual 87 count[0] = 0; // actual - total in bag 89 88 count[1] = 0; // expected 90 count[2] = 0; // total 89 count[2] = 0; // total in database 91 90 resultsTable.put(chromosomeName, count); 92 91 } 93 92 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 94 163 Query q = getQuery(organismName, "actual", bag); 95 96 if (q == null) {97 return;98 }99 100 164 results = os.execute(q); 101 165 results.setBatchSize(50000); … … 112 176 String chromosome = (String) resRow.get(0); 113 177 Long geneCount = (java.lang.Long) resRow.get(1); 178 // set the gene.count for genes in this bag with this chromosome 114 179 (resultsTable.get(chromosome))[0] = geneCount.intValue(); 180 // increase total 115 181 totalInBagWithLocation += geneCount.intValue(); 116 182 } 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; 174 184 } 175 185 … … 180 190 QueryClass chromosomeQC = new QueryClass(Chromosome.class); 181 191 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 */ 184 195 // 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 // } 190 201 191 202 QueryField chromoQF = new QueryField(chromosomeQC, "primaryIdentifier"); branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ChromosomeDistributionGraphURLGenerator.java
r16586 r17102 25 25 public class ChromosomeDistributionGraphURLGenerator implements GraphCategoryURLGenerator 26 26 { 27 String bagName;28 String organism = null;27 private String bagName; 28 private String organism = null; 29 29 30 30 /** branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/HomologueURLQuery.java
r16586 r17102 11 11 */ 12 12 13 import java.util.ArrayList;14 import java.util.Collection;15 16 import org.intermine.model.InterMineObject;17 13 import org.intermine.objectstore.ObjectStore; 18 14 import org.intermine.pathquery.Constraints; … … 29 25 { 30 26 31 InterMineBag bag;32 String key;33 ObjectStore os;27 private InterMineBag bag; 28 private String key; 29 private ObjectStore os; 34 30 35 31 /** … … 47 43 * {@inheritDoc} 48 44 */ 49 public PathQuery generatePathQuery( Collection<InterMineObject> keys) {45 public PathQuery generatePathQuery() { 50 46 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"); 66 55 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); 70 59 return q; 71 60 } branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/PathwayURLQuery.java
r16586 r17102 11 11 */ 12 12 13 import java.util.ArrayList;14 import java.util.Collection;15 16 import org.intermine.model.InterMineObject;17 13 import org.intermine.objectstore.ObjectStore; 18 14 import org.intermine.pathquery.Constraints; … … 29 25 { 30 26 31 InterMineBag bag;32 String key;33 ObjectStore os;27 private InterMineBag bag; 28 private String key; 29 private ObjectStore os; 34 30 35 31 /** … … 47 43 * {@inheritDoc} 48 44 */ 49 public PathQuery generatePathQuery( Collection<InterMineObject> keys) {45 public PathQuery generatePathQuery() { 50 46 PathQuery q = new PathQuery(os.getModel()); 51 47 q.setView("Gene.secondaryIdentifier,Gene.primaryIdentifier,Gene.name,Gene.organism.name," 52 48 + "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)); 60 51 q.setConstraintLogic("A and B"); 61 52 q.syncLogicExpression("and"); branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/ProteinInteractionURLQuery.java
r16586 r17102 11 11 */ 12 12 13 import java.util.ArrayList;14 import java.util.Collection;15 16 import org.intermine.model.InterMineObject;17 13 import org.intermine.objectstore.ObjectStore; 18 14 import org.intermine.pathquery.Constraints; … … 28 24 { 29 25 30 InterMineBag bag;31 String key;32 ObjectStore os;26 private InterMineBag bag; 27 private String key; 28 private ObjectStore os; 33 29 34 30 /** … … 46 42 * {@inheritDoc} 47 43 */ 48 public PathQuery generatePathQuery(Collection<InterMineObject> keys) { 49 50 44 public PathQuery generatePathQuery() { 51 45 PathQuery q = new PathQuery(os.getModel()); 52 53 46 q.setView("Protein.primaryIdentifier, Protein.primaryAccession," 54 47 + "Protein.proteinInteractions.interactingProteins.primaryIdentifier," … … 58 51 + "Protein.proteinInteractions.proteinRole," 59 52 + "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)); 71 55 q.setConstraintLogic("A and B"); 72 56 q.syncLogicExpression("and"); 73 74 57 q.setOrderBy("Protein.primaryIdentifier, Protein.primaryAccession," 75 58 + "Protein.proteinInteractions.interactingProteins.name"); branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/PublicationURLQuery.java
r16586 r17102 11 11 */ 12 12 13 import java.util.ArrayList;14 import java.util.Collection;15 16 import org.intermine.model.InterMineObject;17 13 import org.intermine.objectstore.ObjectStore; 18 14 import org.intermine.pathquery.Constraints; … … 28 24 { 29 25 30 InterMineBag bag;31 String key;32 ObjectStore os;26 private InterMineBag bag; 27 private String key; 28 private ObjectStore os; 33 29 34 30 /** … … 46 42 * {@inheritDoc} 47 43 */ 48 public PathQuery generatePathQuery( Collection<InterMineObject> keys) {44 public PathQuery generatePathQuery() { 49 45 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," 53 48 + "Gene.publications.journal,Gene.publications.year," 54 49 + "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)); 65 53 q.setConstraintLogic("A and B"); 66 54 q.syncLogicExpression("and"); branches/kmr/flybasemine_branch/bio/webapp/src/org/intermine/bio/web/widget/UniProtFeaturesURLQuery.java
r16586 r17102 11 11 */ 12 12 13 import java.util.ArrayList;14 import java.util.Collection;15 16 import org.intermine.model.InterMineObject;17 13 import org.intermine.objectstore.ObjectStore; 18 14 import org.intermine.pathquery.Constraints; … … 28 24 { 29 25 30 InterMineBag bag;31 String key;32 ObjectStore os;26 private InterMineBag bag; 27 private String key; 28 private ObjectStore os; 33 29 34 30 /** … … 46 42 * {@inheritDoc} 47 43 */ 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," 53 48 + "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)); 64 52 q.setConstraintLogic("A and B"); 65 53 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 155 155 String executePathId = type + ".execute.path"; 156 156 String artifactPathId = type + ".artifact.path"; 157 157 String extraDependenciesId = "extra.dependencies"; 158 158 159 // Don't run twice if target not specified. 159 160 if (getProject().getReference(compilePathId) != null && target == null) { … … 206 207 executeFileSet.setDir(new File(workspaceBaseDir.replace('/', File.separatorChar))); 207 208 executeFileSet.setProject(getProject()); 208 209 209 210 String compileIncludes = ""; 210 211 String dependIncludes = ""; 211 212 String executeIncludes = ""; 213 String extraDependenciesIncludes = ""; 212 214 213 215 FileSet artifactFileSet = new FileSet(); … … 220 222 getProject().addReference(executePathId, executePath); 221 223 getProject().addReference(artifactPathId, artifactPath); 222 224 223 225 String projName = calcThisProjectName(); 224 226 … … 260 262 dependIncludes += projName + "/lib/*.jar "; 261 263 executeIncludes += projName + "/lib/*.jar "; 262 264 263 265 for (int i = 0; i < allProjectNames.size(); i++) { 264 266 String depName = (String) allProjectNames.get(i); … … 336 338 337 339 artifactIncludes += depName + "/dist/* "; 340 } else { 341 extraDependenciesIncludes += depName + "/dist/* "; 342 extraDependenciesIncludes += depName + "/lib/*.jar "; 338 343 } 339 344 } … … 353 358 getProject().addReference(executePathId + ".fileset.text", executeIncludes); 354 359 } 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); 355 369 356 370 if (artifactIncludes.length() > 0) { branches/kmr/flybasemine_branch/imbuild/im-ant-tasks/src/org/intermine/task/Integrate.java
r14641 r17102 55 55 private File projectXml; 56 56 private Project intermineProject; 57 private String action, source ;57 private String action, sourceAttribute; 58 58 private File workspaceBaseDir; 59 59 … … 79 79 */ 80 80 public void setSource(String source) { 81 this.source = source;81 this.sourceAttribute = source; 82 82 } 83 83 … … 102 102 throw new BuildException("no workspaceBaseDir specified"); 103 103 } 104 if (source == null || source.trim().equals("")) {104 if (sourceAttribute == null || sourceAttribute.trim().equals("")) { 105 105 throw new BuildException("no source set, try \"ant -Dsource=all\" or " 106 106 + "\"ant -Dsource=source1,source2\""); … … 123 123 System.out.print("Found " + intermineProject.getSources().size() + " sources" + "\n"); 124 124 125 List<String> source s = 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")) { 128 128 Iterator iter = intermineProject.getSources().entrySet().iterator(); 129 129 while (iter.hasNext()) { 130 130 String thisSource = (String) ((Map.Entry) iter.next()).getKey(); 131 source s.add(thisSource);131 sourceNames.add(thisSource); 132 132 } 133 133 } else { 134 Vector<String> bits = StringUtils.split(source , ',');134 Vector<String> bits = StringUtils.split(sourceAttribute, ','); 135 135 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) { 142 143 throw new BuildException("can't find source in project definition file: " 143 + thisSource );144 + thisSourceName); 144 145 } 145 146 146 147 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
