R version 4.5.0 RC (2025-04-04 r88112 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("aroma.apd") Loading required package: affxparser aroma.apd v0.7.1 successfully loaded. See ?aroma.apd for help. > library("R.utils") # Arguments Loading required package: R.oo Loading required package: R.methodsS3 R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help. R.oo v1.27.0 (2024-11-01 18:00:02 UTC) successfully loaded. See ?R.oo for help. Attaching package: 'R.oo' The following object is masked from 'package:R.methodsS3': throw The following objects are masked from 'package:methods': getClasses, getMethods The following objects are masked from 'package:base': attach, detach, load, save R.utils v2.13.0 (2025-02-24 21:20:02 UTC) successfully loaded. See ?R.utils for help. Attaching package: 'R.utils' The following object is masked from 'package:affxparser': findFiles The following object is masked from 'package:utils': timestamp The following objects are masked from 'package:base': cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings > > verbose <- Arguments$getVerbose(TRUE) > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # 1. Scan for existing CEL files > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # a) Scan current directory for CEL files > files <- list.files(pattern="[.](cel|CEL)$") > files <- files[!file.info(files)$isdir] > > if (length(files) > 0 && require("affxparser")) { + # b) Corresponding APD filenames + celNames <- files + apdNames <- gsub(pattern, ".apd", files) + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # 1. Copy the probe intensities from a CEL to an APD file + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + for (kk in 1) { + verbose && enter(verbose, "Reading CEL file #", kk) + cel <- readCel(celNames[kk]) + verbose && exit(verbose) + + if (!file.exists(apdNames[kk])) { + verbose && enter(verbose, "Creating APD file #", kk) + chipType <- cel$header$chiptype + writeApd(apdNames[kk], data=cel$intensities, chipType=chipType) + verbose && exit(verbose) + } + + verbose && enter(verbose, "Verifying APD file #", kk) + apd <- readApd(apdNames[kk]) + verbose && exit(verbose) + stopifnot(identical(apd$intensities, cel$intensities)) + } + + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # 2. Read a subset of the units + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + units <- c(1, 20:205) + cel <- readCelUnits(celNames[1], units=units) + apd <- readApdUnits(apdNames[1], units=units) + stopifnot(identical(apd, cel)) + + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # 3. The same, but stratified on PMs and MMs + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + apd <- readApdUnits(apdNames[1], units=units, stratifyBy="pmmm", + addDimnames=TRUE) + } # if (length(files) > 0) > > proc.time() user system elapsed 0.18 0.07 0.25