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

FoldChange vs FindMarkers give differnet log fc results #6773

Closed
coralzhang opened this issue Dec 9, 2022 · 4 comments
Closed

FoldChange vs FindMarkers give differnet log fc results #6773

coralzhang opened this issue Dec 9, 2022 · 4 comments

Comments

@coralzhang
Copy link

I encountered a similar issue reported here https://www.biostars.org/p/9478554/
Here is an example,
mat1=FoldChange(pbmc_small, ident.1 = 1); mat2 <- FindMarkers(object = pbmc_small, ident.1 = 1); mat1["MS4A1",]; mat2["MS4A1",];
This is the output:

mat1["MS4A1",]
avg_log2FC pct.1 pct.2
MS4A1 -0.6837357 0.08 0.182

mat2["MS4A1",]
p_val avg_log2FC pct.1 pct.2 p_val_adj
MS4A1 0.1840551 -4.289191 0.08 0.182 1

@longmanz
Copy link
Contributor

Hi,
Can you try the latest version of Seurat? This logfc issue should be fixed now.

@coralzhang
Copy link
Author

Thank you for your response. But I tried to reinstall using this
install_github("satijalab/seurat")
Then tried this
`> library(Seurat)

mat1=FoldChange(pbmc_small, ident.1 = 1); mat2 <- FindMarkers(object = pbmc_small, ident.1 = 1); mat1["MS4A1",]; mat2["MS4A1",];
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
avg_log2FC pct.1 pct.2
MS4A1 -0.6837357 0.08 0.182
p_val avg_log2FC pct.1 pct.2 p_val_adj
MS4A1 0.1840551 -4.289191 0.08 0.182 1`

Here is the sessioninfo

sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] devtools_2.4.5 usethis_2.1.6 SeuratObject_4.1.3 Seurat_4.3.0

@lucygarner
Copy link

lucygarner commented Mar 11, 2023

Hi,

I am having the same issue with Seurat 4.3.0. The FoldChange and FindMarkers functions give me very different fold change values. The DefaultAssay of my Seurat object is "RNA".

markers <- FindMarkers(seurat_obj, ident.1 = "TCR", ident.2 = "unstim")
fold_change <- FoldChange(seurat_obj, ident.1 = "TCR", ident.2 = "unstim")

markers["CCL4", ]
p_val avg_log2FC pct.1 pct.2 p_val_adj
CCL4 0 5.550652 0.962 0.685 0

fold_change["CCL4", ]
avg_log2FC pct.1 pct.2
CCL4 1.264632 0.962 0.685

Your advice or explanation would be much appreciated. Which are the "correct" fold change values? I would like to obtain fold change values for all genes.

Best wishes,
Lucy

sessionInfo()

R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /Filers/package/R-base/4.2.0/lib64/R/lib/libRblas.so
LAPACK: /Filers/package/R-base/4.2.0/lib64/R/lib/libRlapack.so

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

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

other attached packages:
[1] forcats_1.0.0 stringr_1.5.0 dplyr_1.1.0 purrr_1.0.1
[5] readr_2.1.3 tidyr_1.3.0 tibble_3.1.8 ggplot2_3.4.0
[9] tidyverse_1.3.2 SeuratObject_4.1.3 Seurat_4.3.0

loaded via a namespace (and not attached):
[1] googledrive_2.0.0 Rtsne_0.16 colorspace_2.1-0
[4] deldir_1.0-6 ellipsis_0.3.2 ggridges_0.5.4
[7] fs_1.6.0 rstudioapi_0.14 spatstat.data_3.0-0
[10] leiden_0.4.3 listenv_0.9.0 ggrepel_0.9.2
[13] lubridate_1.9.1 fansi_1.0.4 xml2_1.3.3
[16] codetools_0.2-19 splines_4.2.0 knitr_1.42
[19] polyclip_1.10-4 jsonlite_1.8.4 broom_1.0.3
[22] ica_1.0-3 dbplyr_2.3.0 cluster_2.1.4
[25] png_0.1-8 uwot_0.1.14 shiny_1.7.4
[28] sctransform_0.3.5 spatstat.sparse_3.0-0 compiler_4.2.0
[31] httr_1.4.4 backports_1.4.1 assertthat_0.2.1
[34] Matrix_1.5-3 fastmap_1.1.0 lazyeval_0.2.2
[37] gargle_1.3.0 cli_3.6.0 later_1.3.0
[40] htmltools_0.5.4 tools_4.2.0 igraph_1.3.5
[43] gtable_0.3.1 glue_1.6.2 RANN_2.6.1
[46] reshape2_1.4.4 Rcpp_1.0.10 scattermore_0.8
[49] cellranger_1.1.0 vctrs_0.5.2 spatstat.explore_3.0-5
[52] nlme_3.1-162 progressr_0.13.0 lmtest_0.9-40
[55] spatstat.random_3.0-1 xfun_0.37 globals_0.16.2
[58] rvest_1.0.3 timechange_0.2.0 mime_0.12
[61] miniUI_0.1.1.1 lifecycle_1.0.3 irlba_2.3.5.1
[64] googlesheets4_1.0.1 goftest_1.2-3 future_1.31.0
[67] MASS_7.3-58.2 zoo_1.8-11 scales_1.2.1
[70] hms_1.1.2 promises_1.2.0.1 spatstat.utils_3.0-1
[73] parallel_4.2.0 RColorBrewer_1.1-3 yaml_2.3.7
[76] reticulate_1.28 pbapply_1.7-0 gridExtra_2.3
[79] stringi_1.7.12 rlang_1.0.6 pkgconfig_2.0.3
[82] matrixStats_0.63.0 evaluate_0.20 lattice_0.20-45
[85] ROCR_1.0-11 tensor_1.5 patchwork_1.1.2
[88] htmlwidgets_1.6.1 cowplot_1.1.1 tidyselect_1.2.0
[91] parallelly_1.34.0 RcppAnnoy_0.0.20 plyr_1.8.8
[94] magrittr_2.0.3 R6_2.5.1 generics_0.1.3
[97] DBI_1.1.3 withr_2.5.0 haven_2.5.1
[100] pillar_1.8.1 fitdistrplus_1.1-8 survival_3.5-0
[103] abind_1.4-5 sp_1.6-0 future.apply_1.10.0
[106] crayon_1.5.2 modelr_0.1.10 KernSmooth_2.23-20
[109] utf8_1.2.3 spatstat.geom_3.0-6 plotly_4.10.1
[112] tzdb_0.3.0 rmarkdown_2.20 readxl_1.4.1
[115] grid_4.2.0 data.table_1.14.6 reprex_2.0.2
[118] digest_0.6.31 xtable_1.8-4 httpuv_1.6.8
[121] munsell_0.5.0 viridisLite_0.4.1

@saketkc
Copy link
Collaborator

saketkc commented Jul 6, 2023

Apologies everyone for the delay.

I have just pushed 992c1a9 to develop branch which should fix this and related issues. Can you pull from the develop branch and re-open this issue if you are still facing issues?

devtools::install_github("satijalab/seurat", ref="develop")

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

4 participants