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

Unable to reproduce results from seurat vignette #9699

Open
rominaappierdo opened this issue Feb 20, 2025 · 0 comments
Open

Unable to reproduce results from seurat vignette #9699

rominaappierdo opened this issue Feb 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rominaappierdo
Copy link

rominaappierdo commented Feb 20, 2025

Unable to reproduce results from seurat vignette

Hello,
Thank you for your great package!

I'm encountering several issues while using it, especially after the update to v5.
To debug, I attempted to run the tutorial from the vignette (https://satijalab.org/seurat/articles/pbmc3k_tutorial), but after running RunPCA, the results do not match those shown in the vignette.

for instance, the heatmap looks like this
DimHeatmap(pbmc, dims = 1, cells = 500, balanced = TRUE)

Image

while it should look like this

Image

I remember being able to reproduce the tutorial in the past, so I'm not sure what has changed. This issue also arises when I analyze other datasets, where PC1 appears to explain nearly all the variance, with elbowplot looking like this

Image

Could you help me understand what might be going wrong?

Reproducing Code Example

CODE:

`setwd("")
library(dplyr)
library(Seurat)
library(patchwork)

# Load the PBMC dataset
pbmc.data <- Read10X(data.dir = "./filtered_gene_bc_matrices/hg19/")
# Initialize the Seurat object with the raw (non-normalized data).
pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
gc()

dim(pbmc)
pbmc.data[c("CD3D", "TCL1A", "MS4A1"), 1:30]

# The [[ operator can add columns to object metadata. This is a great place to stash QC stats
pbmc[["percent.mt"]] <- PercentageFeatureSet(pbmc, pattern = "^MT-")
# Visualize QC metrics as a violin plot
VlnPlot(pbmc, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)

pbmc <- subset(pbmc, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mt < 5)
pbmc <- NormalizeData(pbmc)
pbmc <- FindVariableFeatures(pbmc, selection.method = "vst", nfeatures = 2000)

# Identify the 10 most highly variable genes
top10 <- head(VariableFeatures(pbmc), 10)

# plot variable features with and without labels
plot1 <- VariableFeaturePlot(pbmc)
plot2 <- LabelPoints(plot = plot1, points = top10, repel = F)
plot1 + plot2

all.genes <- rownames(pbmc)
pbmc <- ScaleData(pbmc, features = all.genes)

pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc))

# Examine and visualize PCA results a few different ways
print(pbmc[["pca"]], dims = 1:5, nfeatures = 5)

VizDimLoadings(pbmc, dims = 1:2, reduction = "pca")

DimHeatmap(pbmc, dims = 1, cells = 500, balanced = TRUE)
`

Error Message

Additional Comments

No response

Session Info

R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=it_IT.UTF-8       LC_NUMERIC=C               LC_TIME=it_IT.UTF-8       
 [4] LC_COLLATE=it_IT.UTF-8     LC_MONETARY=it_IT.UTF-8    LC_MESSAGES=it_IT.UTF-8   
 [7] LC_PAPER=it_IT.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=it_IT.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Rome
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] patchwork_1.2.0    Seurat_5.2.1       SeuratObject_5.0.2 dplyr_1.1.4       
[5] sp_2.1-4          

loaded via a namespace (and not attached):
  [1] deldir_2.0-4           pbapply_1.7-2          gridExtra_2.3         
  [4] remotes_2.5.0          rlang_1.1.4            magrittr_2.0.3        
  [7] RcppAnnoy_0.0.22       spatstat.geom_3.2-9    matrixStats_1.3.0     
 [10] ggridges_0.5.6         compiler_4.4.0         png_0.1-8             
 [13] callr_3.7.6            vctrs_0.6.5            reshape2_1.4.4        
 [16] stringr_1.5.1          pkgconfig_2.0.3        fastmap_1.2.0         
 [19] labeling_0.4.3         utf8_1.2.4             promises_1.3.0        
 [22] ps_1.7.6               purrr_1.0.2            jsonlite_1.8.8        
 [25] goftest_1.2-3          later_1.3.2            spatstat.utils_3.1-2  
 [28] irlba_2.3.5.1          parallel_4.4.0         cluster_2.1.6         
 [31] R6_2.5.1               ica_1.0-3              stringi_1.8.4         
 [34] RColorBrewer_1.1-3     spatstat.data_3.1-2    reticulate_1.38.0     
 [37] parallelly_1.37.1      lmtest_0.9-40          scattermore_1.2       
 [40] Rcpp_1.0.12            tensor_1.5             future.apply_1.11.2   
 [43] zoo_1.8-12             R.utils_2.12.3         sctransform_0.4.1     
 [46] httpuv_1.6.15          Matrix_1.7-0           splines_4.4.0         
 [49] igraph_2.0.3           tidyselect_1.2.1       rstudioapi_0.16.0     
 [52] abind_1.4-5            spatstat.random_3.2-3  codetools_0.2-20      
 [55] miniUI_0.1.1.1         spatstat.explore_3.2-7 processx_3.8.4        
 [58] listenv_0.9.1          pkgbuild_1.4.4         lattice_0.22-6        
 [61] tibble_3.2.1           plyr_1.8.9             withr_3.0.0           
 [64] shiny_1.8.1.1          ROCR_1.0-11            Rtsne_0.17            
 [67] future_1.33.2          fastDummies_1.7.3      survival_3.7-0        
 [70] polyclip_1.10-6        fitdistrplus_1.1-11    pillar_1.9.0          
 [73] BiocManager_1.30.23    KernSmooth_2.23-24     plotly_4.10.4         
 [76] generics_0.1.3         RcppHNSW_0.6.0         ggplot2_3.5.1         
 [79] munsell_0.5.1          scales_1.3.0           globals_0.16.3        
 [82] xtable_1.8-4           glue_1.7.0             lazyeval_0.2.2        
 [85] tools_4.4.0            data.table_1.15.4      RSpectra_0.16-1       
 [88] RANN_2.6.1             dotCall64_1.1-1        cowplot_1.1.3         
 [91] grid_4.4.0             tidyr_1.3.1            colorspace_2.1-0      
 [94] nlme_3.1-166           cli_3.6.3              spatstat.sparse_3.1-0 
 [97] spam_2.10-0            fansi_1.0.6            viridisLite_0.4.2     
[100] uwot_0.2.2             gtable_0.3.5           R.methodsS3_1.8.2     
[103] digest_0.6.36          progressr_0.14.0       ggrepel_0.9.5         
[106] farver_2.1.2           htmlwidgets_1.6.4      R.oo_1.26.0           
[109] htmltools_0.5.8.1      lifecycle_1.0.4        httr_1.4.7            
[112] mime_0.12              harmony_1.2.0          MASS_7.3-61   `
@rominaappierdo rominaappierdo added the bug Something isn't working label Feb 20, 2025
@rominaappierdo rominaappierdo changed the title Not able to reproduce results from seurat vignette Unable to reproduce results from seurat vignette Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant