uk.ac.sanger.cgp.standalonecsa.interfaces
Interface ChromatogramService

All Known Implementing Classes:
ChromatogramServiceImpl

public interface ChromatogramService

This interface provides access to all the methods that a view should require for rendering chromatogram graphics.

Author:
Original: kr2, $Author: kr2 $

Method Summary
 java.awt.image.BufferedImage generateComplexVariantView(java.lang.String pathRoot, ExperimentBean expBean, ExperimentBean wtExp, boolean drawBaseChar, boolean writeToFile)
          Generates images required for the complex variant view.
 java.awt.image.BufferedImage generateFullChrom(java.lang.String imageLoc, ExperimentBean expBean, boolean writeImage, boolean drawBaseChar)
          Generates a full chromatogram image.
 java.awt.image.BufferedImage[] generateVariantViewSet(java.lang.String imageLoc, ExperimentBean expBean, ExperimentBean normExp, boolean drawBaseChar, boolean writeToFile)
          Generates images required for the simple variant view.
 java.awt.image.BufferedImage generateVariantViewSingle(java.lang.String pathRoot, ExperimentBean expBean, boolean writeToFile, boolean drawBaseChar)
          Generates an image as used in the simple variant view.
 void resetPreviousRendered()
          Resets the set of files that have been previously rendered and written to a file.
 

Method Detail

generateFullChrom

java.awt.image.BufferedImage generateFullChrom(java.lang.String imageLoc,
                                               ExperimentBean expBean,
                                               boolean writeImage,
                                               boolean drawBaseChar)
Generates a full chromatogram image. This method is expected to generate a full chromatogram image.

Parameters:
imageLoc - directory to write image to
expBean - the experiment containing the chromatogram to be rendered
writeImage - true if the image should be written to file
drawBaseChar - true if the character of the DNA change should be rendered when a variant is provided
Returns:
to be used if further processing of image is required, or streaming

generateVariantViewSet

java.awt.image.BufferedImage[] generateVariantViewSet(java.lang.String imageLoc,
                                                      ExperimentBean expBean,
                                                      ExperimentBean normExp,
                                                      boolean drawBaseChar,
                                                      boolean writeToFile)
Generates images required for the simple variant view. Method should behave as follows:

- variant ExperimentBean.getVariantToRender() must not be null
- calculate where image should start and finish based on the length of the variant
- render and write to file (if indicated) the variant and wildtype segment
- if a compliment comparison was performed render these segments too

Parameters:
writeToFile - indicates if writing to a file should be attempted
imageLoc - directory to write image to
expBean - the variant experiment to use when rendering this variant
normExp - the wildtype experiment to use when rendering this variant
drawBaseChar - true when base character should be rendered over the change
Returns:
array of BufferedImages, ordered {sample, reference, compliment sample, compliment reference}.

generateVariantViewSingle

java.awt.image.BufferedImage generateVariantViewSingle(java.lang.String pathRoot,
                                                       ExperimentBean expBean,
                                                       boolean writeToFile,
                                                       boolean drawBaseChar)
Generates an image as used in the simple variant view. Method should behave as follows:

- ExperimentBean.getVariantToRender() must not be null
- calculate where image should start and finish based on the length of the variant
- render and write to file (if indicated) the segment

If writeToFile is false pathRoot can be null

Parameters:
pathRoot - directory to write image to
expBean - the experiment to use when rendering this variant
writeToFile - indicates if writing to a file should be attempted
drawBaseChar - true when base character should be rendered over the change
Returns:
to be used if further processing of image is required, or streaming

generateComplexVariantView

java.awt.image.BufferedImage generateComplexVariantView(java.lang.String pathRoot,
                                                        ExperimentBean expBean,
                                                        ExperimentBean wtExp,
                                                        boolean drawBaseChar,
                                                        boolean writeToFile)
Generates images required for the complex variant view. Method should behave as follows:

- variant ExperimentBean.getVariantToRender() must not be null
- render full trace for both variant and wildtype traces, but not write to file
- calculate which image should be shifted to right to align variant location
- calculate the x offset for the shift
- create a new image with the wildtype displayed at the top and the variant trace on the bottom
- write this new image to file

Parameters:
writeToFile - indicates if writing to a file should be attempted
pathRoot - directory to write image to
expBean - the variant experiment to use when rendering this variant
wtExp - the wildtype experiment to use when rendering this variant
drawBaseChar - true when base character should be rendered over the change
Returns:
to be used if further processing of image is required, or streaming

resetPreviousRendered

void resetPreviousRendered()
Resets the set of files that have been previously rendered and written to a file. A list is kept to prevent images generated for a variant in one direction being regenerated when the same variant is called on the opposite comparison.

Use this method to empty this list at the end of each amplimer set to reduce memory footprint.

NOT NEEDED IF NOT WRITING TO FILE