carltonyfakhry / QuaternaryProd

An R package for computing the Quaternary Dot Product Scoring Statistic for signed and unsigned causal graphs.
7 stars 6 forks source link

Error: unused arguments #1

Closed slowkow closed 5 years ago

slowkow commented 5 years ago

I'm running the code in your vignette.

I get:

library(QuaternaryProd)
library(data.table)

e2f3 <- fread(system.file("extdata", "e2f3_sig.txt", package = "QuaternaryProd"))

myc <- fread(system.file("extdata", "myc_sig.txt", package = "QuaternaryProd"))

e2f3 <- e2f3[!duplicated(e2f3$entrez),]
myc <- myc[!duplicated(myc$entrez),]

colnames(e2f3) <- c("entrez", "pvalue", "fc")
colnames(myc) <- c("entrez", "pvalue", "fc")

res <- RunCRE_HSAStringDB(
  gene_expression_data     = e2f3,
  method                   = "Quaternary",
  fc.thresh                = log2(1.3),
  pval.thresh              = 0.05,
  only.significant.pvalues = FALSE,
  significance.level       = 0.05,
  epsilon                  = 1e-16,
  progressBar              = TRUE,
  relations                = NULL,
  entities                 = NULL
)
Error in RunCRE_HSAStringDB(gene_expression_data = e2f3, method = "Quaternary",  :
  unused arguments (epsilon = 1e-16, progressBar = TRUE, relations = NULL, entities = NULL)

I guess the code was updated without updating the vignette. So, the vignette still has the old arguments that are no longer used.

You might consider deleting the arguments from the vignette, or else updating the code to accept those arguments. Since it seems to run for a long time, it would be great to show a progress bar.

Session Info

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.5 (Santiago)

Matrix products: default
BLAS: /apps/lib-osver/R/3.4.0/lib64/R/lib/libRblas.so
LAPACK: /apps/lib-osver/R/3.4.0/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] tidyr_0.7.2          ggplot2_3.0.0.9000   data.table_1.10.4-3
[4] QuaternaryProd_1.6.0 rlist_0.4.6.1        dplyr_0.7.6
[7] Rcpp_0.12.17         colorout_1.1-2

loaded via a namespace (and not attached):
 [1] bindr_0.1.1       magrittr_1.5      tidyselect_0.2.4  munsell_0.5.0
 [5] colorspace_1.4-0  R6_2.3.0          rlang_0.3.1       plyr_1.8.4
 [9] tools_3.4.0       grid_3.4.0        gtable_0.2.0      withr_2.1.2.9000
[13] yaml_2.2.0        lazyeval_0.2.1    assertthat_0.2.0  tibble_1.4.2
[17] crayon_1.3.4      bindrcpp_0.2.2    purrr_0.2.5       glue_1.3.0
[21] compiler_3.4.0    pillar_1.3.1      scales_1.0.0.9000 pkgconfig_2.0.2
carltonyfakhry commented 5 years ago

@slowkow I am not sure if this is what is causing your issue , but you are missing a comma after significance.level = 0.05. After I added the comma, I just reran the exact code you had and I had no problem running it:

> library(QuaternaryProd)
> library(data.table)
> 
> e2f3 <- fread(system.file("extdata", "e2f3_sig.txt", package = "QuaternaryProd"))
> 
> myc <- fread(system.file("extdata", "myc_sig.txt", package = "QuaternaryProd"))
> 
> e2f3 <- e2f3[!duplicated(e2f3$entrez),]
> myc <- myc[!duplicated(myc$entrez),]
> 
> colnames(e2f3) <- c("entrez", "pvalue", "fc")
> colnames(myc) <- c("entrez", "pvalue", "fc")
> 
> res <- RunCRE_HSAStringDB(
+     gene_expression_data     = e2f3,
+     method                   = "Quaternary",
+     fc.thresh                = log2(1.3),
+     pval.thresh              = 0.05,
+     only.significant.pvalues = FALSE,
+     significance.level       = 0.05,
+     epsilon                  = 1e-16,
+     progressBar              = TRUE,
+     relations                = NULL,
+     entities                 = NULL
+ )
(1/5) Begin Processing...
(2/5) 135 rows from gene_expression_data removed due 
         to entrez ids being unrepsented in network entities!
(3/5) Loading STRINGdb causal network... 
(4/5) Computing P-values...
  |==========================================================================================| 100%
(5/5) Done.

Here is the session info:

> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 28 (Workstation Edition)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] data.table_1.12.0     QuaternaryProd_1.16.0 yaml_2.2.0            dplyr_0.7.8           Rcpp_1.0.0           

loaded via a namespace (and not attached):
 [1] crayon_1.3.4       assertthat_0.2.0   R6_2.3.0           magrittr_1.5       pillar_1.3.1      
 [6] rlang_0.3.1        rstudioapi_0.9.0   bindrcpp_0.2.2     tools_3.5.0        glue_1.3.0        
[11] purrr_0.3.0        compiler_3.5.0     pkgconfig_2.0.2    BiocManager_1.30.4 knitr_1.21        
[16] bindr_0.1.1        tidyselect_0.2.5   tibble_2.0.1

Also, the reason why I didn't put the progress bar in the vignette is that the generated output pdf has progress values for each increment which turns out to be long and uninformative.

slowkow commented 5 years ago

It turns out I'm using QuaternaryProd_1.6.0 and you're using 1.16.0.

I installed like this:

source("https://bioconductor.org/biocLite.R")
biocLite("QuaternaryProduct")

Since I'm on R 3.4.0, I get QuaternaryProd_1.6.0 instead of 1.16.0.

carltonyfakhry commented 5 years ago

Glad we identified the issue. As a little summary, the examples that are in the vignette on the bioconductor page are only guaranteed to work with the version of the package that is listed for download on the bioconductor page (currently it is 1.16.0).