How to Install JBQR
JBQR is currently hosted on GitHub. You can find the repository here
To install JBQR, you can use the install_github
function from the devtools
library.
Install and load library
# Install devtools package if not already installed
install.packages("devtools")
# Load devtools package
library("devtools")
Install JBQR
install_github("TheJacksonLaboratory/bioconnect-jbqr", force = TRUE)
library("jbqr")
Verify Installation
jbq_obj <- JBQ$new()
jbq_obj$get_version()
[1] "0.0.1"
Test with a Sample Data Package
Download the sample data package JAXDP00006X.zip and save it to a directory of your choice. Start an interactive R session in the same folder as the zip file
jbq_obj <- JBQ$new('JAXDP00006X.zip')
study_sources <- jbq_obj$get_study_sources()
study_sources
> study_sources
source_name bedding date.of.birth date.of.death diet diet.start.date sex
1 JMUS003afd07e626d471dc146e713eccd881 NA 11/03/2020 02/15/2021 44% fat + fiber 12/16/2020 female
2 JMUS052350f269e772f16a5ebd42231f87bf NA 11/10/2020 02/23/2021 44% fat + fiber 12/23/2020 male
3 JMUS0c58dc438c52346c4c8302a027d9f12e NA 11/10/2020 02/22/2021 10% fat + fiber 12/23/2020 male
4 JMUS0c95880aca8e16b158baaca6df39c6e0 NA 11/10/2020 02/22/2021 10% fat + fiber 12/23/2020 female
5 JMUS172822be3046d1938faa1d85d10e9681 NA 11/10/2020 02/23/2021 44% fat + fiber 12/23/2020 male
......
JBQR on sumner2
On sumner2 (Unix), JBQR can be utilized in an interactive R session or RStudio.
Interactive R session
Download the Singularity image with pre-built JBQR:
wget https://storage.googleapis.com/jax-genome-browser-track-public-website-data/jbq/bioconnect_jbqr.sif
Start the R session, with the memory and time parameters, eg. 24 hrs and 8GB
srun -p compute -q batch --mem=16g -t 24:00:00 -c 1 --pty $SHELL
module load singularity
singularity exec bioconnect_jbqr.sif R
Run JBQR within R:
library("logger")
library("jbqr")
jbq_obj <- JBQ$new('JAXDP00006X.zip')
assay_samples <- jbq_obj$get_assay_samples()
assay_samples
> assay_samples
sample_name source_name diet sex strain treatment genotype
1 ORSAM17290-1 JMUSf37118ffca35cf6d2939ae5f8c941d14 10% fat + fiber female C57BL/6J NA NA
2 ORSAM17291-1 JMUSe85c53436f70930c804c17124f048e32 10% fat + fiber female C57BL/6J NA NA
3 ORSAM17292-1 JMUSbbaa0055849bba97849f0067c458e889 10% fat + fiber male C57BL/6J NA NA
4 ORSAM17293-1 JMUSc2113932b206a2c9749d1ad9d20655dd 10% fat + fiber male C57BL/6J NA NA
5 ORSAM17294-1 JMUS613846554fc300089758a7a2fe624f41 10% fat + fiber female NZO/HlLtJ NA NA
To add JBQR to your own Singularity image:
R -e "install.packages(c('devtools', 'testthat', 'roxygen2', 'logger'))"
R -e "remotes::install_github('TheJacksonLaboratory/bioconnect-jbqr')"
RStudio
Start a RStuido session on sumner:
module load rstudio
rstudio-session-4.3.1
(base) [xxxxxx@sumner086 ~]$ rstudio-session-4.3.1
You are attempting to start an Rstudio 4.3.1 session on Sumner using the following resources:
CPUs 2 Memory 8192 (for help: "rstudio-session-4.3.1 --help")
Would you like to proceed (y/n)?
Starting... - Done.
This Rstudio session will expire in 8 hours at 2024-07-03 07:34:57 PM.
Your session login information is below. This will also be sent to your JAX email:
1. Click on or paste the following URL into your browser:
http://sumner130.sumner2.jax.org:37631
2. Login to the RStudio Server using the following temporary session
credentials:
user: xxxxxx
password: xxxxxxxxxx
When done using RStudio Server, terminate the job by:
1. Exiting the RStudio Session ("power" button in the top right corner of the
RStudio window)
2. Issue the following command on the login node:
scancel -f 1393153
If you have trouble accessing your RStudio instance, try canceling the job and
removing the following file, before starting another one:
rm -f /home/xxxxxx/.config/rstudio/rstudio-prefs.json
Open the provided url to access the RStudio through browser
Install and load library
# Install devtools package if not already installed
install.packages("devtools")
# Load devtools package
library("devtools")
Install JBQR
install_github("TheJacksonLaboratory/bioconnect-jbqr", force = TRUE)
library("jbqr")
Run JBQR
library("jbqr")
library("logger")
jbq_obj <- JBQ$new('BioConnect_Data/JAXDP00006X.zip')
INFO [2024-07-03 11:48:26] Version: 0.0.1 build_2024_07_02
study_sources <- jbq_obj$get_study_sources()
View(study_sources)
jbq_obj$get_files("*liver*")
Stop the RStuio session
scancel -f xxxxxx