Title: | Methods for Reading dChip Files |
---|---|
Description: | Functions for reading DCP and CDF.bin files generated by the dChip software. |
Authors: | Henrik Bengtsson [aut, cre, cph] |
Maintainer: | Henrik Bengtsson <[email protected]> |
License: | LGPL (>= 2.1) |
Version: | 0.1.5 |
Built: | 2024-10-24 05:28:58 UTC |
Source: | https://github.com/HenrikBengtsson/dChipIO |
Functions for reading DCP and CDF.bin files generated by the dChip software.
The example data used in this package orginates from the Affymetrix Fusion SDK library [3].
To get started, see:
readCdfBin
() - reads a dChip CDF.bin file.
readDcp
() - reads a dChip DCP data file.
The releases of this package is licensed under LGPL version 2.1 or newer.
Henrik Bengtsson.
[1] The dChip software, http://www.dchip.org/
[2] Thread 'DCP File Format', 'dChip Software', Google Groups,
December 2008.
https://groups.google.com/forum/#!topic/dchip-software/Q7mTJPPpZ5U
[3] Affymetrix Inc, Fusion Software Developers Kit (SDK), 2008.
http://www.affymetrix.com/estore/partners_programs/programs/developer/fusion/index.affx?terms=no
Reads a dChip CDF.bin file.
Please note that this method is incomplete as it currently doesn't read all fields. It is only made available so that someelse can continue the development.
readCdfBin(con, units=NULL, ...)
readCdfBin(con, units=NULL, ...)
con |
A |
units |
An |
... |
Not used. |
Returns a list
structure containing the file header and the unit data.
Henrik Bengtsson
To read only the CDF.bin file header, see readCdfBinHeader
().
path <- system.file("exData", package="dChipIO") chipType <- "Test3" filename <- sprintf("%s.CDF.bin", chipType) pathname <- file.path(path, filename) hdr <- readCdfBinHeader(pathname) print(hdr) data <- readCdfBin(pathname) str(data) # Read a subset of the units units <- c(10:11, 15:20, 150:105, 2,2,2) dataT <- readCdfBin(pathname, units=units) str(dataT) # Assert correctness for (ff in c("unitNames", "numProbes", "CellPos")) { stopifnot(length(dataT[[ff]]) == length(units)) stopifnot(identical(dataT[[ff]], data[[ff]][units])) }
path <- system.file("exData", package="dChipIO") chipType <- "Test3" filename <- sprintf("%s.CDF.bin", chipType) pathname <- file.path(path, filename) hdr <- readCdfBinHeader(pathname) print(hdr) data <- readCdfBin(pathname) str(data) # Read a subset of the units units <- c(10:11, 15:20, 150:105, 2,2,2) dataT <- readCdfBin(pathname, units=units) str(dataT) # Assert correctness for (ff in c("unitNames", "numProbes", "CellPos")) { stopifnot(length(dataT[[ff]]) == length(units)) stopifnot(identical(dataT[[ff]], data[[ff]][units])) }
Reads the file header of a dChip CDF.bin file.
readCdfBinHeader(con, ...)
readCdfBinHeader(con, ...)
con |
A |
... |
Not used. |
Returns a list
structure containing the file header.
Henrik Bengtsson
To read the CDF.bin file data, see readCdfBin
().
Reads a dChip DCP file.
readDcp(con, fields=c("rawIntensities", "normalizedIntensities", "calls", "thetas", "thetaStds", "excludes"), cells=NULL, units=NULL, .nbrOfUnits=NULL, ...)
readDcp(con, fields=c("rawIntensities", "normalizedIntensities", "calls", "thetas", "thetaStds", "excludes"), cells=NULL, units=NULL, .nbrOfUnits=NULL, ...)
con |
A |
fields |
|
cells |
An |
units |
An |
.nbrOfUnits |
A |
... |
Not used. |
Returns a list
structure containing the file header and the
requested data fields.
Henrik Bengtsson
To read only the DCP file header, see readDcpHeader
().
path <- system.file("exData", package="dChipIO") filename <- "Test3-1-121502.dcp" pathname <- file.path(path, filename) hdr <- readDcpHeader(pathname) print(hdr) data <- readDcp(pathname) str(data) # Read a subset of the units units <- c(10:11, 15:20, 150:105, 2,2,2) dataT <- readDcp(pathname, units=units) str(dataT) # Assert correctness for (ff in c("calls", "thetas", "thetaStds", "excludes")) { stopifnot(length(dataT[[ff]]) == length(units)) stopifnot(identical(dataT[[ff]], data[[ff]][units])) }
path <- system.file("exData", package="dChipIO") filename <- "Test3-1-121502.dcp" pathname <- file.path(path, filename) hdr <- readDcpHeader(pathname) print(hdr) data <- readDcp(pathname) str(data) # Read a subset of the units units <- c(10:11, 15:20, 150:105, 2,2,2) dataT <- readDcp(pathname, units=units) str(dataT) # Assert correctness for (ff in c("calls", "thetas", "thetaStds", "excludes")) { stopifnot(length(dataT[[ff]]) == length(units)) stopifnot(identical(dataT[[ff]], data[[ff]][units])) }
Reads the file header of a dChip DCP file.
readDcpHeader(con, ...)
readDcpHeader(con, ...)
con |
A |
... |
Not used. |
Returns a list
structure containing the file header.
Henrik Bengtsson
To read also the DCP file data, see readDcp
().
Reads a spatial subset of probe-level data from a dChip DCP file.
readDcpRectangle(filename, fields=c("rawIntensities", "normalizedIntensities"), xrange=c(0, Inf), yrange=c(0, Inf), ..., asMatrix=TRUE)
readDcpRectangle(filename, fields=c("rawIntensities", "normalizedIntensities"), xrange=c(0, Inf), yrange=c(0, Inf), ..., asMatrix=TRUE)
filename |
The pathname of the DCP file. |
fields |
The cell fields to be read. |
xrange |
A |
yrange |
A |
asMatrix |
If |
... |
Additional arguments passed to |
A named list
CEL structure similar to what readDcp
().
In addition, if asMatrix
is TRUE
, the CEL data fields
are returned as matrices, otherwise not.
Henrik Bengtsson
The readDcp
() method is used internally.
This method was inspired by readCelRectangle()
of the
affxparser package.
path <- system.file("exData", package="dChipIO") filename <- "Test3-1-121502.dcp" pathname <- file.path(path, filename) data <- readDcpRectangle(pathname) layout(matrix(1:4, nrow=2, byrow=TRUE)) image(data$rawIntensities, main="Raw probe signals") image(data$normalizedIntensities, main="Normalized probe signals")
path <- system.file("exData", package="dChipIO") filename <- "Test3-1-121502.dcp" pathname <- file.path(path, filename) data <- readDcpRectangle(pathname) layout(matrix(1:4, nrow=2, byrow=TRUE)) image(data$rawIntensities, main="Raw probe signals") image(data$normalizedIntensities, main="Normalized probe signals")