merging issue cytofkit
1
0
Entering edit mode
@margheritacoccia-10110
Last seen 8.6 years ago

Hello, I am having a merging issue with cytofkit version 1.2.4 run on R 3.2.4.

I am trying to run an analysis on couples of .fcs files. Unfortunately I cannot post the files as they are confidential. 

Here's the code and the error message: 

files <- list.files(path="C:/Users/data", pattern='.fcs$', full=TRUE)
paraFile <- list.files(path="C:/Users/data", pattern='.txt$', full=TRUE)
parameters <- as.character(read.table(paraFile, sep = "\t", header = TRUE)[, 1])
ID_047<-files[16:17]
merged_ID047<-cytof_exprsMerge(ID_047, markers=parameters,fixedNum = 500)

Error in y@f(x[, y@input]) : 
  Logicle Exception: DidNotConverge: scale() didn't converge 

 

I can't figure out what is wrong. I have tried with the GUI with the same results. Can anybody help?

For completeness, here's the output of traceback()

10: .Call("logicle_transform", as.double(x), as.double(t), as.double(w), 
        as.double(m), as.double(a))
9: y@f(x[, y@input])
8: translist %on% `_data`
7: translist %on% `_data`
6: .local(`_data`, ...)
5: flowCore::transform(fcs, trans)
4: flowCore::transform(fcs, trans)
3: (function (fcsFile, comp = FALSE, verbose = FALSE, markers = NULL, 
       transformMethod = "auto_lgcl", scaleTo = NULL, w = 0.1, t = 4000, 
       m = 4.5, a = 0, q = 0.05) 
   {
       name <- sub(".fcs", "", basename(fcsFile))
       if (verbose) {
           fcs <- read.FCS(fcsFile)
       }
       else {
           fcs <- suppressWarnings(read.FCS(fcsFile))
       }
       if (comp == TRUE) {
           if (comp && !is.null(fcs@description$SPILL)) {
               fcs <- applyComp(fcs, "SPILL")
           }
           else if (comp && !is.null(fcs@description$SPILLOVER)) {
               fcs <- applyComp(fcs, "SPILLOVER")
           }
           else if (comp && !is.null(fcs@description$COMP)) {
               fcs <- applyComp(fcs, "COMP")
           }
       }
       pd <- fcs@parameters@data
       if (!(is.null(markers))) {
           right_marker <- markers %in% pd$desc || markers %in% 
               pd$name
           if (!(right_marker)) {
               stop("\n Selected marker(s) is not in the input fcs files \n please check your selected markers! \n")
           }
           else {
               desc_id <- match(markers, pd$desc)
               name_id <- match(markers, pd$name)
               mids <- c(desc_id, name_id)
               marker_id <- unique(mids[!is.na(mids)])
           }
       }
       else {
           marker_id <- 1:ncol(fcs@exprs)
       }
       if (transformMethod == "auto_lgcl") {
           trans <- auto_lgcl(fcs, channels = colnames(fcs@exprs)[marker_id])
           transformed <- flowCore::transform(fcs, trans)
           exprs <- transformed@exprs[, marker_id]
       }
       else if (transformMethod == "fixed_lgcl") {
           trans <- flowCore::logicleTransform(w = w, t = t, m = m, 
               a = a)
           exprs <- apply(fcs@exprs[, marker_id], 2, trans)
       }
       else if (transformMethod == "arcsin") {
           trans <- flowCore::arcsinhTransform(a = 1, b = 1, c = 1)
           exprs <- apply(fcs@exprs[, marker_id], 2, trans)
       }
       else if (transformMethod == "biexp") {
           trans <- flowCore::biexponentialTransform(a = 0.5, b = 1, 
               c = 0.5, d = 1, f = 0, w = 0)
           exprs <- apply(fcs@exprs[, marker_id], 2, trans)
       }
       else {
           stop("transformMethod [", transformMethod, "] doesn't exist for cytofkit!")
       }
       if (!is.null(scaleTo)) {
           exprs <- apply(exprs, 2, function(x) scaleData(x, scaleTo))
       }
       col_names <- paste0(pd$name, "<", pd$desc, ">")
       colnames(exprs) <- col_names[marker_id]
       row.names(exprs) <- paste(name, 1:nrow(exprs), sep = "_")
       return(exprs)
   })(dots[[1L]][[1L]], comp = FALSE, verbose = FALSE, markers = c("162Dy_CD45RA", 
   "164Dy_CD20", "166Er_CD33", "167Er_CD28", "168Er_CD24", "170Er_CD161", 
   "151Eu_CD38", "153Eu_CD11b", "155Gd_CCR6", "156Gd_CD94", "157Gd_CD86", 
   "158Gd_CXCR5", "160Gd_CCR7", "165Ho_CD127", "113In_CD57", "175Lu_HLADR", 
   "142Nd_CD19", "143Nd_CD4", "144Nd_CD8", "146Nd_IgD", "148Nd_CD11c", 
   "150Nd_CD3", "147Sm_CD85j", "149Sm_CD16", "152Sm_CD27", "154Sm_CD14", 
   "159Tb_CXCR3", "169Tm_ICOS", "171Yb_TCRgd", "172Yb_PD-1", "173Yb_CD123", 
   "174Yb_CD56", "176Yb_CD25"), transformMethod = "auto_lgcl", scaleTo = NULL, 
       w = 0.1, t = 4000, m = 4.5, a = 0, q = 0.05)
2: mapply(cytof_exprsExtract, fcsFiles, MoreArgs = list(comp = comp, 
       verbose = verbose, markers = markers, transformMethod = transformMethod, 
       scaleTo = scaleTo, w = w, t = t, m = m, a = a, q = q), SIMPLIFY = FALSE)
1: cytof_exprsMerge(ID_047, markers = parameters, fixedNum = 500)

And the output of sessionInfo()

R version 3.2.4 Revised (2016-03-16 r70336)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] cytofkit_1.2.4 plyr_1.8.3     ggplot2_2.1.0 

loaded via a namespace (and not attached):
 [1] gtools_3.5.0        reshape2_1.4.1      splines_3.2.4       lattice_0.20-33    
 [5] tcltk_3.2.4         pcaPP_1.9-60        colorspace_1.2-6    htmltools_0.3.5    
 [9] stats4_3.2.4        mgcv_1.8-12         flowCore_1.36.9     e1071_1.6-7        
[13] BiocGenerics_0.16.1 matrixStats_0.50.1  foreach_1.4.3       robustbase_0.92-5  
[17] stringr_1.0.0       munsell_0.4.3       pdist_1.2           gtable_0.2.0       
[21] caTools_1.17.1      mvtnorm_1.0-5       codetools_0.2-14    VGAM_1.0-1         
[25] Biobase_2.30.0      permute_0.9-0       doParallel_1.0.10   httpuv_1.3.3       
[29] parallel_3.2.4      class_7.3-14        DEoptimR_1.0-4      Rcpp_0.12.4        
[33] KernSmooth_2.23-15  xtable_1.8-2        corpcor_1.6.8       scales_0.4.0       
[37] gdata_2.17.0        vegan_2.3-5         graph_1.48.0        mime_0.4           
[41] gplots_3.0.1        RANN_2.5            digest_0.6.9        stringi_1.0-1      
[45] Rtsne_0.10          shiny_0.13.2        grid_3.2.4          tools_3.2.4        
[49] bitops_1.0-6        magrittr_1.5        cluster_2.0.3       rrcov_1.3-11       
[53] Matrix_1.2-4        MASS_7.3-45         reshape_0.8.5       iterators_1.0.8    
[57] R6_2.1.2            igraph_1.0.1        nlme_3.1-125  

Thanks

Margherita

cytofkit • 2.1k views
ADD COMMENT
1
Entering edit mode
chen_hao ▴ 30
@chen_hao-8107
Last seen 9.5 years ago
Singapore
Hi Margherita, Thanks for your feedback. I think the problem happens in the transformation due to some outliers. Could you try other transformation method, like modify the parameter transformMethod = "auto_lgcl”, to "fixed_lgcl", “arcsin" or “biexp" Best Regards, Chen Hao On 16 Apr 2016, at 8:31 AM, margherita.coccia [bioc] <noreply@bioconductor.org<mailto:noreply@bioconductor.org>> wrote: cytof_exprsMerge
ADD COMMENT
0
Entering edit mode

That fixed it, thanks a lot!

I should mention that the same files were analysed without any issue using cytofkit 1.2.0. Were any changes in the default transformation method applied between the two versions?

Thank you again,

Margherita

 

 

ADD REPLY
0
Entering edit mode
Thanks Margherita, I will look into the codes comparing with the old version. Best Regards, Chen Hao On 19 Apr 2016, at 1:13 AM, margherita.coccia [bioc] <noreply@bioconductor.org<mailto:noreply@bioconductor.org>> wrote: Activity on a post you are following on support.bioconductor.org<https: support.bioconductor.org=""/> User margherita.coccia<https: support.bioconductor.org="" u="" 10110=""/> wrote Comment: merging issue cytofkit<https: support.bioconductor.org="" p="" 80922="" #80974="">: That fixed it, thanks a lot! I should mention that the same files were analysed without any issue using cytofkit 1.2.0. Were any changes in the default transformation method applied between the two versions? Thank you again, Margherita ________________________________ Post tags: cytofkit You may reply via email or visit C: merging issue cytofkit
ADD REPLY
0
Entering edit mode
Hi Margherita, I have compared, I think I didn’t modify that part of code. The error happens in a call of function from flowCore (one dependent package). I think you can restart your R console and reload the package, and try if it works after that. Thanks again, we are still working on cytofkit to add in new functions and to make it better to use, your any feedback will be warmly welcome. Best Regards, Chen Hao On 19 Apr 2016, at 1:13 AM, margherita.coccia [bioc] <noreply@bioconductor.org<mailto:noreply@bioconductor.org>> wrote: Activity on a post you are following on support.bioconductor.org<https: support.bioconductor.org=""/> User margherita.coccia<https: support.bioconductor.org="" u="" 10110=""/> wrote Comment: merging issue cytofkit<https: support.bioconductor.org="" p="" 80922="" #80974="">: That fixed it, thanks a lot! I should mention that the same files were analysed without any issue using cytofkit 1.2.0. Were any changes in the default transformation method applied between the two versions? Thank you again, Margherita ________________________________ Post tags: cytofkit You may reply via email or visit C: merging issue cytofkit
ADD REPLY
0
Entering edit mode

 

HI,

I see an error when I load all my fcs files on the R console. The error reads as follows: Error in fcs@exprs[cellNo_i, ] : subscript out of bounds. Does it mean the I cannot load that many files together? Help appreciated.

 

 

 

 

 

ADD REPLY

Login before adding your answer.

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