Get Started with BioContainers using Rafay | Rafay

Get Started with BioContainers using Rafay

June 10, 2025

In this step-by-step guide, the Bioinformatics data scientist will use Rafay’s end user portal to launch a well-resourced remote VM and run a series of BioContainers with Docker.

Prerequisites

Step 1: Launch a Remote VM

This step covers the creation and deployment of the remote VM using Rafay’s Developer Hub. Watch a brief video of the end user experience below.

  1. Navigate to Compute Instances:

    • Log in to your Developer Hub. On the dashboard, find and click on “Compute Instances.
  2. Create a New Compute Instance:

    • Click the “New Compute Instance” button.
  3. Select a Compute Profile:

    • From the “Compute Profile” dropdown, choose a profile that meets your needs, for example, “VMAAS – Large (4 GPU)” if you require significant GPU resources.
  4. Configure Instance Details:

    • Fill in the required details for your new VM
      • Name: Enter a descriptive name (e.g., demo-vm-biocontainers).
      • Compute Profile: Confirm your selected profile (e.g., vmaas).
      • Workspace: Select your desired workspace (e.g., demo).
      • CPUs: Specify the number of CPUs (e.g., 44 vCPUs).
      • Disk Storage (GB): Set the disk size (e.g., 100 GB).
      • GPUs: Specify the number of GPUs (e.g., 1 GPU).
      • Memory (MB): Set the memory allocation (e.g., 130 GB).
      • Image: Choose the operating system image (e.g., Ubuntu 24.04).
    • Note that the user can request substantial compute, memory, GPU, and storage resources that are not possible on end user laptops.
  5. Add SSH Public Key:

    • Paste your SSH Public Key into the designated field.
    • Note that this SSH key will be used to securely connect to the remote VM.
  6. Create and Publish the Instance:

    • Click the “Create” or “Publish” button to initiate the VM deployment.
  7. Monitor Deployment Status:

    • Observe the deployment status. It will typically transition through “Pending,” “In Progress,” and finally to “Success.”
    • Once successful, note down the IP Address and Username displayed for your VM. These are crucial for connecting via SSH.

Step 2: Launch a BioContainer Using Docker on the Remote VM

1. Connect to Your Remote VM via SSH:

ssh [Username]@[IP_Address]
#Example: ssh ubuntu@192.0.2.1

2. Verify Docker Installation:

docker --version

3. Create a Host Data Directory:

mkdir host-data

4. Test Run a BioContainer (Get Help):

docker run biocontainers/blast:2.2.31 -help
  1. In this example, we are using BLAST, which is an acronym for Basic Local Alignment Search Tool.

6. List Downloaded Docker Images:

docker images
  1. BioContainer images can be large. This is another benefit of using a Remote VM for these operations.

8. Download and Unzip Data for BLAST (using Docker):

docker run --rm -v $(pwd)/host-data:/host-data biocontainers/wget:1.20.3 wget -P /host-data https://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/blast-2.2.31-src.tar.gz
docker run --rm -v $(pwd)/host-data:/host-data biocontainers/gzip:1.9 gzip -d /host-data/zebrafish.1.protein.faa.gz

9. Verify Unzipped File:

ls host-data

You should see zebrafish.1.protein.faa.

10. Build a BLAST Protein Database:

docker run --rm -v $(pwd)/host-data:/host-data biocontainers/blast:2.2.31 makeblastdb -in /host-data/zebrafish.1.protein.faa -dbtype prot -out /host-data/zebrafish_db

11. Download a Query Protein File:

docker run --rm -v $(pwd)/host-data:/host-data biocontainers/wget:1.20.3 wget -P /host-data https://www.uniprot.org/uniprot/P04156.fasta

12. Verify Query File Download:

ls host-data

You should now see P04156.fasta and your database files.

13. Perform a BLAST Search:

docker run --rm -v $(pwd)/host-data:/host-data biocontainers/blast:2.2.31 blastp -query /host-data/P04156.fasta -db /host-data/zebrafish_db -out /host-data/results.txt

1. View BLAST Results:

cat host-data/results.txt

Conclusion In the previous blog, we reviewed how BioContainers represent a transformative leap forward for bioinformatics, offering unparalleled reproducibility, ease of use, and portability.

In this blog, we reviewed the steps data scientists can follow to successfully launch a remote VM, securely access it, and perform a basic bioinformatics task using BioContainers!