GSBench / reference_answer /Q003 /answer /update_rmvp.R
integer8's picture
Add files using upload-large-folder tool
59b682d verified
Raw
History Blame Contribute Delete
1.19 kB
library('rMVP')
MVP.Data(fileBed="maize_598",
filePhe="BLUP.csv",
sep.phe=",",
#SNP.effect="Add",
fileKin=FALSE,
filePC=FALSE,
#priority="memory",
#maxLine=10000,
out="mvp.plink"
)
# 2. 计算亲缘关系矩阵和主成分
MVP.Data.Kin(TRUE, mvp_prefix='mvp.plink', out='mvpKin')
MVP.Data.PC(TRUE, mvp_prefix='mvp.plink', pcs.keep=5, out='mvpPC') #计算前5个主成分
# 3. 加载数据
genotype <- attach.big.matrix("mvp.plink.geno.desc")
phenotype <- read.table("mvp.plink.phe", head=TRUE)
map <- read.table("mvp.plink.geno.map", head = TRUE)
Kinship <- attach.big.matrix("mvpKin.kin.desc")
Covariates_PC <- bigmemory::as.matrix(attach.big.matrix("mvpPC.pc.desc"))
# 4. 运行FarmCPU GWAS
imMVP <- MVP(
phe=phenotype,
geno=genotype,
map=map,
K=Kinship,
CV.FarmCPU = Covariates_PC,
CV.MLM = Covariates_PC,
CV.GLM = Covariates_PC,
# nPC.GLM = 5,
# nPC.MLM = 3,
# nPC.FarmCPU = 3,
ncpus = 10,
vc.method = "BRENT",
method.bin = "static",
threshold = 0.05,
method = c("GLM", "MLM", "FarmCPU"),
file.output = c("pmap", "pmap.signal", "plot", "log")
)