xiaolei-lab / rMVP

:postbox: A Memory-efficient, Visualization-enhanced, and Parallel-accelerated Tool For Genome-Wide Association Study
Apache License 2.0
277 stars 72 forks source link

issure about PC #67

Open Feng560 opened 3 years ago

Feng560 commented 3 years ago

Dear Xiaolei, Recenlty, I use the rMVP to carry out the GWAS. I have some questions about the PCA analysis (my scripts are attached in below).

  1. As I use the default PC analysis by MLM of the package, I wonder whether just first three columns of principle components have been added in the GWAS analysis. Because when I check the PC file, there are five principle components.
  2. I wonder whether the package can output how much variance of each added PC can explain. Thank you very much!

Best! Feng

MVP.Data(fileHMP = "Arabidopsis_2029_Maf001_Filter95_my_ecos.full.hmp.txt", sep.hmp="\t", SNP.effect="Add", filePhe=phenotype_file, sep.phe="\t", filePC= T, #original was: 'PC_file.txt' type.pc="double", sep.pc="\t", fileKin=T, #original was: fileKin='Kinship_vanRaden.txt' type.kin="double", sep.kin="\t", out="mvp.hmp", priority="speed"

maxLine=10000

)

genotype <- attach.big.matrix("mvp.hmp.geno.desc") Kinship <- attach.big.matrix("mvp.hmp.kin.desc") Covariates <- attach.big.matrix('mvp.hmp.pc.desc')

map <- read.delim(file = "Arabidopsis_2029_Maf001_Filter95_my_ecos.full.hmp.txt", sep = "\t") map <- map[,c(1,3,4)]

write.table(map,"mvp.hmp.map")

met <- read.table("mvp.hmp.phe",head=TRUE)

name <- colnames(met) for(i in 2:length(name)){ gc() imMVP <- MVP( phe=met[, c(1,i)], geno=genotype, map=map, K=Kinship,

CV.GLM=Covariates,

CV.MLM=Covariates,
#CV.FarmCPU=Covariates,
#nPC.MLM=0,
priority="speed",
ncpus=40,
vc.method="EMMA",
#maxLoop=10,
#method.bin= "static",#"FaST-LMM","EMMA"
#permutation.threshold=TRUE,
#permutation.rep=200,
threshold=1,
method="MLM",
col=c("steelblue4","cyan3"),
memo='dom',
file.output = T
)

}

warnings()

XiaoleiLiuBio commented 3 years ago

Hi Feng,

Thank you for using rMVP. Below please find some answers to your questions.

  1. All columns of principal components in 'Covariates' were added as covariates by your attached scripts. If there are five columns of principal components in the 'Covariates' file, all of them were added as covariates in MLM.

  2. Does the 'variance‘ mean phenotypic variance or total variance of principal components?

Xiaolei

Feng560 commented 3 years ago

Dear Xiaolei,

Thank you very much for your answer.

  1. Sure, thank you very much. I wonder whether i can comment out CV.MLM=Covariates and nPC.MLM=3 to the script to just add the 3 principal components in the following GWAS analysis
  2. I mean the total variance of principal components.

Best! Feng

XiaoleiLiuBio commented 3 years ago

We will think about adding the function to meet your second requirement. Thank you for your nice questions and suggestions.

Feng560 commented 3 years ago

Thank you very much! Best! Feng