Thanks for your suggestion! I have updated my question, It works now.
Hi,
I am learning to process sc-seq data in Rstudio. There are 2 problems I have:
I tried to install scater package using BiocManager::install("scater") but it failed. This is the error message:
ld: warning: directory not found for option '-L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0'
ld: warning: directory not found for option '-L/opt/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
when I install sctransform, it worked. But I cannot use SCTransform(). It keeps warning that:
Error in SCTransform(cells, method = "glmGamPoi", vars.to.regress = "percent.mt", :
could not find function "SCTransform"
This is my sessionInfo():
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.0
And this is some other information that may be related to this issue:
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using C++ compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX13.3.sdk’
Is this related to my mac version?
Thank you!
2 answers
I think I have found the solutions: 1) my pc is using mac M2 chip, and ARM version Rstudio(for M2 user). This issue can be solve by using this package: GNU Fortran compiler. I found this from Rstudio website:
If you wish to compile R packages which contain Fortran code, you may need to download the corresponding GNU Fortran compiler from https://mac.R-project.org/tools. Any external libraries and tools are expected to live in /opt/R/arm64 (Apple silicon) or /opt/R/x86_64 (Intel).
When I install this compiler, it works now! scater package runs normally,
2) for this issue, I found I must use Seurat::SCTransform() instead of just using SCTransform() I am not sure why.... But it works when I add the namespace Seurat:: before it.
Thanks for your suggestions!
Log in to answer this question.
For the second problem, did you load the SCTransform library before trying to run the function?
Your first problem might be relate to this issue on SO. Try seeing if any of those solutions work.
Yes, I load it before running function.