zhilizheng / SBayesRC

GNU General Public License v3.0
25 stars 5 forks source link

problem in installing #6

Closed irgp2019 closed 1 year ago

irgp2019 commented 1 year ago

Hi sorry but I have problem in installing SBayes in R. linux x86-64 - Centos7 - R 3.6 I get this error:

zhilizheng commented 1 year ago

Hi @irgp2019 ,

Thanks for the report. This may be an issue from Rcpp package ( I documented this). When error happened, we only include the header, and compiler look into Rcpp header. I also install a fresh CentOS7 (CentOS7.9, R 3.6.0, gcc4.8.5), however, I run into the problem when install the RcppEigen which depends on Rcpp package. I tried mutliple ways, the easiest way to correct it is using anaconda, it works even without sudo permission:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh  
sh Miniconda3-latest-Linux-x86_64.sh -b  # remove the -b if you'd like to customize the locations. 
conda activate    # make sure the "base" is in your prompt; You can also create enviroment. 
conda install r-essentials

R
### run in R
# Run in R to install dependencies
install.packages(c("Rcpp", "data.table", "stringi", "BH",  "RcppEigen"))
# Install SBayesRC package
# Almost all warnings comes from RcppEigen Package,  sorry for that... 
install.packages("https://github.com/zhilizheng/SBayesRC/releases/download/v0.2.0/SBayesRC_0.2.0.tar.gz",
                 repos=NULL, type="source")
q()
### return to bash
# each time you need run SBayesRC:
conda activate  # make sure the "base" in the prompt
# then copy my example script
# If you'd like to run in computation nodes (jobs), anaconda would have problem even you have "conda activate"
RSCRIPT_PATH=$(which Rscript)
# replace the "Rscript" in the script to "$RSCRIPT_PATH"

Let me know if this solve your problem or not.

Regards, Zhili

zhilizheng commented 1 year ago

Hi @irgp2019 ,

We now provide the Docker image for easy running without installation. The image address: zhiliz/sbayesrc

You can use the image in local cluster by apptainer/singluar, which is very common in HPC. You can also use the image on cloud directly (UKB RAP, AWS, GCP).

Example to run on local cluster by apptainer, you only need to change the "ldm", "test.ma", "annot.txt" to your location; and output prefix "test" for a better output name. All the others are the commands don't need to change.

# run clean and impute
# ldm is the ld_folder in my document;  test.ma is the summary data;  annota.txt is the annotation file
apptainer run docker://zhiliz/sbayesrc --ldm-eigen ldm --gwas-summary test.ma --impute-summary --out test --thread 4
# run SBayesRC
apptainer run docker://zhiliz/sbayesrc --ldm-eigen ldm --gwas-summary test.imputed.ma --sbayes RC --annot annot.txt --out test --thread 4

Hope it makes the running easier.

Regards, Zhili