findCdf {affxparser} | R Documentation

## Search for CDF files in multiple directories

### Description

Search for CDF files in multiple directories.

### Usage

    findCdf(chipType=NULL, paths=NULL, pattern="[.](c|C)(d|D)(f|F)$", ...)

### Arguments

`chipType` | A `character` string of the chip type to search for.
`paths` | A `character` `vector` of paths to be searched. The current directory is always searched at the beginning. If `NULL`, default paths are searched. For more details, see below.
`pattern` | A regular expression file name pattern to match.
`...` | Additional arguments passed to `findFiles`().

### Details

Note, the current directory is always searched at the beginning. This provides an easy way to override other files in the search path. If `paths` is `NULL`, then a set of default paths are searched. The default search path is consituted of:

1. `"."`
2. `"cdf/;data/cdf/"`
3. `getOption("AFFX_CDF_PATH")`
4. `Sys.getenv("AFFX_CDF_PATH")`

One of the easiest ways to set system variables for R is to set them in an `.Renviron` file, e.g.

        # affxparser: Set default CDF path
        AFFX_CDF_PATH=${AFFX_CDF_PATH};M:/Affymetrix_2004-100k_trios/cdf
        AFFX_CDF_PATH=${AFFX_CDF_PATH};M:/Affymetrix_2005-500k_data/cdf

See `Startup` for more details.

### Value

Returns a `vector` of the full pathnames of the files found.

### Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

### See Also

This method is used internally by `readCelUnits`() if the CDF file is not specified.

### Examples

    # Find a specific CDF file
    cdfFile <- findCdf("Mapping50K_Xba240")
    print(cdfFile)

    # Find the first CDF file (no matter what it is)
    cdfFile <- findCdf()
    print(cdfFile)

    # Find all CDF files in search path and display their headers
    cdfFiles <- findCdf(firstOnly=FALSE)
    for (cdfFile in cdfFiles) {
      cat("=======================================\n")
      hdr <- readCdfHeader(cdfFile)
      str(hdr)
    }

[Package affxparser version 1.6.2 Index]