BDI-pathogens / phyloscanner

Phylogenetics between and within hosts at once, all along the genome.
GNU General Public License v3.0
44 stars 14 forks source link

Cannot install Phyloscanner.R.utilities #66

Closed vtsyvina closed 1 year ago

vtsyvina commented 2 years ago

When I'm trying to run the tool on example data set by running this command: ~/phyloscanner/phyloscanner_analyse_trees.R RAxMLfiles/RAxML_bestTree. MyOutput s,12.5 --outgroupName C.BW.00.00BW07621.AF443088 --multifurcationThreshold g

I get the following error: Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘phyloscannerR’ Random number seed is 488431526 Error in phyloscanner.analyse.trees(tree.directory, tree.file.regex, reconstruction.mode, : could not find function "phyloscanner.analyse.trees" Execution halted

When I try to run ./phyloscannerR/phyloscanner_installation.sh

I get this:

`> options(unzip = "internal");library(devtools);devtools::install_github("olli0601/Phyloscanner.R.utilities")
Loading required package: usethis
Downloading GitHub repo olli0601/Phyloscanner.R.utilities@HEAD

Skipping 3 packages not available: RBGL, Rsamtools, ggtree
   checking for file ‘/alina-data1/tmp/Rtmp3A8vhb/remotes2a7a2112ccf0f/olli0601-Phyloscanner.R.utilities-36d3269/DESCRIPTION’ ✔  checking for file ‘/alina-data1/tmp/Rtmp3A8vhb/remotes2a7a2112ccf0f/olli0601-Phyloscanner.R.utilities-36d3269/DESCRIPTION’ (429ms)
─  preparing ‘Phyloscanner.R.utilities’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘Phyloscanner.R.utilities_0.7-1.tar.gz’
   Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     ‘Phyloscanner.R.utilities/misc_data_analysis_RCCS1519/Rk1519_02_make_potential_transmission_networks.R’
   Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     ‘Phyloscanner.R.utilities/vignettes/figures/phsc_analysis_of_dataset_S1_phyloscan_RkA04565F_RkA05315F.png’

Installing package into ‘/home/vtsivina/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package ‘Phyloscanner.R.utilities’ ...
** using non-staged installation via StagedInstall field
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error: object ‘get_aes_var’ is not exported by 'namespace:rvcheck'
Execution halted
ERROR: lazy loading failed for package ‘Phyloscanner.R.utilities’
* removing ‘/home/vtsivina/R/x86_64-pc-linux-gnu-library/3.6/Phyloscanner.R.utilities’
Warning message:
In i.p(...) :
  installation of package ‘/tmp/Rtmp3A8vhb/file2a7a23ff33ccc/Phyloscanner.R.utilities_0.7-1.tar.gz’ had non-zero exit status`

Seems like some conflict of versions from googling. Can you give me a tip on how to resolve all the dependencies? Also I had to manually install RBGL cause script couldn't do it. I activated the "phylo" conda environment created by the script, but it doesn't help.

Also, not sure where to get the documentation on installation of the tool. The GitHub READ.me page doesn't seem to have much directions. Maybe I'm missing something?

Thanks

ChrisHIV commented 2 years ago

Any idea @mdhall272? Are the installation notes for the R package at https://github.com/BDI-pathogens/phyloscanner/blob/master/InfoAndInputs/InstallationNotesForAnalysingTrees.sh still up to date?

mdhall272 commented 2 years ago

@vtsyvina Please ignore phyloscanner_installation.sh - it's not part of the standard installation process. (@XiaoyueXI could you review if this file is necessary for the public repository and remove it if not?) The installation instructions that @ChrisHIV outlines above should work.

XiaoyueXI commented 2 years ago

Yeah, the sh file is used to install phyloscanner in HPC. @olli0601, shall we remove the installation file in the public repository to avoid confusion?

vtsyvina commented 2 years ago

@ChrisHIV still got the same error. I'll switch to Virtualbox. It seems to work.

mdhall272 commented 2 years ago

@vtsyvina Is it literally the same error? The file @ChrisHIV pointed to doesn't use Phyloscanner.R.utilities at all.

vtsyvina commented 2 years ago

@mdhall272 is says:

# Change directory to the 'phyloscannerR' subdirectory of the main phyloscanner code directory,
# e.g. cd ~/phyloscanner/phyloscannerR/, then run

So when I run install(".", dependencies = T) it gives me

> install(".", dependencies = T)
Skipping 2 packages not available: treeio, ggtree
✔  checking for file ‘/alina-data0/vtsivina/phyloscanner/phyloscannerR/DESCRIPTION’ (387ms)
─  preparing ‘phyloscannerR’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘phyloscannerR_1.8.0.tar.gz’

Running /usr/lib/R/bin/R CMD INSTALL \
  /tmp/RtmpIYOt7K/phyloscannerR_1.8.0.tar.gz --install-tests
* installing to library ‘/home/vtsivina/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘phyloscannerR’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: object ‘get_aes_var’ is not exported by 'namespace:rvcheck'
Execution halted
ERROR: lazy loading failed for package ‘phyloscannerR’
* removing ‘/home/vtsivina/R/x86_64-pc-linux-gnu-library/3.6/phyloscannerR’
Error in (function (command = NULL, args = character(), error_on_status = TRUE,  :
  System command 'R' failed, exit status: 1, stdout & stderr were printed
Type .Last.error.trace to see where the error occurred

And I still cannot run phyloscanner_analyse_trees.R script

mdhall272 commented 2 years ago

What version of R and OS is this?

vtsyvina commented 2 years ago

Distributor ID: Ubuntu Description: Ubuntu 16.04.7 LTS Release: 16.04 Codename: xenial

R version 3.6.3 (2020-02-29)

When I run the script it says:

Error in phyloscanner.analyse.trees(tree.directory, tree.file.regex, reconstruction.mode,  :
  could not find function "phyloscanner.analyse.trees"
Execution halted
mdhall272 commented 2 years ago

It's failed to install phyloscannerR so that command not being found is no surprise. Maybe try upgrading to R 4.1.1?

vtsyvina commented 2 years ago

Hm. I see something really strange: I'm using phylo conda environment that was created. When I ran R I see version 4.1.1, but when I run sudo R I get 3.6.3. And I cannot install the packages using just R because it doesn't have permissions and don't know how to synchronize the versions(Google didn't give an answer)

mdhall272 commented 2 years ago

Huh. Since sudo is using a different binary, you might not actually be trying to install phyloscannerR somewhere you can use it! You shouldn't really need to use that script with sudo if you know what you're doing, for what it's worth. You need to install ggtree from bioconductor (https://bioconductor.org/packages/release/bioc/html/ggtree.html) and then you can use devtools::install on the phyloscannerR directory on your hard drive or devtools::install_github on the phyloscannerR relevant folder of this repository.