flowDensity, nmRemove and xyplot
1
0
Entering edit mode
@ulrik-stervbo-1723
Last seen 5.6 years ago
Germany

Hello everyone,

I am trying to remove margin events in my flow data and came across flowDensity. After removing margin events plotting with xyplots fails.

Is this known behaviour? 'boundaryFilter' from flowCore works without problems.

Best,

Ulrik

​library(flowDensity)
library(flowViz)

# Example from 'nmRemove' works
data_dir <- system.file("extdata", package = "flowDensity")
load(list.files(pattern = 'sampleFCS_2', data_dir, full = TRUE))
#Removing margin events of FSC-A and SSC-A channels
no.margin <- nmRemove(f2, c("FSC-A","SSC-A"),talk=TRUE)
plotDens(f2, c("FSC-A","SSC-A"))
# Scatter plot of FSC-A vs. SSC-A after removing margins
plotDens(no.margin, c("FSC-A","SSC-A"))

# Ploting the original flow.frame using xyplots works
xyplot(`FSC-A`~ `SSC-A`, data = f2)
# This fails
xyplot(`FSC-A`~ `SSC-A`, data = no.margin)

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=de_DE.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8     LC_MONETARY=de_DE.UTF-8  
[6] LC_MESSAGES=de_DE.UTF-8    LC_PAPER=de_DE.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C           
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

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

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

loaded via a namespace (and not attached):
[1] GEOmap_2.3-8        pcaPP_1.9-60        Rcpp_0.12.3         MBA_0.0-8           RColorBrewer_1.1-2  nloptr_1.0.4        DEoptimR_1.0-4    
[8] RSEIS_3.5-2         bitops_1.0-6        tools_3.2.3         lme4_1.1-11         nlme_3.1-125        mgcv_1.8-11         RPMG_2.2-1        
[15] Matrix_1.2-3        graph_1.48.0        parallel_3.2.3      SparseM_1.7         mvtnorm_1.0-5       spam_1.3-0          hexbin_1.27.1     
[22] cluster_2.0.3       IDPmisc_1.1.17      MatrixModels_0.4-1  gtools_3.5.0        caTools_1.17.1      fields_8.3-6        RFOC_3.3-3        
[29] maps_3.1.0          stats4_3.2.3        grid_3.2.3          nnet_7.3-12         robustbase_0.92-5   Biobase_2.30.0      rrcov_1.3-11      
[36] sp_1.2-2            latticeExtra_0.6-28 minqa_1.2.4         gdata_2.17.0        corpcor_1.6.8       car_2.1-1           splines_3.2.3     
[43] gplots_2.17.0       splancs_2.01-38     matrixStats_0.50.1  BiocGenerics_0.16.1 MASS_7.3-45         pbkrtest_0.4-6      Rwave_2.4         
[50] quantreg_5.21       KernSmooth_2.23-15 
flowdensity flowviz • 855 views
ADD COMMENT
1
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 8 weeks ago
(Private Address)

It is because "nmRemove" function leaves 'NA' values in the flowFrame 'no.margin', which breaks the 'xyplot' that tries to detect and hide the 'marginal events'. You can disable this behavior by setting 'margin = FLASE',

xyplot(`FSC-A`~ `SSC-A`, data =no.margin, margin = F)

If I were you, I'd contact the author of 'flowDensity' to find out why they didn't remove these 'NA's instead.

I'd also like to mention that 'ggcyto' package is more robust on this. It is currently in Bioc Devel branch (http://bioconductor.org/packages/3.3/bioc/html/ggcyto.html) and will deprecate 'flowViz' eventually. 

If you don't mind to install R.3.3.0, here is how it will plot 'no.margin' without complaining 'NA'.

library(ggcyto)
autoplot(no.margin, x = "FSC-A", y = "SSC-A")
ADD COMMENT

Login before adding your answer.

Traffic: 454 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