I am trying to run {Rtsne}. On pca dataset prepared by using dudi.pca from {ade4}.

For pca calculation I selected 40 components while specifying parameters for dudi.pca:

pca = dudi.pca(counts(sce_normalized), scannf=FALSE, nf=40)

{Rtsne} gives me an error: “perplexity is too large”, how could it be fixed?

The code I am trying to run is below:

name_of_file <- "dudi_pca.rds"
path_to_file <- paste0("/scratch/nv4e/scRNA-
                   name_of_file, sep="")
dudi_pca <- readRDS(path_to_file)

# run Rtsne with default parameters
rtsne_out <- Rtsne(as.matrix(dudi_pca), pca=FALSE)
  • $\begingroup$ What are the dimensions of dudi_pca? $\endgroup$ – Devon Ryan Jan 21 '18 at 22:45
  • $\begingroup$ The dimensions are 20 000 x 40 $\endgroup$ – Nikita Vlasenko Jan 22 '18 at 18:30

I was using dudi_pca incorrectly. The supplied parameter to as.matrix() should have been dudi_pca$li:

rtsne_out <- Rtsne(as.matrix(dudi_pca$li), pca=FALSE)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.