knitr::opts_chunk$set(eval=FALSE)

Security

The API assumes the following: - SciDB EE (enterprise edition) is installed. (Install instructions are here. Contact support@paradigm4.com for login credentials)

Follow the steps below to set up the security settings for the API to work:

  1. Turn on security for SciDB, set up root user by following instructions at https://paradigm4.atlassian.net/wiki/spaces/scidb/pages/242843706/Using+iquery+in+Security+Mode https://paradigm4.atlassian.net/wiki/spaces/scidb/pages/242909237/Enabling+Security+Mode

At this point, you should be able to run the following:

iquery --auth-file ~/.scidb_root_auth -aq "show_user();"
iquery --auth-file ~/.scidb_root_auth -aq "list()"
iquery --auth-file ~/.scidb_root_auth -aq "list('libraries')"

Create namespaces, users, roles, permissions

Consult this gist

Plugins and shim

Install via extra-scidb-libs

NOTE

  1. Shim is configured using a file under /var/lib/shim/conf.
  2. Any configuration changes need a restart for shim via sudo service shimsvc restart
  3. Other plugins required for project are:
    • secure_scan

Package installation

First the dependencies

LibXML

# Ubuntu
sudo apt-get install libxml2-dev
# Centos 6
sudo yum install libxml2-dev # need the Centos equivalent here (auto-prompted by R roxgen2 install below)
# Centos 7
sudo yum install libxml2-devel # need the Centos equivalent here (auto-prompted by R roxgen2 install below)

LibPqxx-devel

yum install postgresql93-devel.x86_64

Libcurl-devel

yum install libcurl-devel

Next, install the following R packages from CRAN

sudo R

# install bioconductor using
# https://bioconductor.org/install/

# install Biobase
BiocManager::install('Biobase')

# Then install a few dependencies
install.packages(c('roxygen2', 
                   'tidyr', 
                   'RPostgreSQL', 
                   'devtools',
                   'yaml',
                   'knitr',
                   'reshape',
                   'reshape2')); 

Next we install the SciDB related R package via devtools

sudo R --slave -e "devtools::install_github('Paradigm4/scidbr')"

This API's R package

This API's R package can be installed in two ways:

If you are just using the package

sudo R --slave -e "devtools::install_github('Paradigm4/revealgenomics')"

If you are working on package development on the target machine

(assuming the directory choice described above):

# Scenario 1
# When user `scidb` has sudo privileges
USER=ksen
pushd /home/$USER/coding/downloads/revealgenomics/; R --slave -e "library(roxygen2); roxygenize()" && cd .. && sudo R CMD build revealgenomics && sudo R CMD INSTALL revealgenomics_0.1.tar.gz ; popd

# Scenario 2
# When you are logged in as root, but user `ksenshar` has copy of package
USER=ksenshar
pushd /home/$USER/coding/downloads/revealgenomics/; R --slave -e "library(roxygen2); roxygenize()" && cd /home/$USER/coding/downloads/ && R CMD build revealgenomics && R CMD INSTALL revealgenomics_0.1.tar.gz; popd

# Scenario 3 
# As root, get package from github into `/tmp`, and install for all users
pushd /tmp/; git clone https://github.com/paradigm4/revealgenomics.git; cd revealgenomics; R --slave -e "library(roxygen2); roxygenize()" && cd /tmp/ && R CMD build revealgenomics && R CMD INSTALL revealgenomics_0.1.tar.gz && rm -rf revealgenomics; popd

Package setup and usage

Now let us get to using the package:

library(revealgenomics)
rg_connect('root', ROOTPASSWORD)

CAUTION: Intitializing arrays here

Caution

init_db(arrays_to_init = 'PROJECT')            # CAUTION: To be used with care by DB admin only
init_db(arrays_to_init = get_entity_names())   # EXTREME CAUTION: To be used with extreme care by DB admin only; initializes all arrays


Paradigm4/revealgenomics documentation built on April 7, 2020, 2:01 a.m.