Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compensating #254

Open
marioleivahidalgo opened this issue Jul 21, 2023 · 6 comments
Open

Error when compensating #254

marioleivahidalgo opened this issue Jul 21, 2023 · 6 comments

Comments

@marioleivahidalgo
Copy link

Hi there,

It is Mario. I am doing a cytometry data analysis. But, when I do the compensation, this message appears in R:

spillover(fcsfile)
Error in .local(x, ...) : No spillover matrix stored in that sample

What could be the possible causes? I think it could be related to the type of file? FCS2 or FCS3?

@mikejiang
Copy link
Member

flowCore looks up these fcs keywords c("SPILL", "spillover", "$SPILLOVER") for spill over matrix, if none is present in fcs file, you get this error message, so it has nothing to do with fcs file format version

@marioleivahidalgo
Copy link
Author

First time trying to analize in R.
I try with other archives, from an exercice, and it works.
I receive my FCS files from an exportation of FACSDIVA software. So, should I give some special request and considerations about the exportation of my files ?

@mikejiang
Copy link
Member

ask them to include spillover matrix in one of these keywords according to the standard https://flowcyt.sourceforge.net/fcs/fcs32.pdf

@djhammill
Copy link

@marioleivahidalgo, in the event that the spillover matrix may have been attached to a different keyword, you can search the FCS file to locate keywords containing matrices as below. If a spillover matrix is found you can extract it and pass it to compensate() directly, otherwise as @mikejiang suggested you need to ensure that the spillover matrices are appropriately attached on the instrument.

# path to first FCS file in folder called "folder"
file <- list.files("folder", full.names = TRUE, pattern = ".fcs")[1]
# read into a flowFrame
fr <- read.FCS(file)
# extract list of keywords
kw <- keyword(fr)
# restrict to keywords containing a matrix
kw[sapply(ks, "is.matrix")]

If the output of the last command contains the spillover matrix you can inspect the keyword name (e.g. "sp"), extract it from the flowFrame and pass it to compensate() manually:

# spillover has been erroneously stored under keyword called "sp"
spill <- keyword(fr, "sp")
fr_comp <- compensate(fr, spill)

@SamGG
Copy link
Contributor

SamGG commented Jul 28, 2023

IIRC there is no compensation matrix in FCS 2.0

@marioleivahidalgo
Copy link
Author

Thanks, Samuel. I guess that. I tried with @djhammill recommendations but it seems there is no compensation matrix in my FCS files. By the way, there is a big difference in file size when I compare my files with others that I downloaded to make an exercice with this package. Mine are for far lighter than those of the exercice. I will ask what type of FCS are exporting on the FACS facility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants