Open jianwu1 opened 2 years ago
The reason it's failing is because a few channels are matching multiple filenames in the regex check here. Specifically, "V610" will match "UV610" and "V610" and "V670" will match "UV670" and "V670" in your sampleNames because that regex check doesn't include any anchors. In your case, you can probably just force an exact match:
compA <- spillover(single_stain_A, unstained = 5, patt = "^[^FST]", fsc = "FSC.H", ssc = "SSC.H", stain_match = "regexpr", exact_match = TRUE)
@mikejiang, it might not hurt to add a shape/dimension check on that match to get a more helpful error. I'm happy to make a PR.
a few channels are matching multiple filenames in the regex
@jacobpwagner I see! Thank you very much for providing me with such quick help!
@jacobpwagner Hi Jake,
Although I'm now able to generate a spillover matrix from single_stain_A by setting exact_match = TRUE
, the spillover matrix calculated by spillover()
seems a bit wrong because the diagonal values are not 1:
I found the solution in another thread using the spillover_ng function: https://github.com/RGLab/flowCore/issues/94#issuecomment-413938947
It gives a spillover matrix with diagonals being 1.
Hi there,
Thank you very much for developing this package for analysing flow cytometry data! I've been trying to calculate compensation matrix with spillover() function using single stain controls, but have encountered this error that I can't resolve: I have a flowSet object called single_stain_A, and the sampleNames and colnames are as such:
The code I used is standard:
compA <- spillover(single_stain_A, unstained = 5, patt = "^[^FST]", fsc = "FSC.H", ssc = "SSC.H", stain_match = "regexpr")
But I get this error:
Can I ask what the problem might be? What should I do to get the compensation matrix? The flowSet object single_stain_A is saved as a set of fcs files through write.flowSet(), and attached here.
Kind regards,
Jian single_stain_A.zip