Datamonkey is a free public web application for comparative analysis of sequence alignments using state-of-the-art statistical models. This SvelteKit-based frontend provides a modern, responsive interface for running HyPhy methods, managing analyses, and visualizing results. It connects to the Datamonkey API to perform complex phylogenetic analyses in the cloud or locally via WebAssembly.
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.
├── scripts/ # Build and utility scripts
├── src/
│ ├── app.css # Global CSS
│ ├── app.html # HTML template
│ ├── lib/ # Shared components and utilities
│ │ ├── api/ # Generated API client code
│ │ ├── components/ # Reusable UI components
│ │ ├── data/ # Generated and static data files
│ │ ├── model/ # Generated TypeScript interfaces
│ │ └── stores/ # Svelte stores for state management
│ ├── routes/ # SvelteKit routes (pages)
│ └── styles/ # CSS styles and design system
└── static/ # Static assets (images, fonts, etc.)
This project uses OpenAPI to generate TypeScript interfaces and API clients from the Datamonkey API specification. The following scripts automate this process:
# Fetch the latest OpenAPI spec and generate TypeScript files
npm run update-generated-types
This command performs the following steps:
- Downloads the latest OpenAPI spec from the Datamonkey API repository
- Generates TypeScript interfaces and API client code
- Moves the generated files to the appropriate directories
- Generates method data files for the frontend
The application automatically generates two important data files from the API models:
src/lib/data/methods.ts
- Contains information about available HyPhy methodssrc/lib/data/methodParameters.ts
- Contains parameter definitions for each method
To regenerate these files manually:
npm run generate-method-data
When adding a new HyPhy method to the application:
- Update the OpenAPI spec to include the new method and its parameters
- Run
npm run update-generated-types
to regenerate all files - If needed, add the method to the name mapping in
scripts/generate-method-data.js
:const methodNameMapping = { // existing methods... 'newmethod': 'NewMethod', // Add your new method here with proper formatting };
- Add a description for the method:
const methodDescriptions = { // existing descriptions... 'newmethod': 'Description of what the new method does', };
The script will automatically extract parameters from the generated interface files.