Ejemplo n.º 1
0
  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) {
      }
    }
  }
Ejemplo n.º 2
0
  @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) {
      }
    }
  }
Ejemplo n.º 3
0
  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) {
      }
    }
  }
Ejemplo n.º 4
0
  @Override
  protected List<Property> createProperties(Algorithm algorithm) throws Exception {
    List<Property> p = new ArrayList<Property>();

    LiteratureEntry le = LiteratureEntry.getInstance(Reference.encode(getName(algorithm)), "value");
    Property property = new Property("value", le);

    property.setLabel(algorithm.getName());
    property.setClazz(String.class);
    p.add(property);
    return p;
  }
Ejemplo n.º 5
0
 @Override
 protected void verifyRows(AmbitRows<IStructureRecord> rows) throws Exception {
   // IDatabaseConnection c = getConnection();
   Assert.assertNotNull(rows);
   // Assert.assertEquals(4,rows.size());
   while (rows.next()) {
     IStructureRecord r = rows.getObject();
     logger.fine(r.toString());
     for (Property p : r.getProperties()) {
       logger.fine(p.toString());
       logger.fine(r.getProperty(p).toString());
     }
   }
 }
Ejemplo n.º 6
0
 @Override
 protected void setGroupProperties(Context context, Request request, Response response)
     throws ResourceException {
   String[] r = NCISearchProcessor.METHODS.reach.getOpenToxEntry();
   if (r == null) return;
   Template gp = new Template();
   for (int i = 0; i < r.length; i++) {
     Property p = new Property(r[i]);
     p.setLabel(r[i]);
     p.setEnabled(true);
     p.setOrder(i + 1);
     gp.add(p);
   }
   setGroupProperties(gp);
 }
Ejemplo n.º 7
0
 @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;
 }
Ejemplo n.º 8
0
  @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;
  }
Ejemplo n.º 9
0
  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) {
      }
    }
  }
Ejemplo n.º 10
0
 public void addProperties(Map newProperties) {
   Iterator e = newProperties.keySet().iterator();
   while (e.hasNext()) {
     properties.add(Property.getInstance(e.next().toString(), "I/O"));
   }
 }