Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in svd(X) : infinite or missing values in 'x' #47

Closed
Rudrakshi1234 opened this issue Mar 3, 2020 · 15 comments
Closed

Error in svd(X) : infinite or missing values in 'x' #47

Rudrakshi1234 opened this issue Mar 3, 2020 · 15 comments

Comments

@Rudrakshi1234
Copy link

Rudrakshi1234 commented Mar 3, 2020

library(rMVP)
MVP.Data(fileHMP="Filtered genotype.hmp copy.txt",
         filePhe="Phenotypic_data.txt",
         sep.hmp="\t",
         sep.phe="\t",
         SNP.effect="Add",
         fileKin=FALSE,
         filePC=FALSE,
         out="mvp.hmp",
         #priority="memory",
         #maxLine=10000
)

genotype <- attach.big.matrix("mvp.hmp.geno.desc")
phenotype <- read.table("mvp.hmp.phe",head=TRUE)
map <- read.table("mvp.hmp.geno.map" , head = TRUE)

imMVP <- MVP(
  phe=phenotype,
  geno=genotype,
  map=map,
  #K=Kinship,
  #CV.GLM=Covariates,     ##if you have additional covariates, please keep there open.
  #CV.MLM=Covariates,
  #CV.FarmCPU=Covariates,
  nPC.GLM=5,      ##if you have added PC into covariates, please keep there closed.
  nPC.MLM=3,
  nPC.FarmCPU=3,
  priority="speed",
  #ncpus=10,
  vc.method="BRENT",
  maxLoop=10,
  method.bin="FaST-LMM",#"FaST-LMM","EMMA", "static"
  #permutation.threshold=TRUE,
  #permutation.rep=100,
  threshold=0.05,
  method=c("GLM", "MLM", "FarmCPU")
)

This is the output that I am getting

