ARGscape: interactive ARG visualization and analysis
Project description
ARGscape (v0.2.0) 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 (May be blocked on some networks - working on it!)
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
- Location Inference: Generate spatial coordinates based on genealogical relationships
- Session Management: Secure temporary file storage with automatic cleanup
- Data Export: Download processed tree sequences and visualizations
Visualization Capabilities
- 2D ARG Visualizations: Interactive visualizations of genealogical relationships
- Sample Ordering: Multiple algorithms for optimal sample arrangement
- 3D Spatial ARG Visualizations: Three-dimensional visualization of spatially-embedded samples
- Customizable Rendering: Adjustable node sizes, edge styles, colors, and layouts
- Tree Filtering: Visualize specific genomic regions or tree index ranges
- Temporal Filtering: Highlight specific temporal spans
Session Management
- Temporary storage: Files stored securely for up to 24 hours
- Session persistence: Continue work across browser sessions
- Data export: Download processed tree sequences and visualizations
- Cleanup: Remove files manually or wait for automatic cleanup
Advanced Features
- Batch Processing: Handle multiple files per session
- Custom color themes: Personalize visualization appearance
- Differential Visualization: Compare multiple tree sequences with spatial data
Visualization Gallery
2D Network Visualization
Interactive force-directed layouts showing genealogical relationships with node IDs and genomic spans.
Genomic Filtering
Navigate through specific genomic regions using the interactive slider.
3D Spatial Visualization
Three-dimensional rendering of spatially-embedded tree sequences with geographic context.
Temporal Filtering
Explore different time periods using the temporal slider controls.
Quick Start
Option 1: Use the Live Website
Visit argscape.com to start visualizing tree sequences immediately - no installation required. Storage space and computational power is extremely limited. Please refer to Option 2 below for more intensive uses.
Option 2: Local Installation (Recommended)
Install ARGscape locally for better performance and offline use:
Prerequisites
- Anaconda, Miniconda, or another Conda distribution (Download here)
Installation Steps
-
Download the environment file:
- Visit argscape.com/install and click "Download environment.yml"
- Or download directly from GitHub
-
Navigate to the download folder:
cd /path/to/your/folder
-
Create the ARGscape environment:
conda env create -f environment.yml
Installation takes 5-15 minutes depending on your connection.
-
Activate the environment:
conda activate argscape_env
-
Launch ARGscape:
argscape
-
Open in browser: ARGscape opens automatically at http://127.0.0.1:8000. Wait 2-3 minutes for startup, then refresh if needed.
Command Line Options
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)
Troubleshooting
- Conda not found? Check PATH or use Anaconda Prompt (Windows)
- Package conflicts? Add
--force-reinstallflag to conda command - Web interface not loading? Wait 2-3 minutes, then refresh browser
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.
API Reference
Full API documentation available at /docs when running locally.
Development
Project Structure
argscape/
โโโ argscape/ # Main Python package
โ โโโ cli.py # Command-line interface
โ โโโ frontend_dist/ # Compiled frontend assets
โ โโโ backend/ # Backend application
โ โโโ 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
โ โโโ temporal_inference.py # Temporal inference logic
โ โโโ spatial_generation.py # Spatial data generation
โ โโโ graph_utils.py # Graph utility functions
โ โโโ dev_storage_override.py # Development storage override
โ โโโ requirements-web.txt # Web dependencies
โ โโโ environment.yml # Conda environment
โ โโโ env.example # Environment variables template
โ โโโ Dockerfile # Backend container definition
โ โโโ dev_storage/ # Development storage directory
โ โโโ geo_utils/ # Geographic utilities
โ โ โโโ data/ # Geographic data files
โ โ โโโ eastern_hemisphere.geojson
โ โ โโโ ne_110m_land/ # Natural Earth land data
โ โโโ sparg/ # SPARG algorithm implementation
โ โโโ tskit_utils/ # Tree sequence utilities
โโโ frontend/ # Frontend application (TypeScript/React)
โ โโโ src/ # Source code
โ โ โโโ App.tsx # Main application component
โ โ โโโ main.tsx # Application entry point
โ โ โโโ components/ # React components
โ โ โ โโโ Home/ # Home page components
โ โ โ โโโ ForceDirectedGraph/ # Network visualization
โ โ โ โโโ SpatialArg3DVisualization/ # 3D spatial visualization
โ โ โ โโโ SpatialArgDiffVisualization/ # Diff visualization
โ โ โ โโโ tutorials/ # Tutorial components
โ โ โ โโโ ui/ # UI components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ context/ # React context providers
โ โ โโโ lib/ # Utility libraries
โ โ โโโ utils/ # Utility functions
โ โ โโโ config/ # Configuration files
โ โ โโโ types/ # TypeScript type definitions
โ โโโ public/ # Static assets
โ โโโ package.json # Frontend dependencies
โ โโโ tsconfig.json # TypeScript configuration
โ โโโ nginx.conf # Nginx configuration
โ โโโ components.json # shadcn/ui components config
โ โโโ Dockerfile # Frontend container definition
โโโ docker-compose.yml # Docker Compose configuration
โโโ Dockerfile # Root Dockerfile
โโโ pyproject.toml # Python project configuration
โโโ railway.toml # Railway deployment config
โโโ 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 updated inferred locations or node ages
- Visualization data
Performance Notes
- File Size: Recommended < 100MB per upload
- Samples: Optimal performance with < 1000 nodes
- Sessions: Automatic cleanup after 24 hours (including on local hosting, for now)
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
- James Kitchens for testing and feedback
Support
- ๐ Website: www.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.2.0.tar.gz.
File metadata
- Download URL: argscape-0.2.0.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 |
d5b26bd8fec69a9081370b1c586be03e2f08703d63e2ef37746ee4b67507c53a
|
|
| MD5 |
1843a75a41a5fbe075e371029091949d
|
|
| BLAKE2b-256 |
0cb5ae687fca6ba1a5460677541dc1d8669fbdd1e0a70933299558bb70386b3c
|
File details
Details for the file argscape-0.2.0-py3-none-any.whl.
File metadata
- Download URL: argscape-0.2.0-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 |
57818a297f19f009e55915e5969b72891c38765fcc1392a7f7ec18ae577765cc
|
|
| MD5 |
d9d8b0575de622cf0bbd5c0182041658
|
|
| BLAKE2b-256 |
4943a784945b7ec45028a68594a64489ac19b81ef3d51d6ad443f67d10ea8201
|