public void applyUncalled() { Progress progress = new Progress(uncalled.size(), 50); while (!uncalled.isEmpty()) { List<FunType> uncalledDup = new ArrayList<>(uncalled); for (FunType cl : uncalledDup) { progress.tick(); Call.apply(cl, null, null, null, null, null, null); } } }
private Map<String, Double> getExpressionPvals( Set<String> targets, boolean[] set1, boolean[] set2) { Map<String, Double> map = new HashMap<String, Double>(); Histogram2D h = new Histogram2D(0.2); System.out.println("targets = " + targets.size()); Progress prg = new Progress(targets.size()); for (String sym : targets) { prg.tick(); if (expMan.getNonZeroRatio(sym) == 0) continue; double pval = calcDiffPval(sym, set1, set2, true); if (Double.isNaN(pval)) continue; if (pval == 0) pval = 1E-11; double pPerm = calcDiffPval(sym, set1, set2, false); if (pPerm == 0) pPerm = 1E-5; h.count(-Math.log(pval), -Math.log(pPerm)); // pval = 0 is not real and it is not compatible with fisher's combined probability. // below is a better approximation. // if (pval == 0) // { // pval = 1E-11; // } map.put(sym, pval); } Histogram2DPlot p = new Histogram2DPlot(h); p.setLines(Arrays.asList(new double[] {1, 0})); p.setVisible(true); return map; }
@Nullable private Type parseAndResolve(String file) { try { Node ast = getAstForFile(file); if (ast == null) { failedToParse.add(file); return null; } else { Type type = Node.transformExpr(ast, globaltable); if (!loadedFiles.contains(file)) { loadedFiles.add(file); loadingProgress.tick(); } return type; } } catch (OutOfMemoryError e) { if (astCache != null) { astCache.clear(); } System.gc(); return null; } }