plink2R的github:
10年之前的包,没有更新,但是有用。所以,安装一下。
R语言是昨天安装的R3.6版本(Linux系统安装老版本的R语言,比如R3.6?)。
1,系统中有git(如果没有,通过手动下载上传也是一样的)
通过git下载:
git clone https://github.com/gabraham/plink2R.git
手动下载:
下面以手动下载的文件为演示:
上传到系统中,解压,进入文件:
$ ls
data.bed data.bim data.fam plink2R plink2R.R README.md
进入R3.6:
install.packages('plink2R/',repos=NULL)
ERROR: dependencies ‘Rcpp’, ‘RcppEigen’ are not available for package ‘plink2R’
* removing ‘/home/gwas/R3.6/lib/R/library/plink2R’
Warning message:
In install.packages("plink2R/", repos = NULL) :
installation of package ‘plink2R/’ had non-zero exit status
报错,缺少两个R包,接着安装:
install.packages(c("Rcpp","RcppEigen"))
最后安装:
install.packages("plink2R/",repos=NULL)
安装成功:
installing to /home/gwas/R3.6/lib/R/library/00LOCK-plink2R/00new/plink2R/libs
** R
** byte-compile and prepare package for lazy loading
** help
Warning: /home/gwas/test/plink2R/plink2R/man/plink2R-package.Rd:33: All text must be in a section
Warning: /home/gwas/test/plink2R/plink2R/man/plink2R-package.Rd:34: All text must be in a section
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (plink2R)
> library(plink2R)
Loading required package: Rcpp
Loading required package: RcppEigen
>
测试数据:
library(plink2R)
dat <- read_plink("data")
dim(dat$bed)
dim(dat$fam)
dim(dat$bim)