Thanks for a great package!
I had a great experience with it, but came across an error on parsing a particular .wsp-file.
I have located the error to line 575 in R/GatingSet-Methods where I figure retrieved compensation data is checked against the actual data of the FCS-files. The offending code is as follows.
markerInd <- sapply(marker, function(thisMarker)grep(thisMarker, cnd, ignore.case = channel.ignore.case)) matchedMarker <- cnd[markerInd]
It fails with a subscript error as markerInd is a list. On object inspection I find cod to be a string vector and markerInd to be a list with marker names holding single item vectors of numerics. Through step code debugging I find that the grep function finds more than one index for certain channels and thus returns a list instead of a vector. This turns out to be because of greedy behavior of the grep function as it returns positive match for "Alexa Fluor 700-A" in both "Alexa Fluor 700-A" and "PE-Alexa Fluor 700-A".
I think that the addition of the argument fixed = TRUE to the grep function would deter this behavior.
Again, thanks for a great package that is really helpful!!
love.tatting@liu.se
EDIT: I invesigated a bit further and it is more precisely when the marker element is a substring of the cod element and not a subset, eg.
>grep("PE-A", c("PE-A", "PE-Alexa Fluor 700-A")) [1] 1 2
It seems like the proper adjustment would instead be
>grep("\\<PE-A\\>", c("PE-A", "PE-Alexa Fluor 700-A"), ignore.case=TRUE) [1] 1
That is to append the regex with word start and word ending tags.
Works like a charm! Greatly thankful for your help!