|
C:\cpanrun\depot\main\contrib-patched\perl\CPAN\src\Bio-Affymetrix\blib/lib/Bio/Affymetrix/CEL.pm |
Bio::Affymetrix::CEL- parse Affymetrix CEL files
use Bio::Affymetrix::CEL;
# Parse the CDF file
my $cel=new Bio::Affymetrix::CEL();
$cel->parse_from_file(``foo.cel'');
# Print out all of the intensities for each square
for (my $x=0;$x<scalar(@{$cel->intensity_map()});$x++) {
for (my $y=0;$y<scalar(@{cel->intensity_map()->[$x]});$y++) {
print join(``,'',($x,$y,$cel->intensity_map->[$x][$y]->[0]).``\n'';
}
}
The Affymetrix microarray system produces files in a variety of formats. If this means nothing to you, these modules are probably not for you :). This module parses CEL files. Use this module if you want to find out about the results for individual probes on an array.
All of the Bio::Affymetrix modules parse a file entirely into memory. You therefore need enough memory to hold these objects. For some applications, parsing as a stream may be more appropriate- hopefully the source to these modules will give enough clues to make this an easy task. This module takes lots of memory due to the way Perl stores arrays. If you are writing a program that uses many CEL files, delete each CEL file once you have the information you need from it.
You fill the object filled with data using the parse_from_filehandle, parse_from_string or parse_from_file routines. You can get/set various statistics using methods on the object.
The key method is intensity_map. This returns a reference to a 2D array of parameters for each square.
Modules were written with the official Affymetrix documentation, which can be located at http://www.affymetrix.com/support/developer/AffxFileFormats.ZIP
This module can parse the CEL files produced by the Affymetrix software MAS 5 and GCOS.
Writing CEL files as well as reading them.
Copyright (C) 2005 by Nick James, David J Craigon, NASC, The University of Nottingham
This module is free software. You can copy or redistribute it under the same terms as Perl itself.
Affymetrix is a registered trademark of Affymetrix Inc., Santa Clara, California, USA.
Nick James (nick at arabidopsis.info)
David J Craigon (david at arabidopsis.info)
Nottingham Arabidopsis Stock Centre (http://arabidopsis.info), University of Nottingham.
Arg [0] : none Example : my $cel=new Bio::Affymetrix::CEL(); Description: constructor for CEL object Returntype : new Bio::Affmetrix::CEL object Exceptions : none Caller : general
original_format()
Description: Returns the format of the CEL file parsed. Currently MAS5 or XDA
Returntype : string (``MAS5'' or ``XDA'')
Exceptions : none
Caller : general
orignal_rows()
Description: Get the number of rows originally reported on this chip
Returntype : integer
Exceptions : none
Caller : general
=cutsub original_rows { my $self=shift;
return $self->{"ROWS"};
}
original_cols()
Description: Get the number of cols originally reported on this chip
Returntype : integer
Exceptions : none
Caller : general
=cutsub original_cols { my $self=shift;
return $self->{"COLS"};
}
x_offset()
Description: Get/Set the x offset. This is always 0 when parsed
from a genuine CEL file. Only available in MAS5 CEL files
Returntype : integer
Exceptions : none
Caller : general
=cutsub x_offset { my $self=shift; if (my $q=shift) { $self->{``OFFSETX''}=$q; } return $self->{``OFFSETX''}; }
y_offset()
Description: Get/Set the y offset. This is always 0 when parsed
from a genuine CEL file. Only available in MAS5 CEL files.
Returntype : integer
Exceptions : none
Caller : general
=cutsub y_offset { my $self=shift; if (my $q=shift) { $self->{``OFFSETY''}=$q; } return $self->{``OFFSETY''}; }
grid_corner_ul()
Description: Get/set the XY coordinates of the upper left grid corner in pixel coordinates. Only available in MAS5 CEL files.
Returntype : integer
Exceptions : none
Caller : general
=cutsub grid_corner_ul { my $self=shift; if (my $q=shift) { $self->{``GRIDCORNERUL''}=$q; } return $self->{``GRIDCORNERUL''}; }
grid_corner_ur()
Description: Get/set the XY coordinates of the upper right grid corner in pixel coordinates. Only available in MAS5 CEL files.
Returntype : integer
Exceptions : none
Caller : general
=cutsub grid_corner_ur { my $self=shift; if (my $q=shift) { $self->{``GRIDCORNERUR''}=$q; } return $self->{``GRIDCORNERUR''}; }
grid_corner_lr()
Description: Get/set the XY coordinates of the lower right grid corner in pixel coordinates. Only available in MAS5 CEL files.
Returntype : integer
Exceptions : none
Caller : general
=cutsub grid_corner_lr { my $self=shift; if (my $q=shift) { $self->{``GRIDCORNERLR''}=$q; } return $self->{``GRIDCORNERLR''}; }
grid_corner_ll()
Description: Get/set the XY coordinates of the lower left grid corner in pixel coordinates. Only available in MAS5 CEL files.
Returntype : integer
Exceptions : none
Caller : general
=cutsub grid_corner_ll { my $self=shift; if (my $q=shift) { $self->{``GRIDCORNERLL''}=$q; } return $self->{``GRIDCORNERLL''}; }
axis_invert_x()
Description: Get/set whether the X axis is inverted. Always false in genuine CEL files Only available in MAS5 CEL files.
Returntype : boolean
Exceptions : none
Caller : general
=cutsub axis_invert_x { my $self=shift; if (my $q=shift) { $self->{``AXIS-INVERTX''}=$q; } return $self->{``AXIS-INVERTX''}; }
axis_invert_y()
Description: Get/set whether the Y axis is inverted. Always false in genuine CEL files Only available in MAS5 CEL files.
Returntype : boolean
Exceptions : none
Caller : general
=cutsub axis_invert_y { my $self=shift; if (my $q=shift) { $self->{``AXISINVERTY''}=$q; } return $self->{``AXISINVERTY''}; }
swap_xy()
Description: Get/set whether the X and Y axis are swapped. Always false in genuine CEL files Only available in MAS5 CEL files.
Returntype : boolean
Exceptions : none
Caller : general
=cut
sub swap_xy {
my $self=shift;
if (my $q=shift) {
$self->{``SWAPXY''}=$q;
}
return $self->{``SWAPXY''};
}
Arg [0] : none Example : my $cel_file_name=$cel->original_file_name(); Description: If this object was created using parse_from_file, the original filename. Otherwise undef. Returntype : string Exceptions : none Caller : general
Arg [1] : string $algorithm_name (optional) Example : my $algorithm_name=$cel->algorithm_name(); Description: Get/set the algorithm name that created this CEL file. Returntype : string Exceptions : none Caller : general
Arg [1] : hashref $algorithm_params (optional)
Example : my %algorithm_params=%{$cel->algorithm_params()};
# Print margin of cells ignored for calculating signal
print $algorithm_params(``CellMargin'');
Description: Get/set the algorithm parameters for the CEL file creation Returntype : hashref Exceptions : none Caller : general
sub intensity_map { my $self=shift; if (my $q=shift) { $self->{``_INTENSITY''}=$q; }
return $self->{"_INTENSITY"};
}
Arg [1] : string Example : $cel->parse_from_string($cel_file_in_a_string); Description: Parse a CEL file from a buffer in memory Returntype : none Exceptions : none Caller : general
Arg [1] : string Example : $cel->parse_from_file($cel_filename); Description: Parse a CEL file from a file Returntype : none Exceptions : dies if cannot open file Caller : general
Arg [1] : reference to filehandle Example : $cel->parse_from_filehandle(\*STDIN); Description: Parse a CEL file from a filehandle Returntype : none Exceptions : none Caller : general
|
C:\cpanrun\depot\main\contrib-patched\perl\CPAN\src\Bio-Affymetrix\blib/lib/Bio/Affymetrix/CEL.pm |