Skip to content

🌐 A web-based interface for running Multiple Sequence Alignment (MSA) using A-Star and PA-Star algorithms.

License

Notifications You must be signed in to change notification settings

vncsmnl/msa_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MSA A-Star / PA-Star Flask Application

A web-based interface for running Multiple Sequence Alignment (MSA) using A-Star and PA-Star algorithms.

Overview

This Flask application provides a user-friendly web interface for executing Multiple Sequence Alignment using optimized A-Star and Parallel A-Star (PA-Star) algorithms. It supports various benchmark sequence datasets and provides tools for managing sequences, binaries, and alignment results.

Features

  • Multiple Algorithm Support: Run MSA using A-Star or PA-Star implementations
  • Benchmark Datasets: Built-in support for BALIBASE, Benchmark, NUC, and PAM250 sequence datasets
  • Binary Management: Easy selection and management of different algorithm binaries
  • Sequence Management: Browse and select FASTA sequences from organized datasets
  • Results Tracking: View and manage alignment execution results
  • Parallel Processing: Support for multi-threaded execution with configurable thread count
  • Cost Matrix Options: Support for different substitution matrices (PAM250, etc.)
  • Web Interface: Clean, intuitive web UI for all operations

Project Structure

msa_app/
β”œβ”€β”€ app.py                  # Application entry point
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ __init__.py        # Flask app factory
β”‚   β”œβ”€β”€ config.py          # Configuration settings
β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”‚   β”œβ”€β”€ binaries.py    # Binary management endpoints
β”‚   β”‚   β”œβ”€β”€ results.py     # Results viewing endpoints
β”‚   β”‚   β”œβ”€β”€ run.py         # Alignment execution endpoints
β”‚   β”‚   └── sequences.py   # Sequence browsing endpoints
β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”œβ”€β”€ binaries_service.py
β”‚   β”‚   β”œβ”€β”€ results_service.py
β”‚   β”‚   β”œβ”€β”€ runner_service.py
β”‚   β”‚   └── sequences_service.py
β”‚   β”œβ”€β”€ static/            # CSS and static assets
β”‚   β”‚   └── style.css
β”‚   β”œβ”€β”€ templates/         # HTML templates
β”‚   β”‚   └── index.html
β”‚   └── utils/             # Utility functions
β”‚       β”œβ”€β”€ fasta.py       # FASTA file parsing
β”‚       β”œβ”€β”€ filesystem.py  # File system operations
β”‚       └── security.py    # Security utilities
β”œβ”€β”€ bin/                   # Algorithm binaries (not in repo)
β”œβ”€β”€ seqs/                  # Sequence datasets (not in repo)
β”‚   β”œβ”€β”€ Balibase/
β”‚   β”œβ”€β”€ Benchmark/
β”‚   β”œβ”€β”€ NUC/
β”‚   └── PROT/
└── results/               # Alignment results (generated)

Requirements

  • Python 3.10+
  • Flask
  • Werkzeug

Installation

  1. Clone the repository

    git clone https://github.com/vncsmnl/msa_app
    cd msa_app
  2. Create a virtual environment (recommended)

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Set up directories

    Create the following directories if they don't exist:

    mkdir bin seqs results
  5. Add algorithm binaries

    Place your A-Star and PA-Star executable binaries in the bin/ directory.

  6. Structure

  • seqs/Benchmark/ - Benchmark test sequences
  • seqs/Balibase/ - BAliBASE benchmark suite
  • seqs/NUC/ - Nucleotide sequences (DNA/RNA)
  • seqs/PAM/ - Protein sequences organized by length

These sequences are used for:

  • Testing the MSA algorithms
  • Benchmarking performance
  • Validating alignment quality

References

Usage

  1. Start the server

    python app.py
  2. Access the application

    Open your browser and navigate to:

    http://localhost:5000
    
  3. Run an alignment

    • Select an algorithm (A-Star or PA-Star)
    • Choose a binary version
    • Browse and select a FASTA sequence file
    • Configure parameters (cost type, thread count)
    • Click "Run" to execute the alignment
  4. View results

    Results are automatically saved and can be viewed through the results interface.

API Endpoints

Sequences

  • GET /api/sequences/sources - List available sequence sources
  • GET /api/sequences/<source> - Browse sequences in a source
  • GET /api/sequences/<source>/file - Get sequence file content

Binaries

  • GET /api/binaries - List available algorithm binaries

Execution

  • POST /api/run - Execute MSA alignment
    • Parameters: algorithm, binary_name, file_path, cost_type, num_threads, verbose

Results

  • GET /api/results - List all alignment results
  • GET /api/results/<result_id> - Get specific result details

Configuration

Edit app/config.py to customize:

  • Directory paths
  • Sequence sources
  • Server settings
  • Secret key

License

MIT License

Notes

  • The application runs with debug mode enabled by default
  • Default server port is 5000
  • Results are stored locally in the results/ directory
  • Execution timeout is set to 10 minutes per alignment

About

🌐 A web-based interface for running Multiple Sequence Alignment (MSA) using A-Star and PA-Star algorithms.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published