A web-based visualization tool for genetics cohort data
Project description
Genetics-Viz ๐งฌ
A web-based visualization tool for genetics cohort data, providing interactive analysis and validation of genetic variants.
Features
Core Features
- ๐ Multi-Cohort Management - Browse and analyze multiple cohorts from a single data directory
- ๐จโ๐ฉโ๐งโ๐ฆ Family Structure Visualization - View pedigree information and family relationships
- ๐งฌ Variant Analysis - Interactive TanStack-powered tables for DNM (de novo mutations) and WOMBAT analysis
- ๐ Cohort-Wide Search - Search variants across all samples with filters on locus, genesets, impact, individuals (sex, phenotype, parental status), and validation status
- ๐ Variant Statistics - Interactive charts (chromosome distribution, consequence/validation pie charts) and ideogram visualization with cytoband rendering
- โ Variant Validation - Track and validate genetic variants with inheritance patterns
- ๐ฌ IGV Integration - Built-in IGV.js browser for sequence visualization (CRAM files)
- ๐ WAVES Validation - Specialized validation workflow for bedGraph/coverage analysis
- ๐ Authentication & Authorization - YAML-configured user accounts with role-based access (reader, curator, administrator)
- ๐ Multi-Data-Directory - Switch between multiple data directories per user session via YAML config
- ๐ ๏ธ Admin Pages - Manage users and data directories from the web interface
- ๐จ Modern UI - Clean, responsive interface built with NiceGUI
Validation Features
- Save validation status (present/absent/uncertain/different/in phase MNV)
- Track inheritance patterns (de novo/paternal/maternal/not paternal/not maternal/either/homozygous)
- Add optional comments to validations
- Mark validations as ignored (excluded from statistics and conflict detection)
- View validation history with timestamps and ignore status
- Interactive validation guide accessible via info button
- Filter variants by validation status
- Automatic conflict detection (ignoring validations marked as ignored)
- Export validation data
Installation
Quick Start with uvx (Recommended)
The easiest way to run genetics-viz without installation:
uvx genetics-viz /path/to/config.yaml
From PyPI
pip install genetics-viz
From Source
# Clone the repository
git clone https://github.com/bourgeron-lab/genetics-viz.git
cd genetics-viz
# Install with uv (recommended)
uv sync
uv run genetics-viz /path/to/config.yaml
# Or install with pip
pip install -e .
genetics-viz /path/to/config.yaml
Alternative: Local Python/Virtualenv
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install genetics-viz
pip install genetics-viz
# Run the application
genetics-viz /path/to/config.yaml
Configuration
YAML Config File
The application requires a YAML configuration file listing data directories and users:
data_directories:
- path: /path/to/data/directory1
description: "Primary WGS data"
default: true
- path: /path/to/data/directory2
description: "Secondary dataset"
user_list:
- username: admin
password: "<sha512-hex-digest>"
role: administrator
- username: curator1
password: "<sha512-hex-digest>"
role: curator
- username: viewer
password: "<sha512-hex-digest>"
role: reader
# Auto-generated on first run โ do not edit manually
storage_secret: "<hex-string>"
Generating Password Hashes
echo -n "your_password" | sha512sum | cut -d' ' -f1
User Roles
| Role | Permissions |
|---|---|
| reader | View all data, cannot save validations or diagnostics |
| curator | View all data + save validations and diagnostics |
| administrator | All curator permissions + manage users and data directories |
Initial Setup
- Create a YAML config file with at least one data directory and one administrator user
- Generate the admin password hash (see above)
- Run:
genetics-viz /path/to/config.yaml - Log in with admin credentials at
http://localhost:8080/login - Use the admin pages to add more users and data directories
Usage
Command Line Options
# Basic usage
genetics-viz /path/to/config.yaml
# With custom host and port
genetics-viz /path/to/config.yaml --host 0.0.0.0 --port 8080
# Full help
genetics-viz --help
Web Interface
Once started, open your browser to http://localhost:8080 (or the specified port). You will be redirected to the login page.
The interface provides:
- Home Page - List of available cohorts
- Cohort View - Family list and overview
- Family View - DNM, WOMBAT, and SV analysis tabs with TanStack tables
- Search Page - Cohort-wide variant search with tabbed filters (Variants and Individuals)
- Variant Statistics - Charts and ideogram views for search results
- Validation Pages - Track variant validations (file-specific and all validations)
- Diagnostic Pages - Track variant diagnostic conclusions
- WAVES Validation - Specialized coverage/bedGraph validation workflow
- Profile Page - View role and change password
- Admin Pages - Manage data directories and users (administrators only)
Data Directory Structure
The tool expects the following directory structure:
data_directory/
โโโ cohorts/
โ โโโ cohort1/
โ โ โโโ cohort1.pedigree.tsv
โ โ โโโ wombat/
โ โ โ โโโ cohort1.rare.*.*.results.tsv (cohort-wide search files)
โ โ โโโ families/
โ โ โโโ FAM001/
โ โ โ โโโ FAM001.wombat.*.tsv (WOMBAT analysis files)
โ โ โ โโโ FAM001.dnm.*.tsv (DNM analysis files)
โ โ โโโ FAM002/
โ โ โโโ ...
โ โโโ cohort2/
โ โโโ ...
โโโ params/
โ โโโ genesets/
โ โโโ *.tsv (gene set files for search filtering)
โโโ samples/
โ โโโ SAMPLE001/
โ โ โโโ sequences/
โ โ โโโ SAMPLE001.GRCh38_GIABv3.cram
โ โ โโโ SAMPLE001.GRCh38_GIABv3.cram.crai
โ โ โโโ SAMPLE001.GRCh38.bedGraph.gz (for WAVES)
โ โโโ SAMPLE002/
โ โโโ ...
โโโ validations/
โโโ snvs.tsv (variant validations)
โโโ waves.tsv (WAVES validations)
Required Files
Pedigree File Format
Pedigree files (cohort_name.pedigree.tsv) should be tab-separated. The header is optional - if present, it must start with "FID" (a leading # is stripped automatically):
With header:
#FID IID PAT MAT SEX PHENOTYPE
FAM001 SAMPLE001 SAMPLE003 SAMPLE004 1 2
FAM001 SAMPLE002 0 0 2 1
Without header (positional columns):
FAM001 SAMPLE001 SAMPLE003 SAMPLE004 1 2
FAM001 SAMPLE002 0 0 2 1
Missing/unknown values for parent IDs are 0, -9, or empty. These values are also treated as unknown for sex and phenotype when building filter options.
Column Mapping (case-insensitive, # prefix stripped):
| Column | Possible Names |
|---|---|
| Family ID | FID, family_id, familyid, family |
| Individual ID | IID, individual_id, sample_id, sampleid, sample |
| Father ID | PAT, father_id, fatherid, father, paternal_id |
| Mother ID | MAT, mother_id, motherid, mother, maternal_id |
| Sex | SEX, gender |
| Phenotype | PHENOTYPE, affected, status, affection |
CRAM Files (for IGV visualization)
- Format:
SAMPLE_ID.GRCh38_GIABv3.cram - Index:
SAMPLE_ID.GRCh38_GIABv3.cram.crai - Location:
samples/SAMPLE_ID/sequences/
BedGraph Files (for WAVES validation)
- Format:
SAMPLE_ID.GRCh38.bedGraph.gz - Location:
samples/SAMPLE_ID/sequences/
Analysis Files
- DNM files:
FAMILY_ID.dnm.*.tsv(must containchr:pos:ref:altcolumn) - WOMBAT files:
FAMILY_ID.wombat.*.tsv(must contain#CHROM,POS,REF,ALTcolumns)
GHFC Lab Usage
Prerequisites
You need to either:
- Be on the Institut Pasteur network, OR
- Be connected via VPN
Mounting ghfc_wgs from Helix
On macOS
# Mount the network drive
# In Finder: Go > Connect to Server (โK)
# Enter: smb://helix.pasteur.fr/ghfc_wgs
# Or via command line:
open 'smb://helix.pasteur.fr/projects/ghfc_wgs'
The drive will be mounted at /Volumes/ghfc_wgs
On Linux
# Create mount point
sudo mkdir -p /mnt/ghfc_wgs
# Mount via CIFS
sudo mount -t cifs //helix.pasteur.fr/projects/ghfc_wgs /mnt/ghfc_wgs -o username=YOUR_USERNAME,domain=PASTEUR
# Or add to /etc/fstab for automatic mounting:
# //helix.pasteur.fr/projects/ghfc_wgs /mnt/ghfc_wgs cifs username=YOUR_USERNAME,password=YOUR_PASSWORD,domain=PASTEUR,uid=1000,gid=1000 0 0
Running genetics-viz for GHFC Data
Method 1: Using uvx (Recommended - No Installation)
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Run directly with uvx
uvx genetics-viz /path/to/genetics_viz.yaml
# On Linux (adjust path):
uvx genetics-viz /path/to/genetics_viz.yaml
Method 2: Using uv with Local Installation
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install genetics-viz
uv pip install genetics-viz
# Run the application
genetics-viz /path/to/genetics_viz.yaml
Access the Application
Once started, open your browser to:
http://localhost:8080
To access from other machines on the network:
genetics-viz /path/to/genetics_viz.yaml --host 0.0.0.0 --port 8080
Then access via: http://YOUR_MACHINE_IP:8080
Validation Workflow
SNV Validation
- Navigate to a variant table (DNM or WOMBAT tabs, or Validation pages)
- Click "View in IGV" button for a variant
- In the dialog:
- Review variant details with collapsible sections
- Add additional samples (parents, siblings, or by barcode)
- Examine CRAM tracks in IGV viewer
- Click the info button (โน๏ธ) to view validation guidelines
- Set validation status (default: present) and inheritance pattern
- Add an optional comment
- Click "Save Validation"
- The validation is saved to
validations/snvs.tsv - View validation history below the form
- Toggle the "Ignore" switch to exclude validations from statistics
- Ignored validations appear with reduced opacity
- Validation/all page aggregates multiple validations per variant/sample
- Shows unique list of users who validated each variant
- Computes final status from non-ignored validations
WAVES Validation
- Go to "Validation" > "Waves" in the menu
- Select a cohort and pedigree
- Select a sample from the pedigree
- Click "View on IGV" for the sample
- In the dialog:
- Review bedGraph coverage tracks for the sample
- Add additional samples for comparison
- Set validation status
- Click "Save Validation"
- The validation is saved to
validations/waves.tsv
Development
# Clone repository
git clone https://github.com/bourgeron-lab/genetics-viz.git
cd genetics-viz
# Install with development dependencies
uv sync --dev
# Run tests
uv run pytest
# Run linter
uv run ruff check .
# Format code
uv run ruff format .
# Run with auto-reload for development
uv run genetics-viz --reload /path/to/config.yaml
Validation File Formats
SNV Validations (validations/snvs.tsv)
Version 0.2.0+ format:
FID Variant Sample User Inheritance Validation Comment Ignore Timestamp
FAM001 chr1:12345:A:T SAMPLE001 username de novo present Initial validation 0 2026-01-18T10:30:00
FAM001 chr1:12345:A:T SAMPLE001 reviewer homozygous present Confirmed 0 2026-01-19T14:20:00
FAM002 chr2:67890:G:C SAMPLE002 username unknown uncertain Low coverage 1 2026-01-18T11:00:00
Columns:
- FID: Family ID
- Variant: chr:pos:ref:alt format
- Sample: Sample ID
- User: Username who performed validation
- Inheritance: de novo, paternal, maternal, not paternal, not maternal, either, homozygous, or unknown
- Validation: present, absent, uncertain, different, or "in phase MNV"
- Comment: Optional free-text comment
- Ignore: 0 (included) or 1 (excluded from statistics and conflict detection)
- Timestamp: ISO format timestamp
Migration from v0.1.1:
If upgrading from v0.1.1, use the provided migration script:
./utils/snvs_validations_migration_0.1.1_to_0.2.0.sh /path/to/data/validations/snvs.tsv
This adds the Comment and Ignore columns with default values.
WAVES Validations (validations/waves.tsv)
Cohort Pedigree Sample User Validation Timestamp
cohort1 FAM001 SAMPLE001 username present 2026-01-18T10:30:00
Troubleshooting
Cannot access GHFC data
- Verify VPN connection or Pasteur network access
- Check that ghfc_wgs is properly mounted
- Verify mount path (
/Volumes/ghfc_wgson macOS,/mnt/ghfc_wgson Linux)
IGV not displaying
- Ensure CRAM files and indices (.crai) exist
- Check that files follow naming convention:
SAMPLE_ID.GRCh38_GIABv3.cram - Verify IGV.js is loading (check browser console)
Pedigree file not recognized
- Ensure tab-separated format
- Verify required columns are present
- Check file naming:
cohort_name.pedigree.tsv
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
For detailed changes between versions, see CHANGELOG.md.
License
MIT License - See LICENSE file for details
Citation
If you use this tool in your research, please cite:
Genetics-Viz: A web-based visualization tool for genetics cohort data
GitHub: https://github.com/bourgeron-lab/genetics-viz
Support
For issues, questions, or feature requests, please open an issue on GitHub: https://github.com/bourgeron-lab/genetics-viz/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genetics_viz-0.6.9.tar.gz.
File metadata
- Download URL: genetics_viz-0.6.9.tar.gz
- Upload date:
- Size: 444.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c440ce61c99cbcf10c977589d483098b2cd8a47b82e2918a172091be359d6ea6
|
|
| MD5 |
d7f1a115a1f9ae6d21734a9d7ec6dedc
|
|
| BLAKE2b-256 |
eaf51f7ec80cf1b492b9829f82dbb69acded0fb08357e04c5965b3d149e12b86
|
Provenance
The following attestation bundles were made for genetics_viz-0.6.9.tar.gz:
Publisher:
publish.yml on bourgeron-lab/genetics-viz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genetics_viz-0.6.9.tar.gz -
Subject digest:
c440ce61c99cbcf10c977589d483098b2cd8a47b82e2918a172091be359d6ea6 - Sigstore transparency entry: 1172323021
- Sigstore integration time:
-
Permalink:
bourgeron-lab/genetics-viz@d94f12f3af8963d44b739a705339d3be19450e8f -
Branch / Tag:
refs/tags/v0.6.9 - Owner: https://github.com/bourgeron-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d94f12f3af8963d44b739a705339d3be19450e8f -
Trigger Event:
push
-
Statement type:
File details
Details for the file genetics_viz-0.6.9-py3-none-any.whl.
File metadata
- Download URL: genetics_viz-0.6.9-py3-none-any.whl
- Upload date:
- Size: 476.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3091fd13ca019c458f56346cf2c0a5b5a1e3ee98e70939f4c9bec82b34055694
|
|
| MD5 |
0c83b450bf4a5b2a9de66a7a7910ec83
|
|
| BLAKE2b-256 |
b498c4dcafba6764834a3e8aba57772a2ef97f2e71b5fb7b64149aa7659a139c
|
Provenance
The following attestation bundles were made for genetics_viz-0.6.9-py3-none-any.whl:
Publisher:
publish.yml on bourgeron-lab/genetics-viz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genetics_viz-0.6.9-py3-none-any.whl -
Subject digest:
3091fd13ca019c458f56346cf2c0a5b5a1e3ee98e70939f4c9bec82b34055694 - Sigstore transparency entry: 1172323056
- Sigstore integration time:
-
Permalink:
bourgeron-lab/genetics-viz@d94f12f3af8963d44b739a705339d3be19450e8f -
Branch / Tag:
refs/tags/v0.6.9 - Owner: https://github.com/bourgeron-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d94f12f3af8963d44b739a705339d3be19450e8f -
Trigger Event:
push
-
Statement type: