How do I download Spectre in RStudio - r

I am following directions from https://wiki.centenary.org.au/display/SPECTRE/Install+Spectre+from+Github. I do not know RStudio very well, but I need to work with some data and thus need Spectre. For some reason when I put the requisite code it does not work.
Code:
if(!require('devtools')) {install.packages('devtools')}
library('devtools')
install_github("immunedynamics/spectre")
Output (A lot of nonsense followed by):
installing source package ‘Spectre’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in library("flowCore") : there is no package called ‘flowCore’
Error: unable to load R code in package ‘Spectre’
Execution halted
ERROR: lazy loading failed for package ‘Spectre’
removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Spectre’
Warning messages:
1: In i.p(...) : installation of package ‘xfun’ had non-zero exit status
2: In i.p(...) :
installation of package ‘openxlsx’ had non-zero exit status
3: In i.p(...) :
installation of package ‘/var/folders/j7/p3sjp16n6j5c0mk2l4vmn8sw0000gn/T//Rtmpg2qaiD/file185f75fc78b44/Spectre_0.5.0.tar.gz’ had non-zero exit status
Spectre::package.check()
Error in loadNamespace(x) : there is no package called ‘Spectre’

Sorry you had issues during installation. We've made a few updates that should solve this particular problem (which will be present in v0.5.2 and above). Try installing again using the same instructions. I.e.:
if(!require('devtools')) {install.packages('devtools')}
devtools::install_github("immunedynamics/spectre")
You can also post an issue here if you run into any more trouble.
Good luck!
Tom

Related

Error installing the R package: CBNplot on github

I want to install the CBNplot package on GitHub:
Making the website:https://github.com/noriakis/CBNplot
Try two methods:
The first is direct download:
The following error occurs:
devtools::install_github("noriakis/CBNplot")
Installing package into ‘C:/Users/sjadsqf/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
installing source package 'CBNplot' ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
Error: object 'choose.direction' is not exported by 'namespace:bnlearn'
Execution halted
ERROR: lazy loading failed for package 'CBNplot'
removing 'C:/Users/sjadsqf/Documents/R/win-library/4.1/CBNplot'
Warning message:
In i.p(...) :
installation of package ‘C:/Users/sjadsqf/AppData/Local/Temp/RtmpMHHiTR/file555833c63074/CBNplot_0.99.2.tar.gz’ had non-zero exit status
Then I tried the second method
pkgbuild::build("D:/R/CBNplot-main",
dest_path = "D:/R/library/")
Error: object 'choose.direction' is not exported by 'namespace:bnlearn'
Execution halted
ERROR: lazy loading failed for package 'CBNplot'
removing 'C:/Users/sjadsqf/AppData/Local/Temp/Rtmp2F15K6/Rinst5c845a222d2f/CBNplot'
-----------------------------------
ERROR: package installation failed
Error in (function (command = NULL, args = character(), error_on_status = TRUE, ...:
! System command 'Rcmd.exe' failed
Exit status: 1
stdout & stderr:
i notice that error
Error: object 'choose.direction' is not exported by 'namespace:bnlearn'
So I tried to install belearn,After the installation is complete, the above error still appears in the operation
If you look at the changelog for the package bnlearn, it says
Version 4.8
...
removed choose.direction().
The lastest version of bnlearn therefore does not have the choose.direction function that the earlier versions had. Obviously, the CBNplot package uses this function, so the update in bnlearn has effectively broken the existing version of CBNplot.
The solution is to install an earlier version of bnlearn. For example, if I do
remove.packages('bnlearn')
devtools::install_version('bnlearn', version = '4.7')
devtools::install_github("noriakis/CBNplot")
and skip any package updates that are offered, I can install the package without difficulties.

Snakemake installing R package in rule environment: error cannot move 00LOCK permission denied

I'm writing a Snakemake pipeline with a rule that will run an R script. This rule has its own environment that looks like this:
channels:
- conda-forge
- r
- bioconda
dependencies:
- r-base = 4.1.1
- r-ggplot2 = 3.3.5
- r-biocmanager = 1.30.16
Next to the above packages, I also need ggbio, which can be installed with biocmanager:
if(!require(ggbio, quietly=TRUE)){ # if the package is not there, install it
BiocManager::install("ggbio")
}
When executing this rule via Snakemake, initially everything goes right, and most dependencies of the ggbio package get installed. However, after some while, I get the following error:
...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
mv: cannot move '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/00LOCK-xml2/00new/xml2' to '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/xml2': Permission denied
ERROR: moving to final location failed
ERROR: dependency ‘xml2’ is not available for package ‘biomaRt’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/biomaRt’
ERROR: dependency ‘biomaRt’ is not available for package ‘GenomicFeatures’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/GenomicFeatures’
ERROR: dependency ‘GenomicFeatures’ is not available for package ‘VariantAnnotation’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/VariantAnnotation’
ERROR: dependency ‘GenomicFeatures’ is not available for package ‘OrganismDbi’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/OrganismDbi’
ERROR: dependency ‘GenomicFeatures’ is not available for package ‘ensembldb’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/ensembldb’
ERROR: dependencies ‘GenomicFeatures’, ‘VariantAnnotation’, ‘ensembldb’ are not available for package ‘biovizBase’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/biovizBase’
ERROR: dependencies ‘biovizBase’, ‘VariantAnnotation’, ‘GenomicFeatures’, ‘OrganismDbi’, ‘ensembldb’ are not available for package ‘ggbio’
* removing ‘/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/ggbio’
The downloaded source packages are in
‘/tmp/RtmpiQdboR/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Old packages: 'fansi'
Warning messages:
1: In .inet_warning(msg) :
installation of package ‘xml2’ had non-zero exit status
2: In .inet_warning(msg) :
installation of package ‘biomaRt’ had non-zero exit status
3: In .inet_warning(msg) :
installation of package ‘GenomicFeatures’ had non-zero exit status
4: In .inet_warning(msg) :
installation of package ‘VariantAnnotation’ had non-zero exit status
5: In .inet_warning(msg) :
installation of package ‘OrganismDbi’ had non-zero exit status
6: In .inet_warning(msg) :
installation of package ‘ensembldb’ had non-zero exit status
7: In .inet_warning(msg) :
installation of package ‘biovizBase’ had non-zero exit status
8: In .inet_warning(msg) :
installation of package ‘ggbio’ had non-zero exit status
Error in library(ggbio) : there is no package called ‘ggbio’
Execution halted
The error seems to originate from this part:
mv: cannot move '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/00LOCK-xml2/00new/xml2' to '/mnt/c/Users/nicks/Documents/variantcallingpipeline/.snakemake/conda/b98e3353bb11024e3652b19a833d9dc8/lib/R/library/xml2': Permission denied
I get this error only when I run Snakemake from the Ubuntu app on my Windows. If I run it on the server, it works:
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (xml2)
... (and then it continues to the other packages)
The versions are the same on the server and local, which is 1.3.3 for xml2. I've seen other questions relating to this lock issue (here and here), and most of them suggest doing something like this:
install.packages("Rcpp", dependencies = TRUE, INSTALL_opts = '--no-lock')
But this doesn't work for me because the package doesn't get installed with install.packages(). Adding options("install.lock"=FALSE) before the install also doesn't work. Also, when I check the R library folder in the environment location, I do not see the 00LOCK directory.
Any tips? Or is this just a Windows thing that's not easily fixable? Running the installment code in Rstudio does work, but I need the package to get installed in the conda environment, not my standard Rstudio library.
The YAML shown is substandard (incorrect channel order). But more importantly, it generally does not work well to install anything other than Conda packages in Conda-managed R environments. Fortunately, all Bioconductor packages are on the bioconda channel (usually with a bioconductor- prefix and all lowercase), hence, everything should work perfectly fine with simply:
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- r-base=4.1.1
- r-ggplot2=3.3.5
- bioconductor-ggbio

Cannot install vroom under R.4.0.5 on HPC node

To install another package that depends on vroom (which failed) on a HPC node, I sought to install vroom manually.
I tried to install the package manually but it fails too:
My code:
install.packages("vroom")
error message:
installing to /home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘vroom’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs/vroom.so':
/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs/vroom.so: undefined symbol: __cxa_init_primary_exception
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/vroom’
Warning in install.packages :
installation of package ‘vroom’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpgPcp9Y/downloaded_packages’
I have tried under different R versions (3.5.3 up to 4.1.1) but keep having the same issue no matter what version I chose.
I have also deleted any 00LOCK-"package-name" folder that might have arisen in the process in the corresponding R Version package folder, but to no avail.
Can anybody help me out here?
Many thanks in advance,
Philibertus88

Failing to install Github package, "had non-zero exit status" error

I have been unsuccessful at installing the package 'HonestDiD' from Github. It says that the package in question 'had non-zero exit status.' I followed the instructions given here. Any idea how to solve this issue? Here is the code/full error message.
devtools::install_github("asheshrambachan/HonestDiD")
Downloading GitHub repo asheshrambachan/HonestDiD#HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
Enter one or more numbers, or an empty line to skip updates:3
√ checking for file 'C:\Users\louis\AppData\Local\Temp\RtmpkZzlr8\remotes43401e3a797\asheshrambachan-HonestDiD-1723b17/DESCRIPTION' ...
- preparing 'HonestDiD': (601ms)
√ 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 'HonestDiD_0.1.0.tar.gz'
Installing package into ‘C:/Users/louis/OneDrive/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'HonestDiD' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package 'CVXR' was built under R version 3.6.3
Execution halted
ERROR: lazy loading failed for package 'HonestDiD'
* removing 'C:/Users/louis/OneDrive/Documents/R/win-library/3.6/HonestDiD'
Error: Failed to install 'HonestDiD' from GitHub:
(converted from warning) installation of package ‘C:/.../HonestDiD_0.1.0.tar.gz’ had non-zero exit status

hisafer installation - how do I solve hard-coded installation path?

I am installing the hisafer package (for biophysical modeling) following instructions from author(s) lead by Kevin Wolz:
install.packages("devtools")
devtools::install_github("kevinwolz/hisafer")
here I got the answer:
...
write_param_file html
write_weather html
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
ERROR: hard-coded installation path: please report to the package maintainer and use '--no-staged-install'
* removing 'C:/Users/houska/Documents/R/R-3.6.0/library/hisafer'
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/houska/AppData/Local/Temp/RtmpI5hUAl/file32dc572b4098/hisafer_1.4.14.tar.gz’ had non-zero exit status
the following commands do not work, then:
library(hisafer)
vignette("hisafer-vignette")
What should I do to solve this problem?
This is related to the staged installation of packages introduced with R 3.6.0. You can disable it by passing the --no-staged-install option to R CMD INSTALL (as suggested by the error message):
devtools::install_github("kevinwolz/hisafer", INSTALL_opts="--no-staged-install")

Resources