########################################################################## # # Author: Hans van Leeuwen # Department of Plant Sciences # University of California, Davis # Mail Stop 3 # One Shields Ave # Davis, CA 95616 # Email: hvanleeuwen@ucdavis.edu # Web: http://elp.ucdavis.edu/data/analysis/sfp_map/SFPscan.html # # # Date: JUNE 2005 # ########################################################################## ########################################################################## ######################### IMPORTANT ###################################### ########################################################################## ########### THE LINES MARKED WITH 'CHANGE' MUST ######################### ########### BE MODIFIED USING YOUR PATH ######################### ########################################################################## ######################### IMPORTANT ###################################### ########################################################################## ########################################################################## ######################### IMPORTANT ###################################### ########################################################################## ########### THIS SCRIPT CAN TAKE A WHILE TO RUN ######################### ########### IF YOU HAVE MORE THAN 100 FILES ######################### ########### IT CAN TAKE MORE THAN AN HOUR!! ######################### ########### DEPENDING ON YOUR SYSTEM ######################### ########################################################################## ######################### IMPORTANT ###################################### ########################################################################## ########################################################################## # Set work directory to the directory where your .CEL files are located setwd("C:/rw1081/hans_temp") ######### CHANGE ######## ########################################################################## # Read in file with chip ID's for which the CEL files will be read later # This file should have format: # R5.CEL # R85.CEL # R221.CEL # R277.CEL # R30.CEL # R82.CEL # R270.CEL # # etc... # ##### This file should have the filename 'chips.txt' ##################### chips <- read.table("chips.txt") ########################################################################## # Load affy package library(affy) ########################################################################## # Open cel files one by one for (i in 1:length(chips$V1)){ # Set work directory to the directory where your .CEL files are located setwd("C:/rw1081/hans_temp") ######### CHANGE ######## data <- ReadAffy(filenames = as.character(chips$V1[i])) data.bg <- bg.correct.rma(data) data.bg.matrix <- pm(data.bg) # Set work directory to the directory where the background corrected files # will be saved. This can not be the same work directory that contains the original .CEL files!! setwd("C:/rw1081/hans_temp/bg_files") ######### CHANGE ######## write.table(data.bg.matrix, file = as.character(chips$V1[i]), append = FALSE, quote = TRUE, sep = ",", eol = "\n", na = "NA", dec = ".", row.names = TRUE, col.names = TRUE, qmethod = c("escape", "double")) } # end for