ImmuneDynamics / Spectre

A computational toolkit in R for the integration, exploration, and analysis of high-dimensional single-cell cytometry and imaging data.
https://immunedynamics.github.io/spectre/
MIT License
56 stars 21 forks source link

Error in prep.cytonorm - Reading FCS files #153

Closed grizzly2207 closed 3 months ago

grizzly2207 commented 1 year ago

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!

tomashhurst commented 1 year ago

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?

bakedjps commented 5 months ago

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 commented 5 months ago

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

bakedjps commented 5 months ago

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

tomashhurst commented 3 months ago

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