Menu ▾ ▴

GenBankVault_User_Guide

Bryan P White

← Back to GenBankVault Overview

GenBankVault User Guide

Version: 1.1.0
License: GPL-3.0-or-later
Binary: ncbi-genome-vault

This guide walks through installing, building, navigating, and scripting GenBankVault for gated NCBI retrieval, offline SQLite curation, batch Multi-FASTA preparation, and multi-scale sequence inspection.


1. Building & Launching

Build from Source

$env:CARGO_BUILD_JOBS='4'
cargo build --release

Launch Native GUI

# Default user-local SQLite WAL vault (auto-seeds 10 reference records and 2 Sets on first run)
cargo run --release -- gui

# Use a project-specific vault database and an optional NCBI API key
cargo run --release -- --vault-db ./project_vault.sqlite3 --api-key YOUR_KEY gui

By default, GenBankVault persists its SQLite WAL database to the platform local application data directory (GenBankVault/genbank_vault.sqlite3).


2. Workspace Layout & Async NCBI Workflows

The workstation is divided into four coordinated zones:

  1. Top Bar (top_search_and_gates):
  2. Mode Toggles: Offline Vault Mode (forces SQLite-only lookups and queues network requests cleanly) and Auto-Route Gate (infers the biological gate from your query).
  3. Batch & Vault Tools: Upload Accession List, Sync Queue Now, Export Vault JSON, Import Vault JSON, API Key, and About (F1).
  4. Search & Stage (Ctrl+F): Enter gene symbols, organisms, chromosome synteny phrases, or direct accessions, then press Enter or click Search & Stage. Local SQLite hits appear immediately while live NCBI ESearch + ESummary runs on a background worker thread.
  5. Progress & Cancellation: Whenever a live NCBI search, batch download, queue sync, or region slice fetch is active, a live status strip displays the active operation, progress bar, item label, and a Cancel button.
  6. 5 Gated Modality Pills (1–5): Force or inspect records under Nucleotide, Protein, Circular Genome, Linear Chromosome, or Linear Genome.

  7. Left Sidebar (Saved Sets & Offline Vault):

  8. Filter records by All cached accessions or any named Set (e.g., Homo sapiens COX1).
  9. Set CRUD Controls: Select any named Set to reveal inline Rename and Delete Set controls, export a combined .fasta file, or open Multi-FASTA View (M).
  10. Record Cards: Click View to open a record in the central viewer, -Set to remove an accession from the active Set without deleting the underlying sequence, or Del to remove the record permanently from SQLite.
  11. Search / Uploaded Hits -> Set: Select individual hits (or Select All) and click Download Selected to Set / All -> Set to batch-download uncached accessions asynchronously and bind them into your target Set.

  12. Central Workspace (Single Record Viewer / Set Multi-FASTA View):

  13. Toggle between interactive visual browsers (Single Record Viewer) and batch FASTA preparation (Set Multi-FASTA View) using the mode tabs or pressing M.
  14. In Nucleotide and Circular Genome views, switch between Standard (Table 1) and Vert. Mito (Table 2) genetic codes from the viewer toolbar (Code:). Mitochondrial accessions such as NC_012920.1 auto-select Table 2 on load.

  15. Right Sidebar (Annotation & Locus Inspector + Region Sequence Exporter):

  16. Inspect selected annotations, cytobands, primate ortholog synteny blocks, or assembly chromosomes with direct outbound links to NCBI/UniProt/ClinVar.
  17. Specify Start, End, Strand (+ Forward or - RevComp), and Format (FASTA, GenBank, GFF3), then click:
    • Copy Sequence: Copy the formatted region to clipboard.
    • Save Slice to Vault: Store the slice in SQLite (saved_slices) and write it to disk.
    • Fetch Live Region: Pull [Start..End] directly from NCBI Entrez efetch on a background thread when inspecting uncached megabase chromosome windows.

3. Importing Batch Accession Lists

  1. Click Upload Accession List in the top toolbar.
  2. Either point File path to a .txt, .csv, or .tsv file and click Read File, or paste accessions into the monospace editor (# comments are ignored).
  3. Enter a Target Set Name.
  4. Click Stage Accessions (Select All) to review inferred gates (NP_/XP_/WP_/YP_ -> Protein, GCF_/GCA_ -> Linear Genome, NC_012920/NZ_CP*/CP* -> Circular Genome, NC_0000* -> Linear Chromosome, else Nucleotide), or click Stage & Download Directly to Set to fetch immediately.

4. Managing Multi-FASTA Exports (Set Multi-FASTA View)

Switch to Set Multi-FASTA View (M) to prepare clean, downstream-ready FASTA files:

  • Filter Alphabet: All, Nucleotide Only, or Protein Only.
  • Header Style: Rich (>ACC | Organism | Gate | length | title), Compact (>ACC [Organism]), or AccessionOnly (>ACC).
  • Line Wrap: Configure wrap column (70, 60, 80, or 0 for single-line unwrapped sequences).
  • Search / Uppercase: Filter entries interactively and normalize lowercase bases.
  • QA Metrics: Inspect residue counts, sequence GC%, and ambiguous residue totals (N/X counts strictly reflect cached residues; uncached metadata-only records report 0 ambiguous bases).

5. Runtime NCBI_API_KEY & Portable Vault Bundles

  • Increasing Rate Limits: Click API Key in the top toolbar (or launch with --api-key <KEY> / NCBI_API_KEY environment variable) to raise Entrez throttling from 3 req/s (340 ms spacing) to 10 req/s (105 ms spacing).
  • Portable Sharing: Click Export Vault JSON to write ./genbank_vault_bundle.json, and click Import Vault JSON on another workstation (or in air-gapped environments) to merge records, Sets, and exported slices into SQLite without network access.

6. Navigation & Shortcuts Reference

All shortcuts other than F1/Esc and Ctrl+F are disabled automatically while typing in any input field or when a modal window is open:

Input Effect
Ctrl+F Focus the NCBI search input field
1, 2, 3, 4, 5 Select gate 1..5 (Nucleotide through Linear Genome)
M Toggle Single Record Viewer / Set Multi-FASTA View
+ / = and - Zoom in / zoom out inside the central record viewer
0 Reset viewer zoom (1.0x), pan (0.5), and circular ring angle
Mouse Wheel Zoom viewer smoothly
Click + Drag Pan linear genome/chromosome/nucleotide/protein track or rotate circular map
Hover Show vertical/radial crosshair with genomic bp / aa position, GC% / KD score, and feature metadata

7. Headless Rendering & Automation CLI

GenBankVault supports scriptable batch ingestion, regional slicing, Set Multi-FASTA export, and offscreen wgpu screenshots:

# Search offline vault, stage all hits into a Set, and export wrapped FASTA
ncbi-genome-vault --vault-db work.sqlite3 search "homo sapiens COX1" --offline --download-all --to-set "COX1"
ncbi-genome-vault --vault-db work.sqlite3 sets --export-fasta "COX1" --output cox1.fasta --wrap 60

# Extract reverse-complement circular origin-spanning GenBank slice from human mitogenome
ncbi-genome-vault --vault-db work.sqlite3 export-region NC_012920.1 --start 16550 --end 20 --reverse-complement --format genbank --output dloop_rc.gbk

# Render offscreen 1600x1000 PNG verification views (1 = Chr1, 2 = rCRS Circular, 3 = Set Multi-FASTA)
ncbi-genome-vault --headless-screenshot view1.png --screenshot-view 1

Related

Wiki: GenBankVault