Question: flowWorkspace doesn't allow channels that are named as subset (edit: substring) of other (PE-A and PE-Alexa Fluor 700-A eg.)
0
3.8 years ago by
lovetatting10
Sweden
lovetatting10 wrote:

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

>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.

flowworkspace • 542 views
modified 3.8 years ago by Jiang, Mike1.2k • written 3.8 years ago by lovetatting10
Answer: flowWorkspace doesn't allow channels that are named as subset (edit: substring)
1
3.8 years ago by
Jiang, Mike1.2k
Jiang, Mike1.2k wrote:

I pushed the fix to flowWorkspace 3.16.4. Let me know if it solves your problem. Thanks!