I'm using "glmnet" for lasso regression in GWAS. Some variants and individuals have missing values and it seems that glmnet cannot handle missing values.
Is there any solution for this? or is there other package which can handle missing values in lasso regression?
Here are my scripts.
> library(glmnet)
> geno6<-read.table("c6sigCnt.geno")
> geno6[1:10,1:10] #genotype file (0,1,2 for minor allele counts)
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
1 1 1 1 1 1 1 1 1 1 0
2 NA NA 1 1 1 1 1 1 1 1
3 0 0 0 0 0 0 0 0 0 2
4 0 1 0 0 0 0 0 0 0 1
5 1 0 1 1 1 1 1 1 1 1
6 0 2 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 2
8 0 NA 0 0 0 0 0 0 0 0
9 1 0 1 1 1 1 1 1 1 1
10 1 1 1 1 1 1 1 1 1 0
> pheno6<-read.table("c6sigCnt.pheno")
> head(pheno6) #case-control (1,2 for affection status)
V1
1 2
2 2
3 2
4 2
5 2
> geno61<-as.matrix(geno6)
> pheno61<-pheno6[,1]
> fit_lasso <- glmnet(geno61,pheno61,family="binomial",alpha=1,nlambda=100)
**Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs, :
NA/NaN/Inf in foreign function call (arg 5)**