hanchenphd/GMMAT

glmm.wald exporting only NA

Closed this issue · 5 comments

Hello,

For some reason "glmm.wald" is exporting only NA when I provide the inputs below. I'm not sure where my error is.

Thank you,
Neal

snps<-c("Chr01K_671719","Chr01K_676401","Chr01K_676418","Chr01K_676677","Chr01K_676813")
glmm.wald(fixed = trt ~ 1, data = y, kins = K, id = "ID",verbose=T,snp.col=1,
family = quasibinomial(link = "logit"), infile = "tmp_infile.txt", snps=snps,
infile.nrow.skip = 0, infile.ncol.skip = 1, infile.ncol.print = 1,infile.sep = ",")

K.txt
tmp_y.txt
tmp_infile.txt

Oh, for reference, it's returning a correctly formatted data frame of NAs.

Can you share your log file and output?

Thanks,
Han

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from ~/Desktop/.RData]

library(GMMAT)
#some data processing that I deleted
tmp[1:5,1:5] #marker array (dosage of DNA pools)
A113.0 A113.1 A203.0 A203.1 A204.0
Chr01K_671719 1.808000 1.982456 1.927007 1.765625 1.280000
Chr01K_676401 1.789474 1.647059 1.333333 1.750000 1.739130
Chr01K_676418 1.866667 1.833333 1.250000 1.727273 1.809524
Chr01K_676677 2.000000 2.000000 1.333333 2.000000 1.833333
Chr01K_676813 1.238095 1.809524 1.813953 1.931034 1.735849
write.csv(tmp,"tmp_infile.txt",row.names = T)
outfile<-"outout.txt"
snps<-c("Chr01K_671719","Chr01K_676401","Chr01K_676418","Chr01K_676677","Chr01K_676813")
glmm.wald(fixed = trt ~ 1, data = y, kins = K, id = "ID",verbose=T,snp.col=1,

  •       family = quasibinomial(link = "logit"), infile = "tmp_infile.txt", snps=snps,
    
  •       infile.nrow.skip = 0, infile.ncol.skip = 1, infile.ncol.print = 1,infile.sep = ",")
    

Progress of Wald test:
| | 0%

Analyze SNP 1 : Chr01K_671719
|================== | 20%
Analyze SNP 2 : Chr01K_676401
|==================================== | 40%
Analyze SNP 3 : Chr01K_676418
|====================================================== | 60%
Analyze SNP 4 : Chr01K_676677
|======================================================================== | 80%
Analyze SNP 5 : Chr01K_676813
|==========================================================================================| 100%
SNP N AF BETA SE PVAL converged
1 Chr01K_671719 NA NA NA NA NA NA
2 Chr01K_676401 NA NA NA NA NA NA
3 Chr01K_676418 NA NA NA NA NA NA
4 Chr01K_676677 NA NA NA NA NA NA
5 Chr01K_676813 NA NA NA NA NA NA
Warning message:
In glmm.wald(fixed = trt ~ 1, data = y, kins = K, id = "ID", verbose = T, :
Argument select is unspecified... Assuming the order of individuals in infile matches unique id in data...

str(y)
'data.frame': 60 obs. of 3 variables:
$ pop : chr "113" "113" "203" "203" ...
$ trt : Factor w/ 2 levels "0","1": 1 2 1 2 1 2 1 2 1 2 ...
$ ID : chr "A113.0" "A113.1" "A203.0" "A203.1" ...

If the first row of your infile includes the ID's, you need to specify infile.nrow.skip = 1.

Also you might need to add quote = FALSE in write.csv.

Best,
Han

Good ideas, quote = FALSE in write.csv fixed it. Thank you for your time.