[BioC] TAG3 script

Joshi, Nina (NIH/NCI) joshini at mail.nih.gov
Fri Jan 7 00:01:51 CET 2005


I am trying to create an affybatch from the cel files for the TAG3 chips
(custom DNA arrays made by affy of the diploid and yeast haploid deletion
strain) using the ReadTAG3 array script (written by Rafeal) on UNIX using R
version 1.8.1, but I am receiving the following error:  
 
         Error in eval.with.vis(expr, envir, enclose):
         Object "KIND." not found
 
I would appreciate any information about this error or any suggestions,
advice or comments on retrieving creating an affybatch using the cel files.
 


Note:  the script is attached


Thanks,
 
Nina
 
 


-------------- next part --------------
##THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 
KIND.  
ReadTAG3 <- function(filename="Tag3_ID.txt", CDFfile = "TAG_3.CDF",  
                     CELfiles = NULL,  
                     compress.cel = FALSE,  
                     compress.cdf = FALSE, verbose = T, chip.names = NULL,  
                     rm.mask = FALSE, rm.outliers = FALSE, rm.extra = FALSE,  
                     cdf.name = NULL, ...)  
{  
  ##FIRST CHOOSE FILES  
  ##with widget  
  ##or without  
  files <- list.files(...)  
  if (is.null(CDFfile))  
    CDFfile <- files[grep(".[cC][dD][fF]", files)]  
  if (length(CDFfile) != 1)  
    stop(paste("CDFfile is not specified,exactly one CDF file must exist in path.\n"))  
  if (is.null(CELfiles))  
    CELfiles <- files[grep(".[cC][eE][lL]", files)]  
    
  nchips <- length(CELfiles)  
  if (nchips < 1)  
    stop(paste("CELfiles is not specified, at least one CEL file must exist in path.\n"))  
  if (is.null(chip.names)) {  
  chip.names <- CELfiles  
  chip.names <- as.character(sapply(chip.names, function(x) strsplit(x,"\\.")[[1]][1]))  
}  
  else {  
    if (length(chip.names) != nchips) {  
      warning("Not the same number of chips than chip names. Assigning names from 
file.\n")  
      chip.names <- CELfiles  
      chip.names <- as.character(sapply(chip.names, function(x) strsplit(x,"\\.")[[1]][1]))  
    }  
  }  
    
      
  if (verbose)  
    cat("reading CDF file\n")  
  cdf <- read.cdffile(CDFfile, compress = compress.cdf)  
  if (verbose)  
    cat("processing information\n")  
    
  info <- read.table(filename,header=T,sep="\t",as.is=T)  
  upordown <- info[,"Plate"]  
  upordown <- sapply(upordown,function(x)  
                     if(length(grep("U",x)>0)) return("U")  
                     else return("D")) 
  geneNames <- info[,"Name"]  
  tagNames <- info[,"Tag.name"]  
  names(geneNames) <- tagNames  
  names(upordown) <- tagNames  
    
  probeNames <- cdf at name.levels[as.vector(cdf at name)]  
  nrow <- dim(cdf at name)[1]  
  ncol <- dim(cdf at name)[2]  
  xs <- rep(0:(nrow-1), ncol)  
  ys <- rep(0:(ncol-1), rep(nrow, ncol))  
  Index <- probeNames%in%tagNames  
  mmindex <- which(ys%%4==2 & Index)  
  pmindex <- which(ys%%4==1 & Index)  
  cpmindex <- pmindex+2*nrow  
  cmmindex <- mmindex+2*nrow  
    
  probeNames <- probeNames[pmindex]  
  nprob <- length(pmindex)  
  x <- xs[pmindex]  
  y <- ys[pmindex]  
    
  pm <- matrix(0, nprob, nchips)  
  mm <- matrix(0, nprob, nchips)  
  cpm <- matrix(0,nprob, nchips)  
  cmm <- matrix(0,nprob, nchips)  
    
  if (verbose)  
    cat("reading", nchips, "CEL files")  
  for (i in 1:nchips) {  
    aux <- as.vector(read.affybatch(filenames=CELfiles[i])@exprs)  
    if (nrow * ncol != length(aux))  
          stop(paste(CELfiles[i], "doesn't match with CDFfile\n"))  
        pm[, i] <- aux[pmindex]  
        mm[, i] <- aux[mmindex]  
        cpm[, i] <- aux[cpmindex]  
        cmm[, i] <- aux[cmmindex]  
        if (verbose)  
          cat(".")  
      }  
  if (verbose)  
    cat("\npreparing probe level object\n")  
  ## generate probenames for each probe using cdf at name.levels and probe.ids  
  probe.ids <- as.vector(cdf at name)[pmindex]  
  probe.names <- cdf at name.levels[probe.ids] 
  colnames(pm) <- chip.names  
  rownames(pm) <- probeNames  
  colnames(mm) <- chip.names  
  rownames(mm) <- probeNames  
  colnames(cpm) <- chip.names  
  rownames(cpm) <- probeNames  
  colnames(cmm) <- chip.names  
  rownames(cmm) <- probeNames  
    
    
list(pm=pm,mm=mm,cpm=cpm,cmm=cmm,geneNames=geneNames[probeNames],  
      probeNames=probeNames,upordown=upordown[probeNames],x=x,y=y)  
    
} 



More information about the Bioconductor mailing list