// Create an instance of org.w3c.dom.Document.
String svgNS = "http://www.w3.org/2000/svg";
Document document = domImpl.createDocument(svgNS, "svg", null);
// Create an instance of the SVG Generator.
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
// Read the triplet data
List<Triplet> list = Triplet.readTrips(tripFile);
for (Triplet t : list)
{
t.backFromURLToIDs();
t.pvalGamma = Difference.calcGammaPval(t);
}
list = Triplet.selectModulator(list, "UBE2I");
// StageAnalyzer.removeBadTars(list);
for (Triplet t : list)
{
t.backFromIDToSymbol();
}
// Remove unclassified triplets
Triplet.keepClassified(list);
// Among the triplets with same M, F, and T, keep only the one with the most significant
// gamma
Triplet.keepMostSignif(list);
HashMap<String, Group> map = process(list);
// Filter out unqualyfying groups
filterGroups(map);
System.out.println("map.size() = " + map.size());
// Render using SVG Graphics2D implementation.
Plot plot = new Plot();
// try
// {
// intiVerticalFonts();
// }
// catch (NoninvertibleTransformException e)
// {
// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
// }
plot.paint(svgGenerator, new ArrayList<Group>(map.values()));
// Finally, stream out SVG to the standard output using
// UTF-8 encoding.
boolean useCSS = true; // we want to use CSS style attributes
Writer out = new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8");
svgGenerator.stream(out, useCSS);
}