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

Error in run_tSNE in giotto clustering #1092

Open
Aditya-Venkat opened this issue Jan 10, 2025 · 2 comments
Open

Error in run_tSNE in giotto clustering #1092

Aditya-Venkat opened this issue Jan 10, 2025 · 2 comments
Labels
feedback needed Needs feedback for closing or further work

Comments

@Aditya-Venkat
Copy link

Hey there !

I'm using Giotto to run spatial clustering on a dataset, but I run into the following error :

ST <- runtSNE(ST, dimensions_to_use = 1:20)
Error in Rtsne.default(X = matrix_to_use, dims = dims, perplexity = perplexity, :
Remove duplicates before running TSNE.

ST is the Giotto object after running PCA and UMAP on it. I have done checks from my side for duplicates in spatial_locs, cell/geneIDs in raw expressions and in the pca/umap matrix, but there are no duplicates.

Please help me resolve this issue.

Thanks!

@RubD
Copy link
Collaborator

RubD commented Jan 10, 2025

@Aditya-Venkat can you provide a minimal and reproducible example, otherwise it's impossible for us to figure out what went wrong. Thanks

@RubD RubD added the feedback needed Needs feedback for closing or further work label Jan 10, 2025
@Aditya-Venkat
Copy link
Author

Sure, this is the code snippet of the portion of the code leading up to the error.

library(Giotto)
library(DescTools)
library(anndata)

ST$var_names_make_unique()
ST$obs_names_make_unique()
st_adata <- t(as.matrix(ST$X))

x<- ST$obsm$spatial[,1]
y<- ST$obsm$spatial[,2]
spatial_location_anndata<- data.frame(x=x, y=y)

row.names(spatial_location_anndata)<-colnames(st_adata)
my_giotto_object = createGiottoObject(raw_exprs = st_adata,
spatial_locs = spatial_location_anndata)
visium_brain <- filterGiotto(gobject = my_giotto_object,
expression_threshold = 1,
min_det_genes_per_cell = 10,
expression_values = c('raw'),
verbose = T)
visium_brain <- normalizeGiotto(gobject = my_giotto_object, scalefactor = 6000, verbose = T)

visium_brain <- calculateHVG(gobject = visium

visium_brain <- runPCA(gobject = visium_brain,
scale_unit = T,
center=T,
method="factominer")

visium_brain <- runUMAP(visium_brain, dimensions_to_use = 1:5)
visium_brain <- runtSNE(visium_brain, dimensions_to_use = 1:5)

I am also attaching a dataset this error is coming up on.
MERFISH_0.04.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback needed Needs feedback for closing or further work
Projects
None yet
Development

No branches or pull requests

2 participants