> library(rMVP)
> MVP.Data(fileHMP="Filtered genotype.hmp copy.txt",
+          filePhe="Phenotypic_data.txt",
+          sep.hmp="\t",
+          sep.phe="\t",
+          SNP.effect="Add",
+          fileKin=FALSE,
+          filePC=FALSE,
+          out="mvp.hmp",
+          #priority="memory",
+          #maxLine=10000
+ )
Preparing data for MVP...
Reading file...
inds: 133	markers:1472
Number of threads: 1
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Preparation for GENOTYPE data is done within 0s 
131 common individuals between phenotype and genotype. 
Preparation for PHENOTYPE data is Done within 0s 
Imputing...
out is NULL, impute inplace.
Number of threads: 3
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Impute Genotype File is done!
MVP data prepration accomplished successfully!
Warning messages:
1: In MVP.Data(fileHMP = "Filtered genotype.hmp copy.txt", filePhe = "Phenotypic_data.txt",  :
  SNP.effect has been DEPRECATED.
2: In MVP.Data(fileHMP = "Filtered genotype.hmp copy.txt", filePhe = "Phenotypic_data.txt",  :
  sep.hmp has been DEPRECATED.
> genotype <- attach.big.matrix("mvp.hmp.geno.desc")
> phenotype <- read.table("mvp.hmp.phe",head=TRUE)
> map <- read.table("mvp.hmp.geno.map" , head = TRUE)
> imMVP <- MVP(
+   phe=phenotype,
+   geno=genotype,
+   map=map,
+   #K=Kinship,
+   #CV.GLM=Covariates,     ##if you have additional covariates, please keep there open.
+   #CV.MLM=Covariates,
+   #CV.FarmCPU=Covariates,
+   nPC.GLM=5,      ##if you have added PC into covariates, please keep there closed.
+   nPC.MLM=3,
+   nPC.FarmCPU=3,
+   priority="speed",
+   #ncpus=10,
+   vc.method="BRENT",
+   maxLoop=10,
+   method.bin="FaST-LMM",#"FaST-LMM","EMMA", "static"
+   #permutation.threshold=TRUE,
+   #permutation.rep=100,
+   threshold=0.05,
+   method=c("GLM", "MLM", "FarmCPU")
+ )
====================== Welcome to MVP ======================
      A Memory-efficient, Visualization-enhanced, and       
             Parallel-accelerated Tool For GWAS             
                    __  __  __   __  ___                    
                   |  \/  | \ \ / / | _ \                   
                   | |\/| |  \ V /  |  _/                   
                   |_|  |_|   \_/   |_|   Version: 0.99.17  
  Designed and Maintained by Lilin Yin, Haohao Zhang, and   
  Xiaolei Liu                                               
  Contributors: Zhenshuang Tang, Jingya Xu, Dong Yin,       
  Zhiwu Zhang, Xiaohui Yuan, Mengjin Zhu, Shuhong Zhao,     
  Xinyun Li                                                 
  Contact: xiaoleiliu@mail.hzau.edu.cn                      
============================================================
Start: 2020-03-03 15:19:31 
The log has been output to the file: /Users/rudrakshisharma/Desktop/Manhattan plots/MVP.20200303_151931.log 
Input data has 131 individuals, 1472 markers 
Phenotype: Arimont 
Relationship matrix mode in speed 
Scale the genotype matrix 
Computing Z'Z 
Deriving relationship matrix successfully 
Eigen Decomposition 
Deriving PCs successfully 
Number of PCs included in GLM: 5 
Number of PCs included in MLM: 3 
Number of PCs included in FarmCPU: 3 
-------------------------GWAS Start------------------------- 
General Linear Model (GLM) Start... 
scanning...

Mixed Linear Model (MLM) Start... 
Variance components using: BRENT 
Estimated Vg and Ve: NA NA 
Error in svd(X) : infinite or missing values in 'x'
In addition: Warning messages:
1: In MVP.GLM(phe = phe, geno = geno, CV = CV.GLM, cpu = ncpus, bar = bar,  :
  NAs introduced by coercion
2: In MVP.MLM(phe = phe, geno = geno, K = K, eigenK = eigenK, CV = CV.MLM,  :
  NAs introduced by coercion

Can someone please help me on this issue??

Regards
Rudra

@hyacz
Copy link
Collaborator

hyacz commented Mar 4, 2020

Duplicate of #34

@hyacz hyacz marked this as a duplicate of #34 Mar 4, 2020
@YinLiLin
Copy link
Collaborator

This error may happen when there are missing values in your genotype, which would cause problem when implementing Eigen decomposition on genomic relationship matrix, but looking at the printed log information, the Eigen and GLM accomplished without error, thus it seems to be more likely attributable to the variance components estimation in MLM. I firstly suggest you to check the genotype to see if there are any missing in your genotype. If not, then have a try to change another variance estimation algorithm (eg, vc.method="EMMA") to see if it can help to pass this error.

@rupesht
Copy link

rupesht commented Apr 30, 2020

 I am getting following error 
    __  __  __   __  ___                    
               |  \/  | \ \ / / | _ \                   
               | |\/| |  \ V /  |  _/                   
               |_|  |_|   \_/   |_|   Version: 0.99.19  

Designed and Maintained by Lilin Yin, Haohao Zhang, and
Xiaolei Liu
Contributors: Zhenshuang Tang, Jingya Xu, Dong Yin,
Zhiwu Zhang, Xiaohui Yuan, Mengjin Zhu, Shuhong Zhao,
Xinyun Li
Contact: xiaoleiliu@mail.hzau.edu.cn

Start: 2020-04-30 13:26:37
The log has been output to the file: C:/Users/user/Documents/R/win-library/3.5/rMVP/data/MVP.20200430_132637.log
Input data has 246 individuals, 131620 markers
Phenotype: Y_2016
Relationship matrix mode in speed
Scale the genotype matrix
Computing Z'Z
Deriving relationship matrix successfully
Eigen Decomposition
Error in eigen(K, symmetric = TRUE) : infinite or missing values in 'x'

@XiaoleiLiuBio
Copy link
Collaborator

Could you please check if there is any missing value in the genotype data?

@rupesht
Copy link

rupesht commented Apr 30, 2020 via email

@rupesht
Copy link

rupesht commented Apr 30, 2020 via email

@XiaoleiLiuBio
Copy link
Collaborator

Please impute the genotype data first, there are a lot of imputation tools, e. g., beagle, minimac. If there is only a few missing values in genotype matrix, you can use MVP.Data to convert your genotype data and the missing genotype will be imputed by the major allele.

@rupesht
Copy link

rupesht commented Apr 30, 2020

But if there are many missing values then what to do ? As it is 130K genotype data. Total Missing is about 1045847 out of 130K SNPS.

@rupesht
Copy link

rupesht commented Apr 30, 2020

Dear Dr. Xiaolei,
Previously when I used same same genotyping data in GAPIT with MLM model It gave me the entire analysis results. So is it possible to do it in GAPIT with FarmCPU model ? But there was only problem it required the genotyping data in numeric and I have data in hapmap format. Please suggest the easy way out to perform with FarmCPU model so I can do analysis using same data without further imputation any other step.

@XiaoleiLiuBio
Copy link
Collaborator

As FarmCPU incorporated pseudo QTNs selected from the genotype data, so it needs a fully imputed genotype data. Therefore, you have to impute the genotype data regardless of any software you will use.

@rupesht
Copy link

rupesht commented May 1, 2020

Thank you for the information. The beagle I tried out but its not getting downloaded and secondly minimac also having some issues. Can you please suggest the software where I can submit the CSV. or Excel file of genotype data for imputation?

@XiaoleiLiuBio
Copy link
Collaborator

I am not sure if there is any software that can accept the genotype in csv or excel format. You may try TASSEL, which can accept the hapmap file and also has the imputation function.

@hyacz
Copy link
Collaborator

hyacz commented Nov 6, 2020

This issue is closed because it is no longer active.

@hyacz hyacz closed this as completed Nov 6, 2020
@rupesht
Copy link

rupesht commented Nov 11, 2020 via email

@XiaoleiLiuBio
Copy link
Collaborator

XiaoleiLiuBio commented Nov 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants