Session Overview

This lab loads reference genome feature data directly into the PostgreSQL Chado schema using PostgreSQL's \copy command. Participants will connect to the training database and bulk-import Nipponbare reference genome features from a CSV file, then verify the load with row count queries.

What You Will Do

Where to Get a Quality Reference Genome

For rice, a high-quality annotated reference genome (GFF + FASTA) can be downloaded from RiceOme — a comprehensive rice omics database maintained by Huazhong Agricultural University:

🌎 riceome.hzau.edu.cn/download.html

The GFF annotation file from this source is compatible with both loadReferenceGenome.sh and loadReferenceGenomeWSeq.sh provided in the Related Files section.

Related Files

Download these before starting the lab:

📄 11-feature-nipponbare.csv   📄 loadReferenceGenome.sh   📄 loadReferenceGenomeWSeq.sh

Option A — Load a Pre-built CSV with \copy

Use this option when a ready-made feature CSV is already available (e.g., the Nipponbare training file). Make sure you are in the directory containing the CSV file before connecting.

Step 1: Connect to the Database

bash
sudo -u postgres psql -d chado_training

Step 2: Load the Reference Genome Features

psql
\copy feature FROM '11-feature-nipponbare.csv' WITH (FORMAT csv, HEADER true)

Step 3: Verify

psql
SELECT COUNT(*) FROM feature;

Option B — Load from GFF Using a Script

When you have a raw GFF annotation file instead of a pre-built CSV, use one of the two loader scripts. Both scripts automatically look up or insert the organism, CV, and cvterm entries, then generate intermediate CSVs and bulk-load them into Chado.

Which Script to Use?

Script When to use Chromosome seqlen source Chromosome naming
loadReferenceGenome.sh GFF has only gene rows (no explicit chromosome rows) Inferred from the last gene position per chromosome Chr1, Chr2 …
loadReferenceGenomeWSeq.sh GFF has explicit chromosome-type rows with real sequence lengths Read directly from the chromosome row in the GFF chr01, chr02 … (zero-padded)

What the Scripts Do

Parameters

Flag Description
-iInput GFF file
-oOutput file prefix (intermediate CSVs are named <prefix>_feature.csv etc.)
-nOrganism common name (must match what is in the database)
-pPostgreSQL password (training2026 for the training database)

Step 1: Make the Script Executable

bash
chmod +x loadReferenceGenome.sh

Step 2: Run the Script

bash
bash loadReferenceGenome.sh -i nipponbare.gff -o nipponbare -n "Japonica nipponbare" -p training2026

Or, if using the version with explicit chromosome lengths:

bash
bash loadReferenceGenomeWSeq.sh -i nipponbare.gff -o nipponbare -n "Japonica nipponbare" -p training2026

Step 3: Verify

psql
sudo -u postgres psql -d chado_training -c "SELECT COUNT(*) FROM feature;"
sudo -u postgres psql -d chado_training -c "SELECT COUNT(*) FROM featureloc;"

Expected Outcome

ⓘ Once the load completes, proceed to Session 09 — Loading Dataset into Chado to load the full training dataset using uploadDataset.sh.