KosukeHamazaki / RAINBOWR

Reliable Association INference By Optimizing Weights with R (R package for SNP-set GWAS and multi-kernel mixed model)
https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007663
Other
22 stars 6 forks source link

Function RGWAS.normal does not return p-values #1

Closed mgalland closed 4 years ago

mgalland commented 4 years ago

When I perform a GWAS on the example data, I cannot retrieve any p-values in the normal.res$D dataframe.

Here is the script that I've run:

require(RAINBOWR)
#> Loading required package: RAINBOWR

### Load example datasets
data("Rice_Zhao_etal")
Rice_geno_score <- Rice_Zhao_etal$genoScore
Rice_geno_map <- Rice_Zhao_etal$genoMap
Rice_pheno <- Rice_Zhao_etal$pheno

trait.name <- "Flowering.time.at.Arkansas"
y <- Rice_pheno[, trait.name, drop = FALSE]

x.0 <- t(Rice_geno_score)
MAF.cut.res <- MAF.cut(x.0 = x.0, map.0 = Rice_geno_map)
x <- MAF.cut.res$x
map <- MAF.cut.res$map

# prepare data for GWAS
modify.data.res <- modify.data(pheno.mat = y, 
                               geno.mat = x, 
                               map = map,
                               return.ZETA = TRUE, 
                               return.GWAS.format = TRUE)

pheno.GWAS <- modify.data.res$pheno.GWAS
geno.GWAS <- modify.data.res$geno.GWAS
ZETA <- modify.data.res$ZETA

# GWAS analysis
normal.res <- RGWAS.normal(pheno = pheno.GWAS, 
                           geno = geno.GWAS,
                           plot.qq = FALSE, 
                           plot.Manhattan = FALSE,
                           ZETA = ZETA, 
                           n.PC = 4, 
                           P3D = TRUE, 
                           count = FALSE)

And here is my session info:

R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.4

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods  
[9] base     

other attached packages:
 [1] snpStats_1.36.0             Matrix_1.2-18              
 [3] survival_3.1-8              VariantAnnotation_1.32.0   
 [5] Rsamtools_2.2.3             Biostrings_2.54.0          
 [7] XVector_0.26.0              SummarizedExperiment_1.16.1
 [9] DelayedArray_0.12.2         BiocParallel_1.20.1        
[11] matrixStats_0.55.0          Biobase_2.46.0             
[13] GenomicRanges_1.38.0        GenomeInfoDb_1.22.0        
[15] IRanges_2.20.2              S4Vectors_0.24.3           
[17] BiocGenerics_0.32.0         tidyr_1.0.0                
[19] tibble_2.1.3                dplyr_0.8.3                
[21] RAINBOWR_0.1.14             checkpoint_0.4.8           

Do you have any clue why? thank you Marc

KosukeHamazaki commented 4 years ago

Dear Marc,

Thank you for your question.

When I perform a GWAS on the example data, I cannot retrieve any p-values in the normal.res$D dataframe.

I tried the same codes as you had run, but I succeeded in retrieving p-values in normal.res$D$Flowering.time.at.Arkansas object. (See the end of the comments for my session info.)

What exactly does "I cannot retrieve any p-values" mean? You mean you had some errors? You mean you couldn't see the contents of normal.res$D by print() function? Or you mean you found some NAs/NANs in normal.res$D$Flowering.time.at.Arkansas object? Please tell me more specifically.

Since I don't have enough information on your errors, I'm sorry that I'm not sure why you couldn't retrieve any p-values. But one idea is to update the RAINBOWR to version 0.1.17 (available at CRAN) and restart your R and RStudio session. Then, if you still have some errors, please tell me again.


Here is my session info:

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.4

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] ja_JP.UTF-8/ja_JP.UTF-8/ja_JP.UTF-8/C/ja_JP.UTF-8/ja_JP.UTF-8

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] RAINBOWR_0.1.14

loaded via a namespace (and not attached):
 [1] rrBLUP_4.6.1            Rcpp_1.0.4.6            knitr_1.28             
 [4] cluster_2.1.0           magrittr_1.5            MASS_7.3-51.6          
 [7] xtable_1.8-4            lattice_0.20-41         R6_2.4.1               
[10] rlang_0.4.5             optimx_2020-4.2         fastmap_1.0.1          
[13] tcltk_4.0.0             tools_4.0.0             parallel_4.0.0         
[16] webshot_0.5.2           grid_4.0.0              packrat_0.5.0          
[19] xfun_0.13               miniUI_0.1.1.1          htmltools_0.4.0        
[22] crosstalk_1.1.0.1       yaml_2.2.1              digest_0.6.25          
[25] rgl_0.100.54            numDeriv_2016.8-1.1     Matrix_1.2-18          
[28] pbmcapply_1.5.0         shiny_1.4.0.2           later_1.0.0            
[31] htmlwidgets_1.5.1       promises_1.1.0          manipulateWidget_0.10.1
[34] mime_0.9                evaluate_0.14           rmarkdown_2.1          
[37] compiler_4.0.0          jsonlite_1.6.1          httpuv_1.5.2 

Best regards, Kosuke

mgalland commented 4 years ago

Hello Kosuke, My bad, indeed, to me it was unclear that the Flowering.time.at.Arkansas was containing the p-values and not phenotyping values. All good then! Thank you!