Spectre icon indicating copy to clipboard operation
Spectre copied to clipboard

Error in prep.cytonorm - Reading FCS files

Open grizzly2207 opened this issue 2 years ago • 4 comments

Dear everyone,

Last year I have been using the CytoNorm implementation of the Spectre package and it worked perfectly fine. However now having a new Cohort, I just can't make it run again.

I think there is a problem with flowCore and how the prep.cytonorm function reads and writes FCS files This is what I get:

cytnrm <- prep.cytonorm(dat = myeloid_sub, cellular.cols = cellular.cols, cluster.cols = cellular.cols, batch.col = "identifier", sample.col = "filename")

Working directory is '/xxx' Step 1/3. Mapping data Step 2/3. Merging data Step 3/3. Returning data Step 1/4 - Splitting files for use with original FlowSOM function Step 2/4 - Running FlowSOM Reading 1 - 1.fcs Error in if (any(idx)) { : missing value where TRUE/FALSE needed In addition: Warning message: In readFCSdata(con, offsets, txt, transformation, which.lines, scale, : $PnR NA is invalid. If it is a numeric string, this could be because it is larger than R's numeric limit: 1.79769313486232e+308. The assigned $PnR value will be imputed from the maximum value of the data in this channel.

I do get the different fcs files for each batch file but they look also really weird in FlowJo...

R version: 4.1.3 Spectre: 1.0.0 flowCore: 2.6.0 CytoNorm: 0.0.15 flowSOM: 2.2.0

Looking forward to any help!

grizzly2207 avatar Mar 20 '23 10:03 grizzly2207

Hi @grizzly2207 , thanks for reaching out! $PnR NA is invalid suggests initially to me that one of the columns in cellular.cols might not be numeric? Could you double check?

tomashhurst avatar Apr 11 '23 02:04 tomashhurst

Hello! Just to piggy on to this, I get this error when I run the above code:

Step 1/3. Mapping data Step 2/3. Merging data Step 3/3. Returning data Step 1/4 - Splitting files for use with original FlowSOM function Step 2/4 - Running FlowSOM Reading 1.fcs Error in if (sampleWithReplacement & (nrow(f) < cFile)) { : argument is of length zero

Any guidance is appreciated thank you so much!!

bakedjps avatar Apr 02 '24 01:04 bakedjps

err I found in a closed thread that the problem goes away by reinstalling the development branch? Uhm how do I do this?

bakedjps avatar Apr 02 '24 01:04 bakedjps

sorry...please ignore me...it is fixed...

bakedjps avatar Apr 02 '24 01:04 bakedjps

@grizzly2207 @bakedjps

If you would like, we have have a fix for this and a bunch of other things in a pre-release of v1.2. If you'd like to try it before it comes out properly you can run the following to install v1.2:

if(!require('remotes')) {install.packages('remotes')} # Installs the package 'remotes'
remotes::install_github(repo = "immunedynamics/spectre", ref = 'v1.2.0-beta') # Install the Spectre package

Don't forget the ref = 'v1.2.0-beta'.

Otherwise v1.2 should be out properly next week.

tomashhurst avatar May 24 '24 15:05 tomashhurst