Bio.Affy.CelFile module

Reading information from Affymetrix CEL files version 3 and 4.

exception Bio.Affy.CelFile.ParserError(*args)

Bases: ValueError

Affymetrix parser error.

__init__(*args)

Initialise class.

class Bio.Affy.CelFile.Record

Bases: object

Stores the information in a cel file.

Example usage:

>>> from Bio.Affy import CelFile
>>> with open("Affy/affy_v3_example.CEL") as handle:
...     c = CelFile.read(handle)
...
>>> print(c.ncols, c.nrows)
5 5
>>> print(c.intensities)
[[   234.    170.  22177.    164.  22104.]
 [   188.    188.  21871.    168.  21883.]
 [   188.    193.  21455.    198.  21300.]
 [   188.    182.  21438.    188.  20945.]
 [   193.  20370.    174.  20605.    168.]]
>>> print(c.stdevs)
[[   24.     34.5  2669.     19.7  3661.2]
 [   29.8    29.8  2795.9    67.9  2792.4]
 [   29.8    88.7  2976.5    62.   2914.5]
 [   29.8    76.2  2759.5    49.2  2762. ]
 [   38.8  2611.8    26.6  2810.7    24.1]]
>>> print(c.npix)
[[25 25 25 25 25]
 [25 25 25 25 25]
 [25 25 25 25 25]
 [25 25 25 25 25]
 [25 25 25 25 25]]
__init__()

Initialize the class.

Bio.Affy.CelFile.read(handle, version=None)

Read Affymetrix CEL file and return Record object.

CEL files format versions 3 and 4 are supported. Please specify the CEL file format as 3 or 4 if known for the version argument. If the version number is not specified, the parser will attempt to detect the version from the file contents.

The Record object returned by this function stores the intensities from the CEL file in record.intensities. Currently, record.mask and record.outliers are not set in when parsing version 4 CEL files.

Example Usage:

>>> from Bio.Affy import CelFile
>>> with open("Affy/affy_v3_example.CEL") as handle:
...     record = CelFile.read(handle)
...
>>> record.version == 3
True
>>> print("%i by %i array" % record.intensities.shape)
5 by 5 array
>>> with open("Affy/affy_v4_example.CEL", "rb") as handle:
...     record = CelFile.read(handle, version=4)
...
>>> record.version == 4
True
>>> print("%i by %i array" % record.intensities.shape)
5 by 5 array