flowWorkspace doesn't allow channels that are named as subset (edit: substring) of other (PE-A and PE-Alexa Fluor 700-A eg.)
Entering edit mode
lovetatting ▴ 10
Last seen 5.5 years ago


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


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. 



flowWorkspace • 712 views
Entering edit mode
Jiang, Mike ★ 1.3k
Last seen 3 months ago
(Private Address)

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

Entering edit mode

Works like a charm! Greatly thankful for your help!


Login before adding your answer.

Traffic: 277 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6