Setup Guide for Day 2 Session

By G

Optional Step for Windows users: Install WSL

We recommend installing WSL (Windows Subsystem for Linux) as Linux provides a great environment for bioinformatics work. WSL lets you run Linux on Windows without compatibility issues.

Open PowerShell as Administrator and run:

wsl --install

After installation completes, restart your computer.

When you first launch WSL, you'll be prompted to:

  • Create a username (can be different from your Windows username)
  • Set a password (remember this)

Once inside Ubuntu, run:

sudo apt update && sudo apt upgrade -y

Important: After installing WSL with Ubuntu, you can follow the Ubuntu instructions in the steps below instead of the Windows instructions.

Step 1: Install PostgreSQL

For Windows

Using the Official Installer

Download PostgreSQL 14.19+ from this link

or use this direct download link

For macOS

Using Homebrew

# Install Homebrew if you haven't already
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install postgresql@14

For Ubuntu

sudo apt install postgresql

Step 2: Set up PostgreSQL User Password

Set a password for the postgres user

For Windows:

The password was set during installation, so you can skip this step.

For macOS and Ubuntu:

sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'your_strong_password';"

Replace your_strong_password with a secure password of your choice. Remember this password as you'll need it for subsequent connections.

Step 3: Create the Rice Genome Database

psql -U postgres -c "CREATE DATABASE rgdb;"

Step 3: Download and Load the Database Dump

Download the SQL file containing the genome data from 163 rice varieties

bit.ly/1k1rg-163

Load the data from the SQL file

This may take 10 to 30 minutes.

psql -U postgres -d rgdb -f ~/Downloads/163.sql

For WSL (Ubuntu):

Replace <username> with your Windows username

psql -U postgres -d rgdb -f /mnt/c/Users/<username>/Downloads/163.sql

Clean up the SQL file (Optional)

After successfully loading the database, you may delete the SQL file from your Downloads folder to free up disk space.


You're now ready for Day 2 session of the 1k1RG database training workshop! 🎉


Optional: Post-Day 2 Cleanup

After completing the Day 2 session, you may optionally delete the rgdb database to free up disk space. The database contains test data and can be safely deleted if you no longer need it for practice.

psql -U postgres -c "DROP DATABASE rgdb;"