Learn R Programming

aroma.apd (version 0.7.0)

celToApd: Generates an APD file from an Affymetrix CEL file

Description

Generates an APD file from an Affymetrix CEL file.

Usage

# S3 method for default
celToApd(filename, apdFile=NULL, mapType="asChipType", writeMap=NULL, ..., verbose=FALSE)

Value

Returns (invisibly) the pathname of the written APD file.

Arguments

filename

The pathname of the CEL file.

apdFile

An optional pathname of the APD file, otherwise it will be the same as the CEL file with extension replaced with 'apd'.

mapType

The type of read map for the generated APD file. If NULL, no remapping of the cell indices is done. If "asChipType", the map type is the same as the chip type of the CEL file. If any other character string, it sets the map type to that string. Note that there must be a APD map file with this type that can be found by findApdMap().

writeMap

An optional write map integer vector used to remap the cell indices for optimal reading speed. If NULL, the write map may be obtained from the read map file specified by the mapType argument.

...

Additional arguments passed to writeApd().

verbose

A Verbose object.

Author

Henrik Bengtsson

See Also

To create an APD map file from a CDF file, see cdfToApdMap(). To read an APD file, see readApd(). To read an APD map file, see readApdMap().

Examples

Run this code

library("R.utils")  ## Arguments

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1. Scan for existing CEL files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# a) Scan for CEL files
files <- list.files(pattern="[.](cel|CEL)$")
files <- files[!file.info(files)$isdir]
if (length(files) > 0 && require("affxparser")) {
  cat("Create an optimal read map for CEL file:", files[1], "\n")
  cdffile <- findCdf(readCelHeader(files[1])$chiptype)
  res <- cdfToApdMap(cdffile)
 
  cat("Converting CEL file to APD file:", files[1], "\n")
  apdfile <- celToApd(files[1])
  cat("Created APD file:", apdfile, "\n")
  file.remove(apdfile)
 
  cat("Converting CEL file to APD file with an optimized read map:", files[1], "\n")
  apdfile <- celToApd(files[1], mapType=res$mapType)
  cat("Created APD file:", apdfile, "\n")
 
  writeMap <- invertMap(res$readMap)
  for (file in files[-1]) {
    cat("Converting CEL file to APD file with an optimized read map:", file, "\n")
    apdfile <- celToApd(file, mapType=res$mapType, writeMap=writeMap)
    cat("Created APD file:", apdfile, "\n")
  }
} # if (length(files) > 0)

Run the code above in your browser using DataLab