Version: | 0.1.5 |
Title: | Methods for Reading dChip Files |
Depends: | R (≥ 2.6.0) |
Date: | 2016-01-12 |
Author: | Henrik Bengtsson [aut, cre, cph] |
Maintainer: | Henrik Bengtsson <henrikb@braju.com> |
Description: | Functions for reading DCP and CDF.bin files generated by the dChip software. |
License: | LGPL-2.1 | LGPL-3 [expanded from: LGPL (≥ 2.1)] |
URL: | https://github.com/HenrikBengtsson/dChipIO |
BugReports: | https://github.com/HenrikBengtsson/dChipIO/issues |
LazyLoad: | TRUE |
biocViews: | Infrastructure, DataImport |
NeedsCompilation: | no |
Packaged: | 2016-01-13 17:33:01 UTC; hb |
Repository: | CRAN |
Date/Publication: | 2016-01-13 22:36:24 |
Package dChipIO
Description
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
To get started, see:
-
readCdfBin
() - reads a dChip CDF.bin file. -
readDcp
() - reads a dChip DCP data file.
License
The releases of this package is licensed under LGPL version 2.1 or newer.
Author(s)
Henrik Bengtsson.
References
[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
A private function
Description
A private function.
Usage
.argAssertRange(x, range, ...)
Arguments
x |
|
range |
|
... |
Not used. |
Value
Returns x
if valid, otherwise an error is thrown.
Author(s)
Henrik Bengtsson
Reads a dChip CDF.bin file
Description
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.
Usage
readCdfBin(con, units=NULL, ...)
Arguments
con |
A |
units |
An |
... |
Not used. |
Value
Returns a list
structure containing the file header and the unit data.
Author(s)
Henrik Bengtsson
See Also
To read only the CDF.bin file header, see readCdfBinHeader
().
Examples
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
Description
Reads the file header of a dChip CDF.bin file.
Usage
readCdfBinHeader(con, ...)
Arguments
con |
A |
... |
Not used. |
Value
Returns a list
structure containing the file header.
Author(s)
Henrik Bengtsson
See Also
To read the CDF.bin file data, see readCdfBin
().
Reads a dChip DCP file
Description
Reads a dChip DCP file.
Usage
readDcp(con, fields=c("rawIntensities", "normalizedIntensities", "calls", "thetas",
"thetaStds", "excludes"), cells=NULL, units=NULL, .nbrOfUnits=NULL, ...)
Arguments
con |
A |
fields |
|
cells |
An |
units |
An |
.nbrOfUnits |
A |
... |
Not used. |
Value
Returns a list
structure containing the file header and the
requested data fields.
Author(s)
Henrik Bengtsson
See Also
To read only the DCP file header, see readDcpHeader
().
Examples
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
Description
Reads the file header of a dChip DCP file.
Usage
readDcpHeader(con, ...)
Arguments
con |
A |
... |
Not used. |
Value
Returns a list
structure containing the file header.
Author(s)
Henrik Bengtsson
See Also
To read also the DCP file data, see readDcp
().
Reads a spatial subset of probe-level data from a dChip DCP file
Description
Reads a spatial subset of probe-level data from a dChip DCP file.
Usage
readDcpRectangle(filename, fields=c("rawIntensities", "normalizedIntensities"),
xrange=c(0, Inf), yrange=c(0, Inf), ..., asMatrix=TRUE)
Arguments
filename |
The pathname of the DCP file. |
fields |
The cell fields to be read. |
xrange |
A |
yrange |
A |
asMatrix |
If |
... |
Additional arguments passed to |
Value
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.
Author(s)
Henrik Bengtsson
See Also
The readDcp
() method is used internally.
This method was inspired by readCelRectangle()
of the
affxparser package.
Examples
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")