NAME
Microarray::Image - A Perl module for creating microarray data plots
SYNOPSIS
use Microarray::Image;
use 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
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 tomake_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 reporter. 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 Microarray::Image;
use Microarray::File::Data_File;
use 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 Microarray::File::Data and (optional) Microarray::File::Clone_Locns file objects at initialisation.
- make_plot()
-
Pass hash arguments to
make_plot()
to set various parameters (see below). The only argument required isplot_chromosome
, when creating a single chromosome plot using thecgh_plot
class - set_data()
-
The
data_file
andclone_locn_file
objects do not have to be passed at initialisation, but can instead be set using theset_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). - 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 forgenome_cgh_plot
(whole genome plot) is 2,500,000 bp/pixel. - 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.
Other analysis methods
The cgh_plot and genome_cgh_plot classes can use methods from the Microarray::Analysis::CGH module. Pass analysis parameters to the make_plot() method to implement flip(), has_embedded_locns(), do_smoothing() etc.
SEE ALSO
Microarray, Microarray::Analysis, Microarray::Analysis::CGH, Microarray::File, Microarray::File::Data_File, Microarray::File::Clone_Locn_File
PREREQUISITES
This module utilises the GD module, which requires installation of Thomas Boutell's GD image library (http://www.libgd.org).
AUTHOR
James Morris, Translational Research Laboratories, Institute for Women's Health, University College London.
http://www.instituteforwomenshealth.ucl.ac.uk/trl
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.