NAME
TRL::Microarray::Image - A Perl module for creating microarray data plots
SYNOPSIS
use TRL::Microarray::Image;
use TRL::Microarray::Microarray_File::Data_File;
my $oData_File = data_file->new($data_file);
my $oMA_Plot = ma_plot->new($oData_File);
my $ma_plot_png = $oMA_Plot->make_plot;
open (PLOT,'>ma_plot.png');
print PLOT $ma_plot_png;
close PLOT;
DESCRIPTION
TRL::Microarray::Image is an object-oriented Perl module for creating microarray data plots from a scan data file, using the GD module and image library. A number of different plot types are supported, including MA, RI, intensity scatter, intensity heatmap, log2 heatmap and CGH plots. Currently, only the export of PNG (Portable Network Graphics - or 'PNGs Not GIFs') images is supported.
QC/QA PLOTS
There are several plots for viewing basic microarray data for QC/QA purposes. Most of the parameters for these plots are the same, and only the class name used to create the plot object differs from one plot to another.
Standard Data Plots
- ma_plot
-
See the SYNOPSIS for all there is to know about how to create an MA plot. To create any of the other plot types, just append 'ma_plot' in the above example with one of the class names listed below.
- ri_plot
-
An RI plot is basically identical to an MA plot - at least in appearance.
- intensity_scatter
-
This is a plot of channel 1 signal vs channel 2 signal.
Heatmaps
- intensity_heatmap
-
An image of the slide, using a black->white rainbow colour gradient to indicate the signal intensity across the array. Uses channel 1 as the signal by default, but the channel can be changed by setting the plot_channel parameter in the call to make_plot();
my $oInt_Heatmap = intensity_heatmap->new($oData_File); my $int_heatmap_png = $oInt_Heatmap->make_plot(plot_channel=>2);
- log2_heatmap
-
An image of the slide using a red->yellow->green colour gradient to indicate the Log2 of the signal ratio across the array.
One difference between heatmaps and other plots is in their implementation of the plot scale. This is calculated dynamically in order to generate the best looking image of the array, and requires the dimensions of the array in terms of the number of spots in the x and y axes. If you are using a data file format that returns those values in its header information (such as a Scanarray file, using the Quantarray module) then the scale will be calculated automatically. If BlueFuse files are sorted such that the last data row has the highest block/spot row/column number, then again the scale can be calculated automatically. However, for GenePix files, you will have to pass these values to the make_plot() method (adding extra spots for block padding where appropriate);
my $oLog2_Heatmap = log2_heatmap->new($oData_File);
my $log_heatmap_png = $oLog2_Heatmap->make_plot(x_spots=>108, y_spots=>336);
CGH PLOT
There are two types of CGH plot - a single chromosome plot (cgh_plot) or a whole genome plot (genome_cgh_plot). The big difference between CGH plots and the other types described above is of course that they require genomic mapping data for each feature. This can be loaded into the object using a clone_locn_file object (see below) or using information embedded in the data file by setting the embedded_locns
flag.
use TRL::Microarray::Image;
use TRL::Microarray::Microarray_File::Data_File;
use TRL::Microarray::Microarray_File::Clone_Locn_File;
# first make your data objects
my $oData_File = data_file->new($data_file);
my $oClone_File = clone_locn_file->new($clone_file);
# create the plot object
my $oGenome_Image = genome_cgh_plot->new($oData_File,$oClone_File);
my $oChrom_Image = cgh_plot->new($oData_File,$oClone_File);
# make the plot image
# several parameters can be set when calling make_plot()
my $genome_png = $oGenome_Image->make_plot;
my $chrom_png = $oChrom_Image->make_plot(plot_chromosome=>1, scale=>100000);
CGH Plot Methods
- new()
-
Pass the data file and clone file objects at initialisation.
- make_plot()
-
Pass hash arguments to make_plot() to set various parameters (see below). The only argument required is
plot_chromosome
, when creating a single chromosome plot using the cgh_plot class - set_data()
-
The data_file and clone_locn_file objects do not have to be passed at initialisation, but can instead be set using the set_data() method.
Plot parameters
The following parameters can be set in the call to make_plot(), or separately before calling make_plot().
- plot_chromosome
-
Set this parameter to indicate which chromosome to plot. Required for single chromosome plots using the cgh_plot class. Must match the chromosome name provided by the clone positions file (or embedded data).
- has_embedded_locns
-
By setting the has_embedded_locns parameter to 1, the module expects the feature name to be in the 'ID' field of the data file (i.e. the synonym_id() of the data_file object) and the clone location to be present in the 'Name' field of the data file (i.e. the feature_id() of the data_file object). The clone location should be of the notation 'chr1:12345..67890'. When using has_embedded_locns a clone position file is not required. Disabled by default.
- plot_centromere
-
Set this parameter to zero to disable plotting of the centromere lines. Default is to plot the centromere locations as dashed blue lines.
- scale
-
Pass an integer value to set the desired X-scale of the plot, in bp/pixel. Default for cgh_plot (individual chromosome plot) is 500,000 bp per pixel; default for genome_cgh_plot (whole genome plot) is 2,500,000 bp/pixel.
- smooth_data_by_location, do_smoothing
-
Set either of these parameters to 1 to perform data smoothing. The Log2 ratios in a window of $window bp are averaged, and plotted against the central location of the window. The window moves in steps of $step bp. Disabled by default.
- smooth_window,smooth_step
-
Set the desired window and step sizes for smoothing using these two parameters. A default window size of 500,000bp and step size of 150,000bp provide a moderate level of smoothing, removing outliers while preserving short regions of copy number change. Setting either of these parameters will invoke the smoothing process without setting do_smoothing.
- shift_zero
-
Set this parameter to a value by which all Log2 ratios will be adjusted. Useful to better align the plot with the zero line.
- flip
-
Set this parameter to 1 in order to invert the log ratios returned by the data_file object.
SEE ALSO
TRL::Microarray
AUTHOR
James Morris, Translational Research Laboratories, Institute for Women's Health, University College London.
james.morris@ucl.ac.uk
COPYRIGHT AND LICENSE
Copyright 2007 by James Morris, University College London
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.