Bio-Affymetrix

 view release on metacpan or  search on metacpan

lib/Bio/Affymetrix/CHP.pm  view on Meta::CPAN

#!/usr/bin/perl

package Bio::Affymetrix::CHP;

# Docs come before the code

=head1 NAME

Bio::Affymetrix::CHP- parse Affymetrix CHP files

=head1 SYNOPSIS

use Bio::Affymetrix::CHP;

use Bio::Affymetrix::CDF;

# Parse the CDF file

my $cdf=new Bio::Affymetrix::CDF();

$cdf->parse_from_file("foo.cdf");


# Make a new CHP object, using the CDF file

my $chp=new Bio::Affymetrix::CHP($cdf);

# Parse CHP file

$chp->parse_from_file("foo.chp");

# Find some fun facts about this chip

print $chp->algorithm_name()."\n";

print $chp->version()."\n";


# Print out all of the signal values for this chip

while (my ($probename,$results)=each %{$chp->probe_set_results()}) {
    print $probename.",".$results->{"Signal"}."\n";
}



=head1 DESCRIPTION

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 CHP files. 

This module requires a Bio::Affymetrix::CDF object before it can do
anything. This must be supplied to the constructor. See the perldoc
for that to see how to use that module. The module can parse various
types of CHP file transparently. You can find out what type you have
by using the original_version() method.
    
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. 

You can also use this software to write CHP files (see the
write_to_file and write_to_filehandle methods). 

=head2 HINTS

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. Data is retrieved as a giant hash from
probe_set_results. Subroutines marked "original_" give values as they
are claimed in the original file, not as they are now (for instance if
you modify the value) 

=head1 NOTES

=head2 REFERENCE

Modules were written with the official Affymetrix documentation, which
can be located at http://www.affymetrix.com/support/developer/AffxFileFormats.ZIP

=head2 COMPATIBILITY

This module can parse the CHP files produced by the Affymetrix software
MAS 5 and GCOS v1.2. It can also process files produced by GCOS v1.0
in theory. However the authors of this module have never actually
seen an actual GCOS v1.0 file, and so we rely on the specification
supplied by Affymetrix only. If you have GCOS v1.0 files, feedback
as to whether the code actually works is welcome.

Whatever file format you use the module should work transparently.

These modules are focused on GCOS v1.2 CHP files. The MAS5 CHP
files actually contain a lot of extra information that is not
displayed in MAS5 or GCOS. This information is thrown away by the
parser.

This module can only do expression arrays.

Writing CHP files should work no matter what kind of CHP file was
parsed originally. In other words, you can use these modules as a CHP
file converter.

As stated above, some of the information that is in a MAS5 file is not
present in an GCOS file. This module throws away all of this
additional information. This means that if you try and write a MAS5
file, there will be large blank sections. This should not put off any
programs that use them- this tactic was based on the Affymetrix
conversion.

=head2 KNOWN BUG

Change P Value always comes out wrong when using comparison CHP files
from MAS5. If you have a solution for this, please send email to the
addresses below.

=head1 COPYRIGHT

Copyright (C) 2005 by Nick James, David J Craigon, NASC (arabidopsis.info), 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.

=head1 AUTHORS
    
Nick James (nick at arabidopsis.info)

David J Craigon (david at arabidopsis.info)

Nottingham Arabidopsis Stock Centre (http://arabidopsis.info), University of Nottingham.

=head1 METHODS

=cut


use strict;
use warnings;
use Carp;

our $VERSION=0.5;

# Module for processing CHP files


=head2 new

  Arg [1]    : Bio::Affymetrix::CDF $db_file



( run in 2.632 seconds using v1.01-cache-2.11-cpan-7fcb06a456a )