Microarray::File::GAL - A Perl module for managing microarray GAL file objects
=head1 SYNOPSIS
use Microarray::File::GAL;
my $gal_file = gal_file->new("/gal_file.gal"); # if no filehandle, assumes name is full path to file
# or
my $gal_file = gal_file->new("gal_file.gal",$filehandle); # pass name and FileHandle to original file
my $spot_name = $gal_file->get_spot_name($block,$col,$row);
my $spot_id = $gal_file->get_spot_id($block,$col,$row);
# print the GAL back to file
my $string = $gal_file->file_string;
=head1 DESCRIPTION
Microarray::File::GAL is an object-oriented Perl module for managing microarray GAL files. It doesn't create GAL files for you, but instead is used to check the contents of a GAL file, and display the microarray layout described by it.
=head2 Block padding
For whatever reason, many microarrays are printed with gaps (padding) between pin-blocks. This padding is generated by creating empty rows/columns in the printing software, and (at least on our system) these empty rows/columns are carried through to the GAL file. When the GAL module parses a GAL file, it skips any spot that has a blank 'Name' field, hence automatically removing any padding rows/columns.
It is also important to note that the method C<file_string()> is not a simple regurgitation of a GAL file opened by the object - padding spots won't be output by this method either. This provides a very quick and easy way to remove padding from a GAL file;
#!/usr/bin/perl -w
use strict;
use Microarray::File::GAL;
my $oGal_File = gal_file->new('gal_file.gal');
open GALFILE, ">gal_file_unpadded.gal";
print GALFILE $oGal_File->file_string;
close GALFILE;
If whole rows/columns of padding are found and removed, and the original GAL file has block coordinate information in the header, the GAL module will throw an error during output, warning that the number of rows/columns it has found differs from what is recorded in the header. Don't worry, this is acceptable behaviour.
=head1 METHODS
=over
=item B<get_spot_name>, B<get_spot_id>
Returns the Name/ID of a spot feature. Spot coordinates defined by passing (in order) a block, column and row value.
=item B<set_spot_name>, B<set_spot_id>
Set the Name/ID of a spot feature.
=item B<file_format>, B<file_version>
The first two values at the top of your GAL file (typically C<'ATF 1'>)
=item B<header_rows>, B<data_cols>
The next two values at the top of your GAL file - the number of rows in the header, and the number of columns of data
=item B<block_count>, B<spot_count>
Returns the number of blocks/spots on the array
=item B<block_x_origin>, B<block_y_origin>
The x,y coordinates of the start of a specified block passed to the method
=item B<block_feature_diameter>
The diameter in microns of features (spots) in a specified block
=item B<feature_diameter>
As above, but across the whole array. Returns spot diameter (in microns) if the same in all blocks, otherwise returns -1
=item B<block_x_features>, B<block_y_features>
The number of features (spots) in each column (x) or row (y) of a specified block, as described in the header block info (if present)
=item B<counted_rows>, B<counted_cols>
As above, but the actual counted values of a specified block, rather than those described in the header block info
=item B<row_count>, B<column_count>
As above, but across the whole array. Returns the number if all blocks are the same, otherwise returns -1
=item B<block_x_spacing>, B<block_y_spacing>
The spacing in microns between features (spots) in a specified block passed to the method
=item B<x_spacing>, B<y_spacing>
As above, but across the whole array. Returns the value (in microns) if all blocks are the same, otherwise returns -1
=item B<file_string>
Output the object's GAL file data as a text string.