# Sample processing of FCS .csv file # efg, 6 July 2005, Stowers Institute. fcs <- read.csv("http://research.stowers-institute.org/efg/ScientificSoftware/Utility/FCSExtract/CC4_067_BM.csv") dim(fcs) names(fcs) # 1. Histogram hist(fcs$PE.Cy7, breaks=128, xlab="Channel", ylab="Count", main="Histogram (12-bit) of PE.Cy7") # 2. Histogram as line graph h <- hist(round(fcs$PE.Cy7), breaks=128, plot=FALSE) plot(h$mids, h$counts, type="l", xlab="Channel", ylab="Count", main="PE.Cy7") # 3. PE.Cy7 Vs FITC scatterplot plot(fcs$FITC, fcs$PE.Cy7, pch=".", main="PE.Cy7 Vs FITC") # 4. Use color coding to show "density" of frequencies # Force from 0:4095 (12-bit) to 0:255 (8-bit) i <- 1 + trunc(fcs$PE.Cy7 / 16) j <- 1 + trunc(fcs$FITC / 16) # Use 256-by-256 matrix to form image m <- matrix(0, 256, 256) for (k in 1:length(i)) { m[j[k], i[k]] <- m[j[k], i[k]] + 1 } image(m, col=c("white", rainbow(16)), axes=F, xlab="FITC", ylab="PE.Cy7", main="PE.Cy7 Vs FITC") axis(SOUTH<-1, at=seq(0,1,length=9), labels=256*seq(0,1,length=9)) axis(WEST <-2, at=seq(0,1,length=9), labels=256*seq(0,1,length=9))