我在GWAS中使用“ glmnet”进行套索回归。某些变体和个人缺少值,并且glmnet似乎无法处理丢失的值。
有什么解决办法吗?还是有其他软件包可以处理套索回归中的缺失值?
这是我的脚本。
> 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)**