Roseobase is a local genomic resource for marine Roseobacteraceae. It combines a React web front end with a small Node.js / Express backend that:
- Serves genome FASTA files and optional GFF annotations for JBrowse 2
- Runs NCBI BLAST+ on your machine against BLAST databases you provide
You can run it in the browser during development (Vite + API server) or as a desktop app via Electron (recommended for choosing a custom data folder on your computer).
| Area | Purpose |
|---|---|
Backend API (src/server) |
Serves /genomes/... static sequence data, exposes REST endpoints under /api/blast for genome scanning, BLAST jobs, database listing, and data-folder health checks. |
Front end (src) |
Single-page app: landing page, genome inventory, embedded JBrowse 2, BLAST form and results, and settings (desktop). |
flowchart LR
subgraph ui [React UI]
Home[Home]
Genomes[Genomes]
JBrowse[JBrowse]
Blast[BLAST]
Settings[Settings]
end
subgraph api [Express API]
Static["/genomes static"]
BlastRouter["/api/blast"]
end
ui --> BlastRouter
ui --> Static
BlastRouter --> BlastBin["BLAST+ binaries"]
Static --> Fasta["FASTA plus .fai"]
- Node.js (current LTS, e.g. v20 or v22) and npm
- NCBI BLAST+ executables on your
PATHwhen usingnpm run dev:server(commands such asblastn,blastp,makeblastdb, etc.) - Genome data as described in Data layout below
git clone https://github.com/hunter-powell/Roseobase.git
cd Roseobase
npm installIf you use SSH:
git clone git@github.com:hunter-powell/Roseobase.git
cd Roseobase
npm installSee Data layout. At minimum you need indexed FASTAs (.fa or .fna plus matching .fai) under public/genomes/ and BLAST databases under blastdb/ at the project root (or under a custom data directory in Electron).
To index a FASTA (example):
samtools faidx public/genomes/YourGenome.fnaStarts the Vite dev server, then opens Electron. The embedded app starts the API in the main process and can use Settings to pick a data directory.
npm run devTerminal 1 — front end (proxies /api and /genomes to the API):
npm run dev:webTerminal 2 — API server (default port 3001):
npm run dev:serverThen open the URL Vite prints (usually http://localhost:5173).
Optional: change the API port:
PORT=3001 npm run dev:serverIf you change the port, update vite.config.js proxy targets to match.
Build the UI, then serve the API and open the built files (you would typically serve dist/ with the same host as the API or configure CORS; the Electron packaged app loads dist/index.html locally while the API listens on localhost).
npm run build
npm run dev:server
# Serve dist/ with a static server or use Electron after buildPreview the built site only (API features that need the backend will not work unless the API is running and URLs are aligned):
npm run previewThe server looks for data in this order:
-
Electron custom folder (if set in Settings):
your-data-dir/genomes/— FASTA / GFF filesyour-data-dir/blastdb/— BLAST database files (see below)
-
Project defaults (always used as fallback for genomes when present):
public/genomes/—.fa/.fnaplus.faifor each assembly; optional<same-basename>.gfffor gene tracksblastdb/at the repository root — BLAST databases
- Filenames
*.faor*.fnaare treated as assemblies. - Each assembly must have a
.faiindex in the same folder or it is listed as “unindexed” on the Genomes page and excluded from JBrowse until you index it. - If a
.gfffile with the same basename as the assembly FASTA exists next to it (for exampleMyGenome.gffbesideMyGenome.fna), the app adds a GFF3 annotation track for that assembly in JBrowse.
- Place BLAST nucleotide/protein databases under
blastdb/(or underblastdb/inside your Electron data directory). - The server discovers databases by listing
.ninfiles (typical BLAST DB index suffix). - The BLAST UI can run against one selected database or ALL databases (results merged and capped by max target sequences).
For npm run dist:mac / npm run dist:win, BLAST binaries can be bundled under blast-bin/ using the script in the repo:
bash blast-bin/download-blast.shThat populates platform-specific folders used by electron-builder extraResources. The running Electron app passes that directory to the server so BLAST does not need to be on the system PATH.
Landing page for Roseobase: short scientific context for Roseobacteraceae, navigation to Genomes, BLAST, and JBrowse, sponsor/footer imagery (from src/assets/ when present), and contact lines for the project.
- Fetches the list of assemblies from
GET /api/blast/scan-genomes. - Shows each genome with a readable display name and the underlying file base name.
- Ruegeria pomeroyi DSS-3 is sorted first when present.
- If FASTA files exist without a
.fai, shows a warning and suggestssamtools faidx. - Fixed “View Genomes” control opens JBrowse with a default query for Ruegeria_pomeroyi_DSS-3 (you can change the assembly via JBrowse or URL; see JBrowse below).
- Embeds JBrowse 2 (
@jbrowse/react-app2) with a linear genome view. - Configuration is generated dynamically from disk: assemblies and optional GFF tracks come from the same scan as the Genomes page.
- Query parameters
?genome=<assemblyName>— assembly to open (must match the base name derived from the FASTA file, e.g.Ruegeria_pomeroyi_DSS-3).?loc=<location>— optional JBrowse location string (e.g. a region) when supported by the session.
- In development, sequence and GFF URLs are rewritten to hit the local API base so the browser can load data from the Express server.
Local NCBI BLAST+ search (not the NCBI website):
- Sequence — paste query sequence (FASTA supported in the textarea).
- Program —
blastn,blastp,blastx,tblastn,tblastx. - Database — choose one BLAST DB discovered under
blastdb/, or ALL to search every DB and merge hits (sorted by E-value / bit score, truncated to max targets). - Parameters — E-value threshold, max target sequences, optional word size. For blastn, the form includes a Megablast checkbox (the current API invocation does not pass BLAST
-task; extendblast-api.jsif you need megablast semantics on the command line). - Results — tabular outfmt 6-style output rendered in the UI with parsing for hit descriptions (e.g. protein function / location hints when present in titles).
The handler lives in src/server/blast-api.js (POST /api/blast, GET /api/blast/blastdbs, etc.).
- Electron only: choose a data directory that contains
genomes/andblastdb/. The app restarts the embedded API server with that path. - Data status: refreshes
GET /api/blast/data-statusto show whether genomes and BLAST DB folders were found and rough counts. - Browser-only dev: folder picker is unavailable; the app uses the project’s
public/genomesandblastdbpaths as configured in the server.
On all routes except Home: links to Home, Genomes Available, NCBI Blast, JBrowse, and Settings.
| Script | Description |
|---|---|
npm run lint |
Run ESLint on the project. |
npm run dist |
Build Vite output and package Electron for macOS and Windows (requires platform tooling / machines as appropriate). |
npm run dist:mac |
Build + macOS artifacts (e.g. .dmg, .zip under release/). |
npm run dist:win |
Build + Windows NSIS installer. |
| Path | Role |
|---|---|
electron/main.js |
Electron main process: window, IPC, starts Express backend. |
electron/preload.js |
Exposes safe APIs to the renderer (electronAPI). |
src/server/index.js |
Express app entry: static /genomes, mounts BLAST router. |
src/server/blast-api.js |
BLAST execution, DB listing, genome scan, data status. |
src/pages/ |
Route-level pages (Home, Genomes, Blast, JBrowse, Settings). |
src/components/ |
BLAST UI, JBrowse wrapper, navbar. |
public/genomes/ |
Default location for bundled or dev genome FASTA/GFF. |
blastdb/ |
Default BLAST database directory. |
- “No genomes found” / JBrowse empty — Add FASTA files under
public/genomesor your Electron datagenomes/folder and ensure each has a.fai. - BLAST errors — Confirm BLAST+ is installed and on
PATHfordev:server, or use a packaged Electron build withblast-binpopulated. - CORS / wrong API in browser — Use
npm run dev:webso Vite proxies/apiand/genomesto the server defined invite.config.js. - Genomes page shows databases but BLAST fails — Check
blastdb/contains complete DB sets (e.g..nin,.nhr, and related BLAST files).
Add your preferred LICENSE file and citation text for the Roseobase resource if you distribute this repository publicly.
For JBrowse 2, see JBrowse 2 documentation for citation and licensing of the embedded browser component.