The code below makes a flowSet object, then trims out columns as described in other posts at this forum. Following this, I use the spillover command to create my compensation matrix as detailed here: Help with flowCore
# open .FCS files fcs_names <- list.files(fcspath, pattern="*.fcs", full.names=TRUE) # make a flowSet object fs <- read.flowSet(files = list.files(fcspath, pattern = "fcs", full = TRUE)) trim_fs<-fs[ , c(1,3, 5:15)] # get rid of Time, FSC-H, and SSC-H, columns # Make compensation matrix from flowSet comp <- spillover(trim_fs, unstained = "Compensation_Controls_Unstained_Control_001.fcs", fsc = "FSC-A", ssc = "SSC-A", method = "median", stain_match="regexpr", useNormFilt = T, pregate = F, plot = T) fs_comp <- fsApply(trim_fs,function(frame){ new_frame <- compensate(frame,comp) new_frame })
Doing this generates the following compensation matrix, called `comp`. BUT - in post above, there is an additional line that I removed:
comp <- keyword(frame)$`SPILL`
appears. I removed it, based on Greg Finak's caveat (in that webpage, and reprinted here): "I would add one more caveat.. double check that the $SPILL matrix is not just the identity matrix (sometimes this is the case). If so you'll need the single stained controls and the unstained control to calculate the spillover matrix with spillover(), and then proceed as Mike suggests."
Based on the code (without the removed line) the SPILL matrix is the identity matrix `trim_fs`. However, it is still the identity matrix in `fs_comp`, after the spillover command has been run. Did I do something wrong, or is the matrix correctly specified? comp looks like this:
comp
FL16-A FL17-A FL18-A FL10-A FL11-A FL13-A FL15-A FL3-A FL6-A FL1-A FL2-A FL16-A 0.064483949 0.000000000 0.00000000 0.4966442879 0.000000000 1.000000000 0.1093778062 0.515145949 0.00000000 0.00000000 0.0000000000 FL17-A 0.207667955 0.302936275 0.04505139 0.0037973906 0.000000000 0.044282477 0.0009981806 0.004568788 0.11537844 0.00000000 1.0000000000 FL18-A 0.137290369 0.047755735 1.00000000 0.0026519491 0.000000000 0.005856387 0.0009337569 0.002946610 0.62932020 0.00000000 0.0000000000 FL10-A 0.530164933 0.115803952 0.00000000 0.2101694797 0.000000000 1.000000000 0.0491067396 0.289509871 0.00000000 0.00000000 0.0000000000 FL11-A 0.002544856 0.000000000 0.00000000 0.1752085836 1.000000000 0.090981328 0.0273384220 0.033931431 0.00000000 0.04052444 0.0000000000 FL13-A 0.000000000 0.000000000 0.00000000 0.0602779546 0.003245736 0.000000000 1.0000000000 0.000000000 0.00000000 0.00000000 0.0000000000 FL15-A 0.000000000 0.000000000 0.00000000 1.0000000000 0.075268818 0.715053686 0.6912234419 0.342923585 0.00000000 0.00000000 0.0000000000 FL3-A 0.018565235 1.000000000 0.15944549 0.0043590259 0.000000000 0.007846247 0.0020772031 0.004712460 0.05104339 0.00000000 0.0036707592 FL6-A 1.000000000 0.337469559 0.05865700 0.0018091793 0.000000000 0.008401532 0.0006731674 0.002009455 0.02602914 0.00000000 0.0068649689 FL1-A 0.000000000 0.000000000 0.00000000 0.1466463402 0.000000000 0.372256113 0.0367682861 1.000000000 0.24390244 0.00000000 0.1714634354 FL2-A 0.000583422 0.001697758 0.03302168 0.0006885856 0.000000000 0.001562980 0.0001781283 0.011118988 1.00000000 0.00000000 0.0006667258
In addition, the command
keyword(fs_comp[[11]])$`SPILL`
returns the identity matrix. But should this be the case?
Thank you. I am a bit worried that the 1's are off of the diagonal ...
For sure, it sounds quite strange that the choice of fluorochromes leads to so many cross talk. I think the compensation using the spillover function might be tricky. Double check the fact "you'll need the single stained controls and the unstained control to calculate the spillover matrix with spillover()". What I would do first is to discuss with the cytometrist that produces the data. Best.