ARGscape: interactive ARG visualization and analysis
Project description
ARGscape
ARGscape (v0.1.9) is a comprehensive web application for visualizing and analyzing tree sequences and Ancestral Recombination Graphs (ARGs). Built with React and FastAPI, it aims to provide both an intuitive web interface and powerful computational backend for population genetics research.
๐ Live Demo: www.argscape.com
๐ API Documentation: www.argscape.com/docs
Features
Core Functionality
- File Upload & Management: Upload and visualize
.treesand.tsztree sequence files - Tree Sequence Simulation: Generate new tree sequences using
msprimewith customizable parameters - Interactive Visualization:
- 2D ARG network visualization with force-directed layouts
- 3D spatial visualization for spatially-embedded tree sequences
- Multiple sample ordering algorithms (degree-based, minlex postorder, custom consensus)
- Spatial Analysis: Fast spatial location inference using
fastgaia(higher accuracy withGAIAcoming soon) - Session Management: Secure temporary file storage with automatic cleanup
- Data Export: Download processed tree sequences and visualizations
Visualization Capabilities
- Network Graphs: Interactive node-link diagrams showing genealogical relationships
- 3D Spatial Maps: Three-dimensional visualization of spatially-embedded samples
- Customizable Rendering (Coming Soon): Adjustable node sizes, edge styles, colors, and layouts
- Tree Filtering: Visualize specific genomic regions or tree index ranges
- Sample Ordering: Multiple algorithms for optimal sample arrangement
Advanced Features
- Location Inference: Generate spatial coordinates based on genealogical relationships
- Tree Sequence Filtering: Extract specific genomic intervals or tree ranges
- Batch Processing: Handle multiple files per session
- Real-time Updates: Live feedback during processing and visualization
Quick Start
Option 1: Use the Live Website
Visit argscape.com to start visualizing tree sequences immediately - no installation required.
Option 2: Install via pip
# Windows users should first install msprime via conda-forge
conda install -c conda-forge msprime
# Then install argscape (start here for Linux/Mac)
pip install argscape
To use ARGscape from the command line:
# Start the web interface
argscape [--host HOST] [--port PORT] [--reload] [--no-browser] [--no-tsdate]
# Options:
# --host HOST Host to run the server on (default: 127.0.0.1)
# --port PORT Port to run the server on (default: 8000)
# --reload Enable auto-reload for development
# --no-browser Don't automatically open the web browser
# --no-tsdate Disable tsdate temporal inference (enabled by default)
Note: The web interface provides full functionality for simulating tree sequences and visualization. Additional CLI commands for direct simulation and visualization are planned for future releases.
Option 3: Local Development
Prerequisites
- Node.js 20+ and npm
- Python 3.11+ with conda/mamba
- Git
Setup
-
Clone the repository:
git clone https://github.com/chris-a-talbot/argscape.git cd argscape
-
Backend setup:
# Create and activate conda environment conda env create -f argscape/backend/environment.yml conda activate argscape # Install the package in development mode pip install -e . # Start the backend server uvicorn argscape.backend.main:app --reload --port 8000
-
Frontend setup (in new terminal):
cd frontend npm install npm run dev
-
Access the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API docs: http://localhost:8000/docs
Option 4: Docker Development
# Clone and start the development environment
git clone https://github.com/chris-a-talbot/argscape.git
cd argscape
docker compose up --build
The Docker setup provides a complete development environment with hot-reloading for both frontend and backend. Access at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API docs: http://localhost:8000/docs
Note: The Docker setup mounts your local code directories, so changes to the code will be reflected immediately in the running containers.
Usage Guide
Upload Tree Sequences
- Navigate to the main interface
- Drag and drop or select
.treesor.tszfiles - Click "Run" to process and visualize
Simulate Tree Sequences
- Use the "Simulate new (msprime)" panel
- Configure parameters:
- Samples: 2-500 individuals
- Trees: 1-1000 local trees
- Generations: 1-1000 maximum time
- Model: Population genetics model (default:
dtwf) - Population size: Effective population size
- Random seed: For reproducible results
- Click "Simulate Tree Sequence"
Visualization Options
- 2D ARG Networks: Interactive force-directed graphs
- 3D Spatial Maps: For spatially-embedded data
- Sample Ordering:
degree: Order by node connectivitycenter_minlex: Minlex postorder at sequence centerfirst_tree: Minlex postorder of first treecustom: Consensus algorithm across multiple treesnumeric: Simple numerical order
Advanced Features
- Spatial Inference: Generate coordinates using
fastgaia - Region Filtering: Visualize specific genomic ranges
- Tree Filtering: Focus on particular tree indices
- Data Export: Download processed files
API Reference
Full API documentation available at /docs when running locally.
Development
Project Structure
argscape/
โโโ argscape/ # Main Python package
โ โโโ __init__.py
โ โโโ cli.py # Command-line interface
โ โโโ frontend_dist/ # Compiled frontend assets
โ โโโ backend/ # Backend application
โ โโโ __init__.py
โ โโโ main.py # Main application entry point
โ โโโ startup.py # Application startup logic
โ โโโ constants.py # Application constants
โ โโโ session_storage.py # Session management
โ โโโ location_inference.py # Location inference logic
โ โโโ midpoint_inference.py # Midpoint inference logic
โ โโโ sparg_inference.py # SPARG inference logic
โ โโโ spatial_generation.py # Spatial data generation
โ โโโ graph_utils.py # Graph utility functions
โ โโโ requirements-web.txt # Web dependencies
โ โโโ environment.yml # Conda environment
โ โโโ Dockerfile # Backend container definition
โ โโโ geo_utils/ # Geographic utilities
โ โโโ sparg/ # SPARG algorithm implementation
โ โโโ tskit_utils/ # Tree sequence utilities
โโโ frontend/ # Frontend application (TypeScript/React)
โ โโโ src/ # Source code
โ โโโ public/ # Static assets
โ โโโ package.json # Frontend dependencies
โ โโโ tsconfig.json # TypeScript configuration
โ โโโ vite.config.ts # Vite configuration
โ โโโ tailwind.config.js # Tailwind CSS configuration
โ โโโ nginx.conf # Nginx configuration
โ โโโ Dockerfile # Frontend container definition
โโโ .dockerignore # Docker ignore rules
โโโ docker-compose.yml # Docker Compose configuration
โโโ Dockerfile # Root Dockerfile
โโโ LICENSE # License file
โโโ MANIFEST.in # Python package manifest
โโโ pyproject.toml # Python project configuration
โโโ railway.toml # Railway deployment config
โโโ README.md # Project documentation
โโโ setup.cfg # Python setup configuration
โโโ package.json # Root package.json
File Formats
Supported Inputs
.trees: Standard tskit tree sequence format.tsz: Compressed tree sequence format
Generated Outputs
- Tree sequences with inferred spatial locations
- Visualization data (JSON)
- Processed tree sequence files
Performance Notes
- File Size: Recommended < 100MB per upload
- Samples: Optimal performance with < 500 samples
- Trees: Best visualization with < 1000 local trees
- Sessions: Automatic cleanup after 24 hours
- Memory: Large files may require processing time
Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/new-feature) - Follow clean code principles
- Add tests for new functionality
- Submit pull request
License
This project is licensed under the MIT License.
Citation
Acknowledgments
- tskit development team for tree sequence simulation and analysis tools
- Bradburd Lab for funding and support
Support
- ๐ Website: argscape.com
- ๐ API Docs: Available at
/docsendpoint - ๐ Issues: GitHub Issues for bug reports
- ๐ฌ Discussions: GitHub Discussions for questions
Note: This is research software under active development. The API may change between versions. Data is stored temporarily and may be cleared during updates.
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 argscape-0.1.9.tar.gz.
File metadata
- Download URL: argscape-0.1.9.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34b2ddff3ea6a0625fadcb2d16d8af1ff95367d8c54d0320708a5ed6d618c6d0
|
|
| MD5 |
84b5874b2635319d1f02d6096ed0f217
|
|
| BLAKE2b-256 |
f7d77fc906a5857b2727973d4ab4f768d5baf8ae5bf7c1047aad858005d97e27
|
File details
Details for the file argscape-0.1.9-py3-none-any.whl.
File metadata
- Download URL: argscape-0.1.9-py3-none-any.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
082fb445c365b83db7c040f5e4d6f630f79805846dddf5f0c1ce1db2dc6a3547
|
|
| MD5 |
94960db2c8cd59a0d5625725c0552725
|
|
| BLAKE2b-256 |
2b588a1abafb73c77b88c679047bed4974f1a38871ae96b8182e9ba7c2f272dc
|