public Image testScatterPlot() { Connection c = null; try { initDatasource(); c = datasource.getConnection(); SourceDataset q = new SourceDataset(); q.setId(78); PropertiesChartGenerator gen = new PropertiesChartGenerator(); gen.setConnection(c); Property p = Property.getInstance("XLogP", ""); p.setId(13993); gen.setPropertyX(p); p = Property.getInstance("LLNA EC3 %", ""); p.setId(13995); gen.setPropertyY(p); return gen.process(q); } catch (Exception x) { x.printStackTrace(); return null; } finally { try { c.close(); } catch (Exception x) { } } }
@Test public Image testPropertyHistogramPlot() { Connection c = null; try { initDatasource(); c = datasource.getConnection(); IStoredQuery q = new StoredQuery(13); // this is dataset now q.setName("IRISTR: EPA Integrated Risk Information System (IRIS) Toxicity Review Data"); XTabChartGenerator gen = new XTabChartGenerator(); gen.setBinWidth(0.001); gen.setConnection(c); gen.setPropertyX(Property.getInstance("Inhalation_UnitRisk_micromol_per_m3", "")); // gen.setPropertyY(Property.getInstance("Cramer Class", "")); gen.setPropertyY(Property.getInstance("Oral_RfD_Confidence", "")); return gen.process(q); } catch (Exception x) { x.printStackTrace(); return null; } finally { try { c.close(); } catch (Exception x) { } } }
@Override protected IQueryRetrieval<Object> createQuery() { RetrieveField q = new RetrieveField(); q.setValue(new StructureRecord(-1, 100215, null, null)); q.setFieldname(Property.getInstance("Property 1", "")); return q; }
public Image test() { Connection c = null; try { initDatasource(); c = datasource.getConnection(); // IStoredQuery q = new StoredQuery(6); SourceDataset dataset = new SourceDataset(); dataset.setId(6); PieChartGenerator gen = new PieChartGenerator(); gen.setConnection(c); Property p = Property.getInstance("toxTree.tree.cramer.CramerRules", ""); p.setId(12361); gen.setProperty(p); return gen.process(dataset); } catch (Exception x) { x.printStackTrace(); return null; } finally { try { c.close(); } catch (Exception x) { } } }
@Override protected IQueryRetrieval<IStructureRecord> createQuery() { Profile<Property> profile = new Profile<Property>(); for (int i = 1; i < 5; i++) { // for the test only id matters Property p = Property.getInstance(String.format("test%d", i), String.format("test%d", i)); p.setId(i); p.setEnabled(true); profile.add(p); } RetrieveProfileValuesAsRow q = new RetrieveProfileValuesAsRow(); q.setChemicalsOnly(false); q.setFieldname(profile); q.setValue(new int[] {100211, 100214, 100215, 129345}); return q; }
public Image testMetricNominalPlot() { Connection c = null; try { initDatasource(); c = datasource.getConnection(); IStoredQuery q = new StoredQuery(2); Nominal2SimilarityChartGenerator gen = new Nominal2SimilarityChartGenerator(); gen.setConnection(c); gen.setProperty(Property.getInstance("Inventories", "")); return gen.process(q); } catch (Exception x) { x.printStackTrace(); return null; } finally { try { c.close(); } catch (Exception x) { } } }
public void addProperties(Map newProperties) { Iterator e = newProperties.keySet().iterator(); while (e.hasNext()) { properties.add(Property.getInstance(e.next().toString(), "I/O")); } }