lovrot / misc-examples-pam50

Example: PAM50 molecular subtype classification in the Mainz breast cancer dataset
http://lovrot.github.io/misc-examples-pam50/
Other
0 stars 1 forks source link

Error message regarding varnamconv #1

Closed lovrot closed 6 years ago

lovrot commented 6 years ago

"Hi John,

I tried to use this code, however, it's giving an error message regarding varnamconv. I think somehow it does not have varnamconv read in. Would you please let me know how to resolve this problem? Thank you very much. Sincerely, Sheena"

Originally reported by @sheenalin in https://github.com/lovrot/misc-examples-pam50/commit/8c9d456eeb41c0d19047ba1ae5fd4011f6063ba2#r29637268

lovrot commented 6 years ago

Hi Sheena,

Thanks for trying out the code.

Could you please provide the output from the command ProjectTemplate::reload.project(list(data_loading = TRUE, munging = TRUE)) ?

This command is part of https://github.com/lovrot/misc-examples-pam50/blob/develop/src/cache-objects.R See https://github.com/lovrot/misc-examples-pam50#instructions

sheenalin commented 6 years ago

Hi John, thanks for your reply. Below is the result that I got. I have not studied on how to use project template. I simply copied and pasted the codes that were provided in lib and data directories. I ran into the problem when trying to run the codes in munge.

ProjectTemplate::reload.project(list(data_loading = TRUE, munging = TRUE)) Current Directory: Documents is not a ProjectTemplate directory Change to a valid ProjectTemplate directory and run reload.project() again. Error during wrapup: cannot open the connection

Thank you very much.

Sincerely, Sheena

lovrot commented 6 years ago

ProjectTemplate::reload.project(list(data_loading = TRUE, munging = TRUE)) Current Directory: Documents is not a ProjectTemplate directory Change to a valid ProjectTemplate directory and run reload.project() again. Error during wrapup: cannot open the connection

First, make sure you’ve cloned or downloaded the repository (https://github.com/lovrot/misc-examples-pam50 > click ”Clone or Download”), see also https://help.github.com/articles/cloning-a-repository/

Then, make sure that the working directory in R is the project directory. For example on my system:

> setwd("/Users/lovrot/git/misc-examples-pam50")
> dir()
 [1] "cache"                     "config"                   
 [3] "COPYING.txt"               "data"                     
 [5] "description.dcf"           "lib"                      
 [7] "misc-examples-pam50.Rproj" "munge"                    
 [9] "publish-gh-page.sh"        "README.md"                
[11] "reports"                   "src"   

Thereafter, try to run reload.project() again and provide the output.

I have not studied on how to use project template. I simply copied and pasted the codes that were provided in lib and data directories. I ran into the problem when trying to run the codes in munge.

I see. If you run the code script by script and line by line then you also need to read the tab-separated value files (extension .tsv) into memory that are located the data directory, for example using readr::read_tsv or similar. One of them is the variable naming convention (varnamconv). ProjectTemplate will do this automatically for you.

sheenalin commented 6 years ago

Hi John,

Thanks so much for your help. I tried to clone and reran the project template command. Managed to fix a few errors but there was one regarding suvplot that I could not solve. I tried the following to install the survplot package and reran the project template command, it still complained about not being able to find suvplot.

install.packages("~/GitHub/survplot_0.0.7/survplot_0.0.7.zip", repos = NULL, type = "win.binary") Installing package into ‘C:/Users/sheena.lin/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) package ‘survplot’ successfully unpacked and MD5 sums checked

ProjectTemplate::reload.project(list(data_loading = TRUE, munging = TRUE)) Objects to clear from memory: config Reloading Project ... Project name: misc-examples-pam50 Loading project configuration Autoloading packages Loading package: Biobase Loading package: BiocGenerics Loading package: GEOquery Loading package: hgu133a.db Loading package: genefilter Loading package: Heatplus Loading package: ggplot2 Loading package: survival Loading package: survplot Loading required package: survplot Failed with error: ‘package ‘survplot’ was built before R 3.0.0: please re-install it’ Installing package into ‘C:/Users/sheena.lin/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) Trying to install the survplot Loading required package: survplot Failed with error: ‘package ‘survplot’ was built before R 3.0.0: please re-install it’ Error: .load.libraries(config, my.project.info) requires package survplot. Please install survplot by running install.packages("survplot") and then try re-running load.project()

Thanks!

Sincerely,

Sheena

sheenalin commented 6 years ago

Hi John,

May I also ask where and how to run the second part of the instruction? In Dos? "Then Run src/cache-objects.R Knit reports/example-pam50-in-mainz.Rmd"

Thank you very much.

Sincerely,

Sheena

lovrot commented 6 years ago

install.packages("~/GitHub/survplot_0.0.7/survplot_0.0.7.zip", repos = NULL, type = "win.binary")

Loading required package: survplot
Failed with error: ‘package ‘survplot’ was built before R 3.0.0: please re-install it’

Try to re-install the package from source (should also work on Windows):

download.file(
  url="http://www.cbs.dtu.dk/%7Eeklund/survplot/survplot_0.0.7.tar.gz",
  destfile="survplot_0.0.7.tar.gz")
install.packages("survplot_0.0.7.tar.gz",
  repos=NULL, type="source")

May I also ask where and how to run the second part of the instruction? In Dos?
"Then
Run src/cache-objects.R
Knit reports/example-pam50-in-mainz.Rmd"

Step 1

source("src/cache-objects.R")

Step 2

rmarkdown::render("reports/example-pam50-in-mainz.Rmd")

If you’re using RStudio, you can also open the R Markdown file and hit the ”Knit” button, see also https://rmarkdown.rstudio.com/authoring_quick_tour.html#rendering_output

sheenalin commented 6 years ago

Hi John, I ran the source command but got the message "Error in loadNamespace(name) : there is no package called ‘stringi’ ". I then tried to obtain stringi by the following way. It seemed that there's some problem with not being able to find 'sh'.

download.file(

install.packages("stringi_1.2.3.tar.gz",

  • repos=NULL, type="source") Installing package into ‘C:/Users/sheena.lin/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified)
  • installing source package 'stringi' ... ** package 'stringi' successfully unpacked and MD5 sums checked Warning in system("sh ./configure.win") : 'sh' not found ERROR: configuration failed for package 'stringi'
  • removing 'C:/Users/sheena.lin/Documents/R/win-library/3.5/stringi' In R CMD INSTALL Warning in install.packages : installation of package ‘stringi_1.2.3.tar.gz’ had non-zero exit status

source("src/cache-objects.R") Objects to clear from memory: .Random.seed atanbreaks cat2 cat3 cat4 colBuRd colBuYlRd colCGANsubtypecd colJCO colNEJM colorpanelBuRd colorpanelBuYlRd config cyanblackyellow destdir dis_cor hclust_avl Nielsen10CCRTabS1 trimstr Reloading Project ... Project name: misc-examples-pam50 Loading project configuration Autoloading packages Loading package: Biobase Loading package: BiocGenerics Loading package: GEOquery Loading package: hgu133a.db Loading package: genefilter Loading package: Heatplus Loading package: ggplot2 Loading package: survival Loading package: survplot Loading package: Rtsne Autoloading helper functions Running helper script: atanbreaks.R Running helper script: colorpanels.R Running helper script: palettes.R Running helper script: utility_functions.R Autoloading data Loading data set: Nielsen10CCRTabS1 Translating data.frame to tibble: Nielsen10CCRTabS1 Loading data set: mainz Found 1 file(s) GSE11121_series_matrix.txt.gz Using locally cached version: C:\Users\sheena.lin\AppData\Local\Temp\RtmpeiJhW3/GSE11121_series_matrix.txt.gz Error in loadNamespace(name) : there is no package called ‘stringi’

Thank you very much.

Sincerely,

Sheena

lovrot commented 6 years ago

Error in loadNamespace(name) : there is no package called ‘stringi’

Packages on CRAN (and Bioconductor) are usually well maintained, and the pre-compiled Windows binaries a good starting point. Before you tried to install from source, did you try the default installation command (on a Windows system, this should try to install the Windows binary package, if available)?

install.packages("stringi")
sheenalin commented 6 years ago

Hi John,

OK, besides installing from source, I actually tried several ways of installing the 'stringi' package ie

biocLite("stringi") install.packages('stringi', dependencies = TRUE) install.packages("stringi") I also tried to download Rtools. However, I kept getting similar warnings ie "installation of package ‘stringi’ had non-zero exit status" and the subsequent ProjectTemplate command would not work. It finally worked when I clicked on NO instead of YES in the dialogue box that popped up during the installation! The message in the box was "do you want to install from sources the package which needs compilation?". The installation problem went away when I clicked on NO.

Thank you.

Sincerely,

Sheena

sheenalin commented 6 years ago

Hi John,

I ran the following two commands. They might have run ok since I got the output. step 1: source("src/cache-objects.R") step 2: rmarkdown::render("reports/example-pam50-in-mainz.Rmd")

However, In Step 1, I got the following warning message, is it something that i need to pay attention to? "Warning message: Setting row names on a tibble is deprecated. " In Step 2, do I need to pay attention to the warnings below? " Output created: example-pam50-in-mainz.html Warning messages: 1: Removed 6 rows containing missing values (geom_smooth). 2: Computation failed in stat_summary(): Hmisc package required for this function 3: Removed 6 rows containing missing values (geom_smooth). "

Thank you.

Sincerely,

Sheena

lovrot commented 6 years ago

In Step 1, I got the following warning message, is it something that i need to pay attention to? "Warning message: Setting row names on a tibble is deprecated. "

Now fixed in https://github.com/lovrot/misc-examples-pam50/commit/8fa7a5b52611e5b32b66f74e20f21f2d8b192d32

In Step 2, do I need to pay attention to the warnings below? ... 2: Computation failed in stat_summary(): Hmisc package required for this function

I added Hmisc to list of required package in the README, see https://github.com/lovrot/misc-examples-pam50/commit/67e0ae8adfa813f24936db3c161aaa5c50c6c494

I you clone/download the updated repository, you should only get warning messages about missing values in geom_smooth (nothing to worry about).

sheenalin commented 6 years ago

Hi John, It seems to work! Thank you.

lovrot commented 6 years ago

Perfect! Thank you.