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

Is Warning $PnR NA is invalid while running flowCore::read.FCS safe to ignore? #243

Closed
denvercal1234GitHub opened this issue Jan 27, 2023 · 6 comments

Comments

@denvercal1234GitHub
Copy link

denvercal1234GitHub commented Jan 27, 2023

Hi there,

I encountered the Warning of $PnR NA is invalid when running flowCore::read.FCS on my spectral flow FCS files.

Note that I first exported the FCS files as Channel values, then use Spectre::write.files() to convert them into FCS files (ImmuneDynamics/Spectre#149), so that I can use flowCore::read.FCS() because ultimately I want to use the peacoQC package which only accepts FCS files.

The warning was discussed at #192 by @cciccole and @gfinak, but I am unclear what the final advice was. Would you mind helping me address this warning?

Thank you.

Code:

ff <- flowCore::read.FCS("/Users/clusteredatom/.../Analysis_LiveSinglets/Transformed_ChannelValues/channel_to_FCS_forpeaCoQC/channelFCS_LiveSinglets_Each_AfterMerge/channelFCS_FileNo_1.fcs", truncate_max_range = FALSE, transformation = FALSE)

Ouputs:

Warning: $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.
> 
> ff
flowFrame object 'channelFCS_FileNo_1.fcs'
with 98073 cells and 63 observables:
                       name                   desc     range  minRange  maxRange
$P1                   FSC-A column FSC-A from da..       639         0       638
$P2                   SSC-A column SSC-A from da..       639         0       638
$P3                  TOX1_2 column TOX1_2 from d..       766         0       765
$P4                   FOXP3 column FOXP3 from da..      1003         0      1002
$P5                PERFORIN column PERFORIN from..       801         0       800
...                     ...                    ...       ...       ...       ...
$P59              Comp-PE-A column Comp-PE-A fro..       NaN         0       NaN
$P60                 FileID column FileID from d..         2         0         1
$P61             FileName.y column FileName.y fr..         2         0         1
$P62 Time..SSC.H.subset.L.. column Time..SSC.H.s..     98074         0     98073
$P63 Time..SSC.H.subset.L.. column Time..SSC.H.s..        99         0        98
331 keywords are stored in the 'description' slot
> 
@denvercal1234GitHub denvercal1234GitHub changed the title Warning $PnR NA is invalid while running flowCore::read.FCS? Is Warning $PnR NA is invalid while running flowCore::read.FCS safe to ignore? Jan 27, 2023
@mikejiang
Copy link
Member

This doesn't impact the data that has been parsed from your fcs file per se, these instrument range/maxRanges are imputed by the maximum data value as warning message suggested.
Inaccurate instrument range may or may not affect your workflow down the road depending on what tools you will be using, how they utilize this range information, for example ggcyto uses instrument range to set plot range under certain circumstance.

but I do see you still have an invalid range value ($P59) in your flowframe object, which is concerning

you can print the original keywords to check what has been exported by your Spectre::write.files() function
lapply(1:dim(fr)[2],function(i)keyword(ff)[[paste0("$P",i,"R")]])

also print the data range for $P59 to see what's going on
range(ff, "data")

@denvercal1234GitHub
Copy link
Author

Thank you very much, @mikejiang!

I think the P59 having NaN here is because we ran the experiment with 100 wells. Each well has the same backbone antibodies, but for PE, each well has a different PE-conjugated antibody. So, when I exported the data from the Aurora spectral cytometer, for some wells I assigned a name for the PE channel, but for other wells, I left blank.

So, actually, for this particular FCS file, the PE channel was not P59-Comp-PE, but CD1-PE which does have values and not just NaN.

I will try to go back to the naming and keep the PE channel just blank for all files, and see if this warning still appeared and will let you know.

@ghar1821
Copy link

ghar1821 commented Jan 31, 2023

Realised I replied to the wrong github thread. See here: ImmuneDynamics/Spectre#149

@denvercal1234GitHub
Copy link
Author

denvercal1234GitHub commented Feb 1, 2023

Thank you so much for your time @ghar1821!

I will try `divide.by="FileName" and let you know, and check on QUESTION 3 and let you know.

And, yes please, having a guide on how to incorporate the following packages to our Spectre package would be very useful and increase the packages' usage a lot:

@ghar1821
Copy link

ghar1821 commented Feb 2, 2023

@denvercal1234GitHub I'm copy pasting your reply above to the Spectre github issue thread. Save cluttering this issue as I originally replied to your question in the wrong thread!

@denvercal1234GitHub
Copy link
Author

This was the issue.

Solution = change the marker names before exporting the data from cytometer into FlowJo and subsequent R packages.

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

3 participants