merging issue cytofkit
0
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)

 

Thanks

Margherita

cytofkit • 1.4k views
ADD COMMENT

Login before adding your answer.

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