Install R and Python packages from the local Sandbox repository
Many commonly used R and Python packages are pre-installed in the Sandbox IVM. Users can install additional R and Python packages from the local Sandbox repository. It contains less frequently used packages and packages that may conflict with others.
R packages
List R packages available in the local Sandbox CRAN repository using R
The Sandbox IVM has been pre-configured to use the local Sandbox CRAN repository. The available.packages() R command can be used to list the available packages in the local Sandbox CRAN repository.
Use the following command to list all available packages and their versions:
available.packages()[,c("Package","Version")]You can search available packages by name. For example, use the following command to list all packages that start with 'Bi':
p <- available.packages()[,c("Package", "Version")]
c <- grepl("^Bi", p[,c("Package")], ignore.case=TRUE)
p[c,]The available.packages()command returns other columns as well. You can list them all using the colnames command:
colnames(available.packages())List R packages available in the local Sandbox CRAN repository using the terminal
You can list packages using the R command line program with the -e option following other instructions in the previous section.
List all packages:
R -e 'available.packages()[,c("Package","Version")]'Search packages by name:
R -e 'p <- available.packages()[,c("Package", "Version")];c <- grepl("^Bi", p[,c("Package")], ignore.case=TRUE);p[c,]'You can also directly list the packages in the local Sandbox CRAN repository:
ls /usr/finngen-repos/cran/source/src/contribInstall R packages from the local Sandbox CRAN repository
The Sandbox IVM has been pre-configured to use the local Sandbox CRAN repository. Use the install.packages("package name") R command to install packages from the local Sandbox CRAN repository.
For example, the following command installs the Biobase package:
install.packages("Biobase")List available R packages in the local Sandbox CRAN repository outside the Sandbox
It is possible to list the available R packages outside Sandbox by using buckets.
R packages are available in the following bucket:
gs://fg-production-master_cran/source/src/contribYou can see the contents of the bucket using the cloud console:
or the gsutil command line program:
gsutil ls gs://fg-production-master_cran/source/src/contribPython packages
List Python packages available in the local Sandbox PyPI repository using the terminal
The Sandbox IVM has been pre-configured to use the local Sandbox PyPI repository: https://pypiserver.app.finngen.fi/. It contains packages for both Python 2 and Python 3. FinnGen uses the pip program to install Python packages in the Sandbox.
Use the following command to list available Python 2 packages:
python -m pip listUse the following command to list available Python 3 packages:
python3 -m pip listInstall Python packages from the local Sandbox PyPI repository using the terminal
Use the following command to install a Python 2 package:
python -m pip install <packagename>Use the following command to install a Python 3 package:
python3 -m pip install <packagename>List available Python packages in the local Sandbox PyPI repository outside the Sandbox
It is possible to list the available Python packages outside Sandbox by using buckets.
Python 2 packages are available in the following bucket:
gs://fg-production-master_pypi/python2Python 3 packages are available in the following bucket:
gs://fg-production-master_pypi/python3You can see the contents of the buckets using the cloud console:
or the gsutil command line program:
gsutil ls gs://fg-production-master_pypi/python2
gsutil ls gs://fg-production-master_pypi/python3Last updated
Was this helpful?