1234567891011121314151617181920212223242526272829303132333435 |
- cheminfo<-function (file, masterChemFile = masterChemFile)
- {
- masterChem = read.csv(masterChemFile)
- masterCD <- as.data.frame(masterChem)
- masterCD <- masterCD[, 1:9]
- temp1 <- paste(masterCD$Project, masterCD$Experiment.Date,
- masterCD$Plate.SN, sep = "_")
- masterCD$filenames <- temp1
- masterCD <- masterCD[order(masterCD$Experiment.Date, masterCD$Plate.SN,
- masterCD$Well), ]
- shortFileName <- paste(strsplit(basename(file), "_")[[1]][1],
- strsplit(basename(file), "_")[[1]][2], strsplit(basename(file),
- "_")[[1]][3], sep = "_")
- plate.chem.info <- list()
- count = 1
- matchedFileName = 0
- for (i in which(shortFileName == masterCD$filename)) {
- matchedFileName = 1
- plate.chem.info$well[count] <- paste(masterCD$Well[i])
- plate.chem.info$treatment[count] <- paste(masterCD$Treatment[i])
- plate.chem.info$size[count] <- paste(masterCD$Size[i])
- plate.chem.info$dose[count] <- paste(masterCD$Dose[i])
- plate.chem.info$units[count] <- paste(masterCD$Units[i])
- count = count + 1
- }
- if (matchedFileName == 0) {
- print(paste("File ", shortFileName, " was not found in the possible file names \n constructed from exp log file:",
- unique(masterCD$filename), sep = ""))
- }
- if (!is.element(length(plate.chem.info$well), c(12, 48))) {
- print(paste("Info exists for ", length(plate.chem.info$well),
- " wells; Some wells have no data.", sep = ""))
- }
- plate.chem.info
- }
|