Пример #1
0
  /**
   * Handle writing the {@link DuplicationLevel} to the database.
   *
   * @param duplicationLevel the {@link DuplicationLevel} calculated by fastqc.
   * @param analysis the {@link AnalysisFastQCBuilder} to update.
   */
  private void handleDuplicationLevel(
      DuplicationLevel duplicationLevel, AnalysisFastQCBuilder analysis) throws IOException {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    LineGraph lg = (LineGraph) duplicationLevel.getResultsPanel();
    BufferedImage b = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
    Graphics g = b.getGraphics();
    lg.paint(g, b.getWidth(), b.getHeight());

    ImageIO.write(b, "PNG", os);
    byte[] image = os.toByteArray();
    analysis.duplicationLevelChart(image);
  }