spillover::flowCore problem: Error in match(unstained, sampleNames(x))
6
0
Entering edit mode
@daniel-prieto-9855
Last seen 8.7 years ago
Institut Pasteur de Montevideo

Dear guys, I am trying to get a compensation matrix from FC data (1 unstained and 4 single stained tubes) using spillover, but got stuck at that point.

Here is my little piece of code:

library(flowCore)

comp.files = list.files("~/Documentos/26-2-16-s100/395/compdata/", all.files = T, full.names = TRUE)#Read full directory
comp.fs <- read.flowSet(comp.files[3:7], transformation = F, alter.names = T)#[3:25])#trim off 2 first rows /. and /..
comp.fs <- comp.fs[, 3:30]# remove time fields
comp.fs <- comp.fs[ , c(2,5,10,13,16,19, 25)]#discard unused channels

comp.mat <- spillover(comp.fs, unstained = comp.fs[1], fsc = "FS.Lin", ssc = "SS.Lin", method = "median", stain_match = c("intensity", "ordered", "regexpr"),
                    useNormFilt = T, pregate = F, plot = T)

 

When sourced, I got this error:

Error in match(unstained, sampleNames(x)) : 'match' requires vectorial arguments

Now, here we have further details of my set and stuff:

> traceback()
8: match(unstained, sampleNames(x))
7: .local(x, ...)
6: spillover(comp.fs, unstained = comp.fs[1], fsc = "FS.Lin", ssc = "SS.Lin",
       method = "median", stain_match = c("intensity", "ordered",
           "regexpr"), useNormFilt = T, pregate = F, plot = T)
5: spillover(comp.fs, unstained = comp.fs[1], fsc = "FS.Lin", ssc = "SS.Lin",
       method = "median", stain_match = c("intensity", "ordered",
           "regexpr"), useNormFilt = T, pregate = F, plot = T) at citom2.R#70
4: eval(expr, envir, enclos)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("~/Documentos/citom/citom2.R", echo = TRUE)
---------------------------------------------------------------------------------
> comp.fs
A flowSet with 5 experiments.

  column names:
  FS.Lin SS.Lin FL.1.Log FL.2.Log FL.3.Log FL.4.Log FL.8.Log
---------------------------------------------------------------------------------
> summary (comp.fs)
$`395us.fcs`
        FS.Lin SS.Lin FL.1.Log FL.2.Log FL.3.Log FL.4.Log FL.8.Log
Min.      3132     10        0        0     0.00        0        0
1st Qu.  11810   5426     4784     5842     0.00        0        0
Median   12950   7313     7176     8482     0.00     5569        0
Mean     13100   8402     7087     8204    52.94     5641     2028
3rd Qu.  14300  10170     9453    10730     0.00     9411      133
Max.     45790  65540    33390    34480 18120.00    29840    42300

$FL.1.fcs
        FS.Lin SS.Lin FL.1.Log FL.2.Log FL.3.Log FL.4.Log FL.8.Log
Min.      3105     13        0        0      0.0      0.0        0
1st Qu.  11940   5676     7789     6999      0.0    858.8        0
Median   13110   7670    10020     9571      0.0   6449.0        0
Mean     13270   9122    10860     9834    329.9   6344.0     2025
3rd Qu.  14510  10720    12480    11910      0.0  10130.0     1817
Max.     51230  65540    65530    63240  40900.0  50530.0    40220

$FL.2.fcs
        FS.Lin SS.Lin FL.1.Log FL.2.Log FL.3.Log FL.4.Log FL.8.Log
Min.      3094     10        0        0      0.0        0        0
1st Qu.  11780   5544     4842     6387      0.0     2175        0
Median   12960   7423     7204     8967      0.0     7149        0
Mean     13150   8516     7135     8809    164.7     6859     1682
3rd Qu.  14330  10180     9444    11200      0.0    10660        0
Max.     61120  65540    51480    55280  39720.0    52080    38470

$FL.4.fcs
        FS.Lin SS.Lin FL.1.Log FL.2.Log FL.3.Log FL.4.Log FL.8.Log
Min.      3040     10        0        0      0.0        0        0
1st Qu.  11530   5532     5011     6108      0.0    14990     3168
Median   12720   7492     7366     8721      0.0    18440     8018
Mean     12870   8734     7309     8479    103.1    18210     7608
3rd Qu.  14120  10420     9619    10970      0.0    21770    11380
Max.     51610  65540    42820    44260  28990.0    63660    62950

$FL.8.fcs
        FS.Lin SS.Lin FL.1.Log FL.2.Log FL.3.Log FL.4.Log FL.8.Log
Min.      3090     10        0        0     0.00      0.0        0
1st Qu.  11890   5555     5089     6064     0.00    246.5     5452
Median   13090   7523     7398     8703     0.00   5926.0    10110
Mean     13230   8711     7344     8428    73.05   6037.0     9961
3rd Qu.  14480  10480     9620    10920     0.00   9713.0    13560
Max.     42020  65540    40000    41220 26260.00  43430.0    65530
---------------------------------------------------------------------------------

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 15.10

locale:
 [1] LC_CTYPE=es_UY.UTF-8       LC_NUMERIC=C               LC_TIME=es_UY.UTF-8        LC_COLLATE=es_UY.UTF-8     LC_MONETARY=es_UY.UTF-8   
 [6] LC_MESSAGES=es_UY.UTF-8    LC_PAPER=es_UY.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_UY.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] flowViz_1.34.0    lattice_0.20-33   flowDensity_1.4.0 flowCore_1.37.13

loaded via a namespace (and not attached):
 [1] GEOmap_2.3-8        pcaPP_1.9-60        Rcpp_0.12.3         MBA_0.0-8           nloptr_1.0.4        DEoptimR_1.0-4     
 [7] RColorBrewer_1.1-2  RSEIS_3.5-2         bitops_1.0-6        tools_3.2.3         lme4_1.1-10         nlme_3.1-125       
[13] mgcv_1.8-10         RPMG_2.2-1          Matrix_1.2-3        graph_1.48.0        parallel_3.2.3      SparseM_1.7        
[19] mvtnorm_1.0-5       spam_1.3-0          hexbin_1.27.1       cluster_2.0.3       MatrixModels_0.4-1  gtools_3.5.0       
[25] IDPmisc_1.1.17      caTools_1.17.1      fields_8.3-6        RFOC_3.3-3          maps_3.1.0          nnet_7.3-11        
[31] stats4_3.2.3        grid_3.2.3          robustbase_0.92-5   Biobase_2.30.0      rrcov_1.3-11        sp_1.2-2           
[37] minqa_1.2.4         gdata_2.17.0        latticeExtra_0.6-26 car_2.1-1           corpcor_1.6.8       splines_3.2.3      
[43] gplots_2.17.0       splancs_2.01-38     matrixStats_0.50.1  MASS_7.3-45         BiocGenerics_0.16.1 pbkrtest_0.4-6     
[49] Rwave_2.4           quantreg_5.21       KernSmooth_2.23-15

Thank you very much for your help!

D

flowcore spillover flowcytometry • 2.4k views
ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.1 years ago
(Private Address)

Please read '?spillover' about 'unstained' argument:

unstained

The name of index of the unstained negative control

ADD COMMENT
0
Entering edit mode
@daniel-prieto-9855
Last seen 8.7 years ago
Institut Pasteur de Montevideo

Thank you for your feedback Mike, perhaps I am missing something on the name of index. But when tried:

comp.mat <- spillover(comp.fs, unstained = sampleNames(comp.fs[1]), method = "median", stain_match = c("intensity", "ordered", "regexpr"), useNormFilt = T, pregate = F, plot = F, fsc = "FS.Lin", ssc = "SS.Lin")

got

Error: Unable to match stains with controls based on intensity: a single stain matches to several multiple controls.

> traceback()

8: stop("Unable to match stains with controls based on intensity: ",
       "a single stain matches to several multiple controls. ",
       call. = FALSE)
7: .local(x, ...)
6: spillover(comp.fs, unstained = sampleNames(comp.fs[1]), method = "median",
       stain_match = c("intensity", "ordered", "regexpr"), useNormFilt = F,
       pregate = F, plot = F, fsc = "FS.Lin", ssc = "SS.Lin")
5: spillover(comp.fs, unstained = sampleNames(comp.fs[1]), method = "median",
       stain_match = c("intensity", "ordered", "regexpr"), useNormFilt = F,
       pregate = F, plot = F, fsc = "FS.Lin", ssc = "SS.Lin") at citom2.R#70
4: eval(expr, envir, enclos)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("~/Documentos/citom/citom2.R", echo = TRUE)

 

Also tried with  unstained = 1 with the same results
ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.1 years ago
(Private Address)

There are several way to determine which `fcs file` is for which single stain. By default, it is trying to guess based on the largest statistic of these control files, which apparently failed in your case. You can try different 'statistic`,e.g.("max' or "mode").

If that still does not work, try to set stain_match = "regexpr" so that it looks at the filename as the hint.

ADD COMMENT
0
Entering edit mode
@daniel-prieto-9855
Last seen 8.7 years ago
Institut Pasteur de Montevideo

Thanks a lot!

ADD COMMENT
0
Entering edit mode
@daniel-prieto-9855
Last seen 8.7 years ago
Institut Pasteur de Montevideo

Worked like a charm!

ADD COMMENT
0
Entering edit mode
@samuel-ahuno-14031
Last seen 6 months ago
Ghana/KNUST

Hi Daniel,

I am not sure what you did exactly for your codes to work.

I have tried using the "regexpr" and changing statics to "mode" and "max" but then I get the same error message;

Error in match(unstained, sampleNames(x)) : 
  'match' requires vector arguments

 

Best

Sam

ADD COMMENT

Login before adding your answer.

Traffic: 697 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6