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

How to amend script to Normalize without clustering #47

Open
CNicholasMDA opened this issue Nov 1, 2024 · 3 comments
Open

How to amend script to Normalize without clustering #47

CNicholasMDA opened this issue Nov 1, 2024 · 3 comments

Comments

@CNicholasMDA
Copy link

Hello,
How do I amend the script in order to perform the normalization without using clustering? I ran the script as follows but received an error.

Script I ran:

model <- CytoNorm.train(files = train_files,
                        labels = train_data$Batch,
                        channels = channels,
                        transformList = NULL,
                        FlowSOM.params = NULL,
                        normMethod.train = QuantileNorm.train,
                        normParams = list(nQ = 101,
                                          goal = "mean"),
                        truncate_max_range = FALSE,
                        seed = 1,
                        verbose = TRUE)

CytoNorm.normalize(model = model,
                   files = validation_files,
                   labels = validation_data$Batch,
                   transformList = NULL,
                   transformList.reverse = NULL,
                   normMethod.normalize = QuantileNorm.normalize,
                   outputDir = "Batch Corrected 11-01-24",
                   prefix = "After Correction w clust ",
                   truncate_max_range = FALSE,
                   clean = TRUE,
                   verbose = TRUE)

Error I received:
Error in CytoNorm.train(files = train_files, labels = train_data$Batch, :
FlowSOM.params should contain the parameter nCells.

thank you in advance!

@SamGG
Copy link

SamGG commented Nov 1, 2024

Hi. Did you try to specify a SOM grid of a single cell, I.e. x_grid=y_grid=1?

@CNicholasMDA
Copy link
Author

I did not. I can try that. Thanks.

@SofieVG
Copy link
Member

SofieVG commented Dec 18, 2024

While the solution proposed by Sam could work, you could also try the QuantileNorm.train and QuantileNorm.normalize functions directly (also from this package), without the CytoNorm wrapper which mainly handles the clustering step.

Ensure the distributions in your reference samples are certainly stable, except for technical differences, as the whole distribution will be shifted to fit.

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