Skip to content

Commit

Permalink
Add r_libs to scrips, readme, standardize notes
Browse files Browse the repository at this point in the history
  • Loading branch information
torres-alexis committed Oct 31, 2024
1 parent b39c63c commit dcdf589
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,45 +70,49 @@ This approach allows you to run the workflow within a containerized environment,

Singularity is a containerization platform for running applications portably and reproducibly. We use container images hosted on Quay.io to encapsulate all the necessary software and dependencies required by the GL_RefAnnotTable-A workflow. This setup allows you to run the workflow without installing any software directly on your system.

> ***Note**: Other containerization tools like Docker or Apptainer can also be used to pull and run these images.*
> **Note**: Other containerization tools like Docker or Apptainer can also be used to pull and run these images.

We recommend installing Singularity system-wide as per the official [Singularity installation documentation](https://docs.sylabs.io/guides/3.10/admin-guide/admin_quickstart.html).


> ***Note**: While Singularity is also available through [Anaconda](https://anaconda.org/conda-forge/singularity), we recommend installing Singularity system-wide following the official installation documentation.*
> **Note**: While Singularity is also available through [Anaconda](https://anaconda.org/conda-forge/singularity), we recommend installing Singularity system-wide following the official installation documentation.
<br>

#### Step 2: Fetch the Singularity Image

To pull the Singularity image needed for the workflow, you can use the provided script as directed below or pull the image directly.

> ***Note**: This command should be run in the location containing the `GL_RefAnnotTable-A_1.1.0` directory that was downloaded in [step 1](#1-download-the-workflow-files). Depending on your network speed, fetching the images will take approximately 20 minutes.*
> **Note**: This command should be run in the location containing the `GL_RefAnnotTable-A_1.1.0` directory that was downloaded in [step 1](#1-download-the-workflow-files). Depending on your network speed, fetching the images will take approximately 20 minutes.
```bash
bash GL_RefAnnotTable-A_1.1.0/bin/prepull_singularity.sh GL_RefAnnotTable-A_1.1.0/config/software/by_docker_image.config
```

Once complete, a `singularity` folder containing the Singularity images will be created. Run the following command to export this folder as an environment variable:

Once complete, a `singularity` folder containing the Singularity images will be created. Next, set up the required environment variables:

```bash
# Set R library path to current working directory
export R_LIBS_USER=$(pwd)/R_libs

# Set Singularity cache directory
export SINGULARITY_CACHEDIR=$(pwd)/singularity
```

<br>

#### Step 3: Run the Workflow

While in the directory containing the `GL_RefAnnotTable-A_1.1.0` folder that was downloaded in [step 1](#1-download-the-workflow-files), you can now run the workflow. Below is an example for generating the annotation table for *Mus musculus* (mouse):

> **Note**: The annotation database creation process requires FTP access through port 21. If you encounter connection issues, please verify that port 21 is not blocked by your network/firewall settings or try running the workflow on a system with unrestricted FTP access.
While in the directory containing the `GL_RefAnnotTable-A_1.1.0` folder that was downloaded in [step 1](#1-download-the-workflow-files), you can now run the workflow. Below is an example for generating the annotation table for *Mus musculus* (mouse):

```bash
singularity exec -B $(pwd)/GL_RefAnnotTable-A_1.1.0:$(pwd)/GL_RefAnnotTable-A_1.1.0 \
$SINGULARITY_CACHEDIR/quay.io-nasa_genelab-gl-refannottable-a-1.1.0.img \
Rscript GL_RefAnnotTable-A_1.1.0/GL-DPPD-7110-A_build-genome-annots-tab.R 'Mus musculus'
singularity exec \
--bind $(pwd):$(pwd) \
$SINGULARITY_CACHEDIR/quay.io-nasa_genelab-gl-refannottable-a-1.1.0.img \
Rscript GL_RefAnnotTable-A_1.1.0/GL-DPPD-7110-A_build-genome-annots-tab.R 'Mus musculus'
```

<br>
Expand Down Expand Up @@ -206,12 +210,18 @@ If the reference table does not specify an annotations database for the target o

#### Using Singularity

> **Note**: The annotation database creation process requires FTP access through port 21. If you encounter connection issues, please verify that port 21 is not blocked by your network/firewall settings.
```bash
singularity exec -B $(pwd)/GL_RefAnnotTable-A_1.1.0:$(pwd)/GL_RefAnnotTable-A_1.1.0 \
$SINGULARITY_CACHEDIR/quay.io-nasa_genelab-gl-refannottable-a-1.1.0.img \
Rscript GL_RefAnnotTable-A_1.1.0/install-org-db.R 'Bacillus subtilis'
# Set R library path if not already set
export R_LIBS_USER=$(pwd)/R_libs

singularity exec \
--bind $(pwd):$(pwd) \
$SINGULARITY_CACHEDIR/quay.io-nasa_genelab-gl-refannottable-a-1.1.0.img \
Rscript GL_RefAnnotTable-A_1.1.0/install-org-db.R 'Bacillus subtilis'
```

<br>

#### Using a Local R Environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# GeneLab script for generating organism-specific gene annotation tables
# Example usage: Rscript GL-DPPD-7110-A_build-genome-annots-tab.R 'Mus musculus'
options(timeout = 3600)

.libPaths(Sys.getenv("R_LIBS_USER"))
# Define variables associated with current pipeline and annotation table versions
GL_DPPD_ID <- "GL-DPPD-7110-A"
workflow_version <- "GL_RefAnnotTable-A_1.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# install-org-db.R
options(timeout=3600)
.libPaths(Sys.getenv("R_LIBS_USER"))
# Load required libraries
library(tidyverse)
library(AnnotationForge)
Expand Down

0 comments on commit dcdf589

Please sign in to comment.