How mrmonk12345/ard-database-workbench works
Purpose and Operating Model
ARD is a filesystem-backed SQLite system for managing amplicon-sequencing projects from experimental metadata through raw reads, pipeline execution, and uploaded analysis results. The database is the source of truth; directories hold staged inputs, reads, generated datasets, and pipeline artifacts. Core schema and a sample database are at schema.sql, example_database.db, and database.md.
Database and Metadata Layer
SQLite models projects, treatments, samples, libraries, sequencing outputs, amplicon types, analysis units, datasets, and pipeline-related records. The schema is defined in schema.sql; SQL queries produce analysis-specific views and exports in scripts/sql/get_manifest_data_for_dataset.sql, scripts/sql/get_limited_data_for_sample_metadata.sql, and scripts/sql/get_amplicon_type_data_for_dataset.sql. Python DB access/adaptation is concentrated in scripts/python/db_get_data.py, scripts/python/db_get_columns.py, and scripts/python/refresh_labels.py.
Interactive Data Management
A Python GUI provides database inspection, project/treatment views, record-entry windows, and TSV export. Its application entry point is gui/main.py; main composition and navigation are in gui/main_window.py and gui/general_sections.py. Domain-specific project and treatment interfaces live in gui/project_sections.py, gui/project_data_window.py, and gui/treatment_sections.py.
Incoming Data and Read Organization
New tabular data is staged before database insertion in input_staging/; raw FASTQ data is organized by project in raw_reads_projects/. Primer demultiplexing is a boundary between raw reads and analysis inputs, implemented by scripts/python/0_demultiplex_primers_and_gzip.py with shell launchers at demultiplex_multiple_primers.sh and scripts/shell/demultiplex_multiple_primers.sh.
Dataset Materialization
Database records are transformed into reusable analysis datasets and files. scripts/python/dataset_base_make_inputs.py and scripts/python/dataset_base_write_inputs.py coordinate extraction/writing; numbered scripts generate gzipped analysis files, manifests, sample metadata, amplicon metadata, and links: scripts/python/1_dataset_to_analysis_files_simple_gzip.py, scripts/python/2_dataset_to_manifest_file.py, and scripts/python/5_dataset_symlink_files.py. Outputs cross into analysis_files/ and analysis_datasets/.
Pipeline Handoff and Execution Tracking
Dataset directories are converted into pipeline-run directories by scripts/python/6_dataset_directory_to_pipeline_run_directory.py and scripts/python/create_pipeline_run.py. Pipeline inputs can also be generated directly from database state via scripts/python/database_to_pipeline_input.py and database_to_pipeline_input.sh. Runs and their outputs reside under pipeline_runs/; the intended external analysis runtime is QIIME workflows, likely executed on the documented ARO HPC environment.
Result Ingestion and Traceability
Pipeline outputs return to SQLite through targeted upload scripts: scripts/python/upload_pipeline_run_results_to_database.py, scripts/python/upload_feature_counts_to_database.py, scripts/python/upload_taxonomy_to_database.py, and scripts/python/upload_asvs_fasta_to_database.py. scripts/python/update_pipeline_run_from_snakemake.py updates run state from Snakemake, forming the control boundary between external workflow execution and database lifecycle tracking. The runtime stack is Python, Bash, SQLite, Conda, QIIME, and Snakemake, with DB Browser for SQLite as an operational inspection tool.
Main entry points: schema.sql ARD schema · 1_dataset_to_analysis_files_simple_gzip.py Dataset file generators · dataset_base_make_inputs.py Dataset input builder · main.py Management GUI
Components 18
SQLite metadata
System of record and query layer.
- ARD schema · Models experimental, dataset, and pipeline records.
schema.sql - Analysis SQL queries · Produces dataset manifests and metadata extracts.
scripts/sql/get_manifest_data_for_dataset.sql - DB access adapters
scripts/python/db_get_data.py - Label refresh
scripts/python/refresh_labels.py
Data management
- Management GUI · Inspection, record entry, navigation, and TSV export.
gui/main.py - Project and treatment views
gui/project_sections.py - Tabular staging · Incoming tabular data before database insertion.
- Project raw reads
Dataset preparation
- Primer demultiplexing · Separates raw reads into analysis-ready inputs.
scripts/python/0_demultiplex_primers_and_gzip.py - Dataset input builder · Extracts database records and writes reusable dataset inputs.
scripts/python/dataset_base_make_inputs.py - Dataset file generators · Generates compressed files, manifests, metadata, and links.
scripts/python/1_dataset_to_analysis_files_simple_gzip.py - Analysis files
- Dataset directories
Pipeline lifecycle
- Pipeline run creator · Converts dataset directories into pipeline-run directories.
scripts/python/6_dataset_directory_to_pipeline_run_directory.py - Pipeline runs · Run inputs and outputs tracked against database lifecycle records.
- QIIME and Snakemake · Executes analysis workflows and reports run state.
- Run state updater
scripts/python/update_pipeline_run_from_snakemake.py - Result uploaders · Loads feature counts, taxonomy, and ASV FASTA into SQLite.
scripts/python/upload_pipeline_run_results_to_database.py
Connections 21
- ARD schema → Analysis SQL queries: defines queryable records
- ARD schema → DB access adapters: read and adapt
- Label refresh → ARD schema: maintains labels
- Tabular staging → ARD schema: inserted as metadata
- Management GUI → DB access adapters: uses
- Management GUI → Project and treatment views: composes
- Project and treatment views → ARD schema: inspect and edit
- Project raw reads → Primer demultiplexing: FASTQ input
- ARD schema → Dataset input builder: dataset records
- Analysis SQL queries → Dataset input builder: manifest and metadata
- Primer demultiplexing → Dataset file generators: organized reads
- Dataset input builder → Dataset file generators: dataset inputs
- Dataset file generators → Analysis files: writes
- Dataset file generators → Dataset directories: materializes
- Dataset directories → Pipeline run creator: source directories
- Pipeline run creator → Pipeline runs: creates
- Pipeline runs → QIIME and Snakemake: workflow execution
- QIIME and Snakemake → Run state updater: Snakemake status
- Run state updater → ARD schema: updates run lifecycle
- QIIME and Snakemake → Result uploaders: analysis outputs
- Result uploaders → ARD schema: ingests results