Changeset 20788
- Timestamp:
- 04/03/10 13:21:20 (6 months ago)
- Files:
-
- trunk/bio/tools/main/src/org/intermine/bio/logic/OrthologueLinkManager.java (modified) (2 diffs)
- trunk/flymine/webapp/resources/web.properties (modified) (1 diff)
- trunk/intermine/web/main/src/org/intermine/web/logic/widget/BenjaminiHochberg.java (modified) (4 diffs)
- trunk/intermine/web/main/src/org/intermine/web/logic/widget/Bonferroni.java (modified) (4 diffs)
- trunk/intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bio/tools/main/src/org/intermine/bio/logic/OrthologueLinkManager.java
r20783 r20788 29 29 import org.intermine.model.bio.DataSet; 30 30 import org.intermine.model.bio.Gene; 31 import org.intermine.model.bio.Homologue;32 31 import org.intermine.model.bio.Organism; 33 32 import org.intermine.objectstore.query.ConstraintOp; … … 289 288 QueryClass qcGene = new QueryClass(Gene.class); 290 289 QueryClass qcOrganism = new QueryClass(Organism.class); 291 QueryClass qcHomologue = n ew QueryClass(Homologue.class);290 QueryClass qcHomologue = null; 292 291 QueryClass qcHomologueOrganism = new QueryClass(Organism.class); 293 292 QueryClass qcDataset = new QueryClass(DataSet.class); 294 293 QueryClass qcGeneHomologue = new QueryClass(Gene.class); 295 294 295 try { 296 qcHomologue = new QueryClass(Class.forName(im.getModel().getPackageName() 297 + ".Homologue")); 298 } catch (ClassNotFoundException e) { 299 LOG.info("No orthologues found.", e); 300 return; 301 } 302 296 303 QueryField qfGeneOrganismName = new QueryField(qcOrganism, "shortName"); 297 304 QueryField qfDataset = new QueryField(qcDataset, "title"); trunk/flymine/webapp/resources/web.properties
r20771 r20788 418 418 attributelink.ratmineList.Gene.10116.primaryIdentifier.list.usePost=true 419 419 420 attributelink.ratmine.Pathway.*.identifier.url=http://www.intermine.org/rgd/portal.do?externalids=<<attributeValue>>&class=Pathway&origin=FlyMine 421 attributelink.ratmine.Pathway.*.identifier.text=RatMine: <<attributeValue>> 422 attributelink.ratmine.Pathway.*.identifier.imageName=ratmine_logo.png 423 424 attributelink.ratmine.ProteinDomain.*.identifier.url=http://www.intermine.org/rgd/portal.do?externalids=<<attributeValue>>&class=ProteinDomain&origin=FlyMine 425 attributelink.ratmine.ProteinDomain.*.identifier.text=RatMine: <<attributeValue>> 426 attributelink.ratmine.ProteinDomain.*.identifier.imageName=ratmine_logo.png 427 420 428 # home page 421 429 begin.query.classes = Gene,Protein trunk/intermine/web/main/src/org/intermine/web/logic/widget/BenjaminiHochberg.java
r20631 r20788 13 13 import java.math.BigDecimal; 14 14 import java.math.MathContext; 15 import java.math.RoundingMode;16 15 import java.util.HashMap; 17 16 import java.util.LinkedHashMap; … … 47 46 numberOfTests = originalMap.size(); 48 47 SortableMap sortedMap = new SortableMap(originalMap); 49 // sort descending50 sortedMap.sortValues(false, false);48 // sort ascending 49 sortedMap.sortValues(false, true); 51 50 this.originalMap = new LinkedHashMap(sortedMap); 52 51 } … … 58 57 @SuppressWarnings("unchecked") 59 58 public void calculate(Double max) { 60 MathContext mc = new MathContext(10, RoundingMode.HALF_EVEN);59 adjustedMap = new HashMap(); 61 60 62 adjustedMap = new HashMap();63 BigDecimal adjustedP = new BigDecimal(0);64 61 int index = 0; 62 BigDecimal lastValue = new BigDecimal(-1); 65 63 66 64 for (Map.Entry<String, BigDecimal> entry : originalMap.entrySet()) { … … 68 66 String label = entry.getKey(); 69 67 BigDecimal p = entry.getValue(); 68 BigDecimal adjustedP = p; 69 70 /** 71 * equivalent p-values should have the same adjusted p-value. 72 * 73 * only increase the index if this value is different from the one we saw on the 74 * previous line 75 */ 76 if (!p.equals(lastValue)) { 77 // new value, so increase index 78 index++; 79 } 70 80 71 81 // largest value is not adjusted 72 if (index == 0) { 73 adjustedP = p; 74 } else { 82 if (index < numberOfTests - 1) { 75 83 // p-value * (n/ n - index) 76 84 BigDecimal n = new BigDecimal(numberOfTests); 77 85 BigDecimal divisor = n.subtract(new BigDecimal(index)); 78 BigDecimal m = n.divide(divisor, mc);86 BigDecimal m = n.divide(divisor, MathContext.DECIMAL128); 79 87 adjustedP = p.multiply(m); 80 88 } 81 89 82 90 if (adjustedP.doubleValue() < max.doubleValue()) { 91 // TODO we want to put all values in the map and let the javascript display or not 83 92 adjustedMap.put(label, adjustedP); 84 93 } 85 index++;94 lastValue = p; 86 95 } 87 96 } trunk/intermine/web/main/src/org/intermine/web/logic/widget/Bonferroni.java
r20637 r20788 11 11 */ 12 12 13 import java.math.BigDecimal; 13 14 import java.util.HashMap; 14 import java.util.Iterator; 15 16 import java.math.BigDecimal; 15 import java.util.Map; 17 16 18 17 19 18 /** 20 19 * See online documentation for an in depth description of error correction and bonferroni. 21 * Briefly, the p-values are adjusted (multiple hypothesis test correction) by multiplying 22 * the original value by the number of tests performed. 20 * Briefly, the p-values are adjusted (multiple hypothesis test correction) by adding the 21 * alpha divided by the total number of tests to the original number. 22 * 23 * For example, given 100 tests and an alpha value of .05, we would expect 5 false positives. 24 * 23 25 * @author Julie Sullivan 24 26 */ … … 28 30 private HashMap<String, BigDecimal> adjustedMap = new HashMap<String, BigDecimal>(); 29 31 private BigDecimal numberOfTests; 30 private BigDecimal alpha = new BigDecimal(0.05);31 private BigDecimal alphaPerTest;32 33 32 34 33 /** … … 38 37 this.originalMap = originalMap; 39 38 numberOfTests = new BigDecimal(originalMap.size()); 40 alphaPerTest = alpha.divide(numberOfTests);41 39 } 42 40 … … 47 45 public void calculate(Double max) { 48 46 49 for ( Iterator iter = originalMap.keySet().iterator(); iter.hasNext();) {47 for (Map.Entry<String, BigDecimal> entry : originalMap.entrySet()) { 50 48 51 49 // get original values 52 String label = (String) iter.next();53 BigDecimal p = new BigDecimal("" + originalMap.get(label));50 String label = entry.getKey(); 51 BigDecimal p = entry.getValue(); 54 52 55 // calc new value 56 // (alpha / number of tests) + p 57 BigDecimal adjustedP = p.add(alphaPerTest); 53 // calc new value - p * n 54 BigDecimal adjustedP = p.multiply(numberOfTests); 58 55 59 56 // don't store values >= maxValue trunk/intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties
r20699 r20788 80 80 # list of intermines 81 81 # used on the linkouts section of the list analysis page 82 83 #intermines.flymine.url=http://localhost:8080/preview 84 #intermines.flymine.name=FlyMine 85 #intermines.flymine.logo=flymine_logo_link.gif 86 #intermines.flymine.defaultOrganism=D. melanogaster 87 #intermines.flymine.defaultMapping=remote 82 # intermines.MINE_NAME = this mine name should match the `project.title` in your properties file 88 83 89 84 intermines.modmine.url=http://intermine.modencode.org/query … … 94 89 95 90 intermines.flymine.url=http://preview.flymine.org/preview 96 intermines.flymine.name=FlyMine 91 intermines.flymine.name=FlyMine Preview 97 92 intermines.flymine.logo=flymine_logo_link.gif 98 93 intermines.flymine.defaultOrganism=D. melanogaster